Method and system for instruction-set architecture simulation using just in time compilation
First Claim
1. A method of simulating a program comprising:
- a) determining if compiled data of a program simulation is stored at an address in a memory table of compiled instructions, in response to a request for compiled data of a given instruction, wherein said compiled instructions are individually protected or unprotected from being overwritten in said memory table;
b) if said compiled data is not stored at said location in said memory table, compiling said given instruction and storing said given compiled data of said given instruction at said address in said memory table;
c) determine if said given instruction has changed from a previous execution of an instruction having compiled data at said address in said memory table;
d) if said given instruction has changed from said previous execution of said instruction having compiled data at said address in said memory table, re-compiling said given instruction to generate compiled data of said given instruction;
e) if said given instruction has changed from said previous execution of said instruction having compiled data at said address in said memory table, storing said compiled data of said given instruction if said address in said memory table is not protected from being overwritten; and
f) returning said compiled data of said given instruction or a reference thereto to a simulator that is executing said program simulation.
7 Assignments
0 Petitions
Accused Products
Abstract
A method of simulating a program. Compiled and interpretive techniques are combined into a just-in-time cached compiled technique. When an instruction of a program simulation is to be executed at run-time, a table of compiled instructions is accessed to determine whether compiled data for the instruction is stored in the table. If the compiled data is not therein, the instruction is compiled and stored in the table. The compiled data is returned to a simulator that is executing the program simulation. In another embodiment, before storing new information in the table, another table may be consulted to determine if the location to which the new information is to be stored is protected. If the table location is protected, the new information is not stored in the table. Rather, the new information is simply passed on to the simulator.
22 Citations
35 Claims
-
1. A method of simulating a program comprising:
-
a) determining if compiled data of a program simulation is stored at an address in a memory table of compiled instructions, in response to a request for compiled data of a given instruction, wherein said compiled instructions are individually protected or unprotected from being overwritten in said memory table; b) if said compiled data is not stored at said location in said memory table, compiling said given instruction and storing said given compiled data of said given instruction at said address in said memory table; c) determine if said given instruction has changed from a previous execution of an instruction having compiled data at said address in said memory table; d) if said given instruction has changed from said previous execution of said instruction having compiled data at said address in said memory table, re-compiling said given instruction to generate compiled data of said given instruction; e) if said given instruction has changed from said previous execution of said instruction having compiled data at said address in said memory table, storing said compiled data of said given instruction if said address in said memory table is not protected from being overwritten; and f) returning said compiled data of said given instruction or a reference thereto to a simulator that is executing said program simulation. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)
-
-
14. A computer implemented method of simulating the execution of a set of instructions comprising:
-
a) receiving a request for compiled data of a given instruction to be simulated; b) accessing a memory stored table at a location, wherein compiled data in said memory stored table is individually selectively protected from being overwritten for each of a plurality of instructions; c) if compiled data is not at said location, compiling said given instruction and storing compiled data relating to said given instruction at said location in said memory stored table; d) if compiled data is at said location, verifying that said compiled data at said location is related to said given instruction and not a different instruction that was previously executed at a same instruction address as the given instruction; e) if said compiled data at said location is not related to said given instruction, compiling said given instruction to produce said compiled data relating to said given instruction; f) storing said compiled data relating to said given instruction or a reference thereto at said location if compiled data of said different instruction at said location is not protected from being overwritten; and g) returning said compiled data relating to said given instruction or said reference thereto to a simulator for execution. - View Dependent Claims (15)
-
-
16. 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 at a location in a memory table, wherein compiled data in said memory table is individually selectively protected from being overwritten for each of a plurality of instructions; b) if information to simulate said instruction is stored at said location, returning said information to simulate said instruction to said simulator; c) if information to simulate another instruction is stored at said location, determining said information to be used to simulate said instruction by said simulator; c) determining if said location in said memory table is protected when said location stores information to simulate another instruction; d) if said location is not protected, storing said information to be used to simulate said instruction at said location in said memory table and returning said information to simulate said instruction to said simulator; and e) if said location is protected, returning said information to simulate said instruction to said simulator without storing said information to simulate said instruction in said memory table such that said other instruction stored at said location is not overwritten. - View Dependent Claims (17, 18, 19, 20, 21, 22, 23)
-
-
24. A computer system for simulating a program, comprising:
-
a cache table for storing information for specifying operations to simulate an instruction-set architecture, wherein a location in said cache table stores information for specifying operation for any one of a plurality of instructions; a protection table for indicating whether locations in said cache table are individually protected or unprotected from being overwritten for each instruction stored in said cache table; an instruction compiler for decoding instructions to be simulated, determining said information, and storing said information in said cache table at a given location if said protection table indicates said given location is not protected; an interface for receiving a request for information corresponding to a given instruction from a program simulator, determining if said information corresponding to said given instruction is present and correct in said cache table, causing said instruction compiler to decode said given instruction and determining said information if said information is not present or not correct in said cache table, and returning information corresponding to said given instruction to said program simulator; and said program simulator for using said information corresponding to said given instruction to simulate said program. - View Dependent Claims (25, 26, 27, 28, 29, 30)
-
-
31. A non-transitory 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 a given instruction by a simulator is stored in a memory table of compiled instructions, in response to a request for said compiled data by said simulator, wherein compiled instructions are individually selectively protected from being overwritten; b) if said compiled data is not is said memory table; b1) decoding said given instruction; b2) determining said compiled data used in simulating said given instruction by said simulator; b3) storing said compiled data in said memory table; c) determining if said given instruction has changed from a previous execution of an instruction having compiled data at said address in said memory table; d) if said given instruction has changed from said previous execution of said instruction having compiled data at said address in said memory table; d1) decoding said given instruction; d2) determining said compiled data used in simulating said given instruction by said simulator; d3) determining if said compiled data at said address from a previous execution is protected; d4) storing said compiled data used to simulate said given instruction in said memory table if said compiled data at said address from a previous execution is not protected; d5) not storing said compiled data used to simulate said given instruction in said memory table if said compiled data at said address from a previous execution is protected such that the compiled data at said address from a previous execution is not overwritten; and e) returning said compiled data used in simulating said given instruction to said simulator for executing a program simulation. - View Dependent Claims (32, 33, 34, 35)
-
Specification