Claims
- 1. A method of simulating a program comprising:
a) determining if compiled data of an instruction of a program simulation is stored in a memory table of compiled instructions, in response to a request for said compiled data; b) if said compiled data is not is said memory table, compiling said instruction and storing said compiled data in said memory table; and c) returning said compiled data or said reference thereto to a simulator that is executing said program simulation.
- 2. A method according to claim 1, wherein said b) comprises identifying one or more operations to be used to simulate said instruction.
- 3. A method according to claim 2, wherein said b) further comprises decoding said instruction into one or more parameters.
- 4. A method according to claim 2, wherein said operations comprise LISA (Language for Instruction-Set Architectures) operations.
- 5. A method according to claim 2, further comprising:
d) invoking a function call to implement one of said operations.
- 6. A method according to claim 1, wherein said a) comprises matching a key in said memory table with a code for said instruction.
- 7. A method according to claim 6, wherein said a) comprises retrieving said code from an instruction register in said simulator.
- 8. A method according to claim 1, wherein said a) comprises receiving a request from said simulator for said compiled data or said reference thereto.
- 9. A method according to claim 1, wherein said b) further comprises decoding said instruction to identify a processor instruction and operands.
- 10. A method according to claim 1, wherein said instruction is a processor instruction in said simulation.
- 11. A method according to claim 1, wherein said program simulation is run-time dynamic.
- 12. A method according to claim 1, wherein said simulator is retargetable.
- 13. A method according to claim 1, wherein said compiled data is returned by returning a reference thereto.
- 14. A computer implemented method of simulating the execution of a set of instructions comprising:
a) accessing a first instruction to be simulated; b) determining if compiled data relating to said first instruction is present in a memory stored table; c) if said compiled data relating to said first instruction is present in said memory stored table, providing said compiled data to a simulator for execution thereof by a computer system; and d) if said compiled data relating to said first instruction is not present in said memory stored table, compiling said first instruction to produce a compiled result and providing said compiled result to said simulator for execution thereof by a computer system.
- 15. A method as described in claim 14 further comprising: e) storing said compiled result in said memory stored table and associating said compiled result with said first instruction.
- 16. A method as described in claim 15 further comprising repeating said a)-e) for a second instruction.
- 17. A method as described in claim 14 further comprising:
e) determining if a location in said memory stored table to which said compiled data is to be stored is protected; and f) if said location is not protected, storing said compiled result in said memory stored table and associating said compiled result with said first instruction.
- 18. A computer implemented method of simulating the execution of a set of instructions comprising:
a) when an instruction of a program simulation is to be executed by a simulator at run-time, determining if information to simulate said instruction is stored in a memory table; b) if said information is not therein, determining said information to be used to simulate said instruction; c) determining if a location in said memory table to which said information is to be written is protected; d) if said location is not protected, storing said information in said memory table location and returning said information to said simulator; and e) if said location is protected, returning said information to said simulator without storing said information in said memory table.
- 19. A method according to claim 18, wherein said information comprises identifiers of operations for simulating said instruction.
- 20. A method according to claim 18, wherein said information comprises identifiers of LISA (Language for Instruction-Set Architectures) operations.
- 21. A method according to claim 18, wherein said information comprises identifiers of pre-compiled functions operable to implement LISA (Language for Instruction-Set Architectures) operations.
- 22. A method according to claim 18, wherein said instruction is a processor instruction in said simulation.
- 23. A method according to claim 18, wherein said program simulation is run-time dynamic.
- 24. A method according to claim 18, wherein said simulator is retargetable.
- 25. A method according to claim 18, wherein said d) comprises returning said information by returning a reference thereto.
- 26. A computer system for simulating a program, comprising:
a cache table for storing information for specifying operations to simulate an instruction-set architecture; an instruction compiler for decoding instructions to be simulated, determining said information, and storing said information in said cache table; and a program simulator for using said information to simulate said instruction-set architecture.
- 27. A computer system according to claim 26, further comprising a protection table for indicating whether locations in said cache table are protected from being overwritten.
- 28. A computer system according to claim 26, further comprising an interface for receiving a request for said information from said simulator and for returning said information to said simulator.
- 29. A computer system according to claim 26, wherein said simulator is for simulating the operation of a processor.
- 30. A computer system according to claim 26, wherein said simulator comprises a plurality of functions for simulating said instruction.
- 31. A computer system according to claim 30, wherein said plurality of functions comprise pre-compiled functions in the C programming language.
- 32. A computer system according to claim 26, wherein said information is based on LISA (Language for Instruction-Set Architectures) operations.
- 33. A computer system according to claim 26, wherein said cache table comprises references to C functions.
- 34. A computer system according to claim 26, wherein said cache table comprises an entry comprising a key and said information, wherein said key identifies a compiled instruction currently held at said entry.
- 35. A computer readable medium having stored therein instructions which when executed on a general purpose processor implement a method of simulating a processor, said method comprising:
a) determining if compiled data used in simulating an instruction is stored in a memory table of compiled instructions, in response to a request for said compiled data; b) if said compiled data is not is said memory table:
b1) decoding said instruction; b2) determining said compiled data; b3) storing said compiled data in said memory table; and c) returning said compiled data to a simulator for executing a program simulation.
- 36. A computer readable medium according to claim 35, wherein said b2) of said method comprises determining one or more LISA (Language for Instruction-Set Architectures) operations for simulating said instruction.
- 37. A computer readable medium according to claim 35, wherein said method further comprises:
d) invoking a function call to simulate said instruction.
- 38. A computer readable medium according to claim 35, wherein said program simulation is run-time dynamic.
- 39. A computer readable medium according to claim 35, wherein said simulator is retargetable.
RELATED U.S. APPLICATION
[0001] This Application claims priority to U.S. Provisional Application entitled, “A Universal Technique for Fast and Flexible Instruction-Set Architecture Simulation,” Application No. 60/368,439, filed on Mar. 29, 2002, which application is hereby incorporated by reference.
Provisional Applications (1)
|
Number |
Date |
Country |
|
60368439 |
Mar 2002 |
US |