EP1891517A2 - Operand width indication for micro-sequence processing - Google Patents

Operand width indication for micro-sequence processing

Info

Publication number
EP1891517A2
EP1891517A2 EP06771120A EP06771120A EP1891517A2 EP 1891517 A2 EP1891517 A2 EP 1891517A2 EP 06771120 A EP06771120 A EP 06771120A EP 06771120 A EP06771120 A EP 06771120A EP 1891517 A2 EP1891517 A2 EP 1891517A2
Authority
EP
European Patent Office
Prior art keywords
micro
opcode
operand
sequence
fetch
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
EP06771120A
Other languages
German (de)
French (fr)
Other versions
EP1891517A4 (en
Inventor
Gilbert Cabillic
Jean-Phillipe Lesot
Gerald RESIDENCE DU VALBOSQUET CHAUVEL
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Texas Instruments Inc
Original Assignee
Texas Instruments Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from US11/135,796 external-priority patent/US20060026392A1/en
Application filed by Texas Instruments Inc filed Critical Texas Instruments Inc
Publication of EP1891517A2 publication Critical patent/EP1891517A2/en
Publication of EP1891517A4 publication Critical patent/EP1891517A4/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/3017Runtime instruction translation, e.g. macros
    • G06F9/30174Runtime instruction translation, e.g. macros for non-native instruction set, e.g. Javabyte, legacy code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30181Instruction operation extension or modification
    • G06F9/30185Instruction operation extension or modification according to one or more bits in the instruction, e.g. prefix, sub-opcode
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30181Instruction operation extension or modification
    • G06F9/30189Instruction operation extension or modification according to execution mode, e.g. mode flag
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30181Instruction operation extension or modification
    • G06F9/30192Instruction operation extension or modification according to data descriptor, e.g. dynamic data typing

Definitions

  • the invention relates to data processing; and, more particularly, to apparatus and methods for indicating operand width in the use of micro-sequences for efficient execution of microprocessor code (e.g., JavaTM bytecodes).
  • microprocessor code e.g., JavaTM bytecodes
  • Some processors have the ability to execute JavaTM bytecodes directly (an "opcode” being a single member of the group bytecodes), or the functionality desired may be performed by way of "micro-sequences.”
  • a stacked-based opcode may be used when a stack-based implementation works better for the desired function
  • register-based micro-sequence may be used when a register-based implementation works better for the desired function.
  • U>S> Patent Publication No. US2004-0024999 describes processors having the ability to execute an opcode, or have the opcode trigger a micro-sequence.
  • the width of an operand is indicated by the presence or absence of another opcode known as "WIDE.”
  • WIDE opcode
  • the operand width is greater than if the WIDE opcode is not present.
  • a directly executed JavaTM opcode "ILOAD” integer load
  • the ILOAD opcode may fetch a 32 bit local variable from the location indicated by an sixteen bit operand.
  • WIDE extends the number of available local variables to 65,536, though each local variable is still 32 bits in width regardless of the presence or absence of WIDE.
  • the processor decodes the WIDE and adjusts fetched operand width accordingly. However, if the opcode triggers a micro-sequence, fetching of the operand is performed by register-based micro-sequences that are unaware of whether the opcode that triggered the micro-sequence was preceded by a WIDE opcode.
  • the micro-sequence may have to analyze the opcode instruction stream by reading the instruction stream through data cache reads.
  • the opcode instruction stream may be present in the processor's instruction cache and not the data cache, the initial attempt to read the instruction stream through the data cache results in a cache miss.
  • significant processor time is expended by a micro-sequence reading the various triggering opcodes and determining the operand width.
  • Example embodiments comprise methods and apparatus for fetching a first opcode, asserting a flag if the first opcode modifies an operand width of a subsequent opcode, fetching a second opcode, triggering a micro-sequence based on the opcode, reading the flag by instructions of the micro-sequence, and fetching an operand of the second opcode by the micro-sequence (the bit width of the operand based on a state of the flag).
  • FIG. 1 shows a diagram of a system in accordance with embodiments of the invention
  • FIG. 2 shows a block diagram of the JSM of FIG. 1 in accordance with embodiments of the invention
  • FIG. 3 shows various registers used in the JSM of FIGS. 1 and 2;
  • FIG. 4 illustrates operation of the JSM to trigger "micro-sequences";
  • FIG. 5 illustrates a method in accordance with embodiments of the invention; and
  • FIG. 6 depicts an illustrative embodiment of the system described herein.
  • FIG. 1 shows a system 100 in accordance with embodiments of the invention.
  • the system may comprise at least two processors 102 and 104.
  • Processor 102 may be referred to for purposes of this disclosure as a Java Stack Machine ("JSM") and processor 104 may be referred to as a Main Processor Unit (“MPU").
  • System 100 may also comprise memory 106 coupled to both the JSM 102 and MPU 104. At least a portion of the memory 106 may be shared by both processors, and if desired, other portions of the memory 106 may be designated as private to one processor or the other.
  • System 100 also comprises a Java Virtual Machine (“JVM”) 108, compiler 110, and a display 114.
  • the JVM 108 may comprise a combination of software and hardware.
  • the software may comprise the compiler 110 and the hardware may comprise the JSM 102.
  • the JVM may comprise a class loader, bytecode verifier, garbage collector, and a bytecode interpreter loop to interpret the bytecodes that are not executed on the JSM processor 102.
  • Other components may be included as desired for various applications.
  • JavaTM language source code is converted or compiled to a series of bytecodes 112, with each individual one of the bytecodes referred to as an "opcode.”
  • Bytecodes 112 may be provided to the JVM 108, possibly compiled by compiler 110, and provided to the JSM 102 and/or MPU 104 for execution.
  • the JSM 102 may execute at least some JavaTM bytecodes directly.
  • the JVM 108 may also request the MPU 104 to execute one or more JavaTM bytecodes not executed or executable by the JSM 102.
  • the MPU 104 also may execute non-Java instructions.
  • the MPU 104 may thus also host an operating system ("O/S") (not specifically shown) which performs various functions such as system memory management, the system task management that schedules the software aspects of the JVM 108 and most or all other native tasks running on the system, management of the display 114, and receiving input from input devices (not specifically shown).
  • O/S operating system
  • JavaTM code may be used to perform any one of a variety of applications such as multimedia, games or web based applications in the system 100, while non-JavaTM code, which may comprise the O/S and other native applications, may still run on the system on the MPU 104.
  • JavaTM bytecodes perform stack-based operations. For example, an "IADD" (integer add) JavaTM opcode pops two integers off the top of the stack, adds them together, and pushes the sum back on the stack.
  • a "simple” opcode is one in which the JSM 102 may perform an immediate operation either in a single cycle (e.g., an IADD opcode) or in several cycles (e.g., "DUP2_X2").
  • a “complex” opcode is one in which several memory accesses may be required to be made within the JVM data structure for various verifications (e.g., NULL pointer, array boundaries).
  • a JSM processor 102 in accordance with embodiments of the invention may execute, in addition to the JavaTM bytecodes, a second instruction set other than JavaTM bytecodes.
  • the second instruction set may comprise register-based and memory-based operations rather than stack-based operations.
  • This second instruction set complements the JavaTM instruction set and, accordingly, may be referred to as a complementary instruction set architecture ("C-ISA").
  • C-ISA complementary instruction set architecture
  • complementary it is meant that some complex JavaTM bytecodes may be replaced by a "micro-sequence" comprising C-ISA instructions. The execution of JavaTM code may thus be made more efficient and run faster by replacing some opcodes by more efficient micro-sequences of C-ISA instructions.
  • JSM 102 comprises a stack- based architecture for efficient and accelerated execution of JavaTM bytecodes, combined with a register-based architecture for executing register and memory based micro-sequences of C- ISA instructions. Because various of the data structures described herein are JVM-dependent, and thus may change from one JVM implementation to another, the software flexibility of the micro-sequence provides a mechanism for various JVM optimizations now known or later developed.
  • FIG. 2 shows an illustrative block diagram of the JSM 102.
  • the JSM comprises a core 120 coupled to data storage 122 and instruction storage 130.
  • the components of the core 120 preferably comprise a plurality of registers 140, address generation units (“AGUs”) 142 and 147, micro-translation lookaside buffers (micro-TLBs) 144 and 156, a multi-entry micro-stack 146, an arithmetic logic unit (“ALU”) 148, a multiplier 150, decode logic 152, and instruction fetch logic 154.
  • ALU arithmetic logic unit
  • Instructions may be fetched from instruction storage 130 by fetch logic 154 and decoded by decode logic 152.
  • the AGUs 142 may be used to calculate addresses for micro-sequence instructions based, at least in part, on data contained in the registers 140.
  • AGU 147 couples to the micro-stack 146 and may manage overflow and underflow conditions in the micro-stack 146.
  • the micro-TLBs 144 and 156 perform the function of a cache for the address translation and memory protection information bits that are under the control of the operating system running on the MPU 104.
  • the registers 140 may comprise a plurality of registers designated as R0-R15.
  • Registers R0-R3, R5, R8-R11 and R13-R14 may be used as general purposes ("GP") registers for any purpose. Other registers, and some of the GP registers, may be used for specific purposes. For example, registers R4 and R12 may each be used to store program counters, with R4 storing the program counter ("PC") for a stream of bytecodes, and Rl 2 storing a micro-program counter (“micro-PC”) for executing micro-sequence. The use of the PC and micro-PC will be explained in greater detail below.
  • register R5 may be used to store the base address of a portion of memory in which JavaTM local variables may be stored when used by the current JavaTM method.
  • the top of the micro-stack 146 can be referenced by the values in registers R6 and R7, and the top of the micro-stack may have a matching address in external memory pointed to by register R6.
  • the values contained in the micro-stack are the latest updated values, while their corresponding values in external memory may or may not be up to date.
  • Register R7 provides the data value stored at the top of the micro-stack.
  • Registers R8 and R9 may also be used to hold the address index 0 ("AIO") and address index 1 ("All").
  • Register R14 may also be used to hold the indirect register index ("IRI").
  • Register Rl 5 may be used for status and control of the JSM
  • At least one bit (called the "Micro-Sequence- Active" bit, not specifically shown) in status register Rl 5 is used to indicate whether the JSM 102 is executing by way of a micro-sequence. This bit controls, in particular, which program counter is used R4 (PC) or Rl 2 (micro-PC) to fetch the next instruction.
  • Another bit of the status and control register Rl 5 (termed herein the "WIDE flag” or "WIDE bit”, and given the reference number 200) is used indicate to an executing micro-sequence whether the opcode that triggered the micro-sequence was preceded by a JavaTM WIDE opcode, as discussed more fully below.
  • JavaTM bytecodes may pop data from and push data onto the micro-stack 146, which micro-stack 146 preferably comprises a plurality of gates in the core 120 of the JSM 102.
  • the micro-stack 146 preferably comprises the top n entries of a larger stack that is implemented in data storage 122. Although the value of n may be vary in different embodiments, in accordance with at least some embodiments the size n of the micro-stack may be the top eight entries in the larger, memory-based stack.
  • ALU 148 adds, subtracts, and shifts data.
  • the multiplier 150 may be used to multiply two values together in one or more cycles.
  • the instruction fetch logic 154 fetches instructions from instruction storage 130, which instructions may be decoded by decode logic 152. Because the JSM 102 is configured to process instructions from at least two instruction sets, the decode logic 152 comprises at least two modes of operation, one mode for each instruction set. As such, the decode logic unit 152 may comprise a JavaTM mode in which JavaTM bytecodes may be decoded, and a C-ISA mode in which micro-sequences of C-ISA instructions may be decoded.
  • the data storage 122 comprises data cache ("D-cache”) 124 and data random access memory (“D-RAM”) 126.
  • the stack (excluding the micro-stack 146), arrays and non-critical data maybe stored in the D-cache 124, while JavaTM local variables, critical data and non-JavaTM variables (e.g., C 5 C++) may be stored in D-RAM 126.
  • the instruction storage 130 may comprise instruction RAM (“I-RAM”) 132 and instruction cache (“I-CACHE”) 134.
  • the I-RAM 132 may be used for opcodes or micro-sequences, and the I-CACHE 134 may be used to store other types of JavaTM bytecode and mixed JavaTM/C-ISA instructions.
  • FIG. 4 illustrates the operation of the JSM 102 with regard to triggering of micro-sequences based on JavaTM bytecodes.
  • FIG. 4 illustrates the instruction storage 130, the decode logic 152, and a micro-sequence vector table 162.
  • the decode logic 152 accesses the instruction storage 130 and a micro-sequence vector table 162.
  • the decode logic 152 retrieves instructions (e.g., instructions 170) from instruction storage 130 by way of instruction fetch logic 154 (FIG. 2) and decodes the instructions to determine the type of instruction.
  • the JSM 102 either directly executes an opcode of instructions 170, or triggers a micro-sequence to perform a desired function (that may or may not be related to the opcode).
  • the micro-sequence vector table 162 may be implemented in the decode logic 152, or as separate logic in the JSM 102.
  • the micro-sequence vector table 162 preferably comprises a plurality of entries 164, such as one entry for each opcode that the JSM may receive. For example, if there are a total of 256 bytecodes, the micro-sequence vector table 162 preferably comprises at least 256 entries.
  • Each entry 164 may have at least two fields - a field 166 and an associated field 168.
  • Field 168 may comprise a single bit that indicates whether the instruction 170 is to be directly executed, or whether the associated field 166 contains a reference to a micro-sequence.
  • an asserted bit 168 may indicate the corresponding opcode is directly executable by the JSM, and a non-asserted bit 168 may indicate that the associated field 166 contains a reference to a micro-sequence.
  • the reference may comprise the full starting address in instruction storage 130 of the micro-sequence, or a part of the starting address that can be concatenated with a base address that may be programmable in the JSM.
  • field 166 may provide as many address bits as are required to access the full memory space.
  • a register within the JSM registers 140, or preferably within a JSM configuration register accessible through an indirect addressing mechanism using the IRI register is programmed to hold the base address, m these embodiments the vector table 162 may supply only the offset to access the start of the micro-sequence.
  • Most or all JSM internal registers 140 and any other registers may be accessible by the MPU 104, and therefore may be modified by the JVM as necessary.
  • the offset addressing technique may be preferred to reduce the number of bits needed within field 166.
  • At least a portion 180 of the instruction storage 130 may be allocated for storage of micro-sequences and thus the starting address may point to a location in micro-sequence storage 180 at which a particular micro-sequence can be found.
  • the portion 180 may be implemented in I-RAM 132 shown in FIG. 2.
  • the decode -logic 152 uses an opcode as an index into micro-sequence vector table 162. Once the decode logic 152 locates the indexed entry 164, the decode logic 152 examines the associated bit 168 to determine whether the opcode triggers a micro-sequence. If the bit 168 indicates that the opcode can be directly processed and executed by the JSM, then the instruction is so executed.
  • the decode logic 152 preferably changes the opcode into a "NOP,” executes the NOP opcode, asserts the micro-sequence-active bit in the status register Rl 5 (not specifically shown), and begins fetching the first micro-sequence instruction.
  • NOP NOP
  • the micro-sequence-active bit may be set at any suitable time, such as when the micro-sequence enters the JSM execution stage (not specifically shown).
  • the JSM 102 implements two program counters - the PC 186 (register R4) and the micro-PC 188 (register R12).
  • one of these two program counters is the active program counter used to fetch and decode instructions.
  • the PC 186 stored in register R4 may be the active program counter when executing bytecodes.
  • the micro-PC 188 stored in register Rl 2 maybe the active program counter when fetching and executing micro-sequences.
  • the JSM 102 hardware may need to fetch data, such as data pointed to by operands.
  • data such as data pointed to by operands.
  • the size or bit width of the operand is dictated, at least in part, by the presence or absence of the WIDE opcode.
  • the micro-sequence may be unaware that its triggering opcode was preceded by a WIDE opcode.
  • the decode logic 152 (FIG. 2 or FIG. 3) is configured to assert the WIDE bit or WIDE flag 200 in register Rl 5 when a WIDE opcode is encountered, possibly in addition to other steps taken in response to a WIDE opcode.
  • micro-PC 188 register R12
  • the contents of the field 166 associated with the micro-sequenced opcode is loaded into the micro-PC 188.
  • the JSM 102 begins fetching and decoding the instructions of the micro-sequence.
  • the PC 186 preferably is incremented by a suitable value to point the program counter to the next instruction following the opcode that triggered the micro-sequence.
  • the micro-sequence-active bit within the status register Rl 5 may only be changed when the first instruction of the micro-sequence enters the execute phase of JSM 102 pipe.
  • the switch from PC 186 to the micro-PC 188 preferably is effective immediately after the micro-sequenced instruction is decoded, thereby reducing the latency.
  • the micro-sequence may perform its task and end with a predetermined instruction from the C-ISA called "RtuS" (return from micro-sequence) that indicates the end of the sequence.
  • This C-ISA instruction causes a switch from the micro-PC (register Rl 2) to the PC (register R4).
  • the PC 186 was previously incremented so that the value of the PC 186 points to the next instruction to be decoded.
  • FIG. 5 illustrates a flow diagram of a method in accordance with embodiments of the invention.
  • the process may start (block 502) by the triggering of a micro-sequence operation by an opcode.
  • the micro-sequence instructions read the WIDE flag 200 (block 504). If the WIDE flag 200 is asserted (block 506), then the micro-sequence instructions fetch the operand(s) in WIDE format (block 508). On the other hand, if the WIDE flag is not asserted (block 506), then the micro-sequence instructions fetch the operands in normal or non-WIDE format (block 510).
  • the micro-sequence instructions then perform their desired function (block 512), which may be different for each opcode that triggers a micro-sequence. Thereafter, the micro-sequence clears the WIDE flag (block 514). If the WIDE flag was not asserted, the illustrative clearing of the WIDE flag of step 514 may be skipped. In alternative embodiments, the decode logic 152 may de-assert the WIDE flag 200 at an appropriate time, such as after decoding and executing the instruction immediately subsequent to the WIDE opcode. Thereafter, the process ends (block 516).
  • System 100 may be implemented as a mobile cell phone such as that shown in FIG. 6.
  • the mobile communication device includes an integrated keypad 412 and display 414.
  • the JSM processor 102 and MPU processor 104 and other components may be included in electronics package 410 connected to the keypad 412, display 414, and radio frequency ("RF") circuitry 416.
  • the RF circuitry 416 may be connected to an antenna 418.

Abstract

Methods and apparatus for data processing provide operand width indication for micro- sequence execution. Described embodiments include methods and apparatus that fetch a first opcode, assert a flag if the first opcode modifies an operand width of a subsequent opcode, fetch a second opcode, trigger a micro-sequence based on the opcode, read the flag by instructions of the micro-sequence (504), and fetch an operand of the second opcode by the micro-sequence (the bit width of the operand based on a state of the flag) (508, 510).

Description

OPERAND WIDTH INDICATION FOR MICRO-SEQUENCE PROCESSING The invention relates to data processing; and, more particularly, to apparatus and methods for indicating operand width in the use of micro-sequences for efficient execution of microprocessor code (e.g., Java™ bytecodes). BACKGROUND
Some processors have the ability to execute Java™ bytecodes directly (an "opcode" being a single member of the group bytecodes), or the functionality desired may be performed by way of "micro-sequences." A stacked-based opcode may be used when a stack-based implementation works better for the desired function, and register-based micro-sequence may be used when a register-based implementation works better for the desired function. U>S> Patent Publication No. US2004-0024999 describes processors having the ability to execute an opcode, or have the opcode trigger a micro-sequence.
Whether a desired function is implemented directly by an opcode, or by a micro- sequence, the width of an operand (the operand pointing to local variables, with each local variable 32 bits in width) is indicated by the presence or absence of another opcode known as "WIDE." In particular, when an opcode is immediately preceded by a WIDE opcode, the operand width is greater than if the WIDE opcode is not present. For example, a directly executed Java™ opcode "ILOAD" (integer load), when not preceded by WIDE, may fetch a 32 bit local variable from the location indicated by an eight bit operand. When ILOAD is immediately preceded by a WIDE opcode, the ILOAD opcode may fetch a 32 bit local variable from the location indicated by an sixteen bit operand. Thus, WIDE extends the number of available local variables to 65,536, though each local variable is still 32 bits in width regardless of the presence or absence of WIDE. When executing opcodes directly, the processor decodes the WIDE and adjusts fetched operand width accordingly. However, if the opcode triggers a micro-sequence, fetching of the operand is performed by register-based micro-sequences that are unaware of whether the opcode that triggered the micro-sequence was preceded by a WIDE opcode. hi order for a micro-sequence to determine the operand width, the micro-sequence may have to analyze the opcode instruction stream by reading the instruction stream through data cache reads. Inasmuch as the opcode instruction stream may be present in the processor's instruction cache and not the data cache, the initial attempt to read the instruction stream through the data cache results in a cache miss. Thus, significant processor time is expended by a micro-sequence reading the various triggering opcodes and determining the operand width. SUMMARY The problems noted above are addressed by data processing methods and apparatus providing a micro-sequence with information on operand width. Example embodiments comprise methods and apparatus for fetching a first opcode, asserting a flag if the first opcode modifies an operand width of a subsequent opcode, fetching a second opcode, triggering a micro-sequence based on the opcode, reading the flag by instructions of the micro-sequence, and fetching an operand of the second opcode by the micro-sequence (the bit width of the operand based on a state of the flag). BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 shows a diagram of a system in accordance with embodiments of the invention; FIG. 2 shows a block diagram of the JSM of FIG. 1 in accordance with embodiments of the invention;
FIG. 3 shows various registers used in the JSM of FIGS. 1 and 2; FIG. 4 illustrates operation of the JSM to trigger "micro-sequences"; FIG. 5 illustrates a method in accordance with embodiments of the invention; and FIG. 6 depicts an illustrative embodiment of the system described herein.
DETAILED DESCRIPTION OF THE EMBODIMENTS
The subject matter disclosed herein is directed to a programmable electronic device such as a processor. The processor described herein is particularly suited for executing Java™ bytecodes, or comparable code. Java™ itself is particularly suited for embedded applications as it is a relatively "dense" language, meaning that on average each instruction may perform a large number of functions compared to other programming languages. The dense nature of Java™ is of particular benefit for portable, battery-operated devices with small amounts of memory. The reason, however, for executing Java™ code is not material to this disclosure or the claims which follow. Further, the processor advantageously has one or more features that permit the execution of the Java™ code to be accelerated. FIG. 1 shows a system 100 in accordance with embodiments of the invention. As shown, the system may comprise at least two processors 102 and 104. Processor 102 may be referred to for purposes of this disclosure as a Java Stack Machine ("JSM") and processor 104 may be referred to as a Main Processor Unit ("MPU"). System 100 may also comprise memory 106 coupled to both the JSM 102 and MPU 104. At least a portion of the memory 106 may be shared by both processors, and if desired, other portions of the memory 106 may be designated as private to one processor or the other. System 100 also comprises a Java Virtual Machine ("JVM") 108, compiler 110, and a display 114. The JVM 108 may comprise a combination of software and hardware. The software may comprise the compiler 110 and the hardware may comprise the JSM 102. The JVM may comprise a class loader, bytecode verifier, garbage collector, and a bytecode interpreter loop to interpret the bytecodes that are not executed on the JSM processor 102. Other components (not specifically shown) may be included as desired for various applications.
Java™ language source code is converted or compiled to a series of bytecodes 112, with each individual one of the bytecodes referred to as an "opcode." Bytecodes 112 may be provided to the JVM 108, possibly compiled by compiler 110, and provided to the JSM 102 and/or MPU 104 for execution. In accordance with some embodiments of the invention, the JSM 102 may execute at least some Java™ bytecodes directly. When appropriate, however, the JVM 108 may also request the MPU 104 to execute one or more Java™ bytecodes not executed or executable by the JSM 102. In addition to executing compiled Java™ bytecodes, the MPU 104 also may execute non-Java instructions. The MPU 104 may thus also host an operating system ("O/S") (not specifically shown) which performs various functions such as system memory management, the system task management that schedules the software aspects of the JVM 108 and most or all other native tasks running on the system, management of the display 114, and receiving input from input devices (not specifically shown). Java™ code may be used to perform any one of a variety of applications such as multimedia, games or web based applications in the system 100, while non-Java™ code, which may comprise the O/S and other native applications, may still run on the system on the MPU 104.
Java™ bytecodes perform stack-based operations. For example, an "IADD" (integer add) Java™ opcode pops two integers off the top of the stack, adds them together, and pushes the sum back on the stack. A "simple" opcode is one in which the JSM 102 may perform an immediate operation either in a single cycle (e.g., an IADD opcode) or in several cycles (e.g., "DUP2_X2"). A "complex" opcode is one in which several memory accesses may be required to be made within the JVM data structure for various verifications (e.g., NULL pointer, array boundaries).
A JSM processor 102 in accordance with embodiments of the invention may execute, in addition to the Java™ bytecodes, a second instruction set other than Java™ bytecodes. In some embodiments, the second instruction set may comprise register-based and memory-based operations rather than stack-based operations. This second instruction set complements the Java™ instruction set and, accordingly, may be referred to as a complementary instruction set architecture ("C-ISA"). By complementary, it is meant that some complex Java™ bytecodes may be replaced by a "micro-sequence" comprising C-ISA instructions. The execution of Java™ code may thus be made more efficient and run faster by replacing some opcodes by more efficient micro-sequences of C-ISA instructions. As such, JSM 102 comprises a stack- based architecture for efficient and accelerated execution of Java™ bytecodes, combined with a register-based architecture for executing register and memory based micro-sequences of C- ISA instructions. Because various of the data structures described herein are JVM-dependent, and thus may change from one JVM implementation to another, the software flexibility of the micro-sequence provides a mechanism for various JVM optimizations now known or later developed.
FIG. 2 shows an illustrative block diagram of the JSM 102. As shown, the JSM comprises a core 120 coupled to data storage 122 and instruction storage 130. The components of the core 120 preferably comprise a plurality of registers 140, address generation units ("AGUs") 142 and 147, micro-translation lookaside buffers (micro-TLBs) 144 and 156, a multi-entry micro-stack 146, an arithmetic logic unit ("ALU") 148, a multiplier 150, decode logic 152, and instruction fetch logic 154. Data pointed to by operands- of opcodes may be retrieved from data storage 122 or from the micro-stack 146, and processed by the ALU 148. Instructions may be fetched from instruction storage 130 by fetch logic 154 and decoded by decode logic 152. The AGUs 142 may be used to calculate addresses for micro-sequence instructions based, at least in part, on data contained in the registers 140. AGU 147 couples to the micro-stack 146 and may manage overflow and underflow conditions in the micro-stack 146. The micro-TLBs 144 and 156 perform the function of a cache for the address translation and memory protection information bits that are under the control of the operating system running on the MPU 104. Referring now to FIG. 3, the registers 140 may comprise a plurality of registers designated as R0-R15. Registers R0-R3, R5, R8-R11 and R13-R14 may be used as general purposes ("GP") registers for any purpose. Other registers, and some of the GP registers, may be used for specific purposes. For example, registers R4 and R12 may each be used to store program counters, with R4 storing the program counter ("PC") for a stream of bytecodes, and Rl 2 storing a micro-program counter ("micro-PC") for executing micro-sequence. The use of the PC and micro-PC will be explained in greater detail below. In addition to use as a GP register, register R5 may be used to store the base address of a portion of memory in which Java™ local variables may be stored when used by the current Java™ method. The top of the micro-stack 146 can be referenced by the values in registers R6 and R7, and the top of the micro-stack may have a matching address in external memory pointed to by register R6. The values contained in the micro-stack are the latest updated values, while their corresponding values in external memory may or may not be up to date. Register R7 provides the data value stored at the top of the micro-stack. Registers R8 and R9 may also be used to hold the address index 0 ("AIO") and address index 1 ("All"). Register R14 may also be used to hold the indirect register index ("IRI"). Register Rl 5 may be used for status and control of the JSM
102. At least one bit (called the "Micro-Sequence- Active" bit, not specifically shown) in status register Rl 5 is used to indicate whether the JSM 102 is executing by way of a micro-sequence. This bit controls, in particular, which program counter is used R4 (PC) or Rl 2 (micro-PC) to fetch the next instruction. Another bit of the status and control register Rl 5 (termed herein the "WIDE flag" or "WIDE bit", and given the reference number 200) is used indicate to an executing micro-sequence whether the opcode that triggered the micro-sequence was preceded by a Java™ WIDE opcode, as discussed more fully below.
Referring again to FIG. 2, Java™ bytecodes may pop data from and push data onto the micro-stack 146, which micro-stack 146 preferably comprises a plurality of gates in the core 120 of the JSM 102. The micro-stack 146 preferably comprises the top n entries of a larger stack that is implemented in data storage 122. Although the value of n may be vary in different embodiments, in accordance with at least some embodiments the size n of the micro-stack may be the top eight entries in the larger, memory-based stack. By implementing the micro-stack 146 hardware in the core 120 of the processor 102, access to the data contained in the micro- stack 146 is very fast, although any particular access speed is not a limitation on this disclosure.
Still referring to FIG. 2, ALU 148 adds, subtracts, and shifts data. The multiplier 150 may be used to multiply two values together in one or more cycles. The instruction fetch logic 154 fetches instructions from instruction storage 130, which instructions may be decoded by decode logic 152. Because the JSM 102 is configured to process instructions from at least two instruction sets, the decode logic 152 comprises at least two modes of operation, one mode for each instruction set. As such, the decode logic unit 152 may comprise a Java™ mode in which Java™ bytecodes may be decoded, and a C-ISA mode in which micro-sequences of C-ISA instructions may be decoded.
The data storage 122 comprises data cache ("D-cache") 124 and data random access memory ("D-RAM") 126. The stack (excluding the micro-stack 146), arrays and non-critical data maybe stored in the D-cache 124, while Java™ local variables, critical data and non-Java™ variables (e.g., C5 C++) may be stored in D-RAM 126. The instruction storage 130 may comprise instruction RAM ("I-RAM") 132 and instruction cache ("I-CACHE") 134. The I-RAM 132 may be used for opcodes or micro-sequences, and the I-CACHE 134 may be used to store other types of Java™ bytecode and mixed Java™/C-ISA instructions.
FIG. 4 illustrates the operation of the JSM 102 with regard to triggering of micro-sequences based on Java™ bytecodes. hi particular, FIG. 4 illustrates the instruction storage 130, the decode logic 152, and a micro-sequence vector table 162. The decode logic 152 accesses the instruction storage 130 and a micro-sequence vector table 162. The decode logic 152 retrieves instructions (e.g., instructions 170) from instruction storage 130 by way of instruction fetch logic 154 (FIG. 2) and decodes the instructions to determine the type of instruction. In accordance with some embodiments, the JSM 102 either directly executes an opcode of instructions 170, or triggers a micro-sequence to perform a desired function (that may or may not be related to the opcode). The micro-sequence vector table 162 may be implemented in the decode logic 152, or as separate logic in the JSM 102. The micro-sequence vector table 162 preferably comprises a plurality of entries 164, such as one entry for each opcode that the JSM may receive. For example, if there are a total of 256 bytecodes, the micro-sequence vector table 162 preferably comprises at least 256 entries. Each entry 164 may have at least two fields - a field 166 and an associated field 168. Field 168 may comprise a single bit that indicates whether the instruction 170 is to be directly executed, or whether the associated field 166 contains a reference to a micro-sequence. For example, an asserted bit 168 may indicate the corresponding opcode is directly executable by the JSM, and a non-asserted bit 168 may indicate that the associated field 166 contains a reference to a micro-sequence.
If the bit 168 indicates the associated field 166 includes a reference to a micro- sequence, the reference may comprise the full starting address in instruction storage 130 of the micro-sequence, or a part of the starting address that can be concatenated with a base address that may be programmable in the JSM. In the former case, field 166 may provide as many address bits as are required to access the full memory space. In the latter case, a register within the JSM registers 140, or preferably within a JSM configuration register accessible through an indirect addressing mechanism using the IRI register, is programmed to hold the base address, m these embodiments the vector table 162 may supply only the offset to access the start of the micro-sequence. Most or all JSM internal registers 140 and any other registers may be accessible by the MPU 104, and therefore may be modified by the JVM as necessary.
Although not required, the offset addressing technique may be preferred to reduce the number of bits needed within field 166. At least a portion 180 of the instruction storage 130 may be allocated for storage of micro-sequences and thus the starting address may point to a location in micro-sequence storage 180 at which a particular micro-sequence can be found. The portion 180 may be implemented in I-RAM 132 shown in FIG. 2.
In operation, the decode -logic 152 uses an opcode as an index into micro-sequence vector table 162. Once the decode logic 152 locates the indexed entry 164, the decode logic 152 examines the associated bit 168 to determine whether the opcode triggers a micro-sequence. If the bit 168 indicates that the opcode can be directly processed and executed by the JSM, then the instruction is so executed. If, however, the bit 168 indicates that the opcode triggers a micro-sequence, then the decode logic 152 preferably changes the opcode into a "NOP," executes the NOP opcode, asserts the micro-sequence-active bit in the status register Rl 5 (not specifically shown), and begins fetching the first micro-sequence instruction. Changing the opcode into a NOP while fetching the first instruction of the micro-sequence permits the JSM to process multi-cycle instructions that are further advanced in the pipe without additional latency. The micro-sequence-active bit may be set at any suitable time, such as when the micro-sequence enters the JSM execution stage (not specifically shown).
The JSM 102 implements two program counters - the PC 186 (register R4) and the micro-PC 188 (register R12). In accordance with some embodiments, one of these two program counters is the active program counter used to fetch and decode instructions. The PC 186 stored in register R4 may be the active program counter when executing bytecodes. The micro-PC 188 stored in register Rl 2 maybe the active program counter when fetching and executing micro-sequences.
When directly executing an opcode, the JSM 102 hardware may need to fetch data, such as data pointed to by operands. In Java™ bytecodes, the size or bit width of the operand is dictated, at least in part, by the presence or absence of the WIDE opcode. However, if a particular opcode triggers a micro-sequence, the micro-sequence may be unaware that its triggering opcode was preceded by a WIDE opcode. While in the related art this determination is made by the micro-sequence by reading the opcode instruction stream by way of data cache 124 (initially resulting in a cache miss) and analyzing the opcode stream, in accordance with embodiments of the invention the decode logic 152 (FIG. 2 or FIG. 3) is configured to assert the WIDE bit or WIDE flag 200 in register Rl 5 when a WIDE opcode is encountered, possibly in addition to other steps taken in response to a WIDE opcode. Thus, if a particular opcode triggers a micro-sequence, that micro-sequence need only read the WIDE flag 200 to determine the operand width (local variables pointed to by the operands are always 32 bits in width, thus the operand width extends the number of available local variables).
Setting the status register's micro-sequence-active bit causes the micro-PC 188 (register R12) to become the active program counter instead of the PC 186. Also, the contents of the field 166 associated with the micro-sequenced opcode is loaded into the micro-PC 188. At this point, the JSM 102 begins fetching and decoding the instructions of the micro-sequence. At or about the time the decode logic begins using the micro-PC 188 from register R12, the PC 186 preferably is incremented by a suitable value to point the program counter to the next instruction following the opcode that triggered the micro-sequence. In at least some embodiments, the micro-sequence-active bit within the status register Rl 5 may only be changed when the first instruction of the micro-sequence enters the execute phase of JSM 102 pipe. The switch from PC 186 to the micro-PC 188 preferably is effective immediately after the micro-sequenced instruction is decoded, thereby reducing the latency.
The micro-sequence may perform its task and end with a predetermined instruction from the C-ISA called "RtuS" (return from micro-sequence) that indicates the end of the sequence. This C-ISA instruction causes a switch from the micro-PC (register Rl 2) to the PC (register R4). Preferably, the PC 186 was previously incremented so that the value of the PC 186 points to the next instruction to be decoded.
FIG. 5 illustrates a flow diagram of a method in accordance with embodiments of the invention. In particular, the process may start (block 502) by the triggering of a micro-sequence operation by an opcode. Next, the micro-sequence instructions read the WIDE flag 200 (block 504). If the WIDE flag 200 is asserted (block 506), then the micro-sequence instructions fetch the operand(s) in WIDE format (block 508). On the other hand, if the WIDE flag is not asserted (block 506), then the micro-sequence instructions fetch the operands in normal or non-WIDE format (block 510). Whether the operands are normal or WIDE format, the micro-sequence instructions then perform their desired function (block 512), which may be different for each opcode that triggers a micro-sequence. Thereafter, the micro-sequence clears the WIDE flag (block 514). If the WIDE flag was not asserted, the illustrative clearing of the WIDE flag of step 514 may be skipped. In alternative embodiments, the decode logic 152 may de-assert the WIDE flag 200 at an appropriate time, such as after decoding and executing the instruction immediately subsequent to the WIDE opcode. Thereafter, the process ends (block 516).
System 100 may be implemented as a mobile cell phone such as that shown in FIG. 6. As shown, the mobile communication device includes an integrated keypad 412 and display 414. The JSM processor 102 and MPU processor 104 and other components may be included in electronics package 410 connected to the keypad 412, display 414, and radio frequency ("RF") circuitry 416. The RF circuitry 416 may be connected to an antenna 418.
While the various embodiments of the invention have been shown and described, modifications thereof can be made by one skilled in the art without departing from the scope and teachings of the invention.

Claims

1. A data processing method comprising: fetching a first opcode; asserting a flag if the first opcode modifies an operand width of a subsequent opcode; fetching a second opcode, and triggering a micro-sequence based on the opcode; reading the flag by instructions of the micro-sequence; and fetching an operand of the second opcode by the micro-sequence, with bit width of the operand based on a state of the flag.
2. The method as defined in Claim 1, wherein fetching data further comprises: fetching the operand having 8 bits in width if the flag is not asserted; or fetching the operand having 16 bits in width if the flag is asserted.
3. The method as defined in Claim 1 or 2, wherein asserting further comprises asserting the flag if the first opcode is a Java™ WE)E opcode.
4. Data processing apparatus comprising: an instruction fetch logic configured to fetch instructions from memory; a decode logic coupled to the fetch logic; and a register coupled to the decode logic; wherein the decode logic is configured to assert a bit of the register if a first opcode fetched by the instruction fetch logic and decoded by the decode logic modifies operand fetch parameters of a subsequent opcode.
5. The apparatus as defined in Claim 4, wherein a micro-sequence executed by the processor is configured to fetch an operand of the subsequent opcode, the operand having 8 bits in width if the bit is not asserted; and wherein the micro-sequence executed by the processor is configured to fetch the operand of the subsequent opcode, the operand having 16 bits in width if the bit is asserted.
6. The apparatus as defined in Claim 4 or 5, in the form of a mobile device, comprising: a first processor; a memory coupled to the first processor; and a second processor coupled to the first processor and the memory, the second processor comprising: the instruction fetch logic, configured to fetch instructions from the memory; the decode logic coupled to the fetch logic; and the register coupled to the decode logic; wherein the decode logic is configured to assert the bit of the register if the first opcode fetched by the instruction fetch logic and decoded by the decode logic modifies operand width of the subsequent opcode.
7. Data processing apparatus, comprising: means for fetching instructions from a memory; means for implementing at least one status bit, the means for implementing coupled to the means for fetching; and means for decoding fetched instructions and setting the status bit if a fetched instructions modifies operand width of a subsequently fetched instruction, the means for decoding coupled to the means for fetching and the means for implementing.
8. The apparatus as defined in Claim 7, wherein the means for decoding is configured to assert the bit if the fetched instruction is a Java™ WIDE opcode.
9. The apparatus as defined in Claim 7 or 8, wherein a micro-sequence executed by the processor is configured to fetch an operand of the subsequently fetched instruction, the operand having 8 bits in width if the status bit is not set; and wherein the micro-sequence executed by the processor is configured to fetch the operand of the subsequently fetched instruction, the operand having 16 bits in width if the status bit is set.
EP06771120A 2005-05-24 2006-05-24 Operand width indication for micro-sequence processing Withdrawn EP1891517A4 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US11/135,796 US20060026392A1 (en) 2004-07-27 2005-05-24 Method and system of informing a micro-sequence of operand width
PCT/US2006/020162 WO2006127856A2 (en) 2005-05-24 2006-05-24 Operand width indication for micro-sequence processing

Publications (2)

Publication Number Publication Date
EP1891517A2 true EP1891517A2 (en) 2008-02-27
EP1891517A4 EP1891517A4 (en) 2008-08-13

Family

ID=37452815

Family Applications (1)

Application Number Title Priority Date Filing Date
EP06771120A Withdrawn EP1891517A4 (en) 2005-05-24 2006-05-24 Operand width indication for micro-sequence processing

Country Status (2)

Country Link
EP (1) EP1891517A4 (en)
WO (1) WO2006127856A2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10698859B2 (en) 2009-09-18 2020-06-30 The Board Of Regents Of The University Of Texas System Data multicasting with router replication and target instruction identification in a distributed multi-core processing architecture
US10452399B2 (en) 2015-09-19 2019-10-22 Microsoft Technology Licensing, Llc Broadcast channel architectures for block-based processors
US10963379B2 (en) 2018-01-30 2021-03-30 Microsoft Technology Licensing, Llc Coupling wide memory interface to wide write back paths

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0159699A2 (en) * 1984-04-23 1985-10-30 Nec Corporation A data processor executing microprograms according to a plurality of system architectures
US5898850A (en) * 1997-03-31 1999-04-27 International Business Machines Corporation Method and system for executing a non-native mode-sensitive instruction within a computer system
US20040024999A1 (en) * 2002-07-30 2004-02-05 Texas Instruments Incorporated Micro-sequence execution in a processor
US6775763B2 (en) * 2001-03-09 2004-08-10 Koninklijke Philips Electronics N.V. Bytecode instruction processor with switch instruction handling logic

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4258419A (en) * 1978-12-29 1981-03-24 Bell Telephone Laboratories, Incorporated Data processing apparatus providing variable operand width operation
US4747046A (en) 1985-06-28 1988-05-24 Hewlett-Packard Company Mechanism for comparing two registers and storing the result in a general purpose register without requiring a branch
JPH0827716B2 (en) * 1985-10-25 1996-03-21 株式会社日立製作所 Data processing device and data processing method
US5155807A (en) * 1986-02-24 1992-10-13 International Business Machines Corporation Multi-processor communications channel utilizing random access/sequential access memories
US5815695A (en) 1993-10-28 1998-09-29 Apple Computer, Inc. Method and apparatus for using condition codes to nullify instructions based on results of previously-executed instructions on a computer processor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0159699A2 (en) * 1984-04-23 1985-10-30 Nec Corporation A data processor executing microprograms according to a plurality of system architectures
US5898850A (en) * 1997-03-31 1999-04-27 International Business Machines Corporation Method and system for executing a non-native mode-sensitive instruction within a computer system
US6775763B2 (en) * 2001-03-09 2004-08-10 Koninklijke Philips Electronics N.V. Bytecode instruction processor with switch instruction handling logic
US20040024999A1 (en) * 2002-07-30 2004-02-05 Texas Instruments Incorporated Micro-sequence execution in a processor

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
O. STEINBUSCH: 'Design Hardware to Interpret Virtual Machine Instructions', [Online] February 1998, page 39, XP007912612 Retrieved from the Internet: <URL:http://alexandria.tue.nl/extra2/afstversl/E/513981.pdf> [retrieved on 2010-04-14] *
See also references of WO2006127856A2 *
STEINBUSCH O: "Designing Hardware to Interpret Virtual Machine Instructions", 19980201, 1 February 1998 (1998-02-01), pages 1-54, XP007919032, *

Also Published As

Publication number Publication date
WO2006127856A3 (en) 2007-02-22
EP1891517A4 (en) 2008-08-13
WO2006127856A2 (en) 2006-11-30

Similar Documents

Publication Publication Date Title
US20060026392A1 (en) Method and system of informing a micro-sequence of operand width
EP1489491A1 (en) Dynamically changing the semantic of an instruction
EP1387249B1 (en) RISC processor having a stack and register architecture
US8190861B2 (en) Micro-sequence based security model
EP1387252B1 (en) Instruction prefix to indicate system commands
EP1387255B1 (en) Test and skip processor instruction having at least one register operand
EP1891517A2 (en) Operand width indication for micro-sequence processing
EP1387250B1 (en) Processor that accomodates multiple instruction sets and multiple decode modes
EP1387253B1 (en) Dynamic translation and execution of instructions within a processor
EP1387254B1 (en) Skip instruction carrying out a test with immediate value
EP1387256B1 (en) Program counter adjustment based on the detection of an instruction prefix

Legal Events

Date Code Title Description
PUAI Public reference made under article 153(3) epc to a published international application that has entered the european phase

Free format text: ORIGINAL CODE: 0009012

17P Request for examination filed

Effective date: 20071227

AK Designated contracting states

Kind code of ref document: A2

Designated state(s): DE FR GB

DAX Request for extension of the european patent (deleted)
RBV Designated contracting states (corrected)

Designated state(s): DE FR GB

A4 Supplementary search report drawn up and despatched

Effective date: 20080714

17Q First examination report despatched

Effective date: 20090122

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE APPLICATION HAS BEEN WITHDRAWN

18W Application withdrawn

Effective date: 20121015