Emulator for high speed, continuous and discontinuous instruction fetches
AssigneeKabushiki Kaisha Toshiba
InventorAkio Miyoshi
Life of this patent
Estimating the term…
Abstract
A jump judgment circuit judges whether an instruction read bus cycle of a CPU to be emulated is to be executed in a sequential order of addresses of a memory. A control circuit operates in accordance with the judgment result. Specifically, if an instruction is in the sequential order of addresses of a memory relative to the immediately preceding instruction, instruction codes previously read from the memory and converted are read from a queue and supplied to the CPU. If an instruction is not in the sequential order of addresses, which would correspond to a jump to a noncontiguous address of a memory, that instruction is read from the memory at the designated address, converted into instruction codes, and supplied to CPU.
Claims18
An emulation apparatus, comprising:
- memory means for storing instructions;
- memory bus means for transmitting addresses to said memory means and reading instructions corresponding to the transmitted addresses from said memory means;
- cache memory means for storing the instructions read from said memory means through said memory bus means;
- converting means for receiving instructions corresponding to an address transmitted from a CPU to be emulated, the received instructions being read from said cache memory means via said memory bus means when the received instructions are obtained from said cache memory means and being read from said memory means via said memory bus means when the received instructions are not obtained from said cache memory means, and for converting the received instructions into instruction codes;
- instruction queue means for storing the instruction codes corresponding to the instructions converted by said converting means;
- and
- jump judging means for judging, on the basis of a CPU status signal supplied through a local bus, whether the CPU reads continuous instructions or discontinuous instructions due to an address jump, for transmitting the instruction codes stored in said instruction queue means to the CPU through the local bus when the continuous instructions are read, and for transmitting addresses from the CPU to said memory means through said converting means when the discontinuous instructions are read,
- wherein said cache memory means reads and stores jump destination instructions from said memory means,
- wherein said converting means judges types of instructions during the conversion operation, and
- wherein, when an instruction is judged as being an unconditional branch instruction, without converting the unconditional branch instruction, said converting means determines a jump destination address of a next instruction to be executed after the unconditional branch instruction is executed, retrieves the next instruction to be executed from one of said memory means and said cache memory means, converts the next instruction into a corresponding instruction code, and stores the corresponding instruction code of the converted next instruction in said instruction queue means.
An emulation apparatus, comprising:
- memory means for storing instructions;
- memory bus means for transmitting addresses to said memory means and reading instructions corresponding to the transmitted addresses from said memory means;
- cache memory means for storing the instructions read from said memory means through said memory bus means;
- converting means for receiving instructions corresponding to an address transmitted from a CPU to be emulated, the received instructions being read from said cache memory means via said memory bus means when the received instructions are obtained from said cache memory means and being read from said memory means via said memory bus means when the received instructions are not obtained from said cache memory means, and for converting the received instructions into instruction codes;
- instruction queue means for storing the instruction codes corresponding to the instructions converted by said converting means;
- and
- jump judging means for judging, on the basis of a CPU status signal supplied through a local bus, whether the CPU reads continuous instructions or discontinuous instructions due to an address jump, for transmitting the instruction codes stored in said instruction queue means to the CPU through the local bus when the continuous instructions are read, and for transmitting addresses from the CPU to said memory means through said converting means when the discontinuous instructions are read,
- wherein said jump judging means executes the judging operation on the basis of whether the CPU status signal includes a signal representative of a queue clear status,
- wherein said cache memory means reads and stores jump destination instructions from said memory means,
- wherein said converting means judges types of instructions during the conversion operation, and
- wherein, when an instruction is judged as being an unconditional branch instruction, without converting the unconditional branch instruction, said converting means determines a jump destination address of a next instruction to be executed after the unconditional branch instruction is executed, retrieves the next instruction to be executed from one of said memory means and said cache memory means, converts the next instruction into a corresponding instruction code, and stores the corresponding instruction code of the converted next instruction in said instruction queue means.
An emulation apparatus, comprising:
- memory means for storing instructions;
- memory bus means for transmitting addresses to said memory means and reading instructions corresponding to the transmitted addresses from said memory means;
- cache memory means for storing the instructions read from said memory means through said memory bus means;
- converting means for receiving instructions corresponding to an address transmitted from a CPU to be emulated, the received instructions being read from said cache memory means via said memory bus means when the received instructions are obtained from said cache memory means and being read from said memory means via said memory bus means when the received instructions are not obtained from said cache memory means, and for converting the received instructions into instruction codes;
- instruction queue means for storing the instruction codes corresponding to the instructions converted by said converting means;
- and
- jump judging means for judging, on the basis of a CPU status signal supplied through a local bus, whether the CPU reads continuous instructions or discontinuous instructions due to an address jump, for transmitting the instruction codes stored in said instruction queue means to the CPU through the local bus when the continuous instructions are read, and for transmitting addresses from the CPU to said memory means through said converting means when the discontinuous instructions are read,
- wherein said jump judging means executes the judging operation on the basis of whether instruction fetch addresses are continuous or discontinuous,
- wherein said cache memory means reads and stores jump destination instructions from said memory means,
- wherein said converting means judges types of instructions during the conversion operation, and
- wherein, when an instruction is judged as being an unconditional branch instruction, without converting the unconditional branch instruction, said converting means determines a jump destination address of a next instruction to be executed after the unconditional branch instruction is executed, retrieves the next instruction to be executed from one of said memory means and said cache memory means, converts the next instruction into a corresponding instruction code, and stores the corresponding instruction code of the converted next instruction in said instruction queue means.
A method of emulating a CPU, comprising the steps of:
- a) storing instructions in a main memory;
- b) storing a subset of the instructions in a cache memory;
- c) receiving, by a converter, an instruction sent from the CPU which includes an address transmitted from the CPU;
- d) converting, by said converter, the instruction sent from the CPU into an instruction code;
- e) storing the instruction code in an instruction queue;
- f) receiving a CPU status signal sent from the CPU, the CPU status signal indicative of whether the CPU is currently reading a continuous instruction or a discontinuous instruction, the discontinuous instruction corresponding to an unconditional branch instruction;
- g) transmitting the instruction code stored in said instruction queue to the CPU through a local bus when the CPU status signal indicates that the CPU is reading the continuous instruction;
- and
- h) sending the address transmitted from the CPU to said main memory through said converter when the CPU status signal indicates that the CPU is reading the discontinuous instruction,
- wherein said cache memory reads and stores jump destination instructions from said main memory,
- wherein said converting step d) judges types of instructions, and
- wherein, when an instruction is judged as being an unconditional branch instruction, without converting the unconditional branch instruction, said converting step d) determines a jump destination address of a next instruction to be executed after the unconditional branch instruction is executed, retrieves the next instruction to be executed from one of said main memory and said cache memory, converts the next instruction into a corresponding instruction code, and stores the corresponding instruction code of the converted next instruction in said instruction queue.
An emulation apparatus, comprising:
- memory means for storing instructions;
- memory bus means for transmitting addresses to said memory means and reading instructions corresponding to the transmitted addresses from said memory means;
- cache memory means for storing the instructions read from said memory means through said memory bus means;
- converting means for receiving instructions corresponding to an address transmitted from a CPU to be emulated, the received instructions being read from said cache memory means via said memory bus means when the received instructions are obtained from said cache memory means and being read from said memory means via said memory bus means when the received instructions are not obtained from said cache memory means, and for converting the received instructions into instruction codes;
- instruction queue means for storing the instruction codes corresponding to the instructions converted by said converting means in a sequential order;
- and
- jump judging means for judging, on the basis of a CPU status signal supplied through a local bus, whether the CPU reads continuous instructions or discontinuous instructions due to an address jump, for transmitting the instruction codes stored in said instruction queue means and read therefrom on a sequential basis to the CPU through the local bus when the continuous instructions are read, and for transmitting addresses from the CPU to said memory means through said converting means when the discontinuous instructions are read,
- wherein said jump judging means outputs an initialize signal to said instruction queue means to cause instructions to be written out of said instruction queue means in a sequential manner starting at a predetermined storage location when the CPU status signal is indicative of the CPU reading one of the discontinuous instructions,
- wherein said cache memory means reads and stores jump destination instructions from said memory means,
- wherein said converting means judges types of instructions during the conversion operation, and
- wherein, when an instruction is judged as being an unconditional branch instruction, without converting the unconditional branch instruction, said converting means determines a jump destination address of a next instruction to be executed after the unconditional branch instruction is executed, retrieves the next instruction to be executed from one of said memory means and said cache memory means, converts the next instruction into a corresponding instruction code, and stores the corresponding instruction code of the converted next instruction in said instruction queue means.
Dependencies are inferred from the claim text.