Abstract:
An apparatus for emulation routine control transfer creates a jump host instruction (JHI) containing the address of a next emulation routine during the execution of a current emulation routine and outputs the JHI at the end of current emulation routine for transfer of host processor control. The apparatus preferably comprises: an emulated program counter (EPC), a summing means, a state machine, a pointer storage means, an opcode storage means, and a jump instruction circuit. The state machine is preferably coupled to control the loading of the EPC, the loading of the opcode storage means, the summing means, the pointer storage means and the operation of the jump instruction circuit. The pointer storage means is preferably coupled between the data bus and the jump instruction circuit. The state machine preferably issues commands on the control bus and directly to the summing means and the jump instruction circuit to prefetch the next emulation routine, create a jump instruction to the beginning of the next emulation routine and assert the jump instruction on the bus at the appropriate time to transfer directly from one emulation routine to the next using the single host jump instruction. The jump host instruction is placed upon the host processor's instruction bus after execution of the final instruction within a current emulation routine. Thus, the execution of the next emulation routine begins immediately after the execution of the jump host instruction, and significant amounts of processing time associated with the dispatch loop are eliminated.
Abstract:
An apparatus for emulation routine instruction issue comprises a bus signal router, a state machine, a virtual program counter (VPC) circuit, an emulated program counter (EPC), a summing means, an opcode storage means, and a pointer storage means. The VPC circuit maintains the VPC value under the direction of the state machine. In response to a next instruction request issued by the central processing unit (CPU), the state machine outputs the VPC value to an instruction address bus, thereby causing the host instruction stored at the address indicated by the VPC to be transferred to the instruction bus and therefore be issued to the CPU. After a next host instruction request, the state machine updates the VPC value. Concurrent with the execution of the current emulation routine, the apparatus of the present invention prefetches the nest emulation routine pointer (NERP). To accomplish the NERP prefetch, the state machine issues DMA commands and commands to the EPC, the opcode storage means, and the pointer storage means. If the final host instruction in the current emulation routine has been reached, the state machine assigns the NERP to the VPC and then outputs the VPC to the instruction address bus. The method of the present invention preferably comprises the steps of: determining if a next host instruction request has been made by the CPU; outputting the VPC to the instruction address bus; and updating the VPC; and prefetching the NERP concurrent with the execution of the host instructions in the current emulation routine.
Abstract:
An apparatus for emulation routine pointer prefetch comprises an emulated program counter (EPC), a summing means, a prefetch state machine, an opcode storage means, and a pointer storage means. The EPC, opcode storage means, and a pointer storage means are coupled to a bus to receive, store and output an emulated program counter value, an opcode value and a pointer to a next emulation routine, respectively. The EPC, opcode storage means, and pointer storage means are controlled by the prefetch state machine. The prefetch state machine is coupled to the bus to detect a reference to a reserved memory address and stores an updated emulated program counter value in the EPC using the summing means. The prefetch state machine uses the emulated program counter value to prefetch the next source instruction to be emulated in a first memory operation. A portion of the prefetched source instruction is the opcode value and is stored in the opcode storage means. The prefetch state machine uses the opcode value in a second memory operation to retrieve a pointer to a corresponding emulation routine. The pointer is stored in the pointer storage means. The method for emulation routine pointer prefetch preferably comprises the steps of determining if a currently executing emulation routine has issued an instruction to update the EPC; prefetching a next source instruction based upon the value of the EPC; and utilizing an opcode within the prefetched source instruction to prefetch a pointer to a next emulation routine corresponding to the prefetched source instruction.
Abstract:
An instruction mapping system comprises an instruction mapping circuit, a central processing unit (CPU), a data cache, and a memory. The address outputs of the CPU are coupled to a first address bus, while the address inputs of the data cache and memory are coupled to a second address bus. The instruction mapping circuit's address inputs are coupled to the first address bus, and the instruction mapping circuit's outputs are coupled to the second address bus. The CPU sends a pointer address via the first address bus to the instruction mapping circuit. The instruction mapping circuit determines whether the pointer address indicates that the next source instruction is within the subset of most frequently executed source instructions. If so, the instruction mapping circuit maps the pointer address to an address within the data cache. If not, the pointer address is routed through the instruction mapping circuit unchanged. The pointer address is next routed to the data cache and to the RAM via the second address bus. If the pointer address was mapped to a data cache address, the data cache outputs the pointer to the next emulation routine on the data bus. If the pointer address was not mapped to a data cache address, the pointer to the next emulation routine is output on the data bus at the data outputs of the memory. The present invention also includes a method for manufacturing an instruction mapping system.