SYSTEM WITH WIDE OPERAND ARCHITECTURE, AND METHOD

Abstract: A general purpose processor with four copies of an access unit, with an access instruction fetch queue A-queue (101-104). Each A-queue (101-104) is coupled to an access register file AR (105-108) which is coupled to two access functional units A (109-116). In a typical embodiment, each thread of the processor may have on the order of sixty-four general purpose registers. The access unit functions independently for four simultaneous threads of execution, and each compute control flow by performing arithmetic and branch instructions and access memory by performing load and store instructions. These access units also provide wide specifiers for wide operand instructions. These eight access functional units A (109-116) produce results for access register files (105-108) and memory addresses to a shared memory system (117-120).

Description: SYSTEM WITH WIDE OPERAND ARCHITECTURE, AND METHOD SPECIFICATION Related Applications This application is related to Provisional Application No. 60/097,635, filed August 24, 1998, and is a continuation in part of U.S. Patent Application No. 09/169,963, filed October 13, 1998 which is in turn related to U.S. Patent Application No. 08/516,036, filed August 16, 1995, now U.S. Patent No. 5,742,840. Field of the Invention The present invention relates to general purpose processor architectures, and particularly relates to wide operand architectures. BACKGROUND OF THE INVENTION The performance level of a processor, and particularly a general purpose processor, can be estimated from the multiple of a plurality of interdependent factors: clock rate, gates per clock, number of operands, operand and data path width, and operand and data path partitioning. Clock rate is largely influenced by the choice of circuit and logic technology, but is also influenced the number of gates per clock. Gates per clock is how many gates in a pipeline may change state in a single clock cycle. This can be reduced by inserting latches into the data path: when the number of gates between latches is reduced, a higher clock is possible. However, the additional latches produce a longer pipeline length, and thus come at a cost of increased instruction latency. The number of operands is straightforward; for example, by adding with carry-save techniques, three values may be added together with little more delay than is required for adding two values. Operand and data path width defines how much data can be processed at once; wider data paths can perform more complex functions, but generally this comes at a higher implementation cost. Operand and data path partitioning refers to the efficient use of the data path as width is increased, with the objective of maintaining substantially peak usage. The last factor, operand and data path partitioning, is treated extensively in commonly- assigned U.S. Patent No.'s 5,742,840, 5,794,060, 5,794,061, 5,809,321, and 5,822,603, which describe systems and methods for enhancing the utilization of a general purpose processor by adding classes of instructions. These classes of instructions use the contents of general purpose registers as data path sources, partition the operands into symbols of a specified size, perform operations in parallel, catenate the results and place the catenated results into a general-purpose register. These patents, all of which are assigned to the same assignee as the present invention, teach a general purpose microprocessor which has been optimized for processing and transmitting media data streams through significant parallelism. While the foregoing patents offered significant improvements in utilization and performance of a general purpose microprocessor, particularly for handling broadband communications such as media data streams, other improvements are possible. Many general purpose processors have general registers to store operands for instructions, with the register width matched to the size of the data path. Processor designs generally limit the number of accessible registers per instruction because the hardware to access these registers is relatively expensive in power and area. While the number of accessible registers varies among processor designs, it is often limited to two, three or four registers per instruction when such instructions are designed to operate in a single processor clock cycle or a single pipeline flow. Some processors, such as the Motorola 68000 have instructions to save and restore an unlimited number of registers, but require multiple cycles to perform such an instruction. The Motorola 68000 also attempts to overcome a narrow data path combined with a narrow register file by taking multiple cycles or pipeline flows to perform an instruction, and thus emulating a wider data path. However, such multiple precision techniques offer only marginal improvement in view of the additional clock cycles required. The width and accessible number of the general purpose registers thus fundamentally limits the amount of processing that can be performed by a single instruction in a register-based machine. Existing processors may provide instructions that accept operands for which one or more operands are read from a general purpose processor's memory system. However, as these memory operands are generally specified by register operands, and the memory system data path is no wider than the processor data path, the width and accessible number of general purpose operands per instruction per cycle or pipeline flow is not enhanced. The number of general purpose register operands accessible per instruction is generally limited by logical complexity and instruction size. For example, it might be possible to implement certain desirable but complex functions by specifying a large number of general purpose registers, but substantial additional logic would have to be added to a conventional design to permit simultaneous reading and bypassing of the register values. While dedicated registers have been used in some prior art designs to increase the number or size of source operands or results, explicit instructions load or store values into these dedicated registers, and additional instructions are required to save and restore these registers upon a change of processor context. There has therefore been a need for a processor system capable of efficient handling of operands of greater width than either the memory system or any accessible general purpose register. SUMMARY OF THE INVENTION The present invention provides a system and method for improving the performance of general purpose processors by expanding at least one source operand to a width greater than the width of either the general purpose register or the data path width. In addition, several classes of instructions will be provided which cannot be performed efficiently if the operands are limited to the width and accessible number of general purpose registers. In the present invention, operands are provided which are substantially larger than the data path width of the processor. This is achieved, in part, by using a general purpose register to specify a memory address from which at least more than one, but typically several data path widths of data can be read. To permit such a wide operand to be performed in a single cycle, the data path functional unit is augmented with dedicated storage to which the memory operand is copied on an initial execution of the instruction. Further execution of the instruction or other similar instructions that specify the same memory address can read the dedicated storage to obtain the operand value. However, such reads are subject to conditions to verify that the memory operand has not been altered by intervening instructions. If the memory operand remains current - that is, the conditions are met - the memory operand fetch can be combined with one or more register operands in the functional unit, producing a result. The size of the result is, typically, constrained to that of a general register so that no dedicated or other special storage is required for the result. Exemplary instructions using wide operations include wide instructions that perform bit-level switching (Wide Switch), byte or larger table-lookup (Wide Translate), Wide Multiply Matrix, Wide Multiply Matrix Extract, Wide Multiply Matrix Extract Immediate, Wide Multiply Matrix Floating point, and Wide Multiply Matrix Galois. Another aspect of the present invention addresses efficient usage of a multiplier array that is fully used for high precision arithmetic, but is only partly used for other, lower precision operations. This can be accomplished by extracting the high-order portion of the multiplier product or sum of products, adjusted by a dynamic shift amount from a general register or an adjustment specified as part of the instruction, and rounded by a control value from a register or instruction portion. The rounding may be any of several types, including round-to-nearest/even, toward zero, floor, or ceiling. Overflows are typically handled by limiting the result to the largest and smallest values that can be accurately represented in the output result. When an extract is controlled by a register, the size of the result can be specified, allowing rounding and limiting to a smaller number of bits than can fit in the result. This permits the result to be scaled for use in subsequent operations without concern of overflow or rounding. As a result, performance is enhanced. In those instances where the extract is controlled by a register, a single register value defines the size of the operands, the shift amount and size of the result, and the rounding control. By placing such control information in a single register, the size of the instruction is reduced over the number of bits that such an instruction would otherwise require, again improving performance and enhancing processor flexibility. Exemplary instructions are Ensemble Convolve Extract, Ensemble Multiply Extract, Ensemble Multiply Add Extract, and Ensemble Scale Add Extract. With particular regard to the Ensemble Scale Add Extract Instruction, the extract control information is combined in a register with two values used as scalar multipliers to the contents of two vector multiplicands. This combination reduces the number of registers otherwise required, thus reducing the number of bits required for the instruction. THE FIGURES Figure 1 is a system level diagram showing the functional blocks of a system according to the present invention. Figure 2 is a matrix representation of a wide matrix multiply in accordance with the present invention. Figure 3 is a further representation of a wide matrix multiple in accordance with the present invention. Figure 4 is a system level diagram showing the functional blocks of a system incorporating a combined Simultaneous Multi Threading and Decoupled Access from Execution processor in accordance with the present invention. Figure 5 illustrates a wide operand in accordance with the present invention. Figure 6 illustrates an approach to specifier decoding in accordance with the present invention. Figure 7 illustrates in operational block form a Wide Function Unit in accordance with the present invention. Figure 8 illustrates in flow diagram form the Wide Microcache control function. Figure 9 illustrates Wide Microcache data structures. Figures 10 and 11 illustrate a Wide Microcache control. DETAILED DESCRIPTION OF THE INVENTION Referring first to Figure 1, a general purpose processor is illustrated therein in block diagram form. In Figure 1, four copies of an access unit are shown, each with an access instruction fetch queue A-Queue 101-104. Each access instruction fetch queue A-Queue 101- 104 is coupled to an access register file AR 105-108, which are each coupled to two access functional units A 109-116. In a typical embodiment, each thread of the processor may have on the order of sixty-four general purpose registers (e.g., the AR's 105-108 and ER's 125- 128). The access units function independently for four simultaneous threads of execution, and each compute program control flow by performing arithmetic and branch instructions and access memory by performing load and store instructions. These access units also provide wide operand specifiers for wide operand instructions. These eight access functional units A 109-116 produce results for access register files AR 105-108 and memory addresses to a shared memory system 117-120. The memory system is comprised of a combined cache and niche memory 117, an external bus interface 118, and, externally to the device, a secondary cache 119 and main memory system with I/O devices 120. The memory contents fetched from memory system 117-120 are combined with execute instructions not performed by the access unit, and entered into the four execute instruction queues E-Queue 121-124. For wide instructions, memory contents fetched from memory system 117-120 are also provided to wide operand microcaches 132-136 by bus 137. Instructions and memory data from E-queue 121-124 are presented to execution register files 125-128, which fetch execution register file source operands. The instructions are coupled to the execution unit arbitration unit Arbitration 131, that selects which instructions from the four threads are to be routed to the available execution functional units E 141 and 149, X 142 and 148, G 143-144 and 146-147, and T 145. The execution functional units E 141 and 149, the execution functional units X 142 and 148, and the execution functional unit T 145 each contain a wide operand microcache 132-136, which are each coupled to the memory system 117 by bus 137. The execution functional units G 143-144 and 146-147 are group arithmetic and logical units that perform simple arithmetic and logical instructions, including group operations wherein the source and result operands represent a group of values of a specified symbol size, which are partitioned and operated on separately, with results catenated together. In a presently preferred embodiment the data path is 128 bits wide, although the present invention is not intended to be limited to any specific size of data path. The execution functional units X 142 and 148 are crossbar switch units that perform crossbar switch instructions. The crossbar switch units 142 and 148 perform data handling operations on the data stream provided over the data path source operand buses 151-158, including deals, shuffles, shifts, expands, compresses, swizzles, permutes and reverses, plus the wide operations discussed hereinafter. In a key element of a first aspect of the invention, at least one such operation will be expanded to a width greater than the general register and data path width. Examples of the data manipulation operations are described in the System Architecture/BroadMX Architecture descriptions included herein. The execution functional units E 141 and 149 are ensemble units that perform ensemble instructions using a large array multiplier, including group or vector multiply and matrix multiply of operands partitioned from data path source operand buses 151-158 and treated as integer, floating-point, polynomial or Galois field values. Matrix multiply instructions and other operations described in the System Architecture/BroadMX Architecture descriptions included herein utilize a wide operand loaded into the wide operand microcache 132 and 136. The execution functional unit T 145 is a translate unit that performs table-look-up operations on a group of operands partitioned from a register operand, and catenates the result. The Wide Translate instruction, described in the System Architecture/BroadMX Architecture descriptions included herein, utilizes a wide operand loaded into the wide operand microcache 134. The execution functional units E 141, 149, execution functional units X -142, 148, and execution functional unit T each contain dedicated storage to permit storage of source operands including wide operands as discussed hereinafter. The dedicated storage 132-136, which may be thought of as a wide microcache, typically has a width which is a multiple of the width of the data path operands related to the data path source operand buses 151-158. Thus, if the width of the data path 151-158 is 128 bits, the dedicated storage 132-136 may have a width of 256, 512, 1024 or 2048 bits. Operands which utilize the full width of the dedicated storage are referred to herein as wide operands, although it is not necessary in all instances that a wide operand use the entirety of the width of the dedicated storage; it is sufficient that the wide operand use a portion greater than the width of the memory data path of the output of the memory system 117-120 and the functional unit data path of the input of the execution functional units 141-149, though not necessarily greater than the width of the two combined. Because the width of the dedicated storage 132-136 is greater than the width of the memory operand bus 137, portions of wide operands are loaded sequentially into the dedicated storage 132-136. However, once loaded, the wide operands may then be used at substantially the same time. It can be seen that functional units 141-149 and associated execution registers 125-128 form a data functional unit, the exact elements of which may vary with implementation. The execution register file ER 125-128 source operands are coupled to the execution units 141-145 using source operand buses 151-154 and to the execution units 145-149 using source operand buses 155-158. The function unit result operands from execution units 141- 145 are coupled to the execution register file ER 125-128 using result bus 161 and the function units result operands from execution units 145-149 are coupled to the execution register file using result bus 162. The wide operands of the present invention provide the ability to execute complex instructions such as the wide multiply matrix instruction shown in Figure 2, which can be appreciated in an alternative form, as well, from Figure 3. As can be appreciated from Figures 2 and 3, a wide operand permits, for example, the matrix multiplication of various sizes and shapes which exceed the data path width. The example of Figure 2 involves a matrix specified by register re having a 128*64/size multiplied by a vector contained in register rb having a 128 size, to yield a result, placed in register rd, of 128 bits. The operands that are substantially larger than the data path width of the processor are provided by using a general-purpose register to specify a memory specifier from which more than one but in some embodiments several data path widths of data can be read into the dedicated storage. The memory specifier typically includes the memory address together with the size and shape of the matrix of data being operated on. The memory specifier or wide operand specifier can be better appreciated from Figure 5, in which a specifier 500 is seen to be an address, plus a field representative of the size/2 and a further field representative of width/2, where size is the product of the depth and width of the data. The address is aligned to a specified size, for example sixty-four bytes, so that a plurality of low order bits (for example, six bits) are zero. The specifier 500 can thus be seen to comprise a first field 505 for the address, plus two field indicia 510 within the low order six bits to indicate size and width. The decoding of the specifier 500 may be further appreciated from Figure 6 where, for a given specifier 600 made up of an address field 605 together with a field 610 comprising plurality of low order bits. By a series of arithmetic operations shown at steps 615 and 620, the portion of the field 610 representative of width/2 is developed. In a similar series of steps shown at 625 and 630, the value oft is decoded, which can then be used to decode both size and address. The portion of the field 610 representative of size/2 is decoded as shown at steps 635 and 640, while the address is decoded in a similar way at steps 645 and 650. The wide function unit may be better appreciated from Figure 7, in which a register number 700 is provided to an operand checker 705. Wide operand specifier 710 communicates with the operand checker 705 and also addresses memory 715 having a defined memory width. The memory address includes a plurality of register operands 720A-n, which are accumulated in a dedicated storage portion 714 of a data functional unit 725. In the exemplary embodiment shown in Figure 7, the dedicated storage 714 can be seen to have a width equal to eight data path widths, such that eight wide operand portions 730A-H are sequentially loaded into the dedicated storage to form the wide operand. Although eight portions are shown in Figure 7, the present invention is not limited to eight or any other specific multiple of data path widths. Once the wide operand portions 730A-H are sequentially loaded, they may be used as a single wide operand 735 by the functional element 740, which may be any element(s) from Figure 1 connected thereto. The result of the wide operand is then provided to a result register 745, which in a presently preferred embodiment is of the same width as the memory width. Once the wide operand is successfully loaded into the dedicated storage 714, a second aspect of the present invention may be appreciated. Further execution of this instruction or other similar instructions that specify the same memory address can read the dedicated storage to obtain the operand value under specific conditions that determine whether the memory operand has been altered by intervening instructions. Assuming that these conditions are met, the memory operand fetch from the dedicated storage is combined with one or more register operands in the functional unit, producing a result. In some embodiments, the size of the result is limited to that of a general register, so that no similar dedicated storage is required for the result. However, in some different embodiments, the result may be a wide operand, to further enhance performance. To permit the wide operand value to be addressed by subsequent instructions specifying the same memory address, various conditions must be checked and confirmed: Those conditions include: 1. Each memory store instruction checks the memory address against the memory addresses recorded for the dedicated storage. Any match causes the storage to be marked invalid, since a memory store instruction directed to any of the memory addresses stored in dedicated storage 714 means that data has been overwritten. 2. The register number used to address the storage is recorded. If no intervening instructions have written to the register, and the same register is used on the subsequent instruction, the storage is valid (unless marked invalid by rule #1). 3. If the register has been modified or a different register number is used, the value of the register is read and compared against the address recorded for the dedicated storage. This uses more resources than #1 because of the need to fetch the register contents and because the width of the register is greater than that of the register number itself. If the address matches, the storage is valid. The new register number is recorded for the dedicated storage. 4. If conditions #2 or #3 are not met, the register contents are used to address the general- purpose processor's memory and load the dedicated storage. If dedicated storage is already fully loaded, a portion of the dedicated storage must be discarded (victimized) to make room for the new value. The instruction is then performed using the newly updated dedicated storage. The address and register number is recorded for the dedicated storage. By checking the above conditions, the need for saving and restoring the dedicated storage is eliminated. In addition, if the context of the processor is changed and the new context does not employ Wide instructions that reference the same dedicated storage, when the original context is restored, the contents of the dedicated storage are allowed to be used without refreshing the value from memory, using checking rule #3. Because the values in the dedicated storage are read from memory and not modified directly by performing wide operations, the values can be discarded at any time without saving the results into general memory. This property simplifies the implementation of rule #4 above. An alternate embodiment of the present invention can replace rule #1 above with the following rule: l.a. Each memory store instruction checks the memory address against the memory addresses recorded for the dedicated storage. Any match causes the dedicated storage to be updated, as well as the general memory. By use of the above rule l.a, memory store instructions can modify the dedicated storage, updating just the piece of the dedicated storage that has been changed, leaving the remainder intact. By continuing to update the general memory, it is still true that the contents of the dedicated memory can be discarded at any time without saving the results into general memory. Thus rule #4 is not made more complicated by this choice. The advantage of this alternate embodiment is that the dedicated storage need not be discarded (invalidated) by memory store operations. Referring next to Figure 9, an exemplary arrangement of the data structures of the wide microcache or dedicated storage 114 may be better appreciated. The wide microcache contents, wmc.c, can be seen to form a plurality of data path widths 900A-n, although in the example shown the number is eight. The physical address, wmc.pa, is shown as 64 bits in the example shown, although the invention is not limited to a specific width. The size of the contents, wmc.size, is also provided in a field which is shown as 10 bits in an exemplary embodiment. A "contents valid" flag, wmc.cv, of one bit is also included in the data structure, together with a two bit field for thread last used, or wmc.th. In addition, a six bit field for register last used, wmc.reg, is provided in an exemplary embodiment. Further, a one bit flag for register and thread valid, or wmc.rtv, may be provided. The process by which the microcache is initially written with a wide operand, and thereafter verified as valid for fast subsequent operations, may be better appreciated from Figure 8. The process begins at 800, and progresses to step 805 where a check of the register contents is made against the stored value wmc.rc. If true, a check is made at step 810 to verify the thread. If true, the process then advances to step 815 to verify whether the register and thread are valid. If step 815 reports as true, a check is made at step 820 to verify whether the contents are valid. If all of steps 805 through 820 return as true, the subsequent instruction is able to utilize the existing wide operand as shown at step 825, after which the process ends. However, if any of steps 805 through 820 return as false, the process branches to step 830, where content, physical address and size are set. Because steps 805 through 820 all lead to either step 825 or 830, steps 805 through 820 may be performed in any order or simultaneously without altering the process. The process then advances to step 835 where size is checked. This check basically ensures that the size of the translation unit is greater than or equal to the size of the wide operand, so that a physical address can directly replace the use of a virtual address. The concern is that, in some embodiments, the wide operands may be larger than the minimum region that the virtual memory system is capable of mapping. As a result, it would be possible for a single contiguous virtual address range to be mapped into multiple, disjoint physical address ranges, complicating the task of comparing physical addresses. By determining the size of the wide operand and comparing that size against the size of the virtual address mapping region which is referenced, the instruction is aborted with an exception trap if the wide operand is larger than the mapping region. This ensures secure operation of the processor. Software can then re-map the region using a larger size map to continue execution if desired. Thus, if size is reported as unacceptable at step 835, an exception is generated at step 840. If size is acceptable, the process advances to step 845 where physical address is checked. If the check reports as met, the process advances to step 850, where a check of the contents valid flag is made. If either check at step 845 or 850 reports as false, the process branches and new content is written into the dedicated storage 114, with the fields thereof being set accordingly. Whether the check at step 850 reported true, or whether new content was written at step 855, the process advances to step 860 where appropriate fields are set to indicate the validity of the data, after which the requested function can be performed at step 825. The process then ends. Referring next to Figures 10 and 11, which together show the operation of the microcache controller from a hardware standpoint, the operation of the microcache controller may be better understood. In the hardware implementation, it is clear that conditions which are indicated as sequential steps in Figure 8 and 9 above can be performed in parallel, reducing the delay for such wide operand checking. Further, a copy of the indicated hardware may be included for each wide microcache, and thereby all such microcaches as may be alternatively referenced by an instruction can be tested in parallel. It is believed that no further discussion of Figures 10 and 11 is required in view of the extensive discussion of Figures 8 and 9, above. Various alternatives to the foregoing approach do exist for the use of wide operands, including an implementation in which a single instruction can accept two wide operands, partition the operands into symbols, multiply corresponding symbols together, and add the products to produce a single scalar value or a vector of partitioned values of width of the register file, possibly after extraction of a portion of the sums. Such an instruction can be valuable for detection of motion or estimation of motion in video compression. A further enhancement of such an instruction can incrementally update the dedicated storage if the address of one wide operand is within the range of previously specified wide operands in the dedicated storage, by loading only the portion not already within the range and shifting the in- range portion as required. Such an enhancement allows the operation to be performed over a "sliding window" of possible values. In such an instruction, one wide operand is aligned and supplies the size and shape information, while the second wide operand, updated incrementally, is not aligned. Another alternative embodiment of the present invention can define additional instructions where the result operand is a wide operand. Such an enhancement removes the limit that a result can be no larger than the size of a general register, further enhancing performance. These wide results can be cached locally to the functional unit that created them, but must be copied to the general memory system before the storage can be reused and before the virtual memory system alters the mapping of the address of the wide result. Data paths must be added so that load operations and other wide operations can read these wide results - forwarding of a wide result from the output of a functional unit back to its input is relatively easy, but additional data paths may have to be introduced if it is desired to forward wide results back to other functional units as wide operands. As previously discussed, a specification of the size and shape of the memory operand is included in the low-order bits of the address. In a presently preferred implementation, such memory operands are typically a power of two in size and aligned to that size. Generally, one- half the total size is added (or inclusively or'ed, or exclusively or'ed) to the memory address, and one half of the data width is added (or inclusively or'ed, or exclusively or'ed) to the memory address. These bits can be decoded and stripped from the memory address, so that the controller is made to step through all the required addresses. This decreases the number of distinct operands required for these instructions, as the size, shape and address of the memory operand are combined into a single register operand value. Particular examples of wide operations which are defined by the present invention include the Wide Switch instruction that performs bit-level switching; the Wide Translate instruction which performs byte (or larger) table-lookup; Wide Multiply Matrix, Wide Multiply Matrix Extract and Wide Multiply Matrix Extract Immediate (discussed below), Wide Multiply Matrix Floating-point, and Wide Multiply Matrix Galois (also discussed below). While the discussion below focuses on particular sizes for the exemplary instructions, it will be appreciated that the invention is not limited to a particular width. The Wide Switch instruction rearranges the contents of up to two registers (256 bits) at the bit level, producing a full-width (128 bits) register result. To control the rearrangement, a wide operand specified by a single register, consisting of eight bits per bit position is used. For each result bit position, eight wide operand bits for each bit position select which of the 256 possible source register bits to place in the result. When a wide operand size smaller than 128 bytes, the high order bits of the memory operand are replaced with values corresponding to the result bit position, so that the memory operand specifies a bit selection within symbols of the operand size, performing the same operation on each symbol. The Wide Translate instructions use a wide operand to specify a table of depth up to 256 entries and width of up to 128 bits. The contents of a register is partitioned into operands of one, two, four, or eight bytes, and the partitions are used to select values from the table in parallel. The depth and width of the table can be selected by specifying the size and shape of the wide operand as described above. The Wide Multiply Matrix instructions use a wide operand to specify a matrix of values of width up to 64 bits (one half of register file and data path width) and depth of up to 128 bits/symbol size. The contents of a general register (128 bits) is used as a source operand, partitioned into a vector of symbols, and multiplied with the matrix, producing a vector of width up to 128 bits of symbols of twice the size of the source operand symbols. The width and depth of the matrix can be selected by specifying the size and shape of the wide operand as described above. Controls within the instruction allow specification of signed, mixed- signed, unsigned, complex, or polynomial operands. The Wide Multiply Matrix Extract instructions use a wide operand to specify a matrix of value of width up to 128 bits (full width of register file and data path) and depth of up to 128 bits/symbol size. The contents of a general register (128 bits) is used as a source operand, partitioned into a vector of symbols, and multiplied with the matrix, producing a vector of width up to 256 bits of symbols of twice the size of the source operand symbols plus additional bits to represent the sums of products without overflow. The results are then extracted in a manner described below (Enhanced Multiply Bandwidth by Result Extraction), as controlled by the contents of a general register specified by the instruction. The general register also specifies the format of the operands: signed, mixed-signed, unsigned, and complex as well as the size of the operands, byte (8 bit), doublet (16 bit), quadlet (32 bit), or hexlet (64 bit). The Wide Multiply Matrix Extract Immediate instructions perform the same function as above, except that the extraction, operand format and size is controlled by fields in the instruction. This form encodes common forms of the above instruction without the need to initialize a register with the required control information. Controls within the instruction allow specification of signed, mixed-signed, unsigned, and complex operands. The Wide Multiply Matrix Floating-point instructions perform a matrix multiply in the same form as above, except that the multiplies and additions are performed in floatingpoint arithmetic. Sizes of half (16-bit), single (32-bit), double (64-bit), and complex sizes of half, single and double can be specified within the instruction. Wide Multiply Matrix Galois instructions perform a matrix multiply in the same form as above, except that the multiples and additions are performed in Galois field arithmetic. A size of 8 bits can be specified within the instruction. The contents of a general register specify the polynomial with which to perform the Galois field remainder operation. The nature of the matrix multiplication is novel and described in detail below. In another aspect of the invention, memory operands of either little-endian or big- endian conventional byte ordering are facilitated. Consequently, all Wide operand instructions are specified in two forms, one for little-endian byte ordering and one for big-endian byte ordering, as specified by a portion of the instruction. The byte order specifies to the memory system the order in which to deliver the bytes within units of the data path width (128 bits), as well as the order to place multiple memory words (128 bits) within a larger Wide operand. Each of these instructions is described in greater detail in the System Architecture/BroadMX Architecture descriptions included herein. Another aspect of the present invention addresses extraction of a high order portion of a multiplier product or sum of products, as a way of efficiently utilizing a large multiplier array. Related U.S. Patent No. 5,742,840 and U.S. Patent Application No. 08/857596 (notice of allowance 11/13/98), describe a system and method for enhancing the utilization of a multiplier array by adding specific classes of instructions to a general-purpose processor. This addresses the problem of making the most use of a large multiplier array that is fully used for high-precision arithmetic - for example a 64x64 bit multiplier is fully used by a 64-bit by 64- bit multiply, but only one quarter used for a 32-bit by 32-bit multiply) for (relative to the multiplier data width and registers) low-precision arithmetic operations. In particular, operations that perform a great many low-precision multiplies which are combined (added) together in various ways are specified. One of the overriding considerations in selecting the set of operations is a limitation on the size of the result operand. In an exemplary embodiment, for example, this size might be limited to on the order of 128 bits, or a single register, although no specific size limitation need exist. The size of a multiply result, a product, is generally the sum of the sizes of the operands, multiplicands and multiplier. Consequently, multiply instructions specify operations in which the size of the result is twice the size of identically-sized input operands. For our prior art design, for example, a multiply instruction accepted two 64-bit register sources and produces a single 128-bit register-pair result, using an entire 64x64 multiplier array for 64-bit symbols, or half the multiplier array for pairs of 32-bit symbols, or one-quarter the multiplier array for quads of 16-bit symbols. For all of these cases, note that two register sources of 64 bits are combined, yielding a 128-bit result. In several of the operations, including complex multiplies, convolve, and matrix multiplication, low-precision multiplier products are added together. The additions further increase the required precision. The sum of two products requires one additional bit of precision; adding four products requires two, adding eight products requires three, adding sixteen products requires four. In some prior designs, some of this precision is lost, requiring scaling of the multiplier operands to avoid overflow, further reducing accuracy of the result. The use of register pairs creates an undesirable complexity, in that both the register pair and individual register values must be bypassed to subsequent instructions. As a result, with prior art techniques only half of the source operand 128-bit register values could be employed toward producing a single-register 128-bit result. In the present invention, a high-order portion of the multiplier product or sum of products is extracted, adjusted by a dynamic shift amount from a general register or an adjustment specified as part of the instruction, and rounded by a control value from a register or instruction portion as round-to-nearest/even, toward zero, floor, or ceiling. Overflows are handled by limiting the result to the largest and smallest values that can be accurately represented in the output result. This operation is more fully described in the System Architecture/BroadMX Architecture descriptions included herein. In the present invention, when the extract is controlled by a register, the size of the result can be specified, allowing rounding and limiting to a smaller number of bits than can fit in the result. This permits the result to be scaled to be used in subsequent operations without concern of overflow or rounding, enhancing performance. Also in the present invention, when the extract is controlled by a register, a single register value defines the size of the operands, the shift amount and size of the result, and the rounding control. By placing all this control information in a single register, the size of the instruction is reduced over the number of bits that such a instruction would otherwise require, improving performance and enhancing flexibility of the processor. The particular instructions included in this aspect of the present invention are Ensemble Convolve Extract, Ensemble Multiply Extract, Ensemble Multiply Add Extract and Ensemble Scale Add Extract, each of which is more thoroughly treated in the System Architecture/BroadMX Architecture descriptions included herein.. An aspect of the present invention defines the Ensemble Scale Add Extract instruction, that combines the extract control information in a register along with two values that are used as scalar multipliers to the contents of two vector multiplicands. This combination reduces the number of registers that would otherwise be required, or the number of bits that the instruction would otherwise require, improving performance. Several of these instructions (Ensemble Convolve Extract, Ensemble Multiply Add Extract) are typically available only in forms where the extract is specified as part of the instruction. An alternative embodiment can incorporate forms of the operations in which the size of the operand, the shift amount and the rounding can be controlled by the contents of a general register (as they are in the Ensemble Multiply Extract instruction). The definition of this kind of instruction for Ensemble Convolve Extract, and Ensemble Multiply Add Extract would require four source registers, which increases complexity by requiring additional general-register read ports. Another alternative embodiment can reduce the number of register read ports required for implementation of instructions in which the size, shift and rounding of operands is controlled by a register. The value of the extract control register can be fetched using an additional cycle on an initial execution and retained within or near the functional unit for subsequent executions, thus reducing the amount of hardware required for implementation with a small additional performance penalty. The value retained would be marked invalid, causing a re-fetch of the extract control register, by instructions that modify the register, or alternatively, the retained value can be updated by such an operation. A re-fetch of the extract control register would also be required if a different register number were specified on a subsequent execution. It should be clear that the properties of the above two alternative embodiments can be combined. Another aspect of the invention includes Galois field arithmetic, where multiplies are performed by an initial binary polynomial multiplication (unsigned binary multiplication with carries suppressed), followed by a polynomial modulo/remainder operation (unsigned binary division with carries suppressed). The remainder operation is relatively expensive in area and delay. In Galois field arithmetic, additions are performed by binary addition with carries suppressed, or equivalently, a bitwise exclusive-or operation. In this aspect of the present invention, a matrix multiplication is performed using Galois field arithmetic, where the multiplies and additions are Galois field multiples and additions. Using prior art methods, a 16 byte vector multipled by a 16x16 byte matrix can be performed as 256 8-bit Galois field multiplies and 16*15=240 8-bit Galois field additions. Included in the 256 Galois field multiplies are 256 polynomial multiplies and 256 polynomial remainder operations. But by use of the present invention, the total computation can be reduced significantly by performing 256 polynomial multiplies, 240 16-bit polynomial additions, and 16 polynomial remainder operations. Note that the cost of the polynomial additions has been doubled, as these are now 16-bit operations, but the cost of the polynomial remainder functions has been reduced by a factor of 16. Overall, this is a favorable tradeoff, as the cost of addition is much lower than the cost of remainder. In a still further aspect of the present invention, a technique is provided for incorporating floating point information into processor instructions. In related US patent 5812439, a system and method are described for incorporating control of rounding and exceptions for floating-point instructions into the instruction itself. The present invention extends this invention to include separate instructions in which rounding is specified, but default handling of exceptions is also specified, for a particular class of floating-point instructions. Specifically, the SINK instruction (which converts floating-point values to integral values) is available with control in the instruction that include all previously specified combinations (default-near rounding and default exceptions, Z - round-toward-zero and trap on exceptions, N - round to nearest and trap on exceptions, F - floor rounding (toward minus infinity) and trap on exceptions, C - ceiling rounding (toward plus infinity) and trap on exceptions, and X - trap on inexact and other exceptions), as well as three new combinations (Z.D - round toward zero and default exception handling, F.D - floor rounding and default exception handling, and CD - ceiling rounding and default exception handling). (The other combinations: N.D is equivalent to the default, and X.D - trap on inexact but default handling for other exceptions is possible but not particularly valuable). In yet another aspect of the present invention, best shown in Figure 4, the present invention employs both decoupled access from execution pipelines and simultaneous multithreading in a unique way. Simultaneous Multithreaded pipelines have been employed in prior art to enhance the utilization of data path units by allowing instructions to be issued from one of several execution threads to each functional unit, (e.g., Susan Eggers, University of Wash, papers on Simultaneous Multithreading). Decoupled access from execution pipelines have been employed in prior art to enhance the utilization of execution data path units by buffering results from an access unit, which computes addresses to a memory unit that in turn fetches the requested items from memory, and then presenting them to an execution unit (e.g., James E. Smith, paper on Decoupled Access from Execution). Compared to conventional pipelines, Eggers prior art used an additional pipeline cycle before instructions could be issued to functional units, the additional cycle needed to determine which threads should be permitted to issue instructions. Consequently, relative to conventional pipelines, the prior art design had additional delay, including dependent branch delay. The present invention contains individual access data path units, with associated register files, for each execution thread. These access units produce addresses, which are aggregated together to a common memory unit, which fetches all the addresses and places the memory contents in one or more buffers. Instructions for execution units, which are shared to varying degrees among the threads are also buffered for later execution. The execution units then perform operations from all active threads using functional data path units that are shared. For instructions performed by the execution units, the extra cycle required for prior art simultaneous multithreading designs is overlapped with the memory data access time from prior art decoupled access from execution cycles, so that no additional delay is incurred by the execution functional units for scheduling resources. For instructions performed by the access units, by employing individual access units for each thread the additional cycle for scheduling shared resources is also eliminated. This is a favorable tradeoff because, while threads do not share the access functional units, these units are relatively small compared to the execution functional units, which are shared by threads. With regard to the sharing of execution units, the present invention employs several different classes of functional units for the execution unit, with varying cost, utilization, and performance. In particular, the G units, which perform simple addition and bitwise operations is relatively inexpensive (in area and power) compared to the other units, and its utilization is relatively high. Consequently, the design employs four such units, where each unit can be shared between two threads. The X unit, which performs a broad class of data switching functions is more expensive and less used, so two units are provided that are each shared among two threads. The T unit, which performs the Wide Translate instruction, is expensive and utilization is low, so the single unit is shared among all four threads. The E unit, which performs the class of Ensemble instructions, is very expensive in area and power compared to the other functional units, but utilization is relatively high, so we provide two such units, each unit shared by two threads. In Figure 4, four copies of an access unit are shown, each with an access instruction fetch queue A-Queue 401-404, coupled to an access register file AR 405-408, each of which is, in turn, coupled to two access functional units A 409-416. The access units function independently for four simultaneous threads of execution. These eight access functional units A 409-416 produce results for access register files AR 405-408 and addresses to a shared memory system 417. The memory contents fetched from memory system 417 are combined with execute instructions not performed by the access unit and entered into the four execute instruction queues E-Queue 421-424. Instructions and memory data from E-queue 421-424 are presented to execution register files 425-428, which fetches execution register file source operands. The instructions are coupled to the execution unit arbitration unit Arbitration 431, that selects which instructions from the four threads are to be routed to the available execution units E 441 and 449, X 442 and 448, G 443-444 and 446-447, and T 445. The execution register file source operands ER 425-428 are coupled to the execution units 441-445 using source operand buses 451-454 and to the execution units 445-449 using source operand buses 455-458. The function unit result operands from execution units 441-445 are coupled to the execution register file using result bus 461 and the function units result operands from execution units 445-449 are coupled to the execution register file using result bus 462. The foregoing elements of the present invention may be better understood with reference to the System Architecture/BroadMX Architecture descriptions included herein. In a still further aspect of the present invention, an improved interprivilege gateway is described which involves increased parallelism and leads to enhanced performance. In related U.S. Patent Application No. 08/541416, a system and method is described for implementing an instruction that, in a controlled fashion, allows the transfer of control (branch) from a lower-privilege level to a higher-privilege level. The present invention is an improved system and method for a modified instruction that accomplishes the same purpose but with specific advantages. Many processor resources, such as control of the virtual memory system itself, input and output operations, and system control functions are protected from accidental or malicious misuse by enclosing them in a protective, privileged region. Entry to this region must be established only though particular entry points, called gateways, to maintain the integrity of these protected regions. Prior art versions of this operation generally load an address from a region of memory using a protected virtual memory attribute that is only set for data regions that contain valid gateway entry points, then perform a branch to an address contained in the contents of memory. Basically, three steps were involved: load, branch, then check. Compared to other instructions, such as register-to-register computation instructions and memory loads and stores, and register-based branches, this is a substantially longer operation, which introduces delays and complexity to a pipelined implementation. In the present invention, the branch-gateway instruction performs two operations in parallel: 1) a branch is performed to the contents of register 0 and 2) a load is performed using the contents of register 1, using a specified byte order (little-endian) and a specified size (64 bits). If the value loaded from memory does not equal the contents of register 0, the instruction is aborted due to an exception. In addition, 3) a return address (the next sequential instruction address following the branch-gateway instruction) is written into register 0, provided the instruction is not aborted. This approach essentially uses a first instruction to establish the requisite permission to allow user code to access privileged code, and then a second instruction is permitted to branch directly to the privileged code because of the permissions issued for the first instruction. In the present invention, the new privilege level is also contained in register 0, and the second parallel operation does not need to be performed if the new privilege level is not greater than the old privilege level. When this second operation is suppressed, the remainder of the instruction performs an identical function to a branch-link instruction, which is used for invoking procedures that do not require an increase in privilege. The advantage that this feature brings is that the branch-gateway instruction can be used to call a procedure that may or may not require an increase in privilege. The memory load operation verifies with the virtual memory system that the region that is loaded has been tagged as containing valid gateway data. A further advantage of the present invention is that the called procedure may rely on the fact that register 1 contains the address that the gateway data was loaded from, and can use the contents of register 1 to locate additional data or addresses that the procedure may require. Prior art versions of this instruction required that an additional address be loaded from the gateway region of memory in order to initialize that address in a protected manner - the present invention allows the address itself to be loaded with a "normal" load operation that does not require special protection. The present invention allows a "normal" load operation to also load the contents of register 0 prior to issuing the branch-gateway instruction. The value may be loaded from the same memory address that is loaded by the branch-gateway instruction, because the present invention contains a virtual memory system in which the region may be enabled for normal load operations as well as the special "gateway" load operation performed by the branch- gateway instruction. In a further aspect of the present invention, a system and method is provided for performing a three-input bitwise Boolean operation in a single instruction. A novel method, described in detail in the System Architecture/BroadMX Architecture descriptions herein, is used to encode the eight possible output states of such an operation into only seven bits, and decoding these seven bits back into the eight states. In yet a further aspect to the present invention, a system and method is described for improving the branch prediction of simple repetitive loops of code. The method includes providing a count field for indicating how many times a branch is likely to be taken before it is not taken, which enhances the ability to properly predict both the initial and final branches of simple loops when a compiler can determine the number of iterations that the loop will be performed. This improves performance by avoiding misprediction of the branch at the end of a loop. Having fully described a preferred embodiment of the invention and various alternatives, those skilled in the art will recognize, given the teachings herein, that numerous alternatives and equivalents exist which do not depart from the invention. It is therefore intended that the invention not be limited by the foregoing description, but only by the appended claims. microunϊty Zeus System Architecture COl'VKJGI IT 199a ICROU iTY SYSTEMS ENGINEERI NG, INC. ALL RIGHTS RESERVED. Craig Hansen Chief Architect MicroUnity Systems Engineering, Inc. 475 Potrero Avenue Sunnyvale, CA 94086.4 1 18 Phone: 408.734.8100 icroUnity Fax: 408.734.8136 email: craig@microunity.com http://www.microunity.com /cus S) sttm Archit cture Juc. Λug 17 1999 Content.) microunity Contents System Architecture Cralg Hansen Chief Architect MicroUnity Systems Engineering Inc 475 Potrero Avenue Sunnyvale CA 94086 41 18 Phone 4087348100 MicroUnity Fax. 4087348136 email craιg®mιcrounιty com http//www microuniry com MicroUnity /cus System Architecture l uc, Λug 17, 1999 Conformance /eus System Architecture lue Λug 17 1999 Conformance Conformance memorj Ilu is a particular concern when involved m code that has real time pcrforrmncc constraints i o ensure that /cus systems may freely interchange data user level programs system level In order that upward compatible optional extensions of the original /eus system programs ind interface devices the /cus system architecture reaches above the processor architecture may be relied upon by system and application software, MicroUnity may upon le el architecture occasion promote optional features to mandatory conformance for implementations designed < r produced iftcr a suit ible delaj upon such notification by publication of future Mandatory and Optional Areas version of the specification A computer system conforms to the requirements of the /tus System Architecture if and only if it implements all the specifications dcscnbcd in this document and other Unrestricted Physical Implementation specifications included by reference Conformance to the specification is mandatory in all Nothing in this specification should be construed to limit the implementation choices of the areas including the instruction set, memory management system mtcrftcc devices nd conforming system beyond the specific requirements stated herein In particular a computer external interfaces ind bootstrap ROM functional requirements, except where explicit system may conform to the /cus System Architecture while employing any number of options -ire stated compt πents dissipate any amount of heat require any special environmental facilities or be of any ph sical si/e Optional areas include Number of processor threads Size of first level cache memories Draft Version Txistencc of a second level cache Si/e of second level cache memory Oils document is a drift version of the architectural specification In this form conformance Si e of s stem level memory tu this document ma ) not be claimed or implied MicroUnity ma) change this spccificanon Fλistencc of certain optional interface device interfaces at an) time in an ) manner, until It has been declared final When this document has been declared final the onl ) changes will be to correct defects or deficiencies and to add Upward-compatible Modifications upward compatible optional extensions I rom time to time MicroUnity may modify the architecture in tπ upward comp ttiblc mmner such as by the addition of new instructions definition of reserved bits in system state or addition of new standard interfaces Such modifications will be added as options so th-it designs that conform to this v ersion of the architecture will conform to future m κlι cd versions Additional devices and interfaces not covered by this standard may be added in specified regions of the physical memory space, provided that system reset places these devices and interfaces in an inactive state that docs not interfere with the operation of software that runs in any conformant sy stem ITic software interface requirements of any such addition tl devices and interfaces must be made as widely available as this architecture specification Promotion of Optional Features It is most strongly recommended that such optional instructions, state or interfices be implemented in all conforming designs Such implementations enhance the value of the features in particular and the architecture as a whole by broadening the set of implementations over which software may depend upon the presence of these feitures Implementations that fail to implement these features may encounter unacceptable levels of overhead when attempting to emulate the features by exception handlers or use of v irtual MicroUnit) MicroUnit) /cus Sj stem Architecture l uc, Λug 17, 1999 Common Hcmcnts /eus S tem Architecture l ue, Λug 17, 1999 Common Flcments Common Elements Bit ordering Notation llic ordering of bits in this document is always little cndian, regardless of the ordenng of bytes within larger data structures Thus, the least significant bit of a data structure is always The descriptive notation used in this document is summaπ/cd in the table belo labeled 0 (zero) and the most significant bit is labeled as the data structure si/c (in bits) minus one Memory /cus memory is an array of 2 &1 * bytes, v ithout a specified byte ordenng, which is physically distributed among various components 7 Byte Λ byte is a single element of the memory array, consisting of 8 bits 7 0 byte Byte ordering I-argcr data structures arc constructed from the concatenation of b) tes in cither litde cndian or big end n b)te ordenng Λ memory access of a data structure of sl/c s at address l is formed from memory bytes at addresses l through l+s 1 Unless otherwise specified, there is no specific requirement of alignment it is not generally required that l be a multiple of s Aligned accesses arc preferred whenever possible, however, as they will often require one fewer processor or memory clock c) clc than unaligned accesses With little cndian byte ordering, the bytes arc arranged as s'8 I s'8 8 I S byte l+s- 1 I byte l-t-1 byte I MicroUnity 10 MicroUnity /cus S tem Architecture l uc, Λug 17, 1999 Common Fie men ts /cus Sy stem Architecture l uc, Λug 17 1999 Common Flemcnts With big cndian by te ordering, the bytes are arranged as Fixed point Data s*8 I s'8 8 s'8 9 s'8 16 I byte I | byte l-t- 1 byte l+s- l | fitf A bit is primitive dat i clement /eus mem. ry is byte addressed using either little cndian or big endl in bj te ordering I or 0 consistency with the bit ordering and for compatibility with x86 processors /eus uses little Θ I cndian by te ordering when an ordenng must be selected Zeus load and store instructions arc available for both ht l cndian and big cndian by tc ordering ftic selection of byte ordenng is dynamic, so that little cndian and big cndian processes, and even data structures within a process can be intermixed on the processor A peck is the catenauon of two bits Memory read/load semantics 7cus memory including memory mapped registers, must conform to the following requirements regarding side effects of read or load operations Nibble A memory read must have no side effects on the contents of the addressed memory nor on the contents of any other memory Λ nibble is the catenation of four bits Memory write/store semantics nibble /cus memory including memory mapped registers must conform to the following requirements regarding side effects of read or load operations Byte A memory write must affect the contents of the addressed memory so tint a mem >ry re id Λ b j te is the e iteπatton of eight bits and is a single element of the memory arra j of the addressed memory returns the value πtten and so that a memorj read ( f i portn n 7 0 of the addressed memory returns the appropriate portion of the value written r byte I Doublet i cmpotcnt Λ doublet is the catenation of 16 bits and is the catenauon of two b) tcs /cus store instructions that are weakly ordered may have side effects on the contents of 15 0 memory not addressed by the store itself, subsequent load instructions which are also weakly I doublet I ordered may or may not return values which reflect the side effects Data Oua let /cus provides eight by te (64 bit) virtual and physical address si cs, and eight byte (64 bit) Λ quadlet is the catenation of 32 bus and is the catenation of four b) tes and sixteen byte (l 28 bit) data path si/cs, and uses fixed length four byte (12 bit) 31 instructions Arithmetic is performed on two's complement or unsigned binary and quadlet ΛNSI/IFFF standard 754-1985 conforming bmar) floating point number representations MicroUnity MicroUnit) /cus Sj stcm Architecture fuc, Λug 17, 1999 /cus Processor /cus System Architecture l uc Λug 17, 1999 /eus Processor Fixed-point following the branch into a register The branch through gateway instruction provides a secure means to access code at a higher pnvilcgc level, in a form similar to a normal /cus provides load and store instructions to move data between memory and the registers, procedure call branch instructions to compare the contents of registers and to transfer control from one code address to another, and arithmetic operations to perform computation on the contents Addressing Operations of registers, returning the result to registers Λ subset of general fixed point anthmctic operations is available as addressing operations Load and Store l " hesc include add subtract Boolean, and simple shift operations ITiese addressing operations may be performed at a point in the Zeus processor pipeline so that they may be 'he load and store instructions move data between memory and the registers When loading completed prior to or in conjunction with the execution of load and store operations in a data from mcmor) into a register, values arc /cro-cxtcndcd or sign extended to fill the superspπng pipeline in which other arithmetic operations arc deferred unnl the register When stoπng data from a register into mcmor}, values arc tmnc tcd on the left to completion of load and store operations fit the specified memory region Execution Operations I,oad and store instructions that specify a memory region of more than one bj tc iy use cither little cndian or big cndian byte ordenng- the sue and ordering arc explicitly specified Many of the operations used for Digital Signal Processing (DSP), which arc described in in the instruction Regions larger than one byte may be cither aligned to addresses that are an greater detail below are also used for performing simple scalar operations These operations even multiple of the si c of the region or of unspecified alignment alignment checking is perform arithmetic operauons on values of 8 , 16 , 32 , 64 , or 128 bit si/cs, which arc als explicitly specified in the instruction right aligned in registers I ncsc execution operauons include the add, subtract, btκilcan and simple shift operations which arc also available as addressing operations but further extend I oad anil store instructions specify mcmor) addresses is the sum of a b tsc genera! register the iilahlc sit to include three operand add/subtract three operand boolean dy namic and the product of the si/c of the memory region and cither an immediate value or another shitts and bit field operation 1 ; general register Scaling maximizes the memory space which can be reached by immediate offsets from a single base general register, and assists in generating mcmor) addresses within Floating-point iterative loops Alignment of the address can be reduced to checking the alignment of the first general register /cus provides all the facilities mandated and recommended by ΛNSI/IFFF standard 754 198S Bin iry Moating point Anthmctic, with the use of supporting software I ' he load and store instructions are used for fixed point data as well as floating i t ind digital signal processing data, /cus has a single bank of registers for all data types Branch Conditionally Swap instructions provide mυltithrcad and multiprocessor synchronization, using indivisible I ' he floatin oint compare an 1 branch instructions provide all the comparison types operations add swap, compare swap, multiplex swap, and double compare swap A store required and suggested by the IFFE floating point standard Hiesc floating point multiplex operation provides the abilit) to ln ivisibly wπtc to a portion of an octlet l * hcsc comparisons augment the usual types of numcnc value compansons with special handling instructions always operate on aligned octlet data, using cither little cndian or big endiin for NaN (n >t a number) v alues Λ NaN value compares as unordered with respect to an) by te ordenng other value even tint of an identical NaN value Branch /cus floating point compare branch instructions do not generate an exception on comparisons involving quiet or signaling NaN values If such exceptions arc desired, they rhc fixed point compare and branch instructions provide all aπthmctic tests for equality and can be obtained by combining the use of a floating point compare set instruction with inequality of signed and unsigned fixed point values T ests arc performed cither between two cither a floating point compare branch instruction on the floating point operands or a fixed operands contained in general registers, or on the bitwise and of two operands Depending point ct mpare bunch on the set result on the result of the compare, cither a branch is taken, or not taken Λ taken branch causes an immediate transfer of the program counter to the target of the branch specified by a 12 bit Because the less and greater relations ire anπ commutative one of e tch ret mon that differs signed offset from the location of the branch instruction Λ non taken bπneh c iuses no from another only by the replacement of an I with a G in the code can be removed by transfer, execution continues with the following instruction reversing the order of the operands and using the other code I " hus, an I relation can be used in place of a G relation by swapping the operands to the compare branch or compare Other branch instructions provide for unconditional transfer of control to addresses too set instruction distant to be reached by a 12 bit offset, and to transfer to a target while placing the location MicroUnity 22 MicroUnit) /cus System Architecture luc, Λug 17, 1999 /cus Processor 7eus Sy tem Architecture luc, Λug 17, 1999 /cus Processor No instructions arc provided that branch when the values arc unordered lo accomplish fhc operations cxphciUy specify the precision of the opcrauon, and round the result (or such an operation, use the reverse condition to branch over an immediately follow ing check that the result is exact) to the specified precision at the conclusion of each operation unconditional branch, or in the case of an if then else clause, reverse the clauses and use the Fach of the basic operations splits operand registers into symbols of the specified precision reverse condition and performs the same operation on corresponding symbols I ' he F relation can be used to determine the unordered condition of α single oper d b) In addition to the basic operations, /cus performs a variety of operations in which one or comparing the operand with itself more products arc summed to each other and/or to an additional operand I'he instructions include a fused muluply add (E MU ΛDD Y), convolve (F CON F) matnx multiply (F MUI-MΛT 0, and scale add (F SCΛL.ΛDD 0 I ' he results of these operations arc computed as if the multiplies arc performed to infinite precision, added as if in infinite precision, then rounded only once Conscqucndy, these operations perform these operations with no rounding of intermediate results that would have limited the accuracy of the result Rounding and exceptions compare- branch relations Rounding is specified within the instructions explicitly, to avoid explicit state registers for a rounding mode Simil irly, the instructions cxplicidy specify how standard exceptions (invalid Compare-set operation division by zero, overflow, underflow and inexact) arc to be handled ' The compare set floating point instructions provide all the comparison tjpcs supported as When no rounding is explicitly named by the instruction (default) round to nearest rounding branch instructions Zeus compare set floating point instructions may optionally generate an is performed, and all floating point exception signals cause the standard specified default exception on compansons involving quiet or signaling NaNs result, rather than a trap When rounding is cxpbcity named by the instruction (N nearest, Z zero, r floor, C ceiling), the specified rounding is performed, and floating point exception The following floaung point compare set relations arc provided as instructions signals other than inexact cause a floating point exception trap When X (exact, or exception) is specified all floating point cxccpuon signals cause a floaung point exception trap including inexact rhis technique assists the /cus processor in executing floating point operations with greater parallelism When default rounding and exception handling control is specified in floaung point instrucuons, /cus may safely rcurc instrucuons following them, as they arc guaranteed not to cause data dependent exceptions Similarly, floaung point instructions with N, /, T, or C control can be guaranteed not to cause data dependent exceptions once the operands have been examined to rule out invalid operations, division by zero, overflow or underflow cxccpuons Only floating point instructions with X control, or when exceptions cannot be ruled out with N, / T or C control need to avoid rcuππg following instructions until the final result is generated compare-set relations ΛNSI/IFFF standard 754 1985 specifics information to be given to trap handlers for the five floating point cxccpuons I ' he /cus architecture produces a precise exception, (The Arithmetic Operations program counter points to the instruction that caused the cxccpuon and all register state is present) from which all the required informauon can be produced in software as all source The basic operauons supported m hardware arc floating point add, subtract, multiply, divide, operand values and the spccficd operation are available square root and conversions among floating point formats and between floating point and binar) integer formats Software libraries provide other operations required by the ΛNSI/IFFF floating point 'U i> Patent 581243*) describes this technique of incorporating floating point information into processor standard instrucuons 23 MicroUnit) 24 Micro Unity /eus Sj stcm Architecture l ue, Λug 17, 1999 /eus Processor /eus Sy stem Architecture l uc Λug 17 1999 /eus Processor ΛNSI/IFFF standard 754-1985 specifics a set of five sticky cxccpuon bits for recording bit posmon within the instruction) In the case of uc (as when the F SCΛI ADD scaling the occurrence of cxccpuons that are handled by default The Zeus architecture produces a operand has two corresponding NaN values or when a E MUI CF operand has NaN values precise cxccpuon for instrucuons with N, /, T, or C control for invalid opcrauon, division for both real and imaginary components of a value), the value which is located at a lower by zero overflow or underflow cxccpuons and with X control for all floaung point numbered (little cndian) bit posiuon within the operand is to receive pnonty The exceptions, from which corresponding sucky cxccpuon bus can be set Exccuuon of the ldcntificauon of a NaN as quiet or signaling shall not confer any pnonty for sclccuon - only same instruction with default control will compute the default result with round to nearest the operand position though a signaling NaN will cause an invalid operand exception rounding Most compound operations not specified by the standard arc not avail ible with rounding and cxccpuon controls llic sign bit of NaN values propagated shall be complemented if the instrucuon subtracts or negates the corresponding operand or (but not and) muluplics it by or divides it by or NaN handling divides it into an operand which has the sign bit set, even if that operand is another NaN If a NaN is both subtracted and muluplicd by a ncgauvc value the sign bit shall be propagated ΛNSI/IFEF standard 754-1985 specifics that operauons involving a signaling NaN or unchanged invalid operation shall, if no trap occurs and if a floaung point result is to be delivered deliver a quiet NaN as its result However it fails to specify what quiet NaN value to deliver For /cus operations that convert between two floaung point formats (INr Λ lΕ and NaN values arc propagated by preserving the sign and the most significant /eus operations that produce a floaung point result and do not trip on invalid operations fraction bits except that the most significant bit of a signalling NaN is set and (for propagate signaling NaN values from operands to results, changing the signaling NaN values IP) the least significant fracuon bit preserved is combined via a logical or of all to quiet NaN values by setting the most significant fracuon bit and leaving the remaining fracuon bits not preserved All additional fracuon bits (for INT ΛTF) arc set to zero bits unchanged Other causes of invalid opcriuoπs produce the default quiet NaN value where the sign bit is zero, the exponent field is all one bits, the most significant fraction bit is For /cus operauons that convert from a floating point format to a fixed point format set ind the rcmaing fraction bits arc zero bits Tor /cus operauons that produce multiple ( Nk) NaN values produce zero values (maximum likelihood estimate) Infinity values results catenated together signaling NaN propagation or quiet NaN production is handled produce the largest rcprcscntablc positive or ncgauvc fixed point value that fits in the separately and independently for each result symbol dcsuna on field When cxccpuon traps are enabled, NaN or Infinity values produce a floating point exception Underflows do not occur in the SINK, opcrauon they produce -1 ΛNS1/IEEF standard 754-1985 specifics that quiet NaN values should be propigated from 0 or + 1 depending on rounding controls operand to result by the basic operauons However, it fa s to specif) which of several quiet NaN values to propagate when more than one operand is a quiet NaN In addition the F or absolute negate or copy operations, NaN values arc propagated with the sign bit standard does not clearly specify how quiet NaN should be propagated for the multiple cleared complemented or copied, rcspccuvcly Signalling NaN values cause the Invalid operation instrucuons provided in icus I'he standard docs not specify the quiet NaN operation cxccpuon propagaung a quieted NaN in corresponding symbol locauons (default) produced as a result of an operand being a signaling NaN when invalid operation cxccpuons or an exception as specified by the instrucuon arc handled by default The standard leaves unspecified how quiet and signaling NaN values arc propagated though format conversions and the absolute value, negate and copy Floating point functions operations fhis section specifics these aspects left unspecified by the standard The following functions are defined for use within the detailed instruction dcfiniuons in the Tirst of all for /cus operauons that produce muluplc results catenated together, quiet and follovving section In these functions an internal format represents infinite precision floating signaling NaN propagation is handled separately and indcpcndcndy for each result s mbol point values as a four clement structure consisung of (1) s (sign bit) 0 for positive 1 for Λ quiet or signaling NaN value in a single symbol of an operand causes only those result negative (2) t (type) NORM, /FRO SNΛN, QNΛN INFINITY, (3) c (exponent) and (4) symbols that arc dependent on that operand symbol s value to be propagated as that quiet f (fraction) I ' he mathcmaucal interpretation of a normal value places the binary point at the NaN Multiple quiet or signaling NaN values in symbols of an operand which influence units of the fraction, adjusted by the exponent ( l) ΛS *(2 Λc )*f The funcuon T converts a separate symbols of the result arc propagated independently of each other Λny signaling packed IFFF floaung point value into internal format flic function PackF converts an NaN that is propagated has the high order fraction bit set to convert it to a quiet NiN internal format back into IFFF floaung point format with rounding and exception control Tor /cus operations in which muluplc sy mbols among operands upon which a result sj mbo! Definition is dependent arc quiet or signaling NaNs, a pπoπty rule will determine which NaN is def eb *- cbιts(prec) as propagated Pnonty shall be given to the operand that is specified by a register definition at a case pref of lower numbered (little cndian) bit posmon within the instrucuon (rb has pnonty over re, 16 which has pnonty over td) In the case of operands which are catenated from two registers, eb <- 5 pnoπty shall be assigned based on the register which has highest pnonty (lower numbered 32 25 MicroUnity MicroUnity Tuc, Λug 17, 1999 MicroUnit) -30 Zeus System Architecture Tuc, Λu(! 17, 1999 Zeus Processor Zeus Sjstcm Architecture Tuc, Aug 17, 1999 Zeus Processor c e *- ae MicroUnit} 32 - MlcroUmtj luc, Λug 17, 1999 /cus Processor bs bt be bf bs bt be b f Zeus Sjstcm Architecture Tuc, Λug 17, 1999 Zeus Processor Zeus Sjstcm Architecture l uc, Λug 17, 1999 Zeus Processor Data-handlinq Operations I'he charactcnstics of these algorithms include sequential access to data, which permit the Digital Signal Processing use of the normal load and store operations to reference the data Octlet and hcxlct loads and stores reference several sequential items of data, the number depending on the operand I'he Zeus processor provides a set of operations that maintain the fullest possible use of precision 128 bit data paths when operating on lower precision fixed point or floating point vector values These operauons arc useful for several application areas, including digital signal I ' he discussion of these operations is independent of byte ordenng, though the ordenng of processing, image processing and synthetic graphics The basic goal of these operations is to bit fields within octlcts and hcxlcts must be consistent with the ordenng used for bytes accelerate the performance of algonthms that exhibit the following charactcnstics Specifically, if big cndian byte ordenng is used for the loads and stores, the figures below should assume that index values increase from left to nght, and for little cndian byte Low- precis ion arithmetic ordenng, the index values increase from right to left Tor this reason the figures indicate different index values with different shades, rather than numbering The operands and intermediate results arc fixed point values represented in no greater than 64 btt precision Tor floating point anthmctic, operands and intermediate results arc of 16, When an index of the nx+k form is used in array operands, where n is a power of 2, data 32, or 64 bit precision mcmor) sequentially loaded contains elements useful for separate operands The "shuffle" instruction divides a tnclct of data up into two hcxlcts, with alternate bit fields of the source Hie fixed point anthmctic operations include add, subtract, multipl , divide, shifts and set triclct grouped together into the two results An immediate field, h, in the instrucuon on compare specifics which of the two regrouped hcxlcts to select for the result Tor example, two X SI IUrri-.R 256 rd=rc,rb,32,I28,h operations rearrange the source tnclct (c,b) into two The use of fixed point anthmctic permits various forms of operation rcordcπng that arc not hcxlcts as follows permitted in floating point anthmctic Specifically, commutaϋvit and associativity, and distribution identities can be used to reorder operations Compilers can evaluate operations to determine what intermediate precision is required to get the specified anthmctic result Zeus supports several levels of precision, as well as operauons to convert between these different levels These precision levels arc alwajs powers of two, and arc explicitly specified in the opcrauon code When specified, add, subtract, and shift operauons ma) cause a fixed point anthmctic cxccpuon to occur on resulting conditions such as signed or unsigned overflow The fixed point anthmcuc exception may also be invoked upon a signed or unsigned companson In the shuffle operation, two hcxlct registers specify the source t clct, and one of the two result hcxlcts arc specified as hcxlet register Sequential aςςςss tP datø The algonthms arc or can be expressed as operations on sequentially ordered items in mcmor) Scatter gather memory access or sparse matnx techniques are not required Where an index vanablc is used with a mulupl cr, such muluplicrs must be powers of two When the index is of the form, nx+k, the value of n must be a power of two, and the values referenced should have k include the majonty of values in the range 0 n 1 A ncgauvc muluplicr maj also be used Vectonzable operations The operauons performed on these sequcnαally ordered items arc tdcnucal and independent Condinonal operations arc cither rcwnttcn to use Boolean vaπablcs or masking, or the compiler is permitted to convert the code into such a form 35 MicroUnity - 36 MicroUnity Zeus System Architecture Tuc, Λug 17, 1999 Zeus Processor Zeus System Architecture Tuc, Λug 17, 1999 Zeus Processor An operand can be doubled in precision and shifted left with the "expand" operation, which is essentially the reverie of the "compress" operation. For example the X.EXPΛND Software Conventions 4 bits left: The following section describes software conventions that are to be employed at software module boundaries, in order to permit the combination of separately compiled code and to provide standard interfaces between application, library and system software. Register usage and procedure call conventions may be modified, simplified or optimized when a single compilation encloses procedures within a compilation unit so that the procedures have no external interfaces. For example, internal procedures may permit a greater number of register-passed parameters, or have registcts allocated to avoid the need to save registers at procedure boundaries, or may use a single stack or data pointer allocation to suffice for more than one level of procedure call. The "shuffle" operation can double the precision of an operand and multiply it by 1 Register Usage (unsigned only), 2 m or 2 m +l, by specifying the sources of the shuffle operation to be a zeroed register and the source operand, the source operand and zero, or both to be the All Zeus registers arc identical and general-purpose; there is no dedicated zero-valued source operand. When multiplying by 2m, a constant can be freely added to the source register, and no dedicated floating-point registers. However, some procedure-call-oriented operand by specifying the constant as the right operand to the shuffle. instructions imply usage of registers zero (0) and one (1) in a manner consistent with the conventions described below. By software convention, the non-specific general registers are Arithmetic Operations used in more specific ways. register assembler usage how saved The characteristics of the algorithms that affect the arithmetic operations most dirccdy are number names low-precision arithmetic, and vcctorizable operations. The fixed-point arithmetic operations Ip, rO link pointer caller provided are most of the functions provided in the standard integer unit, except for those dp, rl data pointer caller that check conditions. These functions include add, subtract, bitwise Boolean operations, 2-9 r2-r9 parameters caller shift, set on condition, and multiply, in forms that take packed sets of bit fields of a specified 10-31 rl0-r3l temporary caller size as operands. The floating-point arithmetic operations provided are as complete as the 32-61 r32-r61 saved callee scalar floating-point arithmetic set The result is generally a packed set of bit fields of the same size as the operands, except that the fixed-point multiply function intrinsically doubles 62 fp. r62 frame pointer callee the precision of the bit field. 63 sp, r63 stack pointer callee register usage Conditional operations are provided only in the sense that the set on condition operations can be used to construct bit masks that can select between alternate vector expressions, At a procedure call boundary, registers are saved either by the caller or callee procedure, using the bitwise Boolean operations. All instructions operate over the entire ocdet or hexlet which provides a mechanism for leaf procedures to avoid needing to save registers. operands, and produce a hcxlct result. The sizes of the bit fields supported arc always Compilers may choose to allocate variables into caller or callee saved registers depending on powers of two. how their lifetimes overlap with procedure calls. Galois Field Operations Procedure Calling Conventions Zeus provides a general software solution to the most common operations requited for Procedure patameters are normally allocated in registers, starting from register 2 up to Galois Field arithmetic. The instructions provided include a polynomial multiply, with the " register 9. These registers hold up to 8 parameters, which may each be of any size from one polynomial specified as one register operand. This instruction can be used to perform CRC byte to sixteen bytes (hexlet), including floating-point and small structure parameters. generation and checking, Reed-Solomon code genctation and checking, and sprcad-spectxum Additional parameters are passed in memory, allocated on the stack. For C procedures which encoding and decoding. use varargs.h or stdarg.h and pass parameters to further procedures, the compilers must leave room in the stack memory allocation to save registers 2 through 9 into memory contiguously with the additional stack memory parameters, so that procedures such as _doprnt can refer to the parameters as an array. - 39 - MicroUnity - 40 - MicroUnity /cus System Architecture Tuc, Λug 17 1999 /eus Proecsstir /eus System Architecture Tuc, Λug 17, 1999 Zeus Processor can be discovered from a string following the dp pointer, or a separate table indexed by the calkr (non leaf) dp pointer caller AADDI sp® size // allocate caller stack frame S I 64Λ lp sp off // save original lp register The fp register is used to address the stack frame when the suck s e vanes during execution S I 64Λ dp sp off // save original dp register of a procedure, such as when using the GNU C alloca function When the stack si/c can be lco e using dp| determined at compile time, the sp register is used to address the stack frame and the fp L I 64 A lp=dp off // load lp L I64Λ dp=dp off // load dp register may be used for any other general purpose as a caltcc saved register BUNK lp=lp // invoke callee procedure Typical static-linked fntra module calling sequence L I 64Λ dp=sp off // restore dp register from stack (code using dp| caller (non leaf) L I 64Λ lp=sp off // restore original lp register AΛDDI sp=sιze // deallocate caller stack frame caller AADDI sp® size // allocate caller stack frame B // return S I 64* Ipspoff // save original lp register lp [callee using same dp as caller) callee (leaf) B LINK I callee callee |code using dp| (callee using same dp as caller) B lp // return B LINK I callee lp register I ' he load instrucuon is required in the caller following the procedure call to restore the dp LI 64 A lρ=sp off // restore original AADDI sp®sιze // deallocate caller stack frame register Λ second load instruction also restores the lp register, which may be located at any B lp // return point between the. last procedure call and the branch instruction which returns from the procedure callee (leaf) callee (code using dpj System and Privileged library Calls B // return It is an objccuvc to make calls to system facilities and privileged libraries as similar as Procedures that are compiled together may share a common data region, in which case there possible to normal procedure calls as dcscnbcd above Rather than invoke system calls as an is no need to save, load, and restore the dp region in the callee, assuming that the callee docs exception which involves significant latency and complication, wc prefer to use a modified not modify the dp register The pc relative addressing of the B LINK 1 instrucuon permits procedure call in which the process pnvilcgc level is quietly raised to the required level To the code region to be position independent prov ide this mechanism safely interacuυn with the virtual memory s stem is required Minimum static- linked Intra module calling sequence Such a procedure must not be entered from anywhere other than its legitimate entry point, caller (non leaf) to prohibit entering a procedure after the point at which sccuπry checks are performed or caller ACOPY r31 =lp // save original lp register with invalid register contents, otherwise the access to a higher privilege level can lead to a (callee using same dp as caller) security violation In addition, the procedure generally must have access to memory data, for B LINK.I callee which addresses must be produced by the pπvilegcd code T o facilitate gcncraung these (callee using same dp as caller) addresses the branch g-ucway instrucuon allows the privileged code procedure to rely the B LINK I callee fact that a single register h is been verified to contain a pointer to a valid memory region B r31 // return lhe branch gateway instrucuon ensures both that the procedure is invoked at a proper entry callee (leaf) point, and that other registers such as the data pointer and stack pointer can be properly set To ensure this, the branch gateway instrucuon rctπcvcs a "gateway' dirccdy from the callee [code using dp r3 l unused) // return "protected virtual memory space The gateway contains the virtual address of the entry point of the procedure and the target pnvilcgc level A gateway can only exist in regions of the virtual address space designated to contain them, and can only be used to access privilege When all the callee procedures arc intra module, the stack frame may also be eliminated levels at or below the pnvilcgc level at which the mcmor) region can be written to ensure from the caller procedure by usin ' temporary" caller save registers not utilised by the callee that a gateway cannot be forged leaf procedures In addition to the lp value indicated above, this usage may include other values and variables that live in the caller procedure across callee procedure calls ' he branch gateway instrucuon ensures that register 1 (dp) contains a valid pointer to the Typical dynamic-linked. Inter -module calling sequence gateway for this target code address by compaπng the contents of register 0 (lp) against the 43 MicroUnity 44 MicroUnity /eus Sy stem Architecture l uc, Λug 17, 1999 /cus Proees' /eus System Architecture l uc, Λug 17, 1999 /cus Processor the higher privilege region after the call through a secure re entry point Special care must be Fach instruction uses one or more of these units, according to the table below taken to ensure that the less privileged rυuunc is not permitted to gain unauthorized access by cυrrupuon of the stack or saved registers, such as by saving all registers and setting up a new stack frame (or rcstoπng the original lower privilege stack) that may be manipulated by the less privileged routine Finally, such a technique is vulnerable to an unprivileged routine attempting to use the re entry point directly, so it may be appropriate to keep i privileged state variable which controls permission to enter at the re entry point Instruction Scheduling The next sccuon dcscnbcs detailed pipeline organization for Zeus, which has a significant influence on instruction scheduling l icrc wc will elaborate some general rules for cffccuvc scheduling by a compiler Specific information on numbers of functional units, functional unit parallelism and latency is quite implementation dependent, values indicated here are valid for Zeus's first implementation Latency Separate Addressing from Execution I ' he latency of each functional unit depends on what opcrauon ts performed in the unit, and where the result is used The aggressive nature of the pipeline makes it difficult to Zeus has separate function units to perform addressing operauons (A, l, S B instructions) characterize the latency of each operation with a single number Because the addressing unit from execution operations (G, X, E, W instrucuons) When possible, Zeus will execute all is decoupled from the execution unit, the latency of load operations is generally hidden, the addressing operations of an instruction stream, deferring execution of the execution unles the result of a load instruction must be returned to the addressing unit Store operauons until dependent load instrucuons arc completed Thus, the latency of the memory instructions must be able to compute the address to which the data is to be stored in the system is hidden so long as addressing operauons themselves do not need to wait for addressing unit, but the data will not be irrevocably stored until the data is available and it is memory valid to retire the store instrucuon I lυwcvcr, under certain conditions, data may be forwarded from a store instruction to subsequent load instructions, once the data is Software Pipeline av ailable Instructions should generally be scheduled so that previous operauons can be completed at I ' he latency of each of these units for the initial /cus implementation is indicated below the time of issue When this is not possible, the processor inserts sufficient empty cycles to perform the instrucuons precisely explicit no opcrauon instructions arc not required ultiple Issue Zeus can issue up to two addressing operauons and up to two execution operations per cycle per thrcid Considering functional unit parallelism, descnbcd below, as many of four instrucuon issues per cycle arc possible per thread Functional Unit parallelism Zeus has separate function units for several classes of execution operauons An Λ unit performs scalar add, subtract, boolean, and shift add operations for addressing and branch calculations The remaining functional units arc execution resources, which perform operations subsequent to memory loads and which operate on values in a parallel, partitioned form A G unit performs add, subtract, boolean, and shift add operations An X unit performs general shift operations An H unit performs multiply and floating point operations A T unit performs table look up operauons 47 MicroUnity MicroUnity two or more instrucuons be executed in cither order and separately, producing serially The diagram below shows a two way may be a register to register operation (using to register operation (using stage A) or a memory frequently enough that be independent of the immediately following one or two cycle superpipelined implementation pc of instrucnon that ma) be the function of that to complete the and execute several a particular ordering of instruction t)pcs one a single clock c)clc The ordenng required is Λ, , address calculation, a memory load, a register and a branch Because of the orgaπt/anon of the Instructions of t)pc F include point and digital signal "superstrtπg "* because of clock c)cle as distinguished unrelated context call this pipeline organization feature "supcrspring," an of load instructions can be hidden, as execute Nevertheless, the provides precise exceptions. iniual e s implemcntauon, though it was present in operations must be separated by the latency machines, the latency of simple operations can be provides for very highly pipelined independent threads. In this execution; the architectural privilege level, local TB, thread may handle an exception order to ensure that all threads must be scheduled Zeus Sy stem Architecture l uc, Λug 17, 1999 ' cus Processor /eus System Architecture l uc Λug 17, 1999 /cus Processor An example of a resource that is cntical that it be fairly shared is the d ita mcmory/c ichc Branch/fetch Prediction subsystem In a prototype implementation, Zeus is able to perform a load operation only on every second cycle, and a store operation only on every fourth cycle Zeus schedules these Zeus does not have delayed branch instrucuons, and so relics upon branch or fetch fixed timing resources fairly by using a round robin schedule for a number of threads th it is prediction to keep the pipeline full around unconditional and conditional branch relatively prime to the resource reuse rates For this implemcntauon, five simultaneous instructions In the simplest form of branch prediction, as in Zeus s first implementation, a threads of execution ensure that resources which may be used every two or four cycles ire taken conditional backward (toward a lower address) branch predicts that a future execution fairly shared by allowing the instructions which use those resources to be issued only on of the same branch will be taken More elaborate prediction may cache the source and target every second or fourth issue slot for that thread addresses of multiple branches both conditional and unconditional and both forward and In the diagram below, the thread number which issues an instruction is indicated on each clock cycle, and below it, a list of which funcuonal units may be used by that instruction i ' he hardware prediction mechanism is tuned for optimizing conditional branches that close The diagram repeats every 20 cycles, so cycle 20 is similar to cycle 0, cycle 21 is similar to loops or express frequent alternatives, and will generally require substantially more cycles cycle 1 , etc Fhis schedule ensures that no resource conflict occur between threads for these when executing conditional branches whose outcome is not predominately taken or not resources fhrcad 0 may issue an F, I , S or B on cycle 0, but on its next opportunity, cy cle 5, taken For such cases of unpredictable conditional results the use of code that avoids may only issue F or B, and on cycle 10 may issue F, I or B, and on cycle 15 may issue F or conditional branches in favor of the use of compare set and multiplex instructions may B result in greater performance Under some conditions the above technique may not be applicable for example if the conditional branch guards code which cannot be performed when the branch is taken Hiis may occur for example, when a conditional branch tests for a valid (non zero) pointer and the conditional code performs a load or store using the pointer In these cases the conditional branch has a small positnc offset, but is unpredictable A /cus pipeline may Superthread pipeline handle this case as if the branch is always predicted to be not taken, with the recovery of a J misprediction causing cancellation of the instructions which have already been issued but not completed which would be skipped over by the taken conditional branch ITiis When seen from the perspective of an individual thread the resource use looks ' conditionnl skip optimization is performed by the initial /cus implementation and similar to that of the collection l " hus an individual thread miy use the load unit every two requires no specific architectural feature to access or implement instructions, and the store unit every four instructions L Superthread pipeline A /cus Superthread pipeline, with 5 simultaneous threads of execution permits simple operations, such as register to register add (G ΛDD), to take 5 cycles to complete allowing for an extremely deeply pipcbncd implemcntauon /eus implements two related instructions that can eliminate or reduce branch delays for conditional loops conditional branches, and computed branches I ' he ' branch hint" Simultaneous Multithreading instruction has no effect on architectural state, but informs the instrucuon fetch unit of a potcπtnl future branch instruction, giving the addresses of both the branch instruction and i'he inual Zeus implementation performs simultaneous multithreading among 4 threads of the branch target I ' he two forms of the instruction specify the branch instruction address Each of the 4 threads share a common memory system, a common "1 unit Fairs of threads relative to the current address as an immediate field and one form (branch hint immediate) share two G units, one X unit, and one E unit Each thread individually has two Λ units A specifics the branch target address relative to the current address as an immediate field, and fatr allocation scheme balances access to the shared resources by the four threads the other (branch hint) specifics the branch target address from a general register The branch hint immediate instruction is generally used to give advance notice to the instruction 51 MicroUnity 54 MicroUnity /cus System Architecture l uc, Aug ! 7 1999 /eus System Architecture l uc Λug 17 1999 /eus Processor fetch unit of a branch conditional instruction, so that instructions at the target of the branch generally provide forwarding resources so that dependencies from earlier instrucuons within can be fetched in advance of the branch conditional instruction reaching the execution a string arc immediately forwarded to later instrucuons, except between a first and second pipeline Placing the branch hint as early as possible, and at a point where the extra execution instruction as described above In addition, when forwarding results from the instruction will not reduce the execution rate optimizes performance In other words an execution units back to the data fetch unit additional delay may be incurred optimizing compiler should insert the branch hint instruction as early as possible in the basic block where the parcel will contain at most one other "front end ' instruction Additional Load and Execute Resources Studies of the dynamic distribution of Zeus instructions on benchmark suites indicate that the most frequently issued instrucuon classes arc load instructions and execute instructions In a high performance Zeus implementation, it is advantageous to consider execution pipelines in which the ability to target the machine resources toward issuing load and execute instructions is increased of the means to increase the ability to issue load class instructions is to prov ide the is to issue two load instructions in a single issue stππg 1 his would generally increase the resources required of the data fetch unit and the data cache but a compensating solution is to steal the resources for the store instruction to execute the second load instruetion Thus a single issue string can then contain cither two load instructions or one l id instruction and one store instruction, which uses the same register read ports ind address computation resources as the basic 5 instruction string fhis capability also m iy be employed to provide support for unaligned load and store instructions, where a single issue stnng may contain as an alternative a single unaligned load or store instruction which uses the resources of the two load class units in concert to accomplish the unaligned memory operation Result Forwarding When temporally adjacent instrucuons arc executed by separate resources, the results of the first instrucuon must generally be forwarded directly to the resource used to execute the second instruction, where the result replaces a value which may have been fetched from a register file Such forwarding paths use significant resources Λ /cus implementation must 55 MicroUnity MicroUnity Zeus Sy stem Architecture Tuc, Λug 17, 1999 Instruction Set /eus System Architecture l ue, Λug 17, 1999 Instruction Set Pipeline Organisation Major Operation Codes Instruction Set Major Operation Codes This section describes the instrucuon set in complete architectural detail Operation codes ΛII instructions are 32 bits in size, and use the high order 8 bits to specify a major opcrauon arc numerically defined by their position in the following operation code tables, and arc code referred to symbolically in the detailed instruction definitions Entries that span more than 24 23 one location in the table define the operation code identifier as the smallest value of all the aJor I other locations spanned Hie value of the symbol can be calculated from the sum of the legend values to the left and above the identifier Instructions that have great similarity and identical formats are grouped together Starting on fhc major field is filled with a value specified by the following table s a new page, each category of instructions is named and introduced The Operation codes section lists each instruction by mnemonic that is defined on tint page A textual interpretation of each instruction is shown beside each mnemonic The Equiv alences section lists additional instructions known to assemblers that are equiv alent or special cases of base instructions, again with a textual interpretation of each instruction beside each mnemonic Below the list, each equivalent instruction is defined, cither in terms of a base instruction or another equivalent instrucuon l"hc symbol between the instruction and the definition has a particular meaning If it is an arrow («- or — >), it connects two mathcmaαcaly equivalent operations, and the arrow direction indicates which form is preferred and produced in a reverse assembly If the symbol is a (c=), the form on the left is assembled into the form on the right solely for encoding purposes, and the form on the nght is otherwise illegal in the assembler The parameters in these definitions are formal, the names arc solely for pattern matching purposes, even though they may be suggestive of a parucular meaning The Redundancies section lists instructions and operand values that may also be performed by other instructions in the instruction set The symbol connecting the two forms is a ( =>), which indicates that the two forms arc mathematically equivalent, both arc legal, but the assembler docs not transform one into the other ITic Selection section lists instructions and equivalences together in a tabu r foπn that highlights the structure of the instruction mnemonics major operation code field values The Format section lists (1) the assembler format, (2) the C intπnsics format, (3) the bit level instruction format, and (4) a definition of bit level instruction format fields that arc not a one for one match with named fields in the assembler format The Definition section gives a precise definition of each basic instruction The Exceptions section lists exceptions that may be caused by the execution of the instructions in this category s Blarιk table eπtπcs cause the Reserved Instruction exception to occur 57 MicroUnity 58 MicroUnity zCeus Sy stem Architecture Tuc, Λug 17, 1999 Instruction Set Zeus Sy stem Architecture l ue, Λug 17, 1999 Instruction Set Minor Operation Codes \tmor Operation Codes Minor Operation Codes For the ma|or opcrauon field values Λ MINOR, B MINOR, I-MINOR, S MINOR, G 8, G.16, G 32, G 64, G 128, XSI IIFTI, XSI IIFT, E 8, E 16, E 32, E 64, E 128, MINOR I. and \V MINOR B, the lowest-order six bits in the instrucuon specify a minor opeπuon code 31 24 23 6 5 major other I minor | 18 The minor field is filled with a value from one of the following tables minor operation code field values for L.MINOR minor operation code field values for E size - 59 - MicroUnity - 60 - MicroUnity Zeus Sjstcm Architecture Tuc, Λug 17, 1999 Instruction Set Zeus Sjstcm Architecture luc, Λug 17, 1999 Instrucuon Set General i oπns Imtruction Fetch The compare field is filled with a value from the following table Register rd is cither a source register or destination register, or both Registers rc and rb arc always source registers Register ra is always a destination register Instruction Fetch Definition def Thread|th) as forever do compare operation code field values for ACOM op and G COM op size catch exception if (Event egister & Event ask|th|) ≠ 0 then if ExceptιonState=0 then General Forms raise Eventlnterrupt endif endif The general forms of the instrucuons coded b) a major opcrauon code are one of the mst *- LoadMemoryX|ProgramCounter,ProgramCounter,32, ( following- Iπstructionfinst) eπdcatch 31 24 23 0 case exception of 1 major 1 offset Eventlnterrupt, s 24 1 Reservedlnstruc tion Ace essDisa Ifσ edBy Virtua lAddress, 31 24 23 18 17 0 AccessDisallσwedByTag 1 major I rd 1 Dffset Ace es s DisallowedByGlobafTB Ac cessDi sallo edByLocalTB 8 6 IS 1 AccessDetailRequiredByTag. AccessDetailRequiredByGIobafTB. 31 24 23 18 17 12 I I 0 AccessDetailRequiredByLocalTB 1 major I rd MisslnGlobalTB 6 1 re 6 I offset 8 12 1 MissInLocalTB FixedPoiπtAπthmetic, 31 24 23 18 17 12 I I 6 5 0 FloatingPointArithmetic 1 major 1 rd 1 rc 1 rb Gate ayDisa (towed case ExceptionState of 6 1 ra 8 6 6 6 1 0 PerformExceptιon(exceptιon) The general forms of the instruction.) coded b j ma j or and minor operation codes ire one of 1 PerformException(SecondException) the following 2 31 24 23 18 17 12 1 1 6 5 0 PerformMachineCheckfThirdException) I endcase major 1 rd rb 6 I rc TakenBranch 6 1 6 1 minor | 8 6 Continuations tate «- |ExceptιonState=0) ? 0 ContinuationState TakenBranchContinue 31 24 23 18 17 12 I I 6 5 0 /* nothing */ | major 1 rd 1 rc I slm 1 minor | none others ProgramCounter +- ProgramCounter + 4 ContinuationState <- |ExceptιonState=0| ? 0 ContinuationState endcase The general form of the instructions coded by major, minor, and unarj opention codes is endforever the following enddef 31 24 23 18 17 12 1 1 6 5 0 major rd I rc I unary | minor ~1 - 63 - MicroUnirj MicroUnity Zeus Sj stcm Architecture Tuc, Λug 17, 1999 Instruction Set Zeus Sjstcm Architecture l uc, Λug 17, 1999 Instrucuon Set Instruction Decode Iπltmclion Decode Perform Exception endcase ASUS ASUBO ASUB UO ASETA DE. ASETANDNE. ASETE. ASET E Definition ASETL. ASETGE. ASET U. ASETGE U AddressReversed|mιnσr rd rc rbj def PerformExceptιon|exceptιonJ as ASHL IADD ΛSHLIA0D.3 v «- (exception > 7) 7 7 exception AddressShιftLeftlmmedιateAdd|ιnst ι o.rd rc.rb| t <- LoadMemory|Exceptιonβase.ExceptιonBase* Thread* 12β+64«-8*v.64 L| ASHLISUBASH ISUB»3 if ExceptioπState = 0 then AddressShιftLeftlmmedιateSubtract(ιnst| o.rd.rc.rb) u <- RegRead|3.l28J I I RegRead|2.128| I I RegRead|l.l28| I I RegRead|0 128) ASHL I ASHL 10. ASH I UO. ASH I. ASH IU AROTR I StoreMemory|ExceptιonBase.ExceptιonBase*Thread'l28.512 L.u| AddressShιftlmmedιate|mιnorrd,rc.sιmml RegWrιte(0,64.ProgramCounter63 2 1 1 PπvilegeLevel others RegWritej 1.64.ExceptιonBase+Tnread* 128| raise Reservedlnstruction RegWrιte|264,exceptιon| endcase RegWrιte|364,FaιlιngAddress| ACOPYI endif AddressCopylmmediateJmajor rd mst 17 0) PπvilcgeLevel «- t| o AAOD I AADD I O. AADD I U O. AAMD I. AOR I. AIMA D I. ANOR I. AXOR I ProgramCounter *- tf,3 2 ' ' 0 2 Addresslmmediate[major,r rc.inst| 1 ol case exception of ASETΛND E I ASETAND NE I. ASET E I. ASET NE I. AccessDetailRequiredByTag, ASETL I E SETGE I ASET LU I. ASETGE U I AccessDetailRequiredByGlobalTB, ASUB I ASUBI O. ASUB IU O AccessDetailRequiredByLocatTB AddresslmmediateReversedfmajor rd rc instj 1 ol ContinuationState «- ContinuationState + 1 AMUX others AddressTerπarylmajor rd rc rb ra| / • nothing • / B MINOR endcase case minor of ExceptioπState «~ ExceptionState ♦ I B enddef Branched rc rb) BBAC BranchBack(rd rc rb) Instruction Decode B BARRIER BranchBarπer|rd rc rb) def (nstructιon(ιnst) as B DOWN major «- ιnst3i 2 BranchDown|rd rc rb| B GATE rd «- ιnst23 is BranchGateway|rd rc rb) rc «- ιnst|7 |2 B HALT Slmm <- rb *- ιnst| j 6 8ranchHalt(rd rc rb) B HINT minor t~ ra <- msts n BτanchHιnt|r ιπsti j2 Sim | case major of B LINK ARES BranchLιnk(rd rc rb) AiwaysReserved others AMINOR. raise Reservedlnstruction minor *- msts o endcase case minor of BE BNE. BL. BGE BLU. BGE U. BANDE. BAND NE AADD. AAODO. AAODOU AAND AANDN. ANAND. ANOR BranchCondιtιonal|major.rd rc insti 1 ol AOR. AORN. AXNOR AXOR BHINTI Address|mιnor.rd.rc rb) BranchHιntlmmedιate|ιnst23 1 a mst 17 12 instj 1 0) ACO . Bl compare «- instj ι 6 Branchlmmedιate|ιnst23 0) case compare of BLINKI ACOM E. ACOM NE ACOM AND E. ACOMANDNE BranchlmmedιateLιnlc(ιnst23 ol ACOML ACO GE. ACO U ACO GE U AddressComparelcompare rd,rcj BEFI6 BLGF I6 BLFI6 BGEFI6 others BEF32 BLGF32 BLF32. BGEF32 raise Reservedlnstruction BEF64 BLGF64 BLF64. BGEF64. BEFI28 BLGF128 BLFI28 BGEF128 - 65 - MicroUnity 66 - MicroUnlty Zeus System Architecture Tuc, Aug 17, 1999 Instruction Set Zeus Sjstcm Architecture Tuc. Λu K 17, 1999 Instruction Set Instruction Decode Instruction Decode BranchCondrooπalFtoatιngPoιπt(majσr,rd.rc,ιnst| ι o) minor round rd, rc, rb] BIF32, BN1F32. BNVF32. BVF32 G SH I ADD G SH IΛDD . BranchCondιtιoπalVιsιbιlιtyFloatιngPoιnt|major.rd.rc instj j 0 | GroupShiftLeftlmmedtateAddfinst j o size rd,rc.rb| L MINOR G SHL I SUB G SHL I SUB* 3. case minor of GroupShiftLeftlmmediateSubtractfinstj o.sιze,rd,rc.rb) LI6L. LUI6L. L32L. LU32L. L64L. LU64L. LI28L. L8. LU8. G SUBH G SUBHF. G SUBHN, G SUBHZ, LI6AL. LU16AL. L32AL. LU32AL, L64AL. LU64AL. LI28AL. GSUBHUC. GSUBHUF. GSUBHUN. GSUBHUZ LI6B. LUI6B. L32B. LU32B. L64B. LU64B. LI28B. GroupSubtractHalve|mιnor.ιπst| o size.rd.rc.rb) LI AB. LUI AB. L32AB. LU32AB. L64AB. LU64AB. LI28AB G OM. Load|mιnor.rd,rc rb) compare «- iπsti ι 0 others raise Reservedlnstruction case compare of endcase G OME. GCO NE. GCOMANDE. GCOMjWDNE. GCOML GCOMGE. GCOMLU. GCOMGEU LII6L LIU16L. LI32L. UU32L. LI64L LIU64L. LII28L. LI8. LIU8. GroupCompare|compare.sιze,ra,rb| LII A LIUI6AL LI32AL. UU32AL. LI64AL. UU64AL. UI28AL. others UI6B. LIUI6B. LI32B. LIU32B. LI64B. LIU64B. LI128B. raise Reservedlnstruction LII6AB. LIU16AB. LI32AB. LIU32AB. LI64AB. LIU64AB. LII28AB endcase Loadlmmedιate|major,rd.rc.ιπst| j ol others S MINOR raise Reservedlnstruction case minor of endcase SI6L S32L. S64L. SI28L. S8 G BOOLEAN G BOOLEAN* I SI6AL S32AL. S64AL. SI28AL. GroupBoolean|major.rd,rc rb minor) SAS64AL. SCS64AL. SMS64AL. SM64AL. GCOPYI GCOPYI*l SI6B. S32B. S64B. SI28B. size «- 0 I I I II 0 4 *' , l> '» SI6AB. S32AB, S64A8. SI28AB. GroupCopylmmedιate|major.sιze rd.instrs ol SAS64AB. SCS64AB. SMS64AB. SM64AS Store|mιnor,rd.rc.rb) GANDI. G ANOI GNORI. GO I. GXO I. SDCS64AB. SDCS64AL. GADDI. GADD I O GADDIUO StoreDoubleCompareSwapfminor.rd.rcrb) size <- 0 I I I II o 4 * ,π s't I 10 others Grouplmmedιate|major,sιze.rd.rc,ιnst9 raise Reservedlnstruction GSETANDEI. GSETΛNDNEI. GSETEI. GSETGEI, GSETLI endcase GSETNEI GSETGEIU. GSETLIU GSUBI. GSUBIO. GSUBIUO SII6L SI32L. SI64L SII28L. SIB. size <— 0 I I I II 0 * ιn! 'll 10 SII AL SI32AL. SI64AL. SII28AL. GrouplmmediareReversed|major,size.rd rc.ιnst9 ol SASI64AL SCSI64AL. SMSI64AL. SMUXI64AL. GMUX SII6B. SI32B. SI64B. SII28B. GroupTerπarylmajor.rd rc.rb,ra| SII6AB. SI32AB. SI64AB. SI128AB X SHIFT SASI64AB. SCSI64AB. SMSI64AB. SMUXI64AB Storelmmedιate(major.rd.rc,ιnstι j o) minor <- msts 2 I I 0 2 G8. G 16. G32. G64. G.I28 size <- 0 II I II ol' ns, 24 ' ' '""i ol minor <- msts o case minor of X EXPAND XUEXPAND. XSHL XSH O XSHLUO. sue <- 0 I I I II o 3 * ^J° r - αB XROTR. XSHR. XSH U. case minor of Crossbar|minor,size.rd.rc.rb) G DD. GΛDDL. GADDLU. GADDO. GΛDDOU XSHLM, XSH M Group[mιnor,sιze,rd,rc.rb) Crossbarlnplace(mιnor.sιze,rd.rc,rb) GADDHC. GADDHF. GADDHN. GADDHZ. others GADDHUC. GADDHUF, GADDHUN. GADDHUZ raise Reservedlnstruction GroupAddHalve|mιnor,ιnstj o.sιze.rd.rc,rb| endcase GAAA GASA X EXTRACT Grouplnplace|mιnor.sιze.rd.rc,rb) CrossbarExtract(major.r rc.rb.ra) G SET AND E. GSETANDNE. GSETE. GSETNE. X DEPOSIT. X DEPOSIT U X WITHDRAW X WITHDRAW U GSE L GSET.GE. GSETLU. GSETGEU. CrossbarFιeld|major.rd.rc.ιnst| | o.ιnr.5 0 ) G.SUB. GSUBL. G.SUBLU. G.SUBO GSUBUO X DEPOSIT M GroupReversed(mιnor,sιze.ra.rb rc| CrossbarFιeldlnplace|major.rdrc.ιnstι 1 (, mstς ol GSETE.F. G-SETLGF. GSETGEF. GSET F. X SHIFT I G SET E FX G.SET.LG F X. G SET GE FX GSET FJt GroupReversedFloatingPomtfmiπor op. size. minor *- tnstζ 0 MicroUnit)' MicroUnity Zeus System Architecture l uc, Λug 17, 1999 Instruction Set /cus System Architecture Tuc, Λug 17, 1999 Instrucuon Set Instruction Decode Always Reserved raise Reservedlnstruction endcase Always Reserved enddef rhis operation generates a reserved instrucuon cxccpuon Operation code ARES I Always reserved Format ARES imm ares|ιmm| 31 24 23 I A RES I Imm Description fhc reserved instruction cxccpuon is raised Software may depend upon this major opcrauon code raising the reserved instrucuon cxccpuon m all implcmcntauons The choice of opcrauon code intenuonall) ensures that a branch to a zeroed memory area will raise an cxccpuon Definition del AlwaysReserved as raise Reservedlnstruction enddef Exceptions Reserλetl Instruction MicroUnit) MicroUnity Zeus Sjstcm Architecture Tuc, Λug 17, 1999 Instrucuon Set /cus S)stcm Architecture l uc, Λug 17, 1999 Instrucuon Set Address λddress Format Address op rd=rc rb These operauons perform calculations with two general register values, placing the result in a general register rd=op|rc rbj 31 24 23 18 17 12 I I 6 5 0 Operation codes I A MINOR | rd 6 I rc 6 1 rb 6 I op 8 6 I Description Hie contents of registers rc and rb arc fetched and the specified operation is performed on these operands I ' he result is placed into register rd Definition Redundancies Selection 73 74 MicroUnity Zeus System Architecture Tuc, Λug 17, 1999 Instruction Set Zeus Sjstcm Architecture Tuc, Λug 17, 1999 Instrucuon Set Address Address Compare egWπte|rd 64, a) enddef Address Compare Exceptions These operauons perform calculauons with two general register values and generate a fixed- Fixed point arithmetic point aπthmcuc exception if the condiuon specified is met Operation codes - 75 - Micro Unity - 76 - MicroUnity Zeus S)stcm Architecture Tuc, Λug 17, 1999 Instrucuon Set Zeus System Λtchitecturc Tuc, Λug 17, 1999 Instrucuon Set Redundancies if a then raise FixedPointAnthmetic endif enddef Exceptions Format ACOM op rd.rc acomop(rd.rc) acomopzfrcd) 31 24 23 6 5 I) I A MINOR I rd op I ACOM I pescπption ' he contents of registers rd and rc arc fetched and the specified condiuon is calculated on these operands If the specified condition is true, a fixed-point arithmetic exception is generated This instrucuon generates no general register results Definition def AddressCompareJop rd.rc) as d <- RegRead(rd 128) c <~ RegRead|rc. I28| case op of ACOM E a *- d = c ACOM NE a <- d * c ACOMAND E a «- |d and c| = 0 ACOMAND NE a «- |d and c| * 0 ACOM a «- |rd * rc) 7 |c < 0) |d < c) ACOM GE a f- |rd » rc| 7 |c i 0) |d ≥ c) ACO LU a <- |rd = rc| 7 |c > 0) ||0 I I d| < |0 I I c|| ACOM GE U a <- |rd » rc) 7 |c ≤ Oj ||0 I I d) ≥ |0 I I c|| endcase 77 MicroUnity 78 - MicroUnity Zeus System Architecture Tuc, Λug 17, 1999 Instrucuon Set Zeus System Architecture Tuc, Λug 17, 1999 Instruction Set Address Copy Immediate Address Immediate This operation produces one immediate value, placing the result in a general register These operations perform calculauons with one general register value and one immediate value, placing the result m a general register Operation codes Operation codes lACOPYi Address copy immediate Equivalencies ASET Address set AZERO Address zero ASET rd <_ ACOPY.I rd=-I AZERO rd «- ACOPYI rd=0 Format Equivalencies ACOPY I rd=ιmm rd=acopyι(ιmm) 31 24 23 18 17 I A COPY.I I rd " Imm AANDN 1 rd=rcιmm → AAND I rd=rc,-ιmm ACOPY rd=rc «— AO I rd=rc.O Description ANOT rd=rc <— ANORI rd=rc.O Λn immediate value is sign-extended from the 18 bit imm field The result is placed into AORNI rd=rcιmm → AORI rd=rc.-ιmm tcgistcr rd AXNOR 1 rd=rcιmm → AXOR I rd=rc,-ιmm Definition Redundancies def AddressCopylmmedιate(op.rd.ιmm) as a «- [ιmm| ° 1 1 ιmm| AADD I rd=rc,0 <=> ACOPY rd=rc Reg πte|rd. 128. a| AADDIO rd=rc.O » ACOPY rd=rc enddef AADD I UO rd=rc.O <=> ACOPY rd=rc Exceptions AAND 1 rd=rc.O «=> AZERO rd AAND I rd=rc.-l <=> ACOPY rd=rc ANAND 1 rd=rc O <=> ASET rd ANAND 1 rd=rc,-l «=> ANOT rd=rc AOR I rd=rc.- l <=> ASET rd ANOR I rd=rc.-l «=> AZERO rd AXORI rd=rc,0 <=> ACOPY rd=rc AXORI rd=rc.-l <=> ANOT rd=rc - 79 - MicroUmty - 80 - MtcroUnity Zeus System Architecture Tuc, Λug 17, 1999 Instrucuon Set Zeus S)stcm Architecture Tuc, Λug 17, 1999 Instruction Set Selection endcase RcgWrιte|rd 64. a| enddef Exceptions Format op rd=rc,imm rd=op|rc.ιmm| 31 24 23 18 17 12 I I _°E_ rd Imm Description The contents of register rc is fetched, and a 64-bit immediate value is sign-extended from the 12-bit imm field. The specified opcrauon is performed on these operands. The result is placed into register rd Definition def Addressιmmedιate|op.rd,rc.ιmm) as c *- RegRead|rc. 64) case op of AAND I a <- c and i AORI: a +- c or i ANAND 1. a «- c nand l ANO I- a <- c nor 1 AXOR I a *- c xor e AADDI- a «- c + i AADD IO t <- |c 63 l i e) * I I I) AADDIUO- t .- |c 63 l i ) * I I I) if CJ4 * 0 then raise FixedPointAnthmetic endif MicroUnity - 82 - MicroUnity value is sign-extended from the operands The result is Zeus System Architecture Tue, Λug 17, 1999 Instrucuon Set a *- t63 o ASUBI UO Address Reversed t *- |ι 63 1 1 l| - (c 63 I I c| if t64 ≠ 0 then raise FixedPoiπtArrthmeDc endif a <- t 6 o Operation codes ASET.A DE I a <- ||ι and c| • 0) M ASETΛNDNE I a «- |(ι and c) * 0) M ASET E I a «- |ι = c| 64 ASETNE I a «- |ι * c) 64 ASET LI a <- |ι < c| 64 ASETGE I a ♦- |l ≥ c| 64 ASET LI U a «- ||0 I I l) < |0 I I c)| M ASETGE I U Equivalencies a <- |(0 I I i) ≥ |0 I I c|| 64 endcase Reg rrte|rd 64 a| enddef Exceptions ASETEZ rd=rc <— ASETΛND E rd=rc.rc ASETGZ rd=rc e= ASETL U rd=rc.rc ASETGEZ rd=rc <= ASETGE rd=rc,rc ASETLZ rd=rc e= ASETL rd=rc rc ASETLEZ rd=rc <= ASETGEU rd=rc.rc ASETNEZ rd=rc «- ASETANDNE rd=rc,rc ASETG rd=rb,rc -» ASETL rd=rc,rb ASETGU rd=rb.rc → ASETL U rd=rc.rb ASETLE rd=rb.rc — » ASETGE rd=rc.rb ASET L U rd=rb.rc -→ ASETGE U rd=rc.rb - 85 MicroUnity MicroUnity Zeus S)stcm Architecture Tuc, Λug 17, 1999 Zeus System Architecture Tuc, Λug 17, 1999 Instrucuon Set Redundancies a <- ||rc = rb) ? |b > 0) . ||0 I I b| < |0 I I c|| 64 ASETGEU: ASET.E rd=rc,rc «=» ASET rd a *- ||rc = rb) ? |b i 0] ■ ||0 I I b) ≥ |0 1 I C|| 64 ASET.NE rd=rc.rc «=> AZERO rd ASUB a 4- b - c ASUB O Selection t <- |b 63 I I b| - |c 6 I I c) if t ( ,4 < t 63 then raise FixedPoiπrAπthmetic endif a <- t 63 o ASUBUO t <- |0' I I b| - (0 1 I I c| if t64 ≠ 0 then raise FixedPointAnthmetic endif Format a <- t 63 o endcase op rd=rb,rc Reg rιte|rd 64. a) enddef rd=op[rb.rc) rd=opz(rcb) Exceptions A.MINOR rd rb _°E- 8 6 rc <- rb <- rcb Description The contents of registers rc and rb arc fetched and the specified opcrauon is perfoπned ( these operands 'I'he result is placed into register rd. Definition def AddressReversed|op.rd.rc.rb) as c «- RegReadlrc. 128) b <- RegRead|rb. 128) case op of ASET E- a <- |b - c|* 4 ASCTNE. a <- |b ≠ c| 64 ASETΛ DE. a f- ||b and c| » 0) 64 ASET.ANDNE: a «- ||b and c) ≠ 0| 64 ASETL a *- lire - rb) ? |b < OJ . |b < cffi* ASET.GE: a «- ||rc « rb| ? |b _ • 0| : |b 2 c|| 64 ASET. U- - 87 - MicroUntty MicroUnity Zeus S j stcm Architecture Tuc, Λug 17, 1999 Address Ternary Branch This opcrauon branches to a location specified bj a register Operation codes Operation codes I B lA UX I Address multiplex Format op ra=rd,rc.rb I B MINOR I rd | ra=amux(rd,rc,rb) Description Execution branches to the address specified by the contents of register rd Definition Exceptions Exceptions MicroUnit) Zeus Sj tcm Architecture Tuc, Λug 17, 1999 Instrucuon Set Zeus Sjstcm Architecture Tuc, Λug 17, 1999 Instrucuon Set Branch Back Exceptions Branch Back This operation branches to a location specified by the previous contents of register 0, reduces the current privilege level, loads a value from mcmor}', and restores register 0 to the value saved on a previous exception Operation codes B.B CK Branch back format B.BACK bbackl) Description Processor context, including program counter and pnvilcgc level is restored from register 0, where it was saved at the last cxccpuon. Exception state, if set, is cleared, rc-cnabhng normal cxccpuon handbng The contents of register 0 saved at the last cxccpuon is restored from mcmorj The pnvilcgc level is only lowered, so that this instruction need not be privileged If the previous cxccpuon was an AcccssDctaU exception, Continuation State set at the time of the exception affects the operation of the next instruction after this Branch Back, causing the previous AcccssDctaU exception to be inhibited. If software is performing this instruction to abort a sequence ending in an AcccssDctaU exception, it should abort by branching to an instruction that is not affected by Continuation State. pefiπition def Branch Back[rd,rc.rb) as c <- RegRead|rc, 128) if [rd ≠ OJ or[rc ≠ 0| or (rb ≠ 0] then raise Reservedlnstruction endif a *- LoadMemory(ExceptιonBase ExceptιonBase*Thread' I28.128,L) if PπvilegeLevel > c\ then PrivilegeLevel «- cj o endif ProgramCounter *- (,$ 2 ' ' ° 2 ExceptionState «- 0 Reg πte[rd.l 28.a| raise TakenBranc Coπtinue enddef MicroUnit)' MicroUnity /cus Sjstern Architecture Tuc, Λug 17, 1999 Instruction Set /eus Sjstern Architecture l ut, Λug 17, 1999 Instruction Set Branch Barrier Branch Conditional Branch Barrier Branch Conditional ITiis opcran n stops the current thread until all pending stores arc completed then branches ITicst operations compare two operands, and depending on the result of that compansoπ to a location specified b) a register conditional!) branches to a ncarbj code location Operation codes Operation codes B BARRIER Branch barrier Format B BARRIER rd bbarrιer(rd) 31 24 23 18 17 12 11 6 5 0 I B MINOR | rd I 0 I 0 I B BARRIER | Description The instrucuon fetch unit is directed to cease cxecuuon uπul all pending stores are completed Following the barrier, any previously pre fetched instrucuons arc discarded and cxecuuon branches to the address specified b) the contents of register rd Access disallowed exception occurs if the contents of register rd is not aligned on a quadlet boundary Self modifying, dynamically generated, or loaded code maj require use of this instruction between storing the code into memory and executing the code Definition def BranchβarπeπVd rc rb) as if (rc * OJ or (rb ≠ OJ then raise Reservedlnstruction endif d *- RegReadJrd 64) if (dj o) * 0 then raise AccessDisallowedβyvϊrtualAddress endif ProgramCounter «- d 0 3 2 I I 0* Fetchβarπerfl raise TakenBranch enddef Exceptions Reserved Instruction f B Cj / is encoded as 1-U with both instruction fields rd and rc equal 7 B G Z it encoded as B Gl with both instruction fields rd xπd rc equal M H )-/ is encoded as B 1 with both instruction fields rd and rc equal J B I I / is encoded as B Ol U with both instruction fields rd and rc equal 97 MicroUnity MicroUnity Branch Conditional Floating-Point rd offset Equivalencies BLEFsize rerd.target B GE F size rd.rctarget BGF size rc.rd.target B LF size rd.rctarget Selection number format type compare size floating-point F E LG L GE G LE 16 32 64 128 Exceptions /eus Sjstem Architecture l uc, Λug 17, 1999 Instrucuon Set /cus Sjstcm Architecture l uc, Λug 17, 1999 Branch Conditional \ isibilit) I loatinβ Point Branch Conditional Visibility Floating-Point ITicsc operations compare two group floating point operands, and depending on the result of that cυmpanson, conditionally branches to a ncarb code location Operation codes else Format op rc rd target if |op|rc rd|) goto target, 31 24 23 12 I I _op_ I rd I offset Description l " hc contents of registers rc and rd arc compared, as specified by the op field If th result of the comparison is true, cxecuuon branches to the address specified bj the offset held endif Otherwise, execution continues at the next sequential instruction enddef Exceptions Definition 103 MicroUnity MicroUnity Zeus Sjstcm Architecture Tue, Λug 17, 1999 Instrucuon Set /cus Sjstcm Architecture Tuc, Λug 17, 1999 Instruction Set Branch Down Blanch Gateway Branch Down Branch Gateway This operation branches to a location specified by a register, reducing the current privilege This operation provides a secure means to call a procedure, including those at a higher level pm liege level Operation codes Qper?tιoη cpdes I B DOWN Branch down I B GATE I Branch gateway Format Equivalencies B DOWN rd B GATE B GATE 0 bdownfrd) Format 31 24 23 18 17 12 I I 6 5 0 I B MINOR | rd I 0 1 0 | B DOWN | B GATE rb bgate(rb) Description 31 24 23 65 l B MINOR rb I B GATE " Execution branches to the address specified bj the contents of register rd I ' he current privilege level is reduced to the level specified by the low order two bits of the contents of register rd Description Definition I'he contents of register rb is a branch address m the high order 62 bus and a new pnvilcgc def BranchDown|rd rc rbj as level in the low order 2 bits Λ branch and link occurs to the branch address, and the if (rc ≠ 0) or (rb ≠ 0) then pnvilcgc level is raised to the new pnvilcgc level The high order 62 bits of the successor to raise Reservedlnstruction the current program counter is catenated with the 2 bit current execution privilege and endif placed m register 0 d f- RegRead|rd 64| if PπvilegeLevel > dj 0 then If the new pnvilcgc level is greater than the current privilege level, an ocdct of memory data PrivilegeLevel «- dj o is fetched from the address specified by register 1, using the little cndian byte order and a endrf gatcwaj access type Λ GatcwayDlsaUυwcd exception occurs if the onginal contents of ProgramCounter «- .53 ^ 1 1 0* register 0 do not equal the memory data raise TakenBranch enddef If the new privilege level is the same as the current pnvilcgc level > checking of register 1 Exceptions is performed Reserved Instruction Λn ΛcccssDisallowcd cxccpuon occurs if the new pnvilcgc level ts greater than the pπvdcge level required to write the memory data, or if the old pnvilcgc level is lower than the pnvilcgc required to access the memory data as a gateway, or if the access is not aligned on an 8 bjtc boundary Λ Reservedlnstruction cxccpuon occurs if the tc field is not one or the rd field is not zero In the example below, a gateway from level 0 to level 2 is illustrated The gateway pointer, located by the contents of register rc (1), is fetched from mcmoiy and compared against the 105 MicroUnity 106 MicroUnity Zeus Sjstcm Architecture Tuc, Λug 17, 1999 securely reach values in memory. If no sharing of literal pools is desired, register 1 may be used s a literal pool pointer directly. If sharing of literal pools is desired, register 1 may be used with an appropriate offset to load a new literal pool pointer; for example, with a one cache line offset from the register 1. Note that because the virtual memory system operates with cache line granularity, that several gateway locations must be created together. Software must ensure that an attempt to use any octlet within the region designated by virtual memory as gateway cither functions properly or causes a legitimate exception. For example, if the adjacent octlcts contain pointers to literal pool locations, software should ensure that these literal pools art not executable, or that by virtue of being aligned addresses, cannot raise the execution privilege level. If register 1 is used directly as a literal pool location, software must ensure that the literal poo! locations that are accessible as a gateway do not lead to a security violation. Register 0 contains a valid return address and privilege level, the value is suitable for use directly in the Branch-down (B.DOWN) instruction to return to the gateway callee. Definition Branch gateway gxςeptign? This instruction gives the target procedure the assurances that register 0 contains a valid return address and privilege level, that register 1 points to the gateway location, and that the gateway location is ocdct aligned. Register 1 can then be used to ■ 107 - Zeus System Architecture Tuc, Λug 17, 1999 Instruction Set Zeus Sjstem Architecture Tuc, Λug 17, 1999 Instruction Set Branch Gateway Branch I lalt Access detail required by local 1Η Access detail required by global IB Branch Halt Local TB mm Global 1 B miss This operation stops the current thread until an exception occurs Operation codes I B HALT I Branch halt | Format B HALT bhaltd 31 24 23 18 17 12 1 1 6 5 I B MINOR I B.HALT " Description This iπsttuctioπ directs the instruction fetch unit to cease execution unαl an exception occurs Definition def BranchHalt|rd.rc rb| as if |rd * 0) or (rc * 0| or |rb * 0| then raise Reservedlπstrucϋon endif FetchHaltll enddef Exceptions Kesened Instruction ■ 109 - MicroUnity - 110 - Micro Unity /cus S) stcm Architecture i uc, Λug l7, 1999 Instruction Set /cus S) stem Architecture I uc, Λug 17, 1999 Instrucuon Set Bran h Immediate Branch Immediate Ijπk Branch Immediate Branch Immediate Link This operation branches to a locauon that is specified as an offset from the program This operation branches to a locauon that is specified as an offset from the program counter counter saving the value of the program counter into register 0 Operation codes Operation codes | B . I Branch immediate | Branch immediate link Redundancies Format | B 1 target «_ B E rc re target | BLINK I target Format blιnkι|targetj 31 24 23 B I target I B LINK I I offset 24 bι(target) 31 Description i B i r offset 8 24 I ' he address of the instrucuon following this one is placed into register 0 Execuπon branches to the address specified by the offset field Description Definition Fxccuuon branches to the address specified by the offset field def Branchlmmedιateϋnk|otfset| as RegWntefO 64 ProgramCounter + 4] Definition ProgramCounter 4- ProgramCounter + 1 1 offset I I 0 2 | def Branchlmmedιate(offset| as raise TakenBranch enddef ProgramCounter «- ProgramCounter * |offsetJ| I I offset 1 1 0 2 | raise TakenBranch Exceptions enddef Exceptions 113 MicroUnity 114 MicroUnity /eus Sjstem Architecture Tuc, Λug 17, 1999 Instrucuon Set /cus Sjstem Architecture l uc, Λug 17, 1999 Instrucuon Set Branch I .ink. Branch Link Branch Link Kesened Instruction λccess disallowed by \ irtυal address Fhis operation branches to a location specified by a register, saving the value of the program counter into a register Operation codes | B LINK | Branch link Equivalencies BLINK «- B LINK 0=0 B LINK rc <- B LINK 0=rc Format B LINK r =rc 31 24 23 18 17 12 1 1 6 5 I B MINOR I rd I rc I I B LINK " rb <- 0 Description Hie address of the instruction following this one is placed into register rd F xecution branches to the address specified by the contents of register rc Access disallowed exception occurs if the contents of register rc is not aligned on i qu uilet bound it) Reserved instruction cxccpuon occurs if rb is not -icro Pefiniu-on def Branchtinkfrd rc rb] as if rb ≠ 0 then raise Reservedlnstruction endif c «- RegReadfrc 64| if (c and 3) ≠ 0 then raise AccessDisaltowedByVirtua.Address endif Reg rιte|rd 64 ProgramCounter ♦ 4) ProgramCounter *- c^3 2 ' ' u raise TakenBranch enddef 1 15 MicroUnit) MicroUnit) Instrucuon Set l-oad Ixiad Immedulc Load Immediate MicroUnity /eus S>stem Architecture Tuc, Λug 17 1999 Instruction Set /cus System Architecture l uc, Λug 17, 1999 Instrucuon Set l-oad Immediate Selection Format op rd=rc offset rd=op|rc offset) An operand si/c, expressed in bytes, is specified b> the instrucuon A virtual address is computed from the sum of the contents of register rc and the sign extended value of the offset field, muluplied by the operand sue The contents of memory using the specified bjtc order arc read, treated as the si/c specified zero extended or sign extended as specified and placed into register rd If alignment is specified, the computed virtual address must be aligned, that is, it must be an exact muluplc of the sue expressed in bytes If the address is not aligned an 'access disallowed b> virtual address" cxccpuon occurs MicroUnity MicroUnity 7cus System Architecture luc, Λug 17, 1999 Instrucuon Set Zeus Sjstcm Architecture Tuc, Λug 17, 1999 Instrucuon Set ore Store Description Store Λn operand si/c, expressed in bytes, is specified by the instruction Λ virtual address is These operations add the contents of two registers to produce a virtual address, and store computed from the sum of the contents of register rc and the contents of register rb the contents of a register into memory muluplied by operand size The contents of register rd, treated as the size specified, is stored in memory using the specified byte order Operation codes If alignment is specified, the computed virtual address must be aligned, that is, it must be an exact multiple of the sue expressed in bytes If the address is not aligned an "access disallowed by virtual address" exception occurs Definition def Store|op rd rc rb) as Sδ Selection Format op rd.rc.rb op|rd.rc,rb) I S MINOR rd rb _°E- —a U need not specify byte ordering, nor need it specify alignment checking, as it stores a single by te 123 MicroUnit) MicroUnity Zeus S)stcm Architecture Tuc, Λug 17, 1999 luc, Λug 17, 1999 Instruction Set endcase Store Immediate c «- RegReadJrc 128) b <- RegReadfrb 128J d «- RegRead|rd 128) if |C2 o * °l ° r l°2 o * 0| then raise AccessDisallowedByVirtualAddrcss endif Operation codes lock a *- LoadMemoryW|c63 oC 0 3 o o4 or deτ| I I LoadMemoryW[b63 0053 064 order) rf ((CJ27 64 I I |27 64) = a) then StoreMemory|(C63 0^63 064 order d 127 64) StoreMemory{b63 0 °63 0-64 order 0 3 0) endif endlock RegWπte|rd 128 a] enddef Exceptions Selection Format S op I size align order rd rc offset sopιsιzealιgπorder|rd,rc,offset| 31 24 23 18 17 12 1 1 0 1 op 1 rd 1 rc 1 offset 1 127 128 MicroUnity Tuc, Λug 17, 1999 luc, Λug 17, 1999 Instrucuon Set Store Immediate Inplace Operation codes Selection Format S op 164 align order rd®rc,offset rd=sopι64alιgnorder(rd,rc,offset] 31 24 23 18 17 12 I I 0 1 op 1 rd 1 rc I offset | De cription MicroUnity 132 luc, Λug 17, 1999 Instruction Set Format Group Add G op sιzerd=rc rb rd=gopsιze|rc rb) Operation codes f G size rd rb ns Redundancies GADD H size rnd rd=rc,rc G COPY rd=rc GADD H U size rnd rd=rc.rc o G COPY rd=rc Format G op size rnd rd=rc rb Exceptions rd=gopsιzernd|rc,rb) MicroUnity /cus Sjstem Architecture Tuc, Λug 17, 1999 Instruction Set Zeus S>stcm Architecture 'l uc, Λug 17, 1999 Instruction Set Croup boolean Group Boolean Group Boolean These operations take operands from three registers, perform boolean operations on corresponding bits in the operands, and place the concatenated results in the third register Operation codes GAAA rd@rc.rb G BOOLEAN rd®rc,rb,Ob 10000000 GAAΛ I rdΘrerb GJ XX rd®rc,rb GAAS rdΘrerb -» G.XXX rdSrc.rb GADD 1 rd=rc.rb -» G.XOR rd=rc,rb GAND rd=rerb G BOOLEAN rd®rc.rb.0b 10001000 GANDN rd=rc.rb G BOOLEAN rd®rc,rb,0b01000100 G BOOLEAN rd@rb.rc.ι — > G BOOLEAN rd®r , b,i7i5i6i i3i|i2i0 G COPY rd=rc «- G BOOLEAN rd®rc,rc,0b10001000 GNAAA rd@rc.rb «- G BOOLEAN rd®rc.rb,0b01 1 1 1 1 1 1 GNAND rd=rc.rb «- G BOOLEAN rd®rc,rb,0b01 1 101 1 1 GNOOO rd@rc rb «- G BOOLEAN rd®rc,rb,0b00000001 GNOR rd=rcrb «- G BOOLEAN rd®rc.rb.0b00010001 GNOT rd=rc «- G BOOLEAN rd®rc,rc,0b00010001 G NXXX rd@rcrb «- G BOOLEAN rd®rc,rb,0b01 101001 G OOO rd@rc.rb G BOOLEAN rd®rc.rb.0bl 1 1 1 1 1 10 G OR rd=rc,rb G BOOLEAN rd®rc.rb.0bl 1 101 1 10 G ORN rd=rc.rb <— G BOOLEAN rd®rc,rb.0b l 101 1 101 GSAA I rd@rc.rb -» GXXX rd@rc.rb GSAS I rdørcrb -> GJOCX rd®rc,rb GSET rd G BOOLEAN rd®rd.rd.0b 10000001 GSET AND E l rd=rb.rc → G NAND rd=rc,rb GSET AND NE I rd=rb.rc → GAND rd=rc,rb GSETE 1 rd=rb,rc → G.XNOR rd=rc,rb GSETG I rd=rbrc → GANDN rd=rc,rb GSETG U I rd=rb rc → GANDN rd=rb.rc GSETGZ I rd=rc -> G ZERO rd GSETGE I rd=rb.rc → G ORN rd=rc,rb GSETGEZ 1 rd=rc — > G NOT rd=rc GSETL 1 rd=rb.rc — > GANDN rd=rb rc GSETL Z I rd=rc → G COPY rd=rc GSETLE 1 rd=rbrc → G ORN rd=rb.rc GSETLEU I rd=rb.rc → G ORN rd=rc,rb GSETLEZ I rd=rc -» G SET rd GSETNE 1 rd=rb,rc — > G-XOR rd=rc.rb 141 ■ MicroUnit) 142 MicroUnity l uc, Λug 17, 1999 GSETGEU I rd=rb.rc — » G ORN rd=rb.rc if f6=fs then GSETL U I rd=rb.rc → GANDN rd=rc,rb If f2=f| then GSSA rd@rcrb -» G XXX rd®rc rb if f2 then GSSS I rd@rcrb -> G XXX rdβrc rb rc 4- max|trc trb) GSUB 1 rd=rcrb → GXOR rd=rc rb rb - mιn[trc trb) GXNOR rd=rc.rb <— G BOOLEAN rd®rc rb Ob 1001 1001 else GXOR rd=rc.rb <— G BOOLEAN rd®rc,rb ObO 1 1001 10 rc 4- rnιn|trc trb) GXXX rd@rc.rb «- G BOOLEAN rd®rc.rb,0b 100101 10 rb 4- max|trc trb) endif GZERO rd «- G BOOLEAN rd®rd.rd ObOOOOOOOO ih <- 0 il <- 0 I I f 6 I I f 7 I I f 4 I I f 3 I I fn Selection else if f2 then rc *— trb rb «- trc else rc <- trc rb 4- trb endif ih «- 0 il - I I I f6 I I f7 I I f4 I I f3 I I fo endif else ih <- 1 Format if f6 then rc 4- trb G BOOLEAN rd®trc,trb f rb <- trc rd=gbooleanι|rd,rc,rb,f) il <- fi I I f2 I I f7 I I f I I '3 I I fθ 31 252423 12 else I G BOOLEAN ||h| rd zπ I I rb rc «- trc rb <- trb il «- f2 I I f| I 1 f7 I I f4 I 1 '3 I I fo endif endif Description 143 MicroUnit) f$= 1 , and arc encoded by the values of (7, f_j, f3, , for 128 functions half of these in which fs, (2 Λn ft They then share and f] = l, and arc encoded by 32 immediate values for by the table fι to I I ι) 0 I I 1 I I tl 0 Zeus Sjstcm Architecture Tuc, Λug 17, 1999 Instruction Set Zeus S)sttm Architecture Tuc, Λug 17, 1999 Instruction Set Croup Boolean Group Compare Exceptions Group Compare " i " hcsc operation perform calculations on parutions of bits in two general register values, and gi.ner.uc a fixed point arithmetic exception if the condition specified is met Operation codes 147 - MicroUnity 148 MicroUnity Zeus Sjstem Architecture "l uc, Λug 17, 1999 Instruction Set /eus S)stcm Architecture l uc, Λug 17, 1999 Instruction Set Group Compare I G COM NE 128 | Group compare not equal hexlet Equivalencies 149 MicroUnity - 150 MicroUnity Zeus System Architecture Tuc, Λug 17, 1999 Instruction Set Zeus Sj stcm Architecture Tue, Λug 17, 1999 Instruction Set Group Compare Group Compare Description Two values arc taken from the contents of registers rd and rc. The specified condition is calculated on partitions of the operands. If the specified condition is true for any partition, a fixed-point arithmetic exception is generated. This instruction generates no general purpose register results Definifion GCOM.EZ.size rc *- G.COMΛND.E.size rc.rc G.COM.G.size rd.rc -→ G.COM.Lsize rc.rd G.COM.G.U.size rd.rc -» G.CO L.U.size rcrd G.COM.GZ.size rc «= G.COM.L.U.size rc.rc GCOM.GEZ.size rc G.COM.GE.size rcrc G.COM.L.Z.size rc «= G.COM L.size rc,rc G.COM.LEsize rd.rc — G.COM.GE.size rc.rd G.COM.LEUsize rd.rc → G.COM.GE.U.size rc.rd GCOM.LEZ.size rc = G.COM.GE.U.size rc.rc G.COM.NE size r G.COMΛND.NE.size rc.rc G.FIX G.COM.E.128 rO.rO G.NOP G.COM.NE.128 rO.rO Redundancies G.COM.E.size rd.rd <_> G.FIX G.COM.NE.size rd.rd <=> G.NOP Selection for i 4- 0 to 128-sιze by size Format G.COM op.size rd.rc for i ♦- 0 to 128-sιze by size G.COM.opz.size red gcomopsize|rd.rc) 31 24 2: 12 I I 6 5 I G.size rd I op I GCOM~ MicroUnity Zeus System Architecture Tuc, Λug 17, 1999 Instruction Set /eus Sjstcm Architecture l uc, Λug 17, 1999 Instruction Set Group Compare Group Compare I loating point ExςepHQη? fixed point anthmctic Group Compare Floating-point These operations perform calculations on partiuons of bits m two general register values, and generate a floating point arithmetic exception if the condiuon specified is met Operation codes ■ 153 - MicroUπi y 154 MicroUnity Zeus Sjstcm Architecture luc, Λug 17, 1999 Instrucuon Set Zeus Sjstcm Architecture Tuc, Aug 17, 1999 Instruction Set Group Copy Immediate Croup Copy Immediate Group Copy Immediate This operation copies an immediate value to a general register on endif Operation codes a *- imm 11 imm 11 imm 11 imm 11 imm 11 imm 11 imm 11 imm 32 a 4- s 16 11 imm 11 s' 6 11 imm 11 s 16 11 imm 11 s' 6 11 imm 64 a 4- s 48 II imm II s 48 It imm 128 a *- s * 2 II imm endcase RegWrιte(rd 128 a| Equivalencies enddef Exceptions Kesened Instruction GCOPY 18 rd=(Q II 17 ol 4 - GCOPYI 16 rd=|0 II 170 11 17 Ol GSET rd <_ GCOPYI 128 rd=-l GZERO rd 4 - GCOPYI 128 rd=0 Redundancies GCOPYI size rd=-l « GSET rd GCOPYI size rd=0 » GZERO rd Format rd=gcopyιsιze|ι) 31 252*23 18 171615 I GCOPYI |.| rd \slze\ Imm 1 S *- l|6 imm 4~ i|50 Description Λ 128 bit immediate value is produced from the opcrauon code, the si/c field and the 16 bit imm field hc result is placed into register ra Definition def GroupCopylmmediatefop size rd ιmm| as S 4- opo 157 MicroUnit) 158 MicroUnity cus S)stcm Architecture 'luc, Λug 17, 1999 Instruction Set /eus S)btcm Architecture Tuc, Λug 17, 1999 Instruction Set Equivalencies Group Immediate These operations take operands from a register and an immediate value, perform operauons on partiuons of bits in the operands, and place the concatenated results m a second register Operation codes GANDN 1 size rd=rcι m → GAND 1 size rd=rc -imm G COPY rd=rc G OR I 128 rd=rc O GNOT rd=rc G O I 128 rd=rc,0 GORNI size rd=r ιmm — > G ORI size rd=rc,-ιmm GXNO I size rd-rcimm — » G.XOR 1 size rd=rc -imm Redundancies - 159 - MicroUnit) 160 MicroUnity lue Λug 17, 1999 lue Λug 17 1999 Instruction Set Group Immediate Reversed Operation codes Equivalencies -→ ASUB 1 size rd=0 rc → ASUB 1 size O rd=Orc — GSETGEI size rd=ιmm+l rc → G SET GE 1 U size rd=ιmm+ 1 rc — > G SET L 1 size rd=ιmm 1 rc — > G SET L 1 U size rd=ιmm 1 rc 163 MicroUnit) Tuc, Λug 17, 1999 Tuc, Λug 17, 1999 Instruction Set Redundancies G.SETAND.E.Lsize rd=rc.O o G.SET.size rd G.SETAND NE.Lsize rd=rc,0 o GZERO rd GSETA D.E.I.sιze rd=rc.-l o G.SET.EZ.size rd=rc G SETA D.NE.Lsize rd=rc,-l => G.SET.NEZ.size rd-rc G.SET E.l.size rd=rc.O o GSET.EZ.size rd=rc G.SET.GE.I.size rd=rc,0 » G.SET.GE.Zsize rd=rc G.SET.LI.size rd=rc.O <-> G.SET.LZsize rd=rc GSET.NE.I.size rd=rc.O <=> G.SET.NEZ.size rd=rc G.SETGE.I.U.size rd=rc.O <=> G.SET.GEU.Z.size rd=rc G SET L 1 U size rd=rc.O = GSET.LUZ.size rd=rc Selection Format op.size rd=imm.rc rd=opsize|ιmm.rcJ op rd mr Imm sz <- log(sιze}-4 Description Definition Zeus Sjstcm Architecture Tuc, Λug 17, 1999 Instrucuon Set Zeus Sj stcm Architecture Tuc, Λug 17, 1999 Instruction Set Group Immediate Reversed Group Inplace a r*sιze-l i *- ( b ιmze-l i ≥ c,* stze - 1 J"* endfor Group Inplace GSETLI U for i «- 0 to 128-sιze by size These operations take operands from three registers, perform operauons on partitions of ι*sιze-l i «- (10 I I b 1+sιze I J < (0 I I c l+sιze .| ,|J siIe bits in the operands, and place the concatenated results in the third register endfor G SETGE I U Operation codes for i <- 0 to 1 8-sιze by size a .*sιze-l . «- (10 I ' °ι+sιze-l J ≥ (0 ' I Cι*s«e-I ιll s,ze endfor endcase RegvVπtefrd 128 a) enddef Exceptions Format G op sιzerd@rc rb rd=gopsιze|rd,rc,rb) 31 24 23 G size rd rb op Description The contents of registers rel, rc and rb arc fetched The specified operation is performed on these operands I ' he result is placed into register rd 167 MicroUnit) 168 MicroUnity /cus Sjstcm Architecture l uc, Λug 17, 1999 Instruction Set /eus Sj stem Architecture l uc Λug 17, 1999 Instruction Set rotip Reversed Group eversed Equivalencies 171 MicroUnit) 172 MicroUnit) I °P GSETEZsize rd=rc GSETΛNDEsize rd=rc,rc GSETGZsize rd=rc «= G SET L U size rd=rc,rc GSETGEZ size rd=rc «= G SET GE size rd=rc.rc G SET LZ size rd=rc <== G SET L size rd=rc.rc GSETLEZsize rd=rc «= G SET GE U size rd=rc,rc GSETNEZsize rd=rc <- G SETAND NE size rd=rc,rc GSETG size rd^rb.rc → G SET L size rd=rc rb GSETGU size rd-rb.rc → G SET L U size rd=rc,rb GSETLE size rd=rb.rc → GSETGE size rd=rc.rb GSET LEU size rd=rbrc → G SET GE U size rd=rc rb GSETE size rd=rc,rc <= GSET rd G SET NE size rd=rc,rc o GZERO rd G SUB size rd=rc.rc <= GZERO rd GSUB size rd=rc,rc <=> GZERO rd GSUB U size rd=rc,rc <=» GZERO rd GSUB size O rd=rc,rc «-> GZERO rd GSUBU size O rd=rc,rc GZERO rd /cus Sjstcm Architecture l ue, Λug 17, 1999 Instruction Set /eus System Architecture l uc \u B 17 1999 Instruction Set Group Reversed Group Reversed I loating point for i «- 0 to 128 size by size *ι+sιze I I «- (°ι*stze I i = size I t " Group Reversed Floating-point endfor G SETNE These operations take two values from registers, perform a group of floaung point for i «- 0 to 1 8 size by size anthmetic operations on partitions of bits in the operands and place the concatenated 3|*sjze I i <- (όi+size I ι * c ι+sιze I il 51 " results in a register endfor G SETANDE Operation codes for i <- 0 to 128 size by size assize I i «" f( D ι+sιze I I and c ι+sιze I J = Ol* 26 endfor G SETΛND NE for i «- 0 to 128 size by size assize l i <- l(b, +S) ze 1 i * nd c ι+sιze I J * 0) s,ze endfor G SETL for i <- 0 to 128 size by size 3ι+sιze I i «- ll f C = rb) ? (b,*sιze-l i < 0) l b ι*sιze I I < C|+sι» I ι)) s 2e endfor G SETGE for i «- 0 to I 28 size by size «ι*uze 1 I *- ll rc = rb l ? ( b ι»sιze I i ≥ 0] (b S ι» I I ≥ c ι*sιze I ι)) s,zc endfor G SETL U for i *-~ 0 to 1 8 size by size assize- 1 i *- H rc = rfa ) ? l b ι+sιze I i > 0) ({0 I I b 1+sιze i ,J < |0 1 1 c i+we , JHϊ*« endfor GSETGE U for i «- 0 to 128 size by size a.*sιze I i «- ll« = r b| ' (°ι+sιze I J ≤ 0) |(0 I I b,„ sιze , ,) ≥ [0 I I c f ιM , .)})»« endfor endcase Reg πte|rd 128 a] enddef Exceptions 175 MicroUnit) 176 MicroUnity /cus Sjstem Architecture l ue Λug 17 1999 Instruction Set /eus Sjstem Architecture l uc Λug 17 1999 Instruction Set Ex eption; Group Shift Left Immediate Add rhcsc operations take operands from two registers, perform opcranons on partitions of bits in the opcπnds and place the concatenated results in a third register Operation codes Redundancies I GSHL IADD size rd=rdrc I <_> CAAAsize rd®rc rc Format G opsιzerd=rcrbι rd=gopsιze(rc rb ι| 31 24 23 G size rd I rc I rb « " | assert l<ι<4 sh <- i 1 Description The contents of registers rc and rb arc partitioned into groups of operands of the si/e specified Partitions of the contents of register rb arc shifted left b) the amount specified in the immediate field and added to partitions of the contents of register rc yielding a group of results each of which is the sue specified Overflows arc ignored, and yield modular anthmctic results I ' he group of results is catenated and placed in register rd Definition def GroupShιftLeftlmmedιateAdd|sh size ra rb rc) c <- RegRead[rc I28| b «- RegRead|rb 128) for i <- 0 to 128 s«e by size *i'Stze I I - c».si ∑e i , * |bf, Me .| jh I 1 1 n h l endfor RegWrιte|rd 128 a) enddef 179 MicroUnity 180 MicroUnity 7cus Sj stcm Architecture fuc, Aug 17, 1999 Instrucuon Set /cus Sjstcm Architecture Tuc, Λug 17, 1999 Instrucuon Set Group Shift I .eft Immediate Subtract Croup Shift l-eft Immediate Subtract Exceptions Group Shift Left Immediate Subtract ITiese operations take operands from two registers, perform operations on partitions of bits in the operands and place the concatenated results in a third register Operation codes Redundancies I GSHLISUB size rd=rc 1 rc " » G COPY rd=rc Format G opsιzerd=rb ιrc rd=gopsιze|rb i rc| 31 24 23 G size rd rb s issert l≤ι<4 Description l " hc contents of registers rc and rb arc partitioned into groups of operands of the sl/c specified Partitions of the contents of register rc arc subtracted from partitions of the contents of register rb shifted left by the amount specified in the immediate field, yielding a group of results, each of which is the sl/c specified Overflows arc ignored and j ield modular anthmctic results flic group of results is catenated and placed in rcgtstcr rd Definition def GroupShiftLeftlmmediateSubtractlsh size ra rb rc) c 4- RegRead(rc 128) b 4- RegReadjrb 128) for i 4~ 0 to 128 size by size a ι»sire I I «- I mire I sh I I ' °'* 5h l c wαe I I endfor RegWπteJrd 128 a| enddef 181 MicroUnity MicroUnity Zeus Sjstcm Architecture luc, Λug 17, 1999 Instruction Set /cus S)stcm Architecture luc Λug 17, 1999 Instruction Set Group Subtract Hake Group Subtract I lalvc GSUBHU 128 Z Group Subtract Halve I Group subtract halve unsiqned hexlet zero ITiese operauons take operands from two registers, perform operauons on partitions of bits Redundancies in the operands and place the concatenated results in a third register GSUBH size rnd rd=rc rc «=> GZERO rd GSUBHU size rnd rd= rcrc Operation codes <=> G ZERO rd Format G op size rnd rd=rb rc rd=goρsιzernd|rb rc) 31 24 23 21 0 G size rd rb "dl Description fhc contents of registers rc and rb arc partiuoncd into groups of operands of the sue specified and subtracted, halved rounded and limited as specified, yielding a group of results each of which is the s e specified The group of results is catenated and placed in register rd l " hc result of this operation is alwa)s signed, whether the operands arc signed or unsigned Definition def GroupSubtractHalve(op rnd size rd rc rb) c 4- RegRcad|rc I 8| b <- RegRead|rb 1 8) case op of GSUBHC GSUBHF GSUBHN GSUBH2 as «- cs «- bs *- I GSUBHUC GSUBHUF GSUBHUN GSUBHUZ as 4- 1 cs <- bs «- 0 endcase for i *- 0 to 28 size by size p <- ||bs and b s∞ ι| 11 b SIM ,^ ,| [(cs and c sιze ι| 11 c sm ι», ,) case rnd of none N s t- 0 s ' 2e 11 pi Z s *- 0*'« 11 Ps ∞ F s (_ naze* I C s 4- o a " II I 1 endcase 183 MicroUnit) MicroUnity 7cus Sjstcm Architecture Tuc, Λug 17, 1999 Instruction Set /cus Sj tem Architecture luc, Λug 17, 1999 Instrucuon Set Crossbar These operauons take operands from two registers, perform operauons on partitions of bits in the operands, and place the concatenated results in a third register Operation codes Selection MicroUnit 188 MicroUnity /eus Sjstem Architecture Tuc, Λug 17, 1999 Instruction Set /eus Sjstem Architecture lue, Λug 17, 1999 Instrucuon Set Crossbar Exceptions Crossbar Extract l * hcsL operations take operands from three registers, perform operations on parutions of bits m the operands and place the concatenated results in a fourth register O eration codes x EXTRACT I Crossbar extract Format X EXTRACT ra=rd rc rb ra=xextractfrd rc rb) Description The contents of registers rd rc, and rb are fetched The specified operation is performed on these opcnnds i ' he result is placed Into register ra 3J 24 23 16 15 14 13 12 11 109 8 0 I fslze I dpos |x|ι|n|πj l |rnd| gssp | 8 I 1 I I I 2 I ' he table below describes the meaning of each label MicroUnity 192 MicroUnity luc, Λug 17, 1999 /cus Sjstcm Architecture fsize →~*- spos ■ *- fsize -*~« dpos — Crossbar extract ■ *- fsize →~« dpos — Crossbar merge extract Zeus Sjstcm Architecture Tuc, Λug 17, 1999 Instrucuon Set Zeus Sj stcm Architecture Tue, Λug 17, 1999 Instruction Set Crossbar 1* xtract Crossbar I idd Exceptions Crossbar Field These operations take operands from a register and two immediate values, perform operations on partitions of bits in the operands, and place the concatenated results in the second register Operation codes ■ 195 - MicroUmty ■ 196 - MicroUnity Zeus S)stcm Architecture Tuc, Λug 17, 1999 Instruction Set /cus Sjstcm Architecture l ue, Λug 17, 1999 Crossbar Inplace b <- RegReadfrb 128) shift «- b and (sιze-1) Crossbar Short Immediate for i *- 0 to 128 size by size case op of rhcsc operations take operands from a register and a short immediate value, perform XSHRM operations on p iπons of bits in the operands, and place the concatenated results in a a ι+sιze-l \ *- c l+shιft I I H d ι*sιze-l i+shift register XSHLM a ι*sJze-t f «- °Vsfee-l-shιft.l ' ' c whιft.l i Operation codes endfor RegWπteJrd 128 a) enddef E e tions 205 MicroUnit) MicroUnit) Zeus Sjstcm Architecture Tuc, Λug 17, 1999 Instruction Set Zeus Sjstcm Architecture Tuc, Λug 17, 1999 Instrucuon Set Changing the last immediate value h to 1 (X SHUFFLE 256 rd=rc,rb,8,4,l) modifies the When rc and rb arc equal, the table below shows the value of the op field and associated operation to perform the same function on the high-order halves of the 4 partitions values for size, v, and w op size V w op size V w 0 4 1 2 28 64 8 4 1 8 1 2 29 64 1 8 2 8 2 2 30 64 2 8 3 8 1 4 31 64 4 8 4 16 1 2 32 64 1 16 5 16 2 2 33 64 2 16 6 16 4 2 34 64 1 32 7 16 1 4 35 128 1 2 8 16 2 4 36 128 2 2 9 16 1 8 37 128 4 2 10 32 1 2 38 128 8 2 11 32 2 2 39 128 16 2 12 32 4 2 40 128 32 2 13 32 8 2 41 128 1 4 14 32 1 4 42 128 2 4 15 32 2 4 43 128 4 4 16 32 4 4 44 128 8 4 17 32 1 8 45 128 16 4 IS 32 2 8 46 128 1 8 19 32 1 16 47 128 2 8 20 64 1 2 48 128 4 8 21 64 2 2 49 128 8 8 22 64 4 2 50 128 1 16 23 64 8 2 51 128 2 16 24 64 16 2 52 128 4 16 25 64 1 4 53 128 1 32 26 64 2 4 54 128 2 32 27 64 4 4 55 128 1 64 MicroUnity - 216 MicroUnity Zeus Sjstcm Architecture Tuc, Λug 17, 1999 Instrucuon Set Zeus System Architecture Tuc, Λug 17, 1999 Instruction Set When rc and rb arc not equal, the table below shows the value υf the op4..o field and endcase elsei iff associated values for size, v, and w: Ops is the value of h, which controls whether the low- case op4 o of order or high-order half of each paruuon is shuffled into the result 0 27 op4 o size V w b 4- c I I b 0 256 1 2 h ♦- ops 1 256 2 2 for y «- 0 to x-2, for z «- I to x-y- 1 2 256 4 2 if op4 o = ||l7'z-z"z|7-8»y| then 3 256 8 2 for i 4- h'128 to I27*h'l28 4 256 16 2 aι-h 28 - cfc-ii j ,,, i y 1 1 I, |.y, 1 1 ly i ol 5 256 32 2 end 6 256 64 2 endif 7 256 1 4 endfor, endfor 8 256 2 4 28 31 9 256 4 4 raise Reservedlnstruction 10 256 8 4 endcase endif 11 256 16 4 RegWrιte|rd 128 a| 12 256 32 4 enddef 13 256 1 8 Exceptions 14 256 2 8 15 256 4 8 16 256 8 8 17 256 16 8 18 256 1 16 19 256 2 16 20 256 4 16 21 256 8 16 22 256 1 32 23 256 2 32 24 256 4 32 25 256 1 64 26 256 2 64 27 256 1 128 Definition def CrossbarShuffle(major.rdrc,rbopJ c «- RegRead|rc. 128) b <- RegRead|rb 1281 if rc=rb then case op of 0 55 for x *- 2 to 7. for y «- 0 to x-2. for z 4- i to x-y- 1 if op = Ux'>Cx-3'x'x-4'ψl>-lz'z-z\/2*x'Z4yl then for i 4- 0 to 127 a l <- % x 1 1 ly.z I y 1 1 l« I y.r 11 l i ol end endif endfor. endfor, endfor 56 63 raise Reservedlnstruction - 217 - MicroUmty - 218 - MlcroUmty Zeus Sjstem Architecture Tuc, Λug 17, 1999 Instruction Set Zeus Sj stcm Architecture Tuc, Λug 17, 1999 Instrucuon Set Crossbar ϊ>wι//le Crossbar Swizzle Crossbar Ternary These operations perform calculations with a general register value and immediate values, These operauons take three values from registers, perform a group of calculauons on placing the result in a general register. paruuons of bits of the operands and place the catenated results in a fourth register. QperiψPP ςpde Operation codes X SWIZZLE [Crossbar swizzle |X.SELE .8 ' I Crossbar select bytes Format Format X.SWIZZLE rd=rcicopy,iswap op ra=rd,rc,rb rd=xswιzzle(rc,icopy,iswap| ra=op|rd,rc,rb) 31 26 2524 23 18 17 12 I I 6 5 ι 31 18 17 I X.SWIZZLE I Ih I rd I rc I Icopya I Iswapa I rd I rb icopya - icopys o Description iswapa «- iswaps o The contents of registers rd, rc, and rb arc fetched The specified opcranon is performed on ih 4- icopy 6 I I iswap 0 these operands The result is placed into register ra PefimtiQn Description def CrossbarTernarylop rd,rc.rb.ra| as The contents of register rc arc fetched, and 7-bιt immediate values, icopy and iswap, arc d <- RegRead|rd. 128) constructed from the 2-bit ih field and from the 6-blt icopya and iswapa fields I'he specified c 4- RegRead|rc. I28| operation is performed on these operands The result is placed into register rd b ♦- RegRead|rb 128) dc <- d I I c definition def GroupSwi2zlelmmedιate(ιh,rd,rc.ιcopya.ιswapa| as icopy 4— r j I I icopya iswap +- iho I I iswapa c *- RegRead[rc. I28J en for i <- 0 to 127 Exception,; a ι «" * c (ι & lcopyl " iswap endfor RegWrιte|rd. 128. a) enddef Exceptions - 219 - MicroUmty - 220 - MicroUnity /cus Sjstcm Architecture Tuc, Λug 17, 1999 Instruction Set Zeus System Architecture Tuc Λug 17 1999 Instruction Set I nsemble Ensemble Ensemble These operations take operands from two registers, perform operations on partitions of bits in the operands and place the concatenated results in a third register Operation codes Selection Format E op size rd=rc rb rd=eopsιze(rc rb) 31 24 23 18 17 6 5 I E ilze I rd I rc I rb I op I 8 6 6 6 6 Description I o values arc taken from the contents of registers rc and rb I ' he specified opcrauon is performed and the result is placed in register rd Definition def mulfsize h vs v i ws j) as mul 4- ||vsS.v SIK ,.J" ∞e I I v s ze ,„ ,| • (| s&w Me ., < . J |" ∞« I I w sιze ,,j enddef def c «- PolyMultιply|sιze a b) as p|0) <- 0 2- s'» for x «- 0 to size I p|k.l| <- p|k| " a k ? |0"« I I b I I 0 k | 0 2 ' Me endfor c 4- p|sιze| 221 MicroUnit) 222 MicroUnit} Zcui S)!>tcm Architecture 'l uc. Λug 17, 1999 Instruction Stt /cus Sjstcm Architecture luc, Λug 17, 1999 Instruction Set I Jisemble ComoKe I xtract Immediate I nsemble Convoke I .xtract Immediate Format E op size rnd rd®r rb ι rd=eopsιzernd|rd rc rb i) 31 24 23 6 5 4 3 2 I 0 E op rd rb nd| sh | sz < log(sιze| - 3 sh size + 7 log|sιze| i Description I ' he contents of registers rd and rc re c itcπatcd, as specified b) the ortlcr parameter, ind used as a first value Λ second \ aluc is the contents of register rb I ' he s alucs arc partitioned into groups of operands of the sue specified and arc convolved, producing a group of salues ITic group of values ts rounded, and limited as specified, yielding a group of results w hich is the si/e specified Hie group of results is catenated ind placed in register rd / (zero) rounding is not defined for unsigned extract operations and a Resc edlnstrucπoπ exception ts raised if itlempted I (floor) rounding will proper!) round unsigned results downward Hie order irameter of the instruction specifies the order in hich the contents of registers rd and rc -ire catenated ITic choice ts significant because the contents of register rd is oscrwπttcn W hen little endian order ts specified, the contents are catenated so that the contents of register rc is most significant (left) and the contents of register rd is least significant (right) W hen big endnn order is specified, the contents are catenated so that the contents of register rd is most significant (Idr) and the contents of register rc is leist significant (right) Microl nit) MicroUnit) Zeus Sjstcm Architecture Tuc, Λug 17, 1999 Instruction Set Zeus Sj stem Architecture Tuc, Λug 17, 1999 Instruction Set 1 jiiemble Com oh e I loating point I nsemble 1 xtract q[j+gsjzej «- fadd|q(j|. mul|gsιze,m,ι+l28-j.bj)J ECONCFL ECONCFB Ensemble Extract if f-j) & j & gsize = 0 then qtø+gsizej «- faddtøtøj, muf(gsi2e.m.H- 128-j.b j)J These operations take operands from three registers, perform operations on partiuons of else qli+gsizej «- fsub[q[jj mul(gsιze.m.ι+ l28-j+2*gsιze,bj)| bits in the operands, and place the concatenated results in a fourth register endif endcase OpcrfltiQn ςoςjςs endfor ags.ze-1*. i +- PackF[gsfze,q|vsιzeJ,N| endfor θ|27 wsize «- 0 RegWπtefrd. 128. aj enddef Format Exceptions E.opra=rd,rc.rb ra=gop|rd.rc.rb| 31 op rd rb Description 'I ' he contents of registers rd, rc, and rb arc fetched The specified operation is performed on these operands ' fhc result is placed into register ra Bits 31 0 of the contents of register rb specifies several parameters which control the manner in which data is extracted, and for certain operations, the manner in which the operation is performed The posiuoπ of the control fields allows for the source position to be added to a fixid control value for dynamic computation, and allows for the lower 16 bits of the control field tt) be set for some of the simpler extract cases by a single GCOPYI 128 instruction ' 1 he control fields arc further arranged so that if only the low order 8 bits are πυπ /cro, a 128 bit extraction with truncation and no rounding is performed 31 24 23 16 1514 13 12 11 109 8 0 I fsize I dpos |x[s|nH l |rnd| gssp | 8 8 I I I I I MicroUnity MicroUnity Zeus System Architecture Tue, Λug 17, 1999 Instruction Set Zeus System Architecture Tuc, Λug 17, 1999 Instruction Set Ensemble Hxlracl tinsemble F.xtract The table below describes the meaning of each label: An cnscmble-multiply-cxtract-doublcts instruction (E.MU X) multiplies vector ra fh g f c d c b a] with vector rb |p o n m I k j i], yielding the result |hρ go fn cm dl ck bj ai], rounded and limited as specified by rc3)„n. The 9-bit gssp field encodes both the group size, gsize, and source position, spos, according to the formula gssp = 512-4'gsizc+spos. The group size, gsϊzc, is a power of two in the range I ,.128. The source position, spos, is in the range 0..(2*gsizc)-l. The values in the s, n, m, 1, and rnd fields have the following meaning: For the B.SCΛI..ΛDD.X instruction, bits 127..64 of the contents of register rc specifics the multipliers for the multiplicands in registers ra and rb. Specifically, bits 64+2'μsizc- 1..64+gsizc is the multiplier for the contents of register ra, and bits 64+gsizc-1..64 is the multiplier for the contents of register rb. - 237 - MicroUnity MicroUnit)' Instruction Set Ensemble Extract Immediate /eus Sj stcm Architecture l uc, Λug 17, 1999 Instruction Set /cus Sjstem Architecture l uc Λug 17, 1999 Instruction Set I nsemble I xtract Immediate I nsemble 1 xtract Immediate Format E op size rnd rd=rc rb ι rd=eopsιzernd(rc rb i) 31 24 23 IB 17 6 5 4 3 2 1 0 E op rd rb I sz |rπd| sh | sz 4- log(sιze| 3 case op of E EXTRACTI E EXTRACTI U. E MULXI E MULX I U E MULX I M assert size ≥ i ≥ size 3 E MULX I C assert sιze+ 1 ≥ i > size 2 endcase Description hc contents of re ist r:, rc and rb arc partitioned into groups of operands of the sue specified and multiplied added or subtracted, υr arc catenated and partitioned into operands of twice the si/c specified fhc group of values is rounded and limited as specified yielding a group of results each of which is the si/e specified The group of results is catenated and placed m register rd Tor mixed signed multiplies the contents of register rc Is signed and the contents of register rb is unsigned I ' he extraction opcrauon and the result of mixed signed multiplies is signed (zero) rounding is not defined for unsigned extract operations, and a Reservedlnstruction exception is raised if attempted T (floor) rounding will propcrl) round unsigned results downward 245 MicroUnit ) 246 MicroUπ E bl li l i di /eus Sj stem Architecture l uc, Λug 17, 1999 Instruction Set /eus S)stcm Architecture Tuc, Λug 17, 1999 Instruction Set nsemble I xtract Immediate Inplace I nsemble I xtract Immediate Inplace Ensemble Extract Immediate Inplace These operations take operands from two registers and a short immediate value, perform operations on partitions of bits in the operands, and place the catenated result:, in a third register Operation codes Format E op size rnd rdOrc rb i rd=eopsιzernd(rd,rc.rb ι| 31 24 23 6 5 4 3 2 1 0 E op rd rb I sz |rnd| sh | sz «- log(sιzc) - 3 case op of E MULADD X I E MULADDX I U, E MULADDX I M, E MULADDX I C endcase Description Hie content* of registers rc and rb arc partitioned into groups of operands of the sl/c specified and multiplied, added or subtracted, or are catenated and partitioned into operands of twice the si/c specified The contents of register rd arc partitioned into groups of operands of the si/c specified and sign or zero ensemble and shifted as specified, then added 251 MicroUnity 252 MicroUnity Zeus System Architecture Tue, Λug 17, 1999 Instruction Set Zeus System Architecture Tuc, Λug 17, 1999 Instruction Set An ensemble multiply add extract immediate complex doublets instruction Another illustration of ensemble multiply extract immediate complex doublets instruction (E.MU .ΛDD.X.I.C16 or G.MU ΛDD.X.I.U.16) multiplies operand [h g f c d c b a] by (E.MUL.ΛDD.X.I.C 16) : operand |ρ o n m I k j ij, then adding |x w v u t s r q], yielding the result |gp+ho+x go-hp+w cn+fm+v cm-fn+u cl+dk+t ck-d +s aj+bi+r ai-bj+αj, rounded and limited as specified. Note that this instruction prefers an organization of complex numbers in which the real part is located to the right (lower precision) of the imaginary part.: MicroUnity MicroUniry Zeus Sj stem Architecture u 17, 1999 Instruction Set Zeus Architecture Tuc, Λug 17, 1999 rd=eopprecround|rc,rb) 31 24 23 IS 17 12 I I 6 5 0 1 E prec | rd 1 rc 1 rb I op.round I The contents of registers ra and rb arc combined using the specified floating point opcrauon The result is placed in register rc The opcrauon is rounded using the specified rounding option or using round to nearest if not specified If a rounding opuon is specified, the opcrauon raises a floaung point exception if a floaung-point invalid opcrauon, divide by zero, overflow, or underflow occurs, or when specified, if the result is inexact If a rounding opuon is not specified, floaung-point cxccpuons arc not raised, and arc handled according to the default rules , if lFFF. 754 class op prec round/trap add EADDF 16 32 64 128 NONE C F N X Z divide EDIVF 16 32 64 128 NONE C F N X Z RcgWπte|rd 128 a| multiply EMULF 16 32 64 128 NONE C F N X Z enddef complex multiply EMUL CF 16 32 64 MicroUnit) MicroUnity Zeus S)stcm Architecture Tuc, Λug 17, 1999 Instrucuon Set Zeus System Architecture Tuc, Λug 17, 1999 Instrucuon Set 1 nsemble JnpUie I loating point l.nscmble Inplace Floating point Selection endif endcase a ι+prec-l I *- PackF|prec, ai round| endfor RegWπte|rd 128 a) enddef Exceptions Format rd=eopsιze[rd,rc,rbj 31 24 23 E.slze rd rb °P ,J Description The contents of registers rd, rc and rb arc fetched The specified opcrauon is performed on these operands. The result is placed into register rd. Register rd is both a source and dcsunauon of this instrucuon. Definition def mul|sιze v i wj| as mul «- fmul|F(sιze,v SJze .| + , ,|,F(sιze,w sl2e .ι +J j j| enddef def EnsemblelnplaceFloatιngPoιnt(opsfze,rd,rc,rbJ as d «- RegRead(rd 128) c «- RegReadfrc. 128) b «- RegRead(rb. 128) for i 4- 0 to 128-sιze by size di *- Flprecd^prec. i J case op of E MULADDF ai «- fadd|dι. mul|prec,c,i b.ι)| E ULADDC F if (i and precj then ai «- faddfdi. fadd(mul(prec.c.i,b,i-preej, mul|c,ι-prec b ι(|) else ai «- faddfdi. fsub(mul|prec.c,ι.b,ι), mul|prec.c.ι+prec.b,ιtprec)J) endif E ULSUBF ai <- frsubjdi, meιl|prec,c.ι.b,ιJJ E MUL SUB C F if |ι and prec) then ai «- frsuofdi, fadd(mul(prec,c.ι.b,ι-ρrec]. mul[c.ι-prec.bι|)| else ai «- frsubfdi, fsub(mulfprec.cι.b.ι). mul|prec,c,ι+prec,b.t*prec))J - 265 - MicroUnity - 266 MicroUnity /cus Sjbtem Architecture l uc, Λug 17, 1999 Instruction Set Zeus S)stcm Architecture l uc, Λug 17, 1999 Instrucuon Set Format Ensemble Reversed Floating-point E op prec round rd=rb rc These operauons take two values from registers, perform a foup of floating point arithmetic operations on parutions of bits in the operands, and place the concatenated rd=eopprecround|rb,rc) results in a register 31 24 23 12 I I 6 5 0 Operation codes I E prec | rd I rb I op roun 1 Description The contents of registers rc and rb arc combined using the specified floaung point operation ITic result is placed in register rd The operation is rounded using the specified rounding option or using round to nearest if not specified If a rounding opuon is specified, the operation raises a floaung point cxccpuon if a floaung point invalid opcrauon, divide by /cro overflow, or underflow occurs, or when specified, if the result is inexact If a rounding option is not specified, floaung point exceptions arc not raised, and arc handled according to the default rules of iπ 1 754 Definition def EnsembleReversedFloatingPointfop prec round rd rc rb) as c 4- RegRead|rc I28| b <- RegRead|rb 128) for i 4- 0 to 1 8 prec by prec ci 4- Flprec Ci.p,,* | ,| bi <- Flprec b^ec | J ai «- frsubr|cι bi round| «Vprec I i - PackF|prec ai round| cndfor RcgWπtc|rd 128 a| enddef Exceptions Selection 267 MicroUnity MicroUnity Tuc, Λug 17, 1999 Ensemble Unary Selection Format rd=eopsιze|rc] I E.UNARTI Description Ensemble Unary Floatinq-point Definition Exceptions MicroUnity /cus S)stcm Architecture luc, Λug 17, 1999 Instruction Set /cus S)stcm Architecture l uc Λug 17, 1999 Instrucuon Set Selection op prec round/trap copy COPY 16 32 64 128 NONE X absolute ABS 16 32 64 128 value float from FLOAT 16 32 64 128 ONE C F N X Z inteqer integer SINK 16 32 64 128 ONE C F N X Z from float C D F D Z D increase INFLATE 16 32 64 format precision decrease DEFLATE 32 64 128 NONE C F N X Z format precision neqate NEG 16 32 64 128 reciprocal RECEST 16 32 64 128 estimate reciprocal RSQREST 16 32 64 128 square root estimate square root SQR 16 32 64 128 NONE C F N X Z sum SUM 16 32 64 128 NONE C F N X Z Format E op prec round rd=rc rd=eopprecround|rc| 31 24 23 18 17 12 I I 6 5 0 1 E prec 1 rd 1 rc 1 op I E UNARY | Description Hie contents of register rc is us d as th operand of the specified floating point operation fhc result is placed in register rd The operation is rounded using the specified rounding opϋon or using round to nearest if not specified If a rounding option is specified unless default exception handling is specified, the operation raises a floating point exception if a floating point invalid operation, divide by zero, overflow, or underflow occurs, or when specified, if the result is inexact If a rounding option is not specified or if default exception handling is specified, floating point cxccpuons arc not raised and are handled according to the default rules of IFFF 754 279 MicroUnit) 280 MicroUnity Zeus Sj stem Architecture Tuc, Λug 17, 1999 Instruction Set Zeus S)itcm Architecture Tuc, Λug 17, 1999 Instruction Set Wide Multiply Matnx Wide Multiply Matnx Wide Multiply Matrix Format W op size order r< These instructions take an address from a general register to fetch a large operand from memory, a second operand from a general register, perform a group of operations on rd=wopsιzeorder(rc,rb) partitions of bits in the operands, and catenate the results together, placing the result in a 31 2423 1817 1211 65 43 0 general register |W MINOR orderj rd 1 rc 1 rb | sz | op | Operation codes Description The contents of register rc is used as a virtual address, and a value of specified si/c is loaded from memory A second value is the contents of register rb The values are partitioned into groups of operands of the sue specified The second values are multiplied with the first values, then summed, producing a group of result values The group of result values is catenated and placed in register rd I ' he mcmor} multiply instrucuons ( MU MΛ I , W MUL MAT C, W MUL.MΛ F M, \v MUI MA I P. W MULMΛ I U) perform a partitioned array multiplj of up to 8192 bus, that is 64x128 bits ITic width of the arraj can be limited to 64, 32, or 16 bits, but not smaller than twice the group si c, by adding one-half the desired si/c in bytes to the virtual address operand 4, 2, or 1 Hie array can be limited vertically to 128, 64, 32, or 16 bits, but not smaller than twice the group size, by adding one half the desired mcmor) operand si/c in bytes to the wrtua! address operand Hie virtual address must cither be aligned to 1024/gsι/c bytes (or 512/gst/e for W MUL MA I C) (v. ith gsize measured in bits), or must be the sum of an aligned address and one half of the si/c of the memory operand in bytes and/or one-quarter of the si/c of the result m bytes An aligned address must be an exact muluplc of the si/c expressed in bytes If the address is not valid an "access disallowed b) virtual address" exception occurs Λ wide multiply doublets instrucuon (W MUL MAT, W MULMAT M, W MUL MAT P, W MUL MΛ I U) multiplies memory |m31 m30 ml mOj with vector |h g f c d c b a], Selection yielding products Jhm31 +gm27+ +bm7+am3 hm28+gm24+ +bm4+am0] 283 MicroUnity 284 MicroUnity /cus System Architecture l uc, Λug 17, 1999 Instruction Set Wide Multiply Matrix I xtract Λ wide multiply matrix extract-complex doublets instrucuon ( MUI-MΛ1 X with n set in rb) muluphcs memory (m31 m30 m29 m2 ml mOJ with vector [h g f c d c b a], yielding sgsize 508 51 1 the products [am7+bm6+cml5+dml4+cm23+fm22+gnl31+hm30 . am2 bm3+cml0- dml l +cmlβ fml9+gm26 hm27 aml +bm0-r-cm9+dm8+cml7+fml6+gm25+hm24 a O bml+cm8-dm9+cml6-ft7+gm24-hm25J, rounded and limited as specified Wide multiply extract matrix complex doublets Definition - 291 - - 292 - MicroUnity * lue, Aug 17, 1999 luc.Λuμ 17, 1999 MULMATXIC 16 CB Wide Multiply Matrix Extract Immediate MULMATXIC 16CL WMULMATXIC 16FB These instructions take an address from a general register to fetch a large operand from WMULMATXIC I6FL mcmorj, a second operand from a genera! register, perform a group of operations on WMULMATXIC I6NB partitions of bits in the operands, and catenate the results together, placing the result in a WMULMATXIC I6NL general register WMULMATXIC I62B WMULMATXIC I6ZL Operation codes WMULMATXIC32 C B WMULMATXIC32CL MU MATXIC32FB WMULMATXIC32FL WMULMATXIC32 B WMULMATXIC32NL WMULMATXIC32ZB WMULMATXIC32ZL WMULMATXIC64CB WMULMATXIC64CL WMULMATXIC64FB WMULMATXIC6 FL WMULMATXIC6 NB WMULMATXIC64NL WMULMATXIC64ZB W MUL MAT X I C 642 L WMULMATXIM8CB W ULMATXIM8CL WMULMATXIM8FB WMULMATXIM8FL WMULMATXIM8NB MULMATXIM8NL WMULMATXIM8ZB MULMATXIM8ZL WMULMATXIMI6CB WMULMATXIMI6CL WMULMATXIMI6FB MULMATXIM I6FL U MATXIM I6NB WMULMATXIM I6NL WMULMATXIM I6ZB WMULMATXIM I6ZL WMULMATXIM 32 C B WMULMATXIM32CL WMULMATXIM32FB WMULMAT.XIM32FL WMULMATXIM32NB WMULMATXIM32NL WMULMATXIM32ZB WMULMATXIM32ZL WMULMATXIM64CB WMULMATXIM64CL 296 MicroUnity Zeus System Architecture Tuc, Λug 17, 1999 Instruction Set Zeus System Architecture Tuc, Λug 17, 1999 Instruction Set Wide Multiply Matrix Galon Λ ielc-muItiply-matrix-Galois instruction ( .MUI-MΛT.G) multiplies memory |m255 Igsize «- log|gsize| m254 ... ml mOJ with vector [p o n m l k j i h g f c d c b aj, reducing the result modulo •' C|g S)Ze -4 o ≠ ° then polynomial [qj, yielding products [(pm255+om247+...+bm31+aml5 mod q) raise AccessDisallowedByVirtualAddress (pm254+om246+...+bm30+aml4 mo ) ... (pm248+om240+...+bml6+am0 mod q)J: endif if C3. lgsrze-3 ≠ ° ^ en wsize <- |c and (0-c|| 1 1 0 4 t «- c and |c-lj else wsize *- 128 t «- c endif Iwsize «- log|wsize| if tfwsire+6-lgsize..iwsize-3 * 0 then d|128) msize «- |t and |0-tJJ 1 1 0 4 VirtAddr «- t and ft- 1 J else msize *- ?28*wsize gsize VirtAddr t- t endif case op of W.MUL MAT.G.B: order 4- B W MUL MAT.G L: b(β| order *- L endcase m *- LoadMcmory(c,VιrtAddr,msιze,order| ra(128) for i ♦- 0 to wsize-gsize by gsize q|0J t - 0 '9S'« Wide multiply matrix Galois for j «- 0 to vsize-gsize by gsize k - n-wsize*j 8 gsι2e Definition qϋ*gsize| 4- qfjj * PolyMultiply|gsize.m k *g S i 2 e-i..k.o gsize-t.jl def c 4- Poly Multiply (size.a.bj as cndfor ρ|0] <- Q 2 ' ύκ agsιze-1+ι J <- PolyResidue|gsιze.qIvsize|,b gsJ2e .t..ol for «- 0 to size- 1 endfor p{k+l| 4- p|k| * a k ? (0 s ' ze - k I I b 1 1 0 k ) : 0 " size 3127. wsize *~ 0 endfor Reg rιte|ra, 128, a) c <- pjsizej enddef enddef Exceptions def c 4- PofyResidue|sιze.a,b) as for k «- size- 1 to 0 by -1 endfor c *- p|s.zeJ SIZ( .,o enddef def w'idcMultiplyGalois{op,rd.rc,rb,ra| d 4- RegReadJrd. I28| c - RegRead(rc, 64| b 4- RegRead|rb, 128} gsize ♦- 8 - 309 - MicroUnity - 310 - MicroUnity Zeus Sj ste Architecture Tuc, Λug 17, 1999 Instrucuon Set /cus System Architecture l uc Λug 17, 1999 Instruction Set Wide Translate Fsuliπg to initialize the entire table is a potential security hole, as an instruction n with a small-depth table could access table cntncs previously initialized by an instruction with a large-depth table We could close this hole either by initializing the These instrucuons take an address from a general register to fetch a large operand from entire table, even if extra cycles are required, or by masking the index bits so that memory, a second operand from a general register, perform a group of operations on only the initialized portion of the table is used Initializing the enure table with no partitions of bits in the operands, and catenate the results together, placing the result in a penalty in cycles could require writing to as many as 128 entries at once, which is general register quite likely to cause circuit complications Initializing the entire table with writes to only one entry at a time requires writing 256 cycles, even when the table is smaller Operation codes Masking the index bits Is the preferred solution Masking the index bits suggests that this instrucuon, for tables larger than 256 entries, may be useful for a general-purpose memory translate function where the processor performs enough independent load operauons to fill the 128 bits Thus, the 16, 32, and 64 bit versions of this function perform equivalent of 8, 4, 2 withdraw, 8, 4, or 2 load-indexed and 7, 3, or 1 group-extract instructions In other words, this instruction can be as powerful as 23, 11, or 5 existing instrucuons The 8-bit version is a single-cycle opcrauon replacing 47 existing instructions, so these are not as big a win, but nonetheless, this is at least a 50% improvement on a 2-ιssue processor, even with one-cycle per load timing To make this possible, the default table size would Format become 65536, ^ and 2°^ for 16, 32 and 64-bit versions of the instruction WTRANSLATE size order rd=rc rb For the big cndian ver ion of this instrucuon, in the definition below, the contents of register rb is complemented This reflects a desire to organize the table so that the rd=wtranslatesιzeorder(rc rb) lowest addressed table entries arc selected when the index is zero In the logical implementation, complementing the index can be avoided by loading the table rd rb I " *-} memory differently for big-endian and httle-endian versions A consequence of this shortcut is that a table loaded by a big-endian translate instruction cannot be used by a little endian translate instruction, and vicc-vcrsa Description Hie \ irtual address must either be aligned to 4096 by tes or must be the sum of an aligned I'he contents of register rc is used as a virtual address, and a value of specified si/c is loaded address and one half of the sue of the memory operand in bytes and/or the desired total from memory A second value ts the contents of register rb The values arc parutioncd into table width in by tes An aligned address must be an exact muluplc of the size expressed in groups of operands of a sue specified The low order bytes of the second group of values b)tcs The s e of the memory operand must be a power of two from 4 to 4096 b) tcs, but arc used as addresses to choose cntncs from one or more tables constructed from the first must be at least 4 Umes the group si7c and 4 umes the total table width If the address is not value, producing a group of values The group of results is catenated and placed in register valid an access disallowed by virtual address ' cxccpuon occurs rd By default, the total width of tables is 128 bits, and a total table width of 128, 64, 32, 16 or 8 pςftpitipη bits, but not less than the group size may be specified by adding the desired total table width in bytes to the specified address 16, 8, 4, 2, or I When fewer than 128 bits arc specified the tables repeat to fill the 128 bit width The default depth of each table is 256 entries or in b)tcs is 32 umcs the group si/c in bus Λn opcrauon may specify 4, 8, 16, 32, 64, 128 or 256 entr) tables, b) adding one half of the memory operand s e to the address Table index values arc masked to ensure that only the specified portion of the table is used Tables with just 2 cntncs cannot be specified, if 2 entry tables arc desired, tt is recommended to load the cntncs into registers and use G MUX to select the table cntncs MicroUnity 314 MicroUnity Zeus Sy stem Architecture Instrucuon Set l uc, Λug 17, 1999 Memory Management Memory Management This section discusses the caches, the translation mechanisms, the memory interfaces, and how the multiprocessor interface is used to maintain cache coherence Overview The Zeus processor provides for both local and global virtual addressing, arbitrary page si/cs, and coherent cache multiprocessing The memory management system is designed to provide the requirements for implementation of virtual machines as well as virtual memory Λll facilities of the memory management system arc themselves memory mapped, in order to provide for the manipulauυn of these faclliαcs by high level language, compiled code The translation mechanism is designed to allow full byte at a time control of access to the virtual address space, with the assistance of fast cxccpuon handlers Pnvilcgc levels provide for the secure transition between insecure user code and secure sjste fjcilmes Instructions execute at a privilege, specified by a two bit field in the access infoπ tioπ /ero is the least privileged level, and three is the most pπvilcgcd level RegWπte|rd 128 a] of the memory management system enddef In general terms, the memory management starts from a local virtual address The local virtual address is translated to a global virtual address by a LTB (Local Translation Buffer) In turn, the global virtual address is translated to a physical address by a GTB (Global MicroUnity 316 MicroUnity /eus System Architecture uc, Λug 17, 1999 Memory Management /cus System Architecture l uc, Λug 17, 1999 Memory Management l-ocal I ranslation Buffer l-ocal Translation Buffer 1 ranslation Buffer) One of the addresses, a local vinual address, a global virtual address, or A local virtual address space is specified by the following a physical address, is used to index the cache data and cache tag arra , and one of the addresses is used to check the cache tag array for cache presence Protecuon informauon is assembled from the LTB, G TB, and optionally the cache tag, to determine if the access is legal This form vanes somewhat, depending on implementation choices made Because the I 1T3 leav es the lower 48 bits of the address alone, indexing of the cache arrays with the local virtual address is usually indenucal to cache arrays indexed by the global virtual address I lowcvcr, indexing cache arrays by the global virtual address rather than the physical address local virtual address space specifiers produces a coherence issue if the mapping from global virtual address to physical is many to one Physical address Starung from a local virtual address, the memory management system performs three actions There arc as many LTB as threads, and up to 2^ (8) entries per LTB Each entry is 128 bits, in parallel the low order bits of the virtual address arc used to dirccdy access the data in the with the high order 64 bits reserved The physical address of a LTB entry for thread th, entry cache, a low order bit field is used to access the cache tag, and the high order bits of the en, byte b is virtual address are translated from a local address space to a global virtual address space 63 2423 1918 76 43 0 f llowing these three actions, operations vary depending upon the cache implementation [ FFFF FFFF 0A00 0000 i3 ? | th | 0 |en| b | The cache tag may contain cither a physical address and access control information (a 40 12 phy sically tagged cache), or may contain a global virtual address and global protection information (a virtually tagged cache) Definition I or a physically tagged cache, the global virtual address is translated to a phy sieal address by def data Hags 4~ AccessPhysicalLTBIpa opwdata) as the G l"B, which generates global protection informauon The cache tag is checked agninst th <- 2 3 i the physical address, to determine a cache hit In parallel, the local and global protection en 4- pa 6 4 information is checked if |eπ < |1 1 1 0 LE || and (th < T| and |pa| 8 6=°l then case op of Tor a virtually tagged cache, the cache tag is checked against the global virtual address, to data 4- 0 64 I I LTBArray|th||cn| determine a cache hit, and the local and global protecuon informauon is checked If the cache misses the global virtual address is translated to a physical address by the G 1 B, which LocalTB|th|(en) ♦- wdata&3 0 also generates the global protecuon informauon Local Translation Buffer endif enddef I ' he 64 bit global virtual address space is global among all tasks In a multitask environment, requirements for a task local address space aπsc from operauons such as the UNIX "fork" funcuon, in which a task is duplicated into parent and child tasks, each now having a unique Entry Format virtual address space In addiuoπ, when switching tasks, access to one task s address space These 16 bit values arc packed together into a 64 bit LTB entry as follows must be disabled and another task's access enabled 63 48 47 32 31 16 15 Zeus provides for poruons of the address space to be made local to individual tasks, with a Im la Ix translation to the global virtual space specified by four 16 bit registers for each local virtu il 16 I 16 TZZ iP_ space I'he registers specify a mask sclccung which of the high order 16 address bus arc checked to match a particular value, and if they match, a value with which to modify the The I 1 B contains a separate context of register sets for each thread, indicated b) the th vinual address Zeus avoids setting a fixed page sue or local address si/c, these can be set by index above Λ context consists of one or more sets of Im/la/lx/lp registers, one set for software conventions each simultaneously accessible local virtual address range, indicated by the en index above This set of registers is called the "I-ocal TB context," or I TB (Local Translation Buffer) 317 MicroUnity 318 MicroUnity B in such systems Wc need to be able to guarantee set per thread, cither the code or the data must use address range, as must the LTB and GTB must be raised to two sets for data to guarantee forward progress for arbitrary code (but still be limited to using global addresses for reserving the implemcntauon of the that in such a configurauon, for an address space idcnuficr the virtual address is bits marked as ' local * below may be used as I T B translation on the value program counter, provided that a check is the unmasked upper 16 bits by the add or increment If fails, an ΛcccssDisallowcdByVirtualΛddress dcscnpuon parameter is performed on the local address U no checking is pπvilcge lev el required for each memory acuon (g), as well as memory and cache attributes of ordering (so), cache disable (cd), and wntc with corresponding bits in the G I protect field to memory region /eus Sy stem Architecture Tuc, Λug 17, 1999 Memory Management /cus Sy stem Architecture l uc, Λug 17, 1999 Memory Management Global 1 ranslation Buffer Field Description In the first implementation there is one G 1 B, shared by all four threads (GT=2, T=4) I ' he G I B has 128 cntncs (G=7) The meaning of the fields are given by the following table Per clock cycle each G I B can translate one global virtual address to a physical address y ielding protection information as a side effect A G rB miss causes a software trap Hits trap is designed to permit a fast handler for Global 1 BMiss to be wnttcn m software by pcrmitung a second GTB miss to occur as an cxccpuon rather than a machine check Physical address There miy be as many G I " B as threads and up to 2 ' cntncs per GTB I ' he phy sical address of a G 1 entry for thread th, entry en, byte b is pefmition 63 2423 1918 43 0 def ga L oca (Protect *- LocaiTraπslatιon|th ba la pi) as 1 FFFF FFFF 0C00 0000 63 2 4 | th | en l b l if IB & (ba 6 3 48 * te 63 48l then raise AccessDisallowedByVirtualAddress endif Note thjt in the di above, the low order GT bits of the th value arc Ignored reflecting me <- NONE that 2^T threads share a single G I " B Λ single G I B shared between threads appears for i «- 0 to |1 I I 0 LE ) I tf l'a 6 3 48 & LocalTB|t J|il 6 3 48 | = LocarrBfthJIiM/ 3 then multiple times in the address space GTB entries arc packed together so that entries in a me *- i GTB are consecutive endif endfor Definition if me - NONE then if ControfRegister p i*8 then def data flags «- AccessPhysιcalGTB(paopwdata) as raise LocalTB iss th 4- pa 2 I I 0 QT endif en <- paiβ ga <- la if |cn < (I I I 0 G || and (th < T] and |paι 8 , G τ 19 = °l lnen LocalProtect *- 0 case op of R ga *- (va 63 4S - LocafTBfthllmefci j 6 ) I I va 47 0 data 4- GTBArray|th5 GτJ|en| LocalProtect «- LocalTB[thJ|me| j 5 0 W endif GTBArray|th 5 Gτll en l «- wdata enddef endcase else Global Translation Buffer data «- 0 endif Global virtual addresses which fail to be accessed in either the L/C, the M fl3, the B I * B or enddef Fin are translated to physical references in a table here named the Global I ranslation Buffer, (GI B) Entry Format Fich processor may have one or more G I B\ with each 1 * B shared by one or more Fach G l"B entry is 128 bits I'he format of a GTB entry is threads I ' he parameter GT, the base two log of the number of threads which share a G 1 * B, and the parameter T, the number of threads, allow computation of the number of G I Bs (T/2GT * ), and the number of threads which share each G I " B (2 **) If there are two G fBs and four threads (GT- 1, T=4), GTB 0 services references from threads 0 and 1 and G 1T3 1 services references from threads 2 and 3 \2\ MicroUnity MicroUnit) Zeus S tem Architecture Memory Management /eus S stem Architecture l uc, Λug 17, 1999 Memory Management Global I tanstalion Buffer GTB Regiilert 63 76 0 or physical address range ae can φeafy Consequently ae art encoding the sι as a single additional bit to 1 gs 1 qpO | the global address in order to allou for attribute information 57 7 Definition 127 7271 64 1 PX 1 sp" 1 6 5 4 3 2 0 gpO: I 0 | 0 f da | so | cc | 1 1 1 1 3 71 7069 6867 6665 64 gp l 1 q 1 X 1 w I r I Field Description gs = ga + sι/c/2 256 ≤ sue ≤ 2 M t ga, global address, is aligned (a muluplc of) si/c px = pa Λ ga pa ga, and px are all aligned (a multiple of) si/c ITic meaning υf the fields arc given by the following table GTB Registers Because the processor contains multiple threads of execution, even when taking virtual memory exceptions it is possible for two threads to nearly simultaneously invoke software G 1 B miss cxccpuon handlers for the same memory region In order to avoid producing improper G I state in such cases, the GTB includes access facibues for mdivisibly checking and then upda ng the contents of the G l3 as a result of a memory write to specific addresses Λ 128 bit wπte to the address G I BUpdatcfill (fill= 1) as a side effect, causes first a check of the global address specified in the data against the G I " B If the global address check results lf the enure contents of the G B entry is zero (0), the entry will not match any global in a match, the data is directed to wπte on the matching entry If there is no match, the address at all If a zero value is written, a zero value is read for the G I B entry Softw re address specified by GTBLast is used, and G TBLast is incremented If incrementing must not wntc a zero value for the gs field unless the enure entry is a zero value GT Last results in a veto value, G TBLast is reset to GTBHrst, and GTBBump is set Note that if the size of the updated value is not equal to the size of the matching entry, the global It is an error to write GTB entries that muluply match any global address, all G 113 entries address check may not adequately ensure that no other entries also cover the address range must have unique, non overlapping coverage of the global address space I lardwarc may of the updated value fhc operation is unpredictable if muluplc cntncs match the global produce a machine check if such overlapping coverage is detected, or may produce any address physical address and protection informauon and conunuc execution I ' he G rBUpdatcPill register is a 128 bit memory mapped locauon, to which a wnte I mitwg the C IB entry si to 128 btts αllous up to replace enints αtomicαllj (mtb α single store opcrauon per formes the opcrauon defined above Λ read opcrauon returns a zero value The operation), a Inch is less complex than the previous design, n ubiώ the mask portion o as first reduced, then format of the GTBUpdatcfill register is idcnucal to that of a GTB entry other entries changed, then the mask ts expanded However, it is limiting the amount ofattnbnie information MicroUnity /eus System Architecture l ue Λug 17, 1999 Memory Management /cus System Architecture l uc Λug 17, 1999 Memory Management Memory Hanks Program Microcache program references ) Cache addresses arc presented to the I OC as required and physical I ' he following graph shows the rates for both 8 total ports and 16 total ports addresses arc checked against cache tags as required Memory Banks The I /C has two banks each servicing up to four requests fhc I OC his banks each sc cing it most one request Assuming random request addresses, the following graph shows the expected rate at which requests arc serviced by mulu bank/mulu port memories that have 8 total ports and divided into 1, 2, 4 or 8 interleaved banks The LZC is 2 banks, each with 4 ports, and the I OC is 8 banks each 1 port Bank Arbitration Note significant differences between 8 port systems and 16 port systems even when used with a maximum of 8 applied references In parucular, a 16 bank 1 port system is better than a 4 bank 2 port system with more than 6 applied references Current layout csumatcs would require al out a 1 °/ area increase (assuming nυ savings from smaller/ impler sense amps) to switch to a 16 port I OC with a 22% increase in 8 reference throughput Program Microcache I — ♦— 8-bank 1 port LOC -*~4 bank 2 port 2 -bank 4 port LZC ^ 1 bank 8 port I Λ program microcache (PMC) which holds only program code for each thread may optionally exist and does exist for the lmual implemcntauon The program microcache is Note a small difference between applying 12 references versus 8 references for the I OC (6 5 flushed by reset or by cxccuung a B BΛRJUER instrucuon The program microcache is vs 5 2), and for the LZC (7 8 vs fi 9) This suggests that simplifying the system to produce always clean, and is not snooped by writes or otherwise kept coherent, except by flushing as two address per thread (program+load/storc or two load/store) wJI not overly hurt indicated above Hie microcache is not altered by wπung to the LTB or GTB, and software performance Λ closer simulauon, taking into account the scqucnual nature of the program must execute a B BΛRRJFR instrucuon before expccung the new contents of the I TB or and load/store traffic may well yield better numbers as threads will tend to line up in non GTB to affect determination of PMC hit or miss status on program fetches interfering patterns and program microcachmg reduces program fetching 327 MicroUnity 328 MicroUnity /eus S tem Architecture l ue, Λug 17, 1999 Memory Management /eus System Architecture l uc, Λug 17, 1999 Memory Management Wide Microcache Level Zero Cache In the initial implemcntauon, the program microcache holds simple loop code ITic By making these checks on the physical addresses, wc do not need to be concerned about microcache holds two separately addressed cache lines Branches or cxecuuon beyond this changes to the virtual memory mapping from virtual to physical addresses, and the virtual region cause the microcache to be flushed and refilled at the new address provided that the memory state can be freely changed without invalidauπg any WMC addresses arc executable by the current thread The program microcache uses the B I UN V and B I UN I to accelerate fetching of program code when possible I ' he program Absent any of the above changes, the WMC is only valid if it contains the contents relevant microcache generally functions as a prefetch buffer, except that short forward or backward to the current wide (W) instruction lo check this with minimal use of the front end units, branches within the region covered maintain the contents of the microcache each WMC entry contains a first tag with the thread and address register for which it was last used If the current wide (W) instrucuon uses the same thread and address register, it may Program fetches into the microcache arc requested on any cycle in which less than two proceed safely Any intervening wntcs to that address register by that thread invalidates the load/store addresses arc generated by the address unit, unless the microcache is already full WMC thread and address register tag System arbitrauon logic should give program fetches lower pnonty than load/store references when first presented, then equal priority if the fetch fa s arbitration a certain If the above test fails, the front end is used to fetch the address register and check its number of times 'he delay until program fetches have equal priority should be based on the contents against a second WMC tag, with the physical addresses for which it was last used If expected time the program fetch data will be executed, it may be as small as a single c cle or the tag matches, it may proceed safely Λs detailed above, any intervening stores or cache greater for fetches which are far ahead of the execution point coherency action by any thread to the physical addresses invalidates the WMC entry Wide Microcache If both the above tests fail for all relevant WMC entries, there is no alternative but to load the data from the virtual memory system into the WMC The front end units are responsible for generating the necessary addresses to the virtual memory system to fetch the entire data A wide microcache (WMC) which holds only data fetched for wide (W) instructions may block into a VC MC option illy exist and does exist for the iniua! implementation, for each unit which implements one or more wide (W) instructions I or the. first implementation it is anucipated that there be eight VC MC entries for each of the two X units (for W SWIT CH instrucuons), eight WMC entncs for each of the two R units I'he wide (W) instrucuons each operate on a block of data fetched from memory and the (for VC MUI instrucuons) and four WMC entries for the single 1 unit The total number of contents of one or more registers, producing a result in a register Generally, the amount of WMC address ngs requires is 8*2*1 + 8*2* 1 +4* 1 *16 = 96 cntncs data in the block exceeds the maximum amount of data that the memory system can supply in a single cycle, so caching the memory data is of particular importance Λll the wide (W) I ' he number of WMC address tags can be substantially reduced to 32+4=36 entπes by instructions require that the memory data be located at an aligned address an uldrcss that is making an implementation restriction rcquinng that a single translation block be used to a muluplc of the si/c of the memory data, which ts always a power of two translate the data address of W TΛBI F instrucuons With this restriction, each W TABLE VC MC entry uses a conuguous and aligned physical data memory block, for which a single I'he wide (W) instructions are performed by functional units which normally perform address tag can contain the relevant informauon The si/e of such a block is a maximum of execute or "back end" instrucuons, though the loading of the memory data requires use of 4096 by tes Hie restriction can be checked by examining the size field of the referenced the access or "front end" funcuonal units To mintmi/c the use of the ' front end ' G I B entry functional units special rules arc used to maintain the coherence of a wide microcache (VC MQ Level Zero Cache Fxccution ot a wide (W) instruction has a residual effect of loading the specified memory data into a wide microcache (VCMC) Under certain conditions, a future wide (W) instruction Fhc innermost cache level, here named the Zero Cache,' (I- is full) associative may be able to reuse the MC contents and indexed b) global address Fntπes in the L/C contain global addresses and previously fetched data from the memory sjstcm I'he I./C is an implementation feature, not visible to Tirst of all, any store or cache coherency action on the ph sical addresses referenced by the the /cus architecture WMC will invalidate the contents The minimum translauoπ unit of the virtual memory system, 256 bytes, defines the number of physical address blocks which must be checked by Fntπcs in the I /C are also used to hold the global addresses of store instructions that have any store A WMC for the W TΛBLF instrucuon may be as large as 4096 by tes, and so been issued but not jet completed in the memory system the I ZC entry may also contain requires as many as 16 such physical address blocks to be checked for each WMC entry A the data associated with the global address, as maintained cither before or after updating WMC for the W SWI1 CI I or W MUL * instructions need check only one address block for with the store data When it contains the post store data, results of stores aj be forwarded each WMC entry, as the maximum si/c is 128 bytes directl ) to the requested reference 329 MicroUnity 330 MicroUnity /cus System Architecture l uc, Λug 17, 1999 Zeus System Architecture l uc, Λug 17, 1999 With an 1,/C hit, data is returned from the LXC data, and protecuon from the I /C tag No def data protect, alid dirty match +- LevelZeroCachef?ead|gaJ as LOC access is required to complete the reference eo «- g^ match <- NONE AH loads and program fetches arc checked against the I-ZC for conflicts with entries being for i *- 0 to LevclZeroCacheEntπes/2 I used as store buffer On a I ZC hit on such entries, if the post store data is present, data may lf (9^63 5 = LevelZeroTag|eo|(ι| then be returned by the I-ZC to satisfy the load or program fetch If the post store elata is not match «— i present, the load or program fetch must stall until the data ts available endif endfor if match = NONE then With an I ZC miss, a vicum entry is selected, and if dirty , the victim entry is written to the raise LevelZeroCacheMiss I OC The LOC cache is accessed, and a valid I 7C entry is constructed from data from the else I OC and tags from the LOC protection informauon data *- cevelZeroData[eol[match| j27 o valid «- LevelZeroDataJeo|ImatchJ |4j jjg ΛU stores arc checked against the L/C for conflicts, and further cause a new entry in the dirty <~ Leve.ZeroData|eo||matchJι s9 1 I /C, or take over" a previously clean I ZC entry for this purpose Unaligned stores may protect «- evelZcroDataIeo)fmatch) ]67 i60 require two entries in the I /C At Qmc of allocauon, the address is filled in endtf enddef I wo operations then occur in parallel 1) for πtc back cached references the remaining bytes of the hcxlct arc loaded from the LOC (or I /C), and 2) the addressed by tes arc filled Level One Cache in with data from data path If an exception causes the store to be purged before rcurcmcnt, the I /C entry is marked invalid, and not wnttcn back When the store is retired, the I /C I ' he next cache level, here named the 'Level One Cache,' (I OC) is four set associauvc and entry can be written back to LOC or external interface indexed by the physical address The eight memory addresses arc partitioned into up to eight addresses for each of eight independent memory banks The I OC has a cache block st/c of Structure 256 bytes with tnclet (32 byte) sub blocks l " hc eight memory addresses arc paruuoned into up to four odd addresses and four ev en I ' he 1 OC m iy be partitioned into two sections one part used as a cache, and the remainder addresses used as niche memory Niche memory is at least as fast as cache memory, but unlike cache, never misses to ma memory Niche memory may be placed at any virtual address, I'he L/C contains 16 fully associative cntncs that may each contain a single hexlet of data at and has physical addresses fixed in the memory map The nl field in the control register e en hexlet addresses (I /CF), and another 16 cntnes for odd hcxlct addresses (I /CO) I he configures the partitioning of I OC into cache memory and niche memory maximum capacity of the I-ZC is 16*32=512 bytes I ' he I OC data memory is (256+8)x4x(128+2) bits, depth to hold 256 cntncs in each of four I ' he tags for these entries arc indexed by global virtual address (63 5) and contain access sets each entry consisung of one hcxlct of data (128 bits), one bit of panty, and one spare control informauon, detailed below bit I ' he addiuυπal 8 entries in each of four sets hold the I OC tags with 128 bits per entry for 1 /8 of the total cache, using 512 bytes per data memory and 4k. bytes total The address of entries accessed associauvcly is also encoded into binary and provided as output from the tags for use in updaung the LZC, through its wπtc ports l " hcrc arc 128 cache, blocks per set, or 512 cache blocks total The maximum capacity of the I OC is 128k by tes Used as a cache the I OC is paruuoned into 4 sets, each 32k by tes Physically the I OC is partitioned into 8 interleaved physical blocks each holding 16k bytes 8 bit rwxg JTic phy ical address p 63 0 is partitioned as below into a 52 to 54 bit tag (three to five bits arc duplicated from the following field to accommodate use of portion of the cache as 16 bit vabd niche), 8 bit address to the memory bank (7 bits arc physical address (pa), 1 bit is virtual address (v)), 3 bit memory bank select (bn), and 4 bit byte address (bt) AH access to the 16 bit dirty I OC are in units of 128 bits (hcxlcts), so the 4 bit byte address (bt) docs not apply here The shaded field (pa v) is translated via nl to a cache tdcnuficr (ci) and set idenπfier (si) and 4 bit IDS address presented to the I OC as the I OC address to I OC bank bn 16 bit protecuon MicroUnity 332 MicroUnity /cus Sy stem Architecture Tue, Λug 17, 1999 eu Sj stem Λrehitecturc l ue, Aug 17, 1999 The I OC address (ci 1 1 si) uniquely identifies the cache location, and this LOC address is associate ely checked against all MTB cntncs on changes to the LOC tags, such as by cache block replacement, bus snooping, or software modification Λny matching MTB cntncs arc flushed, even if the MTB entry specifies a different global address - this permits iddrcss aliasing (the use of a physical address with more than one global address With an L C miss, a victim set is selected (LOC vicu selection is dcscnbcd below), whose contents, if any sub-block is modified, is written to the external memory Λ new LOC entry ts constructed with address and protection information from the GTB, and data fetched from external memory. The diagram below shows the contents of I OC data memory banks 0 7 foi iddresses 0 2047. % - 335 - MicroUniry ■ 336 - MicroUnity Memory Management Memory Management I-evel One Cache l-*vel One Cache if op=R then I - 339 - MlcroUnir I I wdj 0 changes in clock αming or When testing the LOC while test environment with may not reliably fail tesung stress, may be set to stress these bits arc cleared (00), (01, 10, 11) Self testing should failures combined defects in the LOC data array each 128 bits of memory data panty over the 128 bits of pressed into service by setting a bank data, one bit for parity, and bit to be selected from a bit 2) aπ control) with a 128 bit value To set to the control with cither bit /eus System Architecture l uc, Λug 17, 1999 Memory Mamgement /cus System Architecture l uc Λug 17, 1999 Memory Management 124 set (1) or bit 126 set (1) l o set bit 124 of the LOC redundancy control, a value is Cache Control wπttcn to the control with both bit 124 set (1) and 126 set (1) When the T OC redundancy control register is read, the process is reversed by sclccung the pc bit instead of control bit The cache may be used in one of five wa s, depending on a three bit cache control field (cc) 124 for the \ aluc of bit 124 if control bit 126 is zero (0) in the I I * B and G7 B The cache control field may be set to one of seven states NC, CD, WT WA, PF, SS, and LS l * hιs system can remove one defective column at an even bit position and one defective column at an odd bit position within each I OC block for each defective column location, x, I OC control bit must be set at bits x, x+2, x+4, x+6, If the dcfccuvc column is in the panty location (bit 128), then set bit 124 only The following table defines the control bits for parity bit 126 and bit 124 (other control bits arc same as values wnttcπ) fhc /cus processor controls cc as an attribute in the LTB and GTB, thus software may set this attribute for certain address ranges and clear it for others Λ three bit field indicates the Physical address choice of caching according to the table above The maximum of the three bit cache control field (cc) v dues of the I I " B and G IB indicates the choice of caching, according to the table The I OC redundancy controls are accessed explicitly by uncached memory accesses to above particular physical address ranges No Cache Fhc phy sical address of a I OC redundancy control for I OC bank bn byte b is 63 _76 _43 0 No Cache (NC) is an attribute that can be set on a LTB or G TB translation region to FFFF FFFF 09000000 63 7 |bn| b indicate that the cache is to be not to be consulted No changes to the cache state result from reads or writes with this attnbutc set, (except for accesses that directly address the cache ua memory rmppcd region) definition Cache Disable f data <- AccessPhysicalLOCRedundancylpa op wd) as bank *- pa^ 4 Cache Disable (CD) is an attnbutc that can be set on a LTB or GTB translation region to case op of indicate that the cache is to be consulted and updated for cache lines which arc already R present, but no new cache lines or sub blocks arc to be allocated when the cache does not rd 4- LOCRedeindancyjbankl already contain the addressed memory contents data <- rd, 2 I2s "( rd l26 ? K-124 rd| 28 JI lrd| 23 0 w The Socket 7 bus also provides a mechanism for supporting chip sets to decide on each rd 4- |wdj 26 or wd| 2 |l l dj 2 7 1251 l| dι 26 and wdj 24 JI lwd f 23 0 access whether data is to be cached, using the CAC1 IE# and EN# signals Using these OCRedundancyfbankJ 4- rd signals, external hardware may cause a region selected as WT, WA or PF to be treated as endcase enddef CD ITiis mechanism is only active on the first such access to a memory region if caching is enabled as the caehc ma) satisfy subsequent references without a bus transaction Memory Attributes Write Through He Ids in the LfB, GTB and cache tag control vanous attributes of the memory access in the specified region of memory ITiese include the control of cache consultation, updating, Write 111 rough (WT) is an attribute that can be set on a LI * B or G J B translauon region to allocation, prefetching, coherence, ordenng, victim selection, detail access, and cache indicate that the wntcs to the cache must also immediately update backing memory Reads to prefetching addressed memory that is not present in the cache cause cache bπcs or sub blocks to be 343 MicroUniη MicroUnity /eus S j stem Architecture l ue Λug 17 1999 Memory Management /eus Sj stem Architecture l uc Λug 17 1999 Memory Management Memory λtlπbutes Memory Attributes allocated VC πtes to addressed memory that is not present in the cache does not modify entry associated with the nearby address Prefetching is terminated if an attempted cache fill cache state results in a bus response that is not cacheable Prefetches arc implemcntauon dependent behavior and such behavior may vary as a result of other memory references or other bus fhc Socket 7 bus also provides a mechanism for supporung chip sets to decide on each acuvity access whether data is to be written through using the PWT and WB/W1 # signals Using these signals, external hardware may cause a region selected as WA or PF to be treated as SubStrcam WT ITus mechanism is only active on the first wnte to each region of memory as on subsequent references, if the cache line is in the Exclusive or Modified state and writeback SubStrcam (SS) is an attribute that can be set on a LTB or G TB translation region to caching is enabled on the first reference, no subsequent bus operation occurs, at least until indicate that references in this region axe to be selected as the next victim on a cache miss In the cache line is Hushed parucular cache misses which normally place the cache line in the last to be victim state, instead place the cache line in the first to be vicum state except relative to cache lines in the Write Allocate I state Wπte allocate (WA) is an attnbutc that can be set of a I 1 " B or GTB translaϋon region to In other respects the SS attribute is handled in the manner of the WA attribute SubStrcam indicate that the processor is to allocate a memory block to the cache when the data is not is considered an implemcntauon dependent feature, and an implementation may choose to previously present in the cache and the operation to be performed is a store Reads to implement region with the SS attnbutc exacdy as with the WA attπbute addressed memory that is not present in the cache cause cache lines or sub blocks to be allocated for cacheable data, wnte allocate is generally the preferred policy, as allocating the The SubStrcam attribute is appropnatc for regions which arc large data structures in which data to the cache reduces further bus traffic for subsequent references (loads or stores) or the processor is likely to reference the memory data just once or a small number of times, the data V πtc allocate never occurs for data which is not cached A write allocate brings in but for which the cache permits the data to be fetched using burst transfers By making it a the data immediately into the Modified state pnonty for vicum ation, these references are less likely to interfere with caching of data for which the cache performs a longer term storage funcuon Other ' socket 7 processors have the ability to inhibit wπtc allocate to cached locauons under certain conditions, related by the address range K6, for example, can inhibit write UneStream allocate in the range of 15 16Mbyte, or for all addresses above a configurable limit with 4Mb te granularity Pentium has the ability to label address ranges over which wπtc allocate Ϊ ncStrcam (LS) is an attπbute that can be set on a LTB or GTB translaπon region to can be inhibited indicate that references in this region arc to be selected as the next vicum on a cache miss, and to enable prefetching In particular, cache misses which normally place the cache line in PreFetch the last to be v icum state instead place the cache line in the first to be victim state except relative to cache lines in the I state Prefetch (PF) is an attribute that can be set on a I ITB or G TB translation region to indicate that increased prefetching is appropriate for references in this region Fach program fetch In either respects the LS attnbutc is handled in the manner of the PF attπbute I incStrcam load or store to a cache line that or docs not already contain all the sub blocks causes a is considered an implemcntauon dependent feature, and an implemcntauon may choose to prefetch allocation of the remaining sub blocks Cache misses cause allocation of the implement region with the SS attnbutc exactly as with the PF or WA attπbutcs requested sub block and prefetch allocation of the remaining sub blocks Prefetching does not necessarily fill in the enure cache line, as prefetch memory references arc performed at a Ijkc the, SubStrcam attribute, the LmcStrcam attnbutc is particularly appropnatc for regions lower pnonty to other cache and memory reference traffic A limited number of prefetches for whch large data structures arc used in sequcnual fashion By prefetching the enure cache (as low as one in the initial implementation) can be queued, the older prefetch requests arc line, memory traffic is performed as large sequential bursts of at least 256 bytes, maximizing terminated as new ones arc created the available bus utilization In other respects, the PF attribute is handled in the manner of the WA attnbutc Prefetching is considered an implementation dependent feature, and an implemcntauon may choose to implement region with the PF attribute exacdy as with the WA attnbutc Implcmcntauons may perform even more aggressive prefetching in future versions Data may be prefetched into the cache in regions that arc cacheable, as a result of program fetches loads or stores to nearby addresses Prefetches may extend beyond the cache line associated with the nearby address Prefetches shall not occur beyond the reach of the GTB MicroUnity 346 MicroUnity /eus System Architecture Tuc, Λug 17, 1999 Memory Management /cus System Architecture l uc, Λug 17, 1999 Memory Management Memory Vlnbtitei Memory Attribute! Cache Coherence On the Pentium processor, for a cache line in the S state, an internal store operation causes a wnte through cycle and a transition to the F state On the /cus processor the mesi field is Cache coherency is maintained by using MESI protocols, for which each c che line (256 changed to F Other tnclcts in the cache line arc invalidated by clearing the tv bits, the MFSI by tes) the cache data is kept in one of four states M, E, S, I state is effectively changed to the I state for these other tnclcts When illocating data into the cache due to a store operation, data is brought immediately into the Modi tied state, setting the mesi field to M lf the previous mesi field is S, other tnclcts which are valid arc invalidated by clearing the tv bits If the previous mesi field is F, other tnclcts arc kept valid and therefore changed to the M state When allocating data into the cache due to a load opcrauon, data is brought into the Shared state, if another processor reports that the data is present in its cache or the mesi field is already set to S the Fxclusivc state, if no processor reports that the data is present in its cache and the mesi field is currcndy E or I, or the Modified state if the mesi field is already set to M I ' he determination is performed by dnving PW1 low and checking whether Wlϊ/Wl # ib sampled high, if so the line is brought into the Fxclusivc state (Sec page 202 (184) of the K6 2 documentation) Strong Ordering I ' he state is contained in the mesi field of the cache tag Strong ordering (so) is an attnbutc which permits certain memory regions to be operated In addition, because the ' Socket 7" bus performs block transfers and cache coherency with strong ordering in which all memory operations are performed exactly in the order actions on tnclct (32 byte) blocks, each cache line also maintains 8 bits of tnclct valid (tv) specified by the program and others to be operated with weak ordenng, m which some state Each bit of tv corresponds to a tnclet sub block of the cache line, bit 0 for by tes 0 31, memory operations may be performed out of program order bit 1 for by tes 32 63, bit 2 for bytes 64 95, etc If the tv bit is zero (0), the coherence state for that tnclct is I, no matter what the value of the mesi field If the tv bit is one (1) the flic /eus processor controls strong ordering as an attnbutc in the M B and Gl B, thus coherence state is defined by the mesi field If all the tv bits arc cleared (0) the mesi field software may set this attribute for certain address ranges and clear it for others A one bit must also be cleared, mdicaung an invalid cache line field indicates the choice υf access ordering A one (1) bit indicates strong ordering while a zero (0) bit indicates weak ordering Cache coherency activ ity generally follows the protocols defined bj the Socket 7 bus i defined by Penuum and K6 2 documentation I lowcvcr, because the coherence state of a W ith weak ordering the memory system may retain store operations in a store buffer cache line is represented in only 10 bits per 256 bytes (1 25 bits per tnclct), a few state indefinitely for later storage into the memory system, or unαl a synchronization operation to transisuons arc defined diffcrcndy The differences arc a direct result of attempts to set anj address performed by the thread that issued the store operation forces the store to tπclcts within a cache line to different MES states that cannot be represented fhc data occur I-oad operations may be performed in any order, subject to requirements that they be structure allows any tnclct to be changed to the I state, so state transitions in this direction performed logically subsequent to pπor store operations to the same address, and match the Pentium processor exactly subsequent to pπor synchronization operations to any address Under weak ordenng it is permitted to forward results from a retained store opcrauon to a future load operation to the On the Pentium processor, for a cache line in the M state, an external bus Inquiry cycle that same address Operations arc considered to be to the same address when any bytes of the does not require invalidation (INV=0) places the cache line in the S state On the /cus operation arc in common Weak ordering is usually appropriate for convcnuonal memory processor, if no other tnclct in the cache hne is valid, the meet field is changed to S lf other regions w hich are side effect free triclcts in the cache bnc arc valid, the mesi field is left unchanged and the tv bit for this tnclct is turned off, effectively changing it to the 1 state With strong ordenng the memory system must perform load and store operauons in the order specified In particular, strong ordered load operations arc performed in the order On the Pentium processor, for a cache line in the I state an external bus Inquiry cycle that specified and all load operations (whether weak or strong) must be delayed until all previous does not require invalidation (INV=0) places the cache line in the S state On the /eus strong ordered store operations have been performed, which can have a significant processor, the mesi field is changed to S If other triclcts in the cache line arc valid, the performance impact Strong ordering is often required for memory mapped I/O regions, MESI state is effectively changed to the S state for these other tnclcts where store operations may have a side effect on the value returned by loads to other 347 MicroUnity 348 MicroUnity /eus System Architecture l uc, Λug 17, 1999 Memory Management /cus System Architecture l uc, Λug 17, 1999 Memory Management Cache flushing and invalidations can cause cache sets to be cleared out of sequential order If Victim selection encoding LOC tag bits the current highest pnonty for replacement is a valid set, the flushed or invalidated set is made highest pnonty for replacement At even more extreme values of the niche limit register (nl in the range 125 127), not only is the bit normally used to hold the vs bit is usurped for use as a physical address bit, but vsc «— (mcsι[vsc]=I) 5 vsc fs there is a deficit of one or two physical address bits In this case, the number of sets can be reduced to encode physical address bits into the vicum selection, allowing the choice of set When updating the hexlet containing vs|l] and vs|0J, the new values of vsjl] and vs|0] are to indicate physical address bits 9 or bits 9 8 On each replacement a new vsc valus is computed from vsjlj «— vs|3J Λ vscj gvsc ♦— gvsc + 1 vs[0] 4— vs|2] Λ vsco si «— p»9 I J (nl=127) > pag gvsc Λ paιo When updating the hcxlct containing vs|3] and vs|2], the new values υf vs|3] and vs|2] arc I ' he algorithm above is designed to uuli/c all four sets on scqucnual access to memory vs|3J *— vsjlj Λ vscj Detail Access vs[2J «— vs|0J Λ vsco Detail access is an attribute which can be set on a cache block or translation region to Software must iniuabic the vs bits, but any state is legal Tor example, to set the pnonty indicate that software needs to be consulted on each potential access, to determine whether (highest to lowest) to (0, 1 2 3), vβc must be set to ObOO There are many legal solutions that the access should proceed or not Setting this attnbutc causes an cxccpuon trap to occur, by yield this vsc value, such as vs|3] ♦— 0, vs[2J «— 0,vs|lj «— 0,vs|0J «— 0 which software can examine the virtual address, by for example, locating data in a table, and if indicated causes the processor to conunuc cxecuuon In continuing ephemeral state is set Full victim selection ordering for additional sets upon returning to the rc execution of the instruction that prevents the exception trap from recurring on this particular re execution only The ephemeral state is cleared as soon as the lo extend the full victim ordenng scheme to eight sets, 3*7—21 bits are needed, ahtch divided among two instrucuon is cither completed or subject to another exception, so DctailΛccess exceptions tags is I f bits per tag this is someu hat generous as the minimum required ts 8*7*6*5*4*3*2*1 —40320 can recur on a subsequent execution of the same instruction Alternatively, if the access is ordenngs ahtch can be represented in as few as 16 bits Extending the full victim ordenng four set scheme not to proceed execution has been trapped to software at this point which can abort the above to represent the first 4 pnonttes in binary, but to use 2 bits for each of the next 3 pnonties requires thread or take other corrective action 3+3+3+3+2+2+2 - 18 bits Representing fewer distinct ordenngs can further reduce the number of bits used As an extreme example using the simplified scheme above with eight sets requires only 3 bits ahtch I ' he detail access attπbute permits specification of access parameters over memory region on divided among two tags is 2 bits per tag arbitrary byte boundaπes This is important for emulators, which must prevent store access to code which has been translated, and for simulating machines which have byte granulanty Victim selection without LOC tag bits on segment boundaries The detail access attribute can also be appbcd to debuggers, which have the need to set breakpoints on byte level data, or which may use the feature to set code At extreme values of the niche limit register (nl in the range 121 124), the bit normally used breakpoints on instruction boundaries without altcπng the program code cnabbπg to hold the vs bit is usurped for use as a physical address bit Under these conditions, no vsc breakpoints on code contained in ROM value is maintained per cache bnc, instead a single, global vsc value is used to select victims for cache replacement In this case, the cache consists of four lines, each with four sets On A one bit field indicates the choice of detail access A one (1) bit indicates detail access while each replacement a new si valus is computed from a zero (0) bit indicates no detail access Detail access is an attribute that can be set by the I ITΪ the G 1 B, or a cache tag gvsc +— gvsc + 1 The table below indicates the proper status for all potential values of the detail access bits in « «- vsc * an ιo the I TB G I B and Tag 'he algorithm above is designed to uuh/c all four sets on sequential access to memory 351 MicroUnity 352 MicroUnity /eus System Architecture l uc, Λug 17 1999 Memory Management /eus System Architecture l uc, Λug 17, 1999 Memory Management Memory λttnbutet Micro 1 rantlatton Buffer detail access bit in the cache tag is again reset to ?cro, and another AcccssDetailRcquircd exception occurs Settings of the niche limit parameter to values that require use of the da bit in the LOC tag for retaining the physical address usurp the capabihty to set the Tag detail access bit Under such conditions, the Tag detail access bit is effectively always zero (0), so it cannot inhibit ΛcccssDctailRcquircdByl 113, inhibit ΛccessDctadRcquiredByG lTJ, or cause ΛccessDctailRcquiredBy l ag I ' he cxecuuon of a /eus instruction has a reference to one quadlet of instruction, which may be subject to the DctailΛccess exceptions, and a reference to data, which may be unabgncd or wide ITiese unaligned or wide references may cross GTB or cache boundaπcs, and thus involve multiple separate reference that arc combined together, each of which may be subject to the DctailΛcccss exception There is sufficient information in the DctailAcccss exception handler to process unaligned or wide references The implementation is free to indicate DctailΛcccss exceptions for unaligned and wide data ITic first eight rows show appropriate activities when all three bits arc available I ' he dcfii! references either in combined form, or with each sub reference separated Tor example, in access attπbutcs for the I T B, G JT5, and cache tag work together to define whether and an unaligned reference that crosses a Gl B or cache boundary, a DetailΛcccss exception may which kind of detail access cxccpuon ttap occurs Generally, setting a single attribute bit be indicated for a portion of the reference I ' he exception may report the virtual address and causes an exception, while setting two bits inhibits such exceptions In this way a detail sue of the complete reference and upon conunumg, may inhibit reoccurrence of the access exception can be narrowed down to cause an exception over a specified region of DctailΛccess exception for any portion of the reference Λltcrnauvely, it may report the memory Software generally will set the cache tag detail access bit only for regions in which virtual address and si/c of only a reference portion and inhibit reoccurrence of the the LIB or G * I B also has a detail access bit set Because cache activity may flush and refill DctailAcccss exception for only that portion of the reference subject to another cache bncs implicit), it is not generally useful to set the cache tag detail access bit alone but DctailΛcccss exception occurnng for the remaining portion of the reference if this occurs, the ΛcccssDctadRequircdBy fag cxccpuon catches such an attempt I'he next two rows show appropropnatc activities on a G I B miss On a G I B miss, the Micro Translation Buffer detail access bit in the GfB is not present If the I FB indicates detail access and the G fB misses, the AccessDetailRequiredByLT B cxccpuon should be indicated If software ITie Micro I ranslation Buffer (M TB) is an implemcntauon dependent structure which continues from the ΛcccssDctailRcquircdByl 1T3 exception and has not filled in the G I reduces the access traffic to the G I B and the I OC tags The M FB contains and caches the G l Miss exception happens next Since the G fBMiss cxcction is not a continuation informauon read from the G 1 B and I OC tags, and is consulted on each access to the I OC exception a re execution after the GTBMiss exception can cause a rcoccurcncc of the AcccssDctatlRcquircdByl FB cxccpuon Alternatively, if software continues from the l o access the I OC a global address is supplied to the Micro I ranslation Buffer (MTB), ΛcccssDctailRcquircdByl I"B cxccpuon and has filled in the G fB, the which associatively looks up the global address into a table holding a subset of the I OC tags AccessDctailRcquircdByF TB exception is inhibited for that reference, no matter what the In addition, each table entry contains the physical address bits 14 8 (7 bits) and set identifier status of the G I B and Fag detail bits, but the re executed instruction is still subject to the (2 bits) required to access the I OC data ΛccessDctailRequiredByG l B and ΛccessDctailRcquiredBy I ag exceptions In the first /eus implementation, there are two MTB blocks M I B 0 is used for threads 0 I ' he last four rows show appropnatc activities for a cache miss On a cache miss, the dctiil and 1 , and M 1 * B 1 is used for threads 2 and 3 Per clock cycle, each MTB block can check access bit in the tag is not present lf the I T B or GTB indicates detail access and the cache for 4 simultaneous references to the LOC Fach MTB block has 16 cntnes misses the AccessDetailRequiredByLTB or AccessDctailRcquircdByG rB exception should be indicated If software continues from these exceptions and has not filled in the cache a Fach M 1 * B entry consists of a bit less than 128 bits of information, including a 56 bit global cache miss happens next If software continues from the ΛcccssDctailRcquiredBy I I B or address tag 8 bits of privilege level required for read, wnte, execute, and gateway access, a ΛcccssDctailRcquircdByG i B exception and has filled in the cache, the previous exception is detail bit, and 10 bits of cache state indicating for each tnclct (32 bytes) sub block, the MFSI inhibited for that reference, no matter what the status of the Tag detail bit, but is still subject to the ΛcccssDctailRcquircdByTag cxccpuon When the detail bit must be created from a cache miss, the intial value filled in ts zero Software may set the bit, thus turning off AcccssDetailRcquircd exceptions per cache line If the cache line is flushed and refilled the 353 MicroUnity 354 MicroUnity fB, bit 7 from the LΛ) and set bank selected from bits 6 4 of suppbcd from the MTB replacement I ' he MTB and a wπtcback The G fB and protection information M I B or BI B is filled the PA to determine which the correct physical address, filled and the I OC access mechanisms are MTB Activity that modifies cntncs arc flushed /cus System Architecture 'l uc, Λug 17, 1999 Memory Management /eus System Architecture Tuc, Λug 17, 1999 Memory Management Program I raiitlalion Buffer Microarchitecture A write to the G FBUpdatc register that updates a matching entry, a write to the GFBUpdatcF.il register, or a direct wnte to the GTB all flush relevant cntncs from the Global Virtual Cache M 1"B Ml B flushing is accompbshcd by searching MTB entnes for values that match on the ' he initial implementation of Zeus contains cache which is both indexed and tagged by a gt field with the GFB entry that has been modified Each such matching M 1 " B entry ts physical address Other prototype implementations have used a global vitual address to index flushed and/or tag an internal cache This section will define the required charactcnstics of a global vitually indexed cache TODO The M I B is kept synchronous with the LOC tags, particularly with respect to MFSI state On an LOC miss or LOC snoop, any changes in MESI state update (or flush) MTB cntncs which physically match the address If the MTB may contain less than the full physical Memory Interface address it is sufficient to retain the LOC physical address (ci 1 1 v 1 1 si) Dedicated hardware mechanisms arc provided to fetch data blocks in the levels zero and one Block Translation Buffer caches, provided that a matching entry can be found in the MTB or GTB (or if the MMU is disabled) Dedicated hardware mechanisms arc provided to store back data blocks in the level zero and one caches, regardless of the state of the MTB and GTB When no entry is to Zeus has a per thread "Block Translation Buffer" (B 1 * B) The BTB retains G 113 information be found in the GTB, an exception handler is invoked cither to generate the required for unctchcd address blocks The BFB is used in parallel with the MI " B exactly one of the infυπnation from the virtual address, or to place an entry in the GTB to provide for BTB or Mi B may translate a particular reference When both the BTB and MTB miss, the automatic handling of this and other similarly addressed data blocks GTB is consulted, and depending on the result, the block is filled into cither the M FB or B I B as appropriate In the first Zeus implementation, the B FB has 2 entries for each thread I'he initial implementation of Zeus accesses the remainder of the memory system through the ' Socket 7 interface Via this interface, Zeus accesses a secondary cache, DRΛM B FB entries cover any power of two granulanty , as they retain the si/c information from the memory, external ROM memory, and an I/O system The size and presence of the secondary G 1"B B entries contain no MESI state, as they only contain uncached blocks cache and the DRAM memory array, and the contents of the external ROM memory and the I/O system arc vanablcs in the processor environment Fach B FB entry consists of 128 bits of information, containing the same information in the same format as a GTB entry Microarchitecture Niche blocks arc indicated by G FB information, and correspond to blocks of data that arc retained in the I OC and never miss Λ special physical address range indicates niche blocks Fach thread has two address generation units, capable of producing two abgncd, or one For this address range, the BTB enables use of the I OC as a niche memory, generating the unaligned lo id or store operation per cycle Alternatively, these units may produce a single ' set select" address bits from low order address bits There is no checking of the LOC tags load or store address and a branch target address for consistent use of the LOC as a niche the nl field must be preset by software so that LOC cache replacement never claims the LOC niche space, and only BI B miss and Fach thread has a I 13, which translates the two addresses into global virtual addresses protection bits prevent software from using the cache portion of the LOC as niche Fach pair of threads has a MTB, which looks up the four references into the LOC The PTB Other address ranges include other on chip resources, such as bus interface registers, the provides for additional references that arc program code fetches control register and status register, as well as off chip memory, accessed through the bus interface Each of these regions arc accessible as uncached memory In parallel with the M1 * B, these four references are combined with the four references from the other thread pair and partitioned into even and odd hcxlct references Up to four Program Translation Buffer references arc selected for each of the even and odd portions of the LZC One reference for each of the eight banks of the LOC (four arc even hcxlcts, four arc odd hcxlcts) arc selected from the eight load /store /branch references and the PTB references Later implementations of Zeus may optionally have a per thread "Program 1 ranslation Buffer" (PTB) The FFB retains GTB and LOC cache tag information The P B enables Some references may be directed to both the I ZC and LOC, in which case the L/C hit generation of LOC instruction fetching in parallel with load/store fetching 'he PTB is causes the I OC data to be ignored An I-ZC miss which hits in the MTB is filled from the updated when instruction fetching crosses a cache line boundary (each 64 instructions in I OC to the \J Λn I /C miss which misses in the MTB causes a G FB access and I OC straight line code) ITic P B functions similarly to a one entry MTB, but can use the tag access, then an M I B fill and I OC access, then an I.ZC fill sequential nature of program code fetching to avoid checking the 56 bit match Fhc P TS is flushed at the same time as the MTB Pnonty of access (highest/lowest) cache dump, cache fill load program, store The initial implementation of Zeus has no PTB the MTB suffices for this function 357 MicroUnity 358 MicroUnity /cus System Architecture Tuc, Λug 17, 1999 Memory Management Zeus System Architecture Tuc, Λug 17, 1999 Memory Management I-oad ore Snoop The ' Socket 7 bus requires certain bus accesses to be checked against on chip caches On a bus read, the address is checked against the on chip caches, with accesses aborted when requested data is in an internal cache m the M state, and the E state, the internal cache is changed to the S state On a bus write, data wπttcn must update data in on chip caches l meet these requirements, physical bus addresses must be checked against the I OC t igs The S7 bus requires that responses to inquire cycles occur with fixed timing Λt least with certain combinations of bus and processor clock rate, inquire cycles will require top pnonty to meet the inquire response timing requirement Synchroπi/ition operations must take into account bus activity generally a synchronization operation can only proceed on cached data which is in Exclusive or Modified - if cached data in Shared state, ownership must be obtained Data that is not cached must be accessed using locked bus cycles Load Load operations require partitioning into reads that do not cross a hcxlct (128 bit) boundary, checking for store conflicts, checking the I ZC, checking the LOC, and reading from memory Execute and Gateway accesses are always abgned and since they arc smaller than a hcxlct do not cross a hexlet boundary Store Note S7 processors perform unabgncd operations LSB first, MSB last, up to 64 bits at a Store operations requires partitioning into stores less than 128 bits that do not cross hcxlct time Unabgncd 128 bit loads need 3 64 bit operations, LSB, ocdct, MSB I ransfers which boundaries, checking for store conflicts, checking the LZC, checking the LOC, and storing arc smaller than a hcxlct but larger than an ocdct arc further divided in the S7 bus unit into mcmor) Definition Definition def data «- LoadMemoryX|ba la size order) assert lorder = l) and {{la and (sιze 8 IJ) = 0| and [size = 32} 359 MicroUnity 360 MicroUnit) Tuc, Λug 17, 1999 Memory Management Tuc, Λug 17, 1999 Memory Management Memory - 361 - -362- Zeus System Architecture Tuc, Λug 17, 1999 Bus interface /cus Sjstcm Architecture Tuc, Λug 17, 1999 Bus interface 365 MicroUnity MicroUnity /cus Sjstcm Architecture luc,Λu B I7, 1999 Bus interface cub Sjbtcm Architecture lue, Λug 17, 1999 I'm sumi iγ Electrical Specifications llicsc prcllmlπar) electrical spcαficitlons provide AC and DC parameters that are required for ' Super Socket 7 ' compatibili 367 MicroUnity 368 MicroUnity Zeus Sjstcm Architecture <=> Microl'nit) Micr Lnit) /cus S)*>tcm Architecture Tuc, Λug 17, 1999 Bus interface /cus Sjstem Architecture Tue. Λug 17, 1999 Bus interface Bus Control Register The Bus Control Register provides direct control of Fmulator signals, selecting output states and active input states for these signals The la> out of the But* Control Register is designed to match the assignment of signals to the Fvcπt Register Emulator signals Several of the signals Λ20M#, INl i , NMI, SM1#, S 1TCI K#, IGNNF# arc inputs that have purposes primarily defined by the needs of x86 processor emulation They have no direct purpose in the Zeus processor, other than to signal an event, which is handled by software Fach of these signals is an input sampled on the rising edge of each bus clock if the input signal matches the active level specified m the bus control register, the corresponding bit in the event register is set The bit in the event register remains set even if the signal is no longer acuvc, until cleared by software If the event register bit is cleared b) software, it is set again on each bus clock that the signal is sampled acαvc 373 MicroUnit) 374 MicroUnity /eus Sjstem Architecture lue, Λug 17, 1999 Bus interface /cus System Architecture Tuc, Λug 17, 1999 Bus interface I miii/Hor signali I mulalor iignats A20M# SMI# A20M# (address bit 20 ma.sk inverted), when asserted (l (ϊW ) » directs fin x86 emulator to SMI# (system management interrupt inverted) when asserted (low), directs an x86 generate ph j sical addresses for which bit 20 is zero emulator to simulate a system management interrupt by flushing caches and saving registers, and asserting (low) SMIACT# (system management interrupt active inverted) External The Λ20M# bit of the bus control register selects which level of the A20M# sign il will h irdwarc will normall) release the SMI# generate an event m the A20M# bit of the event register Clearing (to 0) the A20M# bit of the bus control register will cause the A20M# bit of the event register to be set when the I ' he SMI# bit of the bus control register is normally cleared (to 0) to cause the SMI# bn A20M# signal is asserted (low) of the event register to be set when the SMI# signal is asserted (low) Asserting the A20M# signal causes the emulator to modify all current TB mappings to STPCLK# produce a zero value for bit 20 of the byte address The Λ20M# bit of the bus control register is then set {to 1) to cause the Λ20M# bit of the event register to be set when the STPCLK# (stop clock inverted) when asserted (low), directs an x86 emulator to simulate a Λ20M# signal is released (high) stop clock interrupt by flushing caches and saving registers and performing a stop grant special cycle Releasing the Λ20M# signal causes the emulator to restore the TB mapping to the onginal state The Λ20M# bit of the bus control register is then cleared (to 0) again, to cause the I'he STPCLK# bit of the bus control register is normally cleared (to 0) to cause the A20M# bit of the event register to be set when the Λ20M# signal is asserted (low) STPCLK# bit of the event register to be set when the STPCLK# signal is asserted (low) INIT Software must set (to 1) the STPCLK# bit of the bus control register to cause the STPC K# bit of the event register to be set when the STPCLK# signal is released (high) INIT (initialize) when asserted (high), directs an x86 emulator to begin execution of the to resume execution Software must cease producing bus operauons after the stop grant external ROM BIOS special cycle Usually , software will use the B HΛ T instruction in all threads to cease performing operations The processor P I continues to operate, and the processor must still Ilic INIT bit of the bus control register is normally set (to 1) to cause the INIT bit of the sample INI I IN FR RFSF1 , NMI, SMI# (to place them in the event register) and respond event register to be set when the INIT signal is asserted (high) to RFSF 1 and inquire and snoop transactions, so long as the bus clock continues operating INTR I ' he bus clock itself cannot be stopped until the stop grant special cycle If the bus clock ts INTR (maskable interrupt) when asserted (high), directs an x86 emulator to simulate a stopped it must stop in the low (0) state The but clock must be operating at frequency for maskable interrupt by generating two locked interrupt acknowlege special cycles Fxtern.il at least 1 ms before releasing STPCLKtf or releasing RESET While the bus clock is hardware will normally release the IN JTR signal between the first and second interrupt stopped, the processor docs not sample inputs or responds to RFSF f or inquire or snoop acknowlege special cycle transactions fhc INTR bit of the bus control register is normally set (to 1) to cause the INTR bit of Fxterπal hardware will normally release STPCLK# when it is desired to resume execution the event register to be set when the INTR signal is asserted (high) The processor should respond to the STPCLK# bit m the event register by awakening one or more threads NMI IGNNE# NMI (non-maskable interrupt) when asserted (high), directs an x86 emulator to simulate a non maskable interrupt External hardware will normally release the NMI signal IGNNE# (address bit 20 mask inverted), when asserted (l° ) » directs an x86 emulator to ignore numcnc errors The NMI bit of the bus control register is normally set (to 1) to cause the NMI bit of the event register to be set when the NMI signal is asserted (high) l ic IGNNE# bit of the bus control register selects which level of the IGNNE# signal will generate an event in the IGNNE# bit of the event register Clearing (to 0) the IGNNE# bit of the bus control register will cause the IGNNE# bit of the event register to be set when the IGNNE# signal is asserted (low) 375 MicroUnity 376 MicroUnity Zeus System Architecture Tuc, Λug 17, 1999 Bus interface /cus System Architecture Tuc Λug 17 1999 Bus interface lacke cycl s Sampled per Clock Asserting the IGNNE# signal causes the emulator to modify its processing to ignore Locked sequences of bus transactions numenc errors, if suitably enabled to do so The IGNNE# bit of the bus control register is then set (to 1) to cause the IGNNE# bit of the event register to be set when the IGNNE# Bus lock (LOCK#) is also asseπed (low) on subsequent bus transactions by wπting a one signal is released (high) (1) to the bus lock bit of the bus control register Split cycle (SCYC) is similarly asserted (high) if a one (1) is also wnttcn to the split cycle bit of the bus emulation control register Releasing the IGNNE# signal causes the emulator to restore the emulation to the original state I ' he IGNNE# bit of the bus control register is then cleared (to 0) again, to cause the AH subsequent bus transactions will be performed as a locked sequence of transactions, IGNNE# bit of the event register to be set when the IGNNE# signal is asserted (low) asserting bus lock (I OCK# low) and optionally split cycle (SCYC high) until 2crocs (0) arc written to the bus lock and spbt cycle bits of the bus control register The next bus Emulator output signals transaction completes the locked sequence releasing bus lock (I OCK# high) and spbt cycle (SCYC low) at the end of the transaction If the locked transaction must be aborted Several of the signals, BP3 BPO, TERR#, IERR#, PM1 PMO, SMIΛC1 # arc outputs that because υf bus acuvity such as backoff a lock broken event is signalled and the bus lock is have purposes pnmarity defined by the needs of x86 processor emulation They are dπvcπ released from the bus control register that can be wnttcn by software Unless special care is taken the bus transactions of all threads occur as part of the locked Bus snooping sequence of transactions Software can do so by interrupting all other threads until the locked sequence is completed Software should also take case to avoid fetching instructions Zeus support the Socket 7 protocols for inquiry, invalidation and coherence of cache lines duππg the locked sequence, such as by executing instructions out of niche or ROM memory The protocols arc implemented in hardware and do not interrupt the processor as a result of Software should also take care to avoid terminating the sequence with event handling prior bus activity Cache access cycles may be "stolen for this purpose, which may delay to releasing the bus lock such as by executing the sequence with events disabled (other than completion of processor memory acuvity the lock broken event) Definition The purpose of this facility is primarily for x86 emulauon purposes, in which we arc willing to perform vile acts (such as stopping all the other threads) in the name of def SnoopPhysicaBus as compatibihty It is possible to take special care in hardware to sort out the activity of //wait for transaction on bus or inquiry cycle other threads, and break the lock in response to events In doing so, the bus u t do must defer bus activity generated by other threads until the locked sequence is wait completed The bus unit should inhibit event handling while the bus is locked while BRDY# = 0 P^ I 3 «- A31 3 op ♦- /R# 7 R Sampled at Reset cc - CACHE# I I PwT I I PCD enddef Certain pins arc sampled at rtsu and made available in the event register CPU ΪYV Primary or Dual processor Locked cycles P1CD0|DPFN#) Dual processing enable Locked cycles occur as a result of synchronization operations (Store swap instrucuons) performed by the processor For x86 emulation locked cycles also occur as a result of PI USI \ 1 πstatt test mode setting specific memory mapped control registers INI 1 Built in self test Locked synchronization instruction Sampled per Clock Bus lock (I OCk#) is asserted (low) automatically as a result of store swap instructions that generate bus activity, which always perform locked read modify wnte cycles on 64 bits of Certain pins arc sampled per clock and changes are made available in the event register data Note that store swap instructions that arc performed on cache sub blocks that arc in the F or M state need not generate bus acuvity Λ20M# address bit 20 mask Brjl Oj bus frequency 377 MicroUnity MicroUniry SM1# system management Bus Access MicroUmty 7cus Sjstcm Architecture Tue, Λug 17, 1999 Bus interface 7cus Sjstcm Architecture Tuc, Λug 17, 1999 Bus interface Other bus c>cles Other but cydei Other bus cycles A back trace message special cycle is performed by a byte store to the control space (dc=l) with a b tc address (ba) of 5 (Λ31 3=0, BE5#=0, BE7 6,4 0#=1) Input/Output transfers, Interrupt acknowledge and special bus c>cles (stop grant, flush acknowledge, writeback, halt, flush, shutdown) arc performed by uncached loads and stores Performing load or store operauons of other sizes (doublet, quadlet, octlet, hcxlct) to the control space (dc= l) or operations with other byte address (ba) values produce bus to a memory mapped control region operauons which arc not defined by the "Super Socket 7" specifications and have undefined effect on the sj tcm I/O cycles Λn input cycle is performed by a byte, doublet, or quadlet load to the data space (dc=0), with a bj tc address (ba) of the I/O address The address may not be aligned, and if it crosses an octlet boundary, will be performed as two separate cycles Λn output cycle is performed by a byte, doublet, or quadlet store to the data space (dc=0), with a byte address (ba) of the I/O address The address may not be aligned, and if it crosses an cκ:det boundary, will be performed as two separate cycles Performing load or store operauons of other sizes (octlet, hcxlct) to the data space (dc=0) produce bus operations which arc not defined by the "Super Socket 7" spccificauons and have undefined effect on the sj stcm Physical address Special cycles ITic other bus cycles arc accessed explicitly by uncached memory accesses to parucular phjsical address ranges Appropnatcly sized load and store operauons must be used to An interrupt acknowlege cycle is performed by two byte loads to the control space (dc= l), perform the specific bus cycles required for proper operations The dc field must equal 0 for the first with a b>tc address (ba) of 4 (Λ31 3=0, BE4#=0, BE7 5,3 0#=1), the second with I/O operations, and must equal 1 for control operauons Within this address range, bus a b>tc address (ba) of 0 (Λ31 3=0, BE0#=0, BR7 1#=1) The first byte read is ignored, the transactions arc si cd no greater than 4 bytes (quadlet) and do not cross quadlet boundancs second bj tc contains the interrupt vector The external sjstcm normally release!. IN 1 * R between the first and second byte load i ' he physical address of a other bus cycle data/control dc, byte address ba is 63 2423 1615 0 Λ shutdown special cycle is performed bj a byte store to the control space (dc= l) with a j FFFF FFFF 0B00 0000 ά3 24 | dc " ba bjtc address (ba) of 0 (Λ31 3=0, BE0#=0, BF7 1 #=1) 40 A flush special cjclc is performed b a byte itorc to the control space (dc= l) with a bj te address (ba) of 1 (Λ31 3=0, BE1#=0, BE7 2,0#=1) Definition def data *- AccessPhysicaOtherBuslpa size op wd) as Λ halt special cjcle is performed by a b tc store to the control space (dc= l) with a byte address (ba) of 2 (Λ31 3=0, BE2#=0, BE7 3,1 0#=1) // divide transfers sized between octlet and hexlet into two parts // also divide transfers which cross octlet boundary into two parts A stop grant special cjclc is performed by a byte store to the control space (dc= l) with a if |64<sιze≤l28) or (|sιze<64| and (sιze+8*pa2 o >64 IJ then bj tc address (ba) of 0x12 (Λ31 3=2, BE2#=0, BT7 3,1 0#= 1) dataO *- AccessPhysicaOtherBuslpa 64 8* a2 nopw ) pa I «- ρa 6 4 1 1 11 10 3 A writeback special cycle is performed by a byte store to the control space (dc= l) with a datal «- AccessPhysJcaOtherBus(pa 1 sιze+8*pa2 o-° opwd) b tc address (ba) of 3 (Λ31 3=0, BE3#=0, BE7 4,2 0#= 1) data +- datat |27 ' ' dataO^ 0 Λ flush acknowledge special cjclc is performed by a byte store to the control space (dc=l) ADS# i- with a bj tc address (ba) of 4 (Λ31 3=0, BF4#=0, BE7 5,3 0#=1) M/IO# MicroUnit) 382 MicroUnity Zeus Sj tcm Architecture Tuc, Λug 17, 1999 Bus interface /cus S)stcm Architecture l uc, Λu K 17, 1999 Fvcnts and Threads Events and Threads Fxccpuons signal several kinds of events (1) events that arc indicauvc of failure of the software or hardware, such as aπthmeuc overflow or paπty error, (2) events that are hidden from the virtual process model, such as translation buffer misses, (3) events that infrequendy occur, but may require corrective action, such as floaung point underflow ln addiuon, there arc (4) external events that cause scheduling of a computational process, such as clock events or compleuon of a disk transfer Fach of these types of events require the interruption of the current flow of cxecuuon, handling of the cxccpuon or event, and in some cases, dcschcdul g of the current task and rescheduling υf another The Zeus processor provides a mechanism that is based on the ulti threaded execution model of Mach Mach divides the well known UNIX process model into two parts, one called a task, which encompasses the virtual memory space, file and resource state, and the other called a thread, which includes the program counter, stack space, and other register file state The sum of a Mach task and a Mach thread exacdy equals one UNIX process, and the Mach model allows a task to be associated with several threads On one processor at any one moment in time, at least one task with one thread is running ln the taxoπom) of events described above, the cause of the event ma) cither be sjnchronυus to the currently running thread, generally types 1 , 2, and 3, or asynchronous and associated with another task and thread that is not currently running, generally type 4 Tor these events, /eus will suspend the currcndy running thread in the current task, saving a minimum of registers, and continue exccuuoπ at a new program counter The event handler aj perform some minimal computauon and return, rcstoπng the current threads' registers, or save the remaining registers and switch to a new task or thread context facilities of the exception, memory management, and interface sj stems arc themselves mcmor) mapped, in order to provide for the manipulation of these facilities by high level language, compiled code The sole cxccpuon is the register file itself, for which standard store and load instructions can save and restore the state Definition 383 MicroUnity 384 MicroUnity and or for in to cleared as a result of a context ΛcccssDctail cxccpuon context switch In the case care must be taken to by the exception set by event handling and that results in a to communicate the occurrence of events between 7cus S)stcm Architecture Tuc, Λug 17, 1999 and Threads /cus System Architecture Tuc, Λug 17, 1999 Fvcnts and Threads I Register r> cm Mask l * hc Fvcnt Register appears at several locations in mcmor), with slight I) different side effects on read and write opcranons Hie table below shows the events and their corresponding event number Hie pnonty of these events is soft, m that dispatching from the event register is controlled by software 1 ODO notwithstanding the above, using the F I OGMOST U instruction is handy for pnorm/iπg these events so lf )θu vc got a preference as to numbenng, speak upl Physical address The Fvcnt Register appears at three different locauons, for which three functions of the Fveπt Register are performed as dcscnbcd above I'he phjsical address of an Register for funcnon f, b) tc b is 63 2423 10987 32 0 FFFF FFFF 0F000000 6324 UJ Definition def data *- AccessPhysιcalEventRegιster|pa opwdata| as r «- pa 9 g |f lP a 23 lo = °) anα> 19 7 4 = °) and l f ≠ ') * n ^ n case f I ! op of O U R data «- O 64 I I EventRegtster 2 I I R 3 I I R data 4- 0 0 I I EventRegister *- wdata ϋ 3 0 2 I I W Event Mask EventRegister «- EventRegister or wdata.43 0 3 I I The Fvcnt Mask (one per thread) control whether each of the events dcscnbcd above is EventRegister «- EventRegister and -wdat ^ 0 permitted to cause an cxccpuon In the corresponding thread endcase else Physical address data 4- 0 endif ITierc are as many Fvcnt Masks as threads I'he physical address of an Event Mask for enddef thread th, b) te b is 389 MicroUnity 390 MicroUnity Zeus Sjstcm Architecture Tuc, Λug 17, 1999 and Threads /eus S) stcm Architecture Tuc, Λug 17, 1999 Events and Threads I tcni Mask Global IVMiss Handler 63 2423 1918 FFFF FFFF OEOO OOOO 632 |th ±1 Exceptions: The table belυ shows the exceptions, the corresponding cxccpuon number, and the parameter si upplicd by the exception handler in register 3 Definition def data *- AccessPhysιcalEventMask(paopwdata| as th 4- pa 2 I? if (th < T) and (pajg 4 = OJ then case op of R data «- 0 64 I I EventMask[thJ w EventMask-JthJ +- wdata53 0 endcase else data 4- 0 endif enddef GlobalTBMiss Handler The GlobalTBMiss cxccpuon occurs when a load, store, or instruction fetch is attempted while* none of the GIobalTB cntncs contain a matching virtual address The Zeus processor uses a fast software based cxccpuon handler to fill m a missing GIobalTB entry llicrc arc possible ways that software ma, maintain page tables Tor purposes of this discussion it is assumed that a virtual page table is maintained, in which 128 bit GTB values for each 4k byte page in a linear table which is itself in virtual memory By maintaining the page table ln virtual memory, very large virtual spaces ma) be managed without keeping a large amount of physical memory dedicated to page tables - 391 - MicroUnity MicroUnity /cus Sjstem Architecture l uc, Λug 17, 1999 /cus S)stem Architecture l ue Λug 17, 1999 Events and Threads GlobalTBNtiM Handler Because the page table is kept in virtual mcmor), it is possible that a valid reference may In the code below, offsets from rl arc used with the following data structure cause a second G 1 BMiss cxccpuon if the virtual address that contains the page table is not present in the GT B The processor is designed to permit a second cxccpuon to occur within an exception handler causing a branch to the SecondException handler I lowcvcr, to simplify the hardware involved, a SecondException cxccpuon saves no specific information about the exception - handling depends on keeping enough relevant information in registers to recov er from the second cxccpuon Zeus is a multithreaded processor, which creates some special considcrauons in the cxccpuon handler Unbkc a single threaded processor, it is possible that multiple threads maj ncarlj simultaneously reference the same page and invoke two or more G rB misses, and the full) associative construction of the GTB requires that there be no more than one matching cntr) for each global virtual address Zeus provides a search and insert operation (GT BUpdatcπil) to simphf) the handling of the G rB This opcrauon also uses hardware BasePT = 512 + 16 G 1 B pointer registers to select G 1T3 cπtnes for replacement in TWO prioπt) GTBUpdateFill = BasePT + 8 DummyPT = GTBUpdateFill + 8 Λ further problem is that software may need to modify the protection information contained On a GTBMiss, the handler rctπcvcs a base address for the virtual page table and constructs in the Gl B such as to remove read and/or wnte access to a page in order to infer which an index b) shifting awa) the page offset bits of the virtual address Λ single 128 bit indexed parts of mcmor) arc in use, or to remove pages from a task These modifications may occur load retrieves the new G I * B entry directly (except that a virtual page table miss causes a concurrent!) with the GTBMiss handler, so software must take care to propcrl) s)πchroni/e second exception hindled below) Λ single 128 bit store to the GTBUpdaterill location these operations Zeus provides a search and update opcrauon (G l BUpd tc) to simplif) places the entry into the G TB, after checking to ensure that a concurrent handler has not updating G JT3 cntncs alrcad) placed the cntr) into the G IT3 \\ hen a large number of page table cntncs must be changed noting the limited capacit) of Code for Global I BMiss the G I B can reduce the work Reading the G JT3 can be less work than matching all modified cntncs against the G I B contents l o facihutatc this, Zeus also provides read //base address for page table r3®l2 //4k pages access to the hardware GT B pointers to further permit scanning the GTB for entries which r3=r2 r3 //retrieve page table SecExc if bad va have been replaced since a previous scan G fB pointer wraparound is also logged so it can r2=rl GTBUpdateFill //pointer to GTB update location be determined that the entire G FB needs to be scanned if all entries hive been rcphccd r3 r20 //save new Tβ entty since a previous scan r3=rl 48 //restore r3 r2-rl 32 //restore r2 rl-rl 16 //restore rl //restore rO and return Λ second exception occurs on a virtual page table miss It is possible to service such a page table miss direct]), however, the page offset bits of the virtual address have been shifted away, and have been lost These bits can be recovered in such a case, a dummy G TB entry is constructed, which will cause an exception other than G TBMiss upon returning A re execution of the offending code will then invoke a more extensive handler, making the full virtual address available Tor purposes of this example, it is assumed that checking the contents of r2 against the contents of a good wa to ensure that the second exception handler was entered from the GlobalTBMiss handler //save r4 //base address for page table bne r2 r4 If //did we lose at page table load? MicroUnit) 394 MicroUnit) Zeus S)stcm Architecture Tuc, Λug 17, 1999 Events and Tlireads Zeus S)stcm Architecture T uc, Λug 17, 1999 Events and Threads xceptiom in detail III 281a r2=rI,DummyPT //dummy page table, shifted (eft 64 12 bits xshlmi 128 r3®r264+ 12 //combine page number with dummy entry Access Disallowed by virtual address li 1281a r4=r 1 512 //restore r4 b 2b //fall back into GTB Miss handler This cxccpuon υccurs when a lυad, stυrc, branch, or gateway refers to an aligned memory I operand with an improperly aligned address, or if architecture descπbuυn parameter LB=t, Exceptions in detail may also occur if the add or increment of the base register or program counter which generates the address changes the unmasked upper 16 bits of the local address There are no special registers to indicate details about the exception, such as the virtual Register 3 contains the local address to which the access was attempted address at which an access was attempted, or the operands of a floating point opcrauon that results in an cxccpuon Instead, this information is available via general purpose registers or Access disallowed by tag registers stored in memory This cxccpuon occurs when a read (load), wπte (store), execute, υr gateway attempts to When a synchronous exception or as)nchronous event occurs, the onginal contents of access a virtual address for which the matching cache tag entry docs not permit this access registers 0 3 are saved in memory and replaced with (0) program counter, privilege level, and ephemeral program state, (1) event data pointer, (2) exception code, and (3) when applicable, Register contains the global address to which the access was attempted failing address or instruction Λ new program counter and privilege level is loaded from mcmor) and cxecuuon begins at the new address Λftcr handling the cxccpuon and rcstonng Access detail required by tag all but one register, a branch back instrucuon restores the final register and resumes execution This exception occurs when a read wπtc (store), or execute attempts to access a virtual address for which the matching virtual cache entry would permit this access, but the Duπng cxccpuon handling, any asynchronous events arc kept pending until a BranchBack detail bit is set instrucuon is performed By this mechanism, wc can handle cxccpuons and events one at a time, without the need to interrupt and stack cxccpuons Software should take care to avoid Register 3 contains the global address to which the access was attempted keeping the handling of asynchronous events pending for too long Description When a second cxccpuon occurs in a thread which is handling an exception, all the above operations occur, except for the saving and replacing of registers 0 3 in memory Λ disunct ITic exception handler should determine accessibility If the access should be allowed, the exception code SccondExccpuoπ replaces the normal exception code By this mechanism, a con tinucpistdc tail bit is set and cxecuuon returns Upon return, cxecuuon is restarted and fast exception handler for GlobalTBMiss can be written, in which a second Global 1 BMiss the access will be retned Fvcn if the detail bit is set in the matching virtual cache cntr) , or rixcdPoimOvcrflow exception may safely occur access will be permitted When a third cxccpuon occurs in a thread which is handling an exception, an immcdntc Access disallowed by qlobal TB transfer of control occurs to the machine check vector address, with information about the exception available in the machine check cause field of the status register ' I ' he transfer This exception occurs when a read (load), write (store), execute, or gateway attempts to of control may overwrite state that may be necessary to recover from the exception, the access a virtual address for which the matching global TB entry does not permit this access intent is to provide a satisfactory post mortem indication of the charactcnstics of the failure Register 3 contains the global address to which the access was attempted This sccuoπ describes in detail the conditions under which cxccpuons occur, the parameters passed to the exception handler, and the handling υf the result υf the procedure Description Reserved Instruction The exccpuon handler should determine accessibility, υdify the virtual mcmury state if desired, and return if the access should be allowed Upon return, cxccuuυn is restarted and the access will be retried The Rcscrvedlnstrucαon cxccpuon occurs when an instrucuon cυdc which is reserved for future dcfin on as part of the Zeus architecture is executed Access detail required by global TB Register 3 contains the 32 bit instrucuon Tins cxccpuon occurs when a read (load), wnte (stυte), execute, υr gateway attempts to access a virtual address for which the matching global TB entry would permit this access, but the detail bit in the global TB entry is set - 395 MicroUnity 396 - MicrυUnity Zeus S)stcm Architecture Tue, Λug 17, 1999 Events and Tlireads Zeus S)stcm Architecture Tuc, Λug 17, 1999 Events and Threads I xceptions in detail F xception* in detail Register 3 contains the global address to which the access was attempted Local TB miss Description This cxccpuon occurs when a read (load), wπte (store), execute, or gateway attempts to access a virtual address for which no local TB entry matches The cxccpuon handler should determine accessibility and return if the access should be allowed Upon return, cxecuuon is restarted and the access will be allowed If the access is Register 3 contains the local address to which the access was attempted nυt tυ be allowed, the handler should nυt return Description Global TB miss The cxccpuon handler should load a local TB entry that defines the translauon and This exception occurs when a read (load), write (store), execute, or gateway attempts to protecuon for this address Upon return, execution is restarted and the local TB access will access a virtual address for which no global TB entry matches be attempted again Register 3 contains the global address to which the access was attempted Floatinα-pomt arithmetic Description Register 3 contains the 32 bit instrucuon The cxccpuon handler should load a global TB entry that defines the translation and Descπotion protecuon for this address Upon return, cxecuuon is restarted and the global TB access will be attempted again The address of the instrucuon that was the cause of the cxccpuon is passed as the contents of register 0 llic exception handler should attempt to perform the funcuon specified in the Access disallowed bv local TB instruction and service any exceptional conditions that occur This cxccpuon occurs when a read (load), write (store), execute, ur gateway attempts to Fixed-point arithmetic access a virtual address for which the matching local TB entry docs not permit this access Register 3 contains the 32 bit instruction Register 3 contains the local address to which the access was attempted Description Description The address of the instruction which was the cause of the exception is passed as the The cxccpuon handler should determine accessibility, modify the virtual memory state if contents of register 0 The exception handler should attempt to perform the funcuon desired, and return if the access shυuld be allowed Upon return, cxecuuon is restarted and specified in the instruction and service any exceptional conditions that occur the access will be retπed Access detail required bv local TB This cxccpuon occurs when a read (load), wπtc (store), execute, or gatcwa) attempts to access a virtual address for which the matching local TB entry would permit this access, but the detail bit in the local TB entry is set Register 3 contains the local address to which the access was attempted Descπotion The cxccpuon handler should determine accessibility and return if the access should be allowed Upon return, cxecuuon is restarted and the access wilt be allowed If the access is not to be allowed, the handler should not return 397 - MicroUnity 398 - MicroUnity /cus Syst m Architecture Tuc Λug 17 1999 Reset and Frror Recovery /eus S) stem Λrehitecture T uc, Λug 17, 1999 Reset and Frror Recovery Machine Check Reset and Error Recovery Control Register Reset Certain external and internal events cause the processor to invoke reset or error recovery Λ reset occurs upon wnting a one to the reset bit of the Control Register The cause of the operations These operauons consist of a full or parual reset of cπuca! machine state, reset is noted b) initializing the Status Register and other registers to the reset values noted including initialization of the threads to begin fetching instructions from the start vector below address Software may determine the nature of the reset or error by reading the value of the control register, in which finding the reset bit set (1) indicates that a reset has occurred, and Meltdown Detected Reset finding both the reset bit cleared (0) indicates that a machine check has occurred When A reset occurs if the temperature is above the threshold set b) the meltdown margin field cither a reset or machine check has been indicated, the contents of the status register contain more detailed information on the cause of the configuration register The cause of the reset is noted by setting the meltdown detected bit υf the Status Register Definition Double Check Reset def PerformMachιneCheck(cause| as esetVirtualMemorylJ A reset occurs if a second machine check occurs that prevents recover) from the first ProgramCounter «- StartVectorAddress PnvilegeLevel *- 3 machine check Spccificall), the occurrence of an exception in event thread, watchdog StatusRegister *- cause timer error υr bus error while any machine check cause bit is still set in the Status Register enddef results in a double machine check reset The cause of the reset is noted by setting the double check bit of the Status Register Reset Λ reset ma) be caused by a power on reset, a bus reset, a write of the control register which Machine Check sets the reset bit or internally detected errors including meltdown detection and double Detected hardware errors sueh as communications errors in the bus, a watchdog timeout check error or internal cache paπty errors, invoke a machine check A machine check will disable the MMU, to translate all local virtual addresses to equal physical addresses, note the cause Λ reset causes the processor to set the configuration to minimum power and low clock of the exception in the Status Register, and transfer control of the all threads to the start speed, note the cause of the reset in the status register, stabilize the phase locked loops, vector address This action is similar to that υf a reset, but differs in that the configuration disable the MMU from the control register, and initialize a all threads to begin execution at settings ind thread state are preserved the start vector address Recover) from m tchine cheeks depends on the scvcπt) of the error and the potential loss of Other S)stcm state is left undefined b) reset and must be explicitly initialized b) software, information as a direct cause of the error The start vector address is designed to reach this cxpϋcidy includes the thread register state, LTB and GTB state, supcrspπng state, and internal ROM memory, so that operation of machine check diagnostic and recovery code external interface devices The code at the start vector address is responsible for initializing need not depend on proper operation or contents of an) external device The program these remaining s)stem facilities, and reading further bootstrap code from an external ROM counter and register file state of the thread prior to the machine check is lost (except for the Power-on Reset portion of the program counter saved in the Status Register), so diagnostic and recovery code must not assume that the register file state is indicative of the prior operating state of the thread lhc state of the thread is frozen similarly to that of an exception A reset occurs upon initial power on The cause of the reset is noted b) initializing the Status Register and other registers to the reset values noted below Machine check diagnostic code determines the cause of the machine check from the processor s Status Register and as required the status and other registers of external bus Bus Reset devices A reset occurs upon observing that the RESET signal has been at active The cause of the Recovery code will generally consume enough time that real time interface performance reset i noted by iniuali/ing the Status Register and other registers to the reset values noted targets may have been missed Cυnscqucndy, the machine check recovery software may need below to repair further damage, such as interface buffer undcrruns and overruns as may have occurred during the intervening time 399 MicroUnity 400 MicroUnity /eus S)stcm Architecture Tuc, Λug 17, 1999 Reset and Frror Recovery /cus S) stem Architecture T uc, Λug 17, 1999 Reset and Error Recovery un Λddress This final recovery code, which rc initializes the state of the interface S)stcm and recovers a If the affected mcmor) is that of a critical part of the υpcratiπg system, such a condition is functional event thread state, may return to using the complete machine resources, as the considered a system failure, unless recovery can be accomplished from a system level condition which caused the machine check will have been resolved checkpoint The following table lists the causes of machine check errors Watchdog Timeout Error Parity or uncorrectable error in on-chip cache Parity or communications error in system bus Λ watchdog timeout error indicates a general software or hardware failure Such an error is Event Thread exception generally treated as non recoverable and fatal Watchdog timer machine check errors Event Thread Exception When an event thread suffers an exception, the cause of the exception and a portion of the Parity or Uncorrectable Error in Cache virtual address at which the exception occurred arc noted in the Status Register Because under normal circumstances, the event thread should be designed not to encounter When a parity or uncorrectable crrυr occurs in an on chip cache, such an error is gcnerall) exceptions, such exceptions arc treated as non recoverable, fatal errors non recoverable These errors arc non recoverable because the data in such caches may reside anywhere in memory, and because the data such caches may be the only up to date cop) of that memory contents Conscqucndy. the enure contents of the mcmυry store is Reset state lost, and the seventy of the error is high enough to consider such a condition to be a s)stem A reset or machine check causes the /cus processor to stabilize the phase locked loops, failure disable the local and global 'TB, to translate all local virtual addresses to equal physical addresses, and initialize all threads to begin execution at the start vector address The imchinc check provides an υpportunit) to report such an error before shutting do n i system for repairs Start Address There arc specific means b) which a system may recover from such an error without failure, such as bj restarting from a s)stem level checkpoint, from which a consistent mcmor) stite The start address is used to initialize the threads with a program counter upon a reset, or can be recovered machine check lliest causes of such initialization can be differentiated b) the contents of the Status Register Parity or Communications Error in Bus I ' he start address is a virtual address which, when translated ' b) the local TB and global TB When a parity or cυmmunicatioπs error occurs in the system bus, such an error π ) be to a ρh)sιcal address is designed to access the internal ROM code The internal ROM space partiall) recoverable is chosen to minimize the number of internal rcsυurccs and interfaces that must be υperatcd to begin cxecuuon or recover from a machine check Bits corresponding to the affected bus operation arc set in the processor's Status Register Recovery software should determine which devices arc affected, by querying the Status Register υf each device on the affected McdiaChanncl channels A bus timeout ma) result from normal self configuration activities Definition def StartProcessor as If the error is simply a communications error, resetting appropnatc devices and restarting forever tasks ma) recover from the error Read and write transactions ma) have been undcrwa) at catch check the time of a machine check and may or may nυt be reflected in the current s)stcm state EnableWatchdog <- 0 fork unClock If the error is from a parity error in memory, the contents of the affected area of memory is ControlRegιster 62 *- 0 lost, and consequently the tasks associated with that memory must gcnerall) be aborted, or for th <- 0 to T I resumed from a task-level checkpoint If the contents of the affected memory can be ProgramCounter|th| «- OxFFFF FFFF FFFF FFFC rccov crcd from mass storage, a complete recovery is possible PπvιlegeLevel|th| «- 3 fork Thread|th| end/or MicroUnity MicroUnity /eus Sj stem Architecture T uc, Λug 17, 1999 Reset and Frror Recover) /cus S) stem l uc Λug 17 1999 Mcmor) and Devices Physical Memoπ Map endcatch kill unClock for th «- 0 to T I Memory and Devices kfll Thread(th) endfor Physical Memory Map PerformMachιπeCheck|check) end forever enddef def Perforrn achιneCheck(check) as case check of CtockWatchdog CacheError ThirdException Address range bytes Meaning endcase External Memory enddef External Memory expansion Level One Cache Level One Cache expansion Level One Cache redundancy Internal ROM Code LOC redundancy expansion LTB thread t entry e /eus internal ROM code performs reset initialization of on chip resources including the LTB max 8T2 lε = I6M bytes Special Bus Operations I ZC and I OC, followed by self testing The BIOS ROM should be scanned for a special GTB thread t entry e prefix that indicates that %cu native code is present in the ROM, in which case the ROM GTB max 2 5,, ' ιs « I6M bytes code is executed dirccdy, otherwise execution of a BIOS level x86 emulator is begun GTBUpdate thread t GTBUpdateFill thread t GTBLast thread t GTBFirst thread t GTBBump thread t Event Mask thread t Reserved Event-Regtster-with-staH Reserved Event Register bit set Reserved Event Register bit clear Reserved Clock Cycle Reserved Thread Reserved Clock Event Reserved Clock Watchdog Reserved Tally Counter 0 Reserved Tally Control 0 Reserved Tally Counter 1 403 MicroUnity MicroUnity Devices /eus S) sicm Architecture l ue, Λug 17 1999 Memor) and Devices /cus S)stem Architecture l ue Λug 17, 1999 Mcmor) and Devices Statin Register Status Register Architecture Description Reqister The last hcxlct of the internal ROM contains data that describes implementation dependent choices within the architecture specification I ' he last quadlet of the internal ROM contains a branch immediate instruction, so the architecture description is limited to 96 bits lTie architecture description register contains a machine readable version of the architecture framework parameters T, CE, CS, CT, LE, GE, and GT described in the Architectural rrøπΛWWrt section on page 17 Status Reqister I'he power on bit of the status register is set upon the completion of a power on reset The status register is a 64 bit register with both read and wπtc access, though the on!) legal value which a) be written is a ?cro, to clear the register The result of wπting a non zero ITic bus reset bit of the status register is set upon the completion of a bus reset initiated b ) \ aluc is not specified the RrSFT pin of the Socket 7 interface The double check bit of the status register is set when a second machine check occurs that prevents recovery from the first machine check, or which is indicative of machine check recovery software failure Specifically, the occurrence of an event exception, watchdog timeout bus error, or meltdown while any reset or machine check cause bit of the status register is still set results in a double check reset ITic meltdown bit of the status register is set when the meltdown detector has discovered an on chip temperature above the threshold set by the meltdown threshold field of the control register, which causes a reset to occur The event exception bit of the status register is set when an event thread suffers an exception which causes a machine check The exception code is loaded into the machine MicroUnit) 408 MicroUnity /eus S)stem Architecture Tuc, Λug 17, 1999 Memor) and Devices Xeus S) stcm Architecture l uc, Λug 17, 1999 Memory and Devices Control llegister check detail field of the status register, and the machine check program counter is loaded bits with the low order 12 bits of the program counter and pnvilcgc level 63 62 I ie watchdog timeout bit of the status register is set when the watchdog timer register is 61 equal to the clock cycle register, causing a machine check 60 59 57 ITie bus error bit of the status register is set when a bus transaction error (bus timeout, im lid trans ction code, invalid address, parity errors) has caused a machine check 56 55 54 52 The cache error bit of the status register is set when a cache error, such as a cache pant) 51 12 error has caused a machine check I I 8 ITie vm error bit of the status register is set when a virtual mcmor) error, such as a G 1 B 7 0 multiple cntr) selection crrυr has caused a machine check ITic machine check detail field of the status register is set when a machine check has been The reset bit of the control register provides the ability to reset an individual Zeus device ln completed for an cxccptiυn in event thread, the value indicates the t)pc υf exception for a system \X πting a one (1) to this bit is equivalent to a power on reset or a bus reset The which the most recent machine check has been repυrtcd Tor a bus error, this field ma) duration of the reset is sufficient for the operating state changes to have taken effect Λt the indicate addidonal detail on the cause of the bus error Tor a cache error, this field may completion of the reset operation, the internal reset bit of the status register is set and the indicate the address of the error at which the cache parity error was detected reset bit of the control register is cleared (0) The machine check program counter field of the status register is loaded with bits 11 0 of ITic MMU bit of the control register provides the abllit) to enable or disable the MMU the program counter and privilege level at which the most recent machine check has features of the /cus processor Writing a zero (0) to this bit disables the MMU, causing all occurred ITic value in this field provides a limited diagnostic capability for purposes of MMU related exceptions to be disabled and causing all load, store, program and gateway software development, or possibly for error recovery virtual addresses to be treated as physical addresses Writing a one (1) to this bit enables the MMU and MMU related exceptions On a reset or machine check, this bit Is cleared (0), thus Physical address disabling the MMU fhc ph)sιcal address of the Status Register, bμc b is I ' he parity hit of the control register provides the abllit) to enable or disable the cache pant) 63 320 feature of the /eus processor Writing a zero (0) to this bit disables the paπty check, causing FFFF FFFF OFOO 0E00 63 3 El the pant) cheek machine check to be disabled Writing a one (1) to this bit enables the cache parity machine check On a reset or machine check, this bit is cleared (0), thus disabling the cache pant) check Definition The meltdown bit of the control register provides the abllit) to enable or disable the def data «- AccessPhysicalStatusfpa op wdata] as meltdown detection feature of the /cus processor Wnting a zero (0) to this bit disables the case op of meltdown detector, causing the meltdown detected machine check to be disabled Writing a R one (1) to this bit enables the meltdown detector On a reset or machine check, this bit is data *- 0 64 I I StatusRegister W cleared (0) thus disabling the meltdown detector StatusRegister *- wdata 0 3 o endcase The LOC timing bits of the control register provide the ability to adjust the cache timing of enddef the /eus processor Wnting a zero (0) to this field sets the cache timing to its slowest state, enhancing reliability but limiting clock rate Wnting a seven (?) to this field sets the cache Control Reqister υming to its fastest state, limiting reliability but enhancing performance On a reset or machine check, this field is cleared (0), thus providing operation at low clock rate Changing fhc control register is a 64 bit register with both read and wnte access It is altered only by this register should be performed when the cache is not actively being operated wπte access to this register MicroUnity 410 MicroUnity /eus S)stem Architecture l ue, Λug 17, 1999 Memor) and Devices /cus Sj stem Architecture l uc Λug 17, 1999 Memory and Devices Clock ITic LOC stress bits of the control register provide the abllit) to stress the I OC piπmctcrs bj adjusting voltage levels within the I OC Wnting a zero (0) to this field sets the cache Clock parameters to its normal state enhancing rcliabilit) Writing a non zero value (1 2 or 3) to I ' he /eus processor provides internal clock facilities using three registers a clock cycle this field sets the cache parameters to levels at which cache reliability i slightly register that increments one every cycle, a clock event register that sets the clock bit in the compromised I ' he stressed parameters arc used to cause I OC cells with marginal event register and a clock watchdog register that invokes a clock watchdog machine pcrformincc to fail dunng self test, so that redundancy can be cmρlo)cd to cnruπtc check ITiese registe rs are memor) mapped rcliabilit) On a reset or machine check, this field is cleared (0), thus prov iding opcπtum at normal parameters Changing this register should be performed when the cache is not Clock Cycle acm el) being operated Fach /cus processor includes a clock that maintains processor clock cycle accuracy The J"hc clock timing bits of the control register provide the abllit) to adjust the clock timing of value of tlκ clock cycle register is incremented on ever) c)c!e, regardless of the number of the /eus processor Writing a zero (0) to this field sets the clock timing to its slowest stale, instructions executed on that c)clc The clock cycle register is 64 bits long enl neing rcliabilit) but limiting clock rate Wπtmg a seven (?) to this field sets the clock timing to its fastest state, limiting rcliabilit) but enhancing performance On a power on I or testing purposes the clock cycle register is both readable and wπtablc, though in reset, bus reset, or machine check, this field is cleared (0), thus providing operation it low normal operation it should be wnttcn onl) at s)stcm initialization time there is no clock rate I ' he internal clock rate is set to (clock tιmιng+l)/2*(cxtcrnal clock rate) mechanism provided tor adjusting the value in the clock c)de counter without the possibility Changing this register should be performed along with a control register reset of losing c)cles The global access bits of the control register determine whether a local l B miss ciusc an 63 0 exceptions or treatment as a global address Λ single bit, selected b) the privilege level active clock c :ycle for the access from four bit configuration register field, "Global Access," (GA) determines the result If GΛpi is zero (0), the failure causes an cxccpuon if it is one (I) the failure causes the address to be used as a global address direct!) Clock Event JTic niche limit bits of the control register determine which cache lines are used for c iche An event is asserted when the value in the clock cycle register is equal to the value in the icetss md which lines are used for niche access I or addresses aj 8 <n ' Λ 7 bit tdeircss clock event register which sets the clock bit in the ev ent register -nodi tier register am is inclusive or'ed against j4 8 to determine the cache line ITic cichc It is required tint a sufficient number of bits be implemented in the clock event register so nodifier m must be set to (I 7 128 n 0 | | 0 , K( 128 n ) for proper operation Hie am th it the companion with the clock cycle register overflows no more frequent!) than once aluc does not appear in a register and is generated from the nl value per second 32 bits is sufficient for a 4 GI clock The remaining unimplcmcntcd bits must be zero whenev er re d ind ignored on write Fqualit ) is checked on!) against bits that arc Physical address implemented in both the clock cycle and clock event registers The physical address of the Control Register b) te b is I or testing purposes the clock event register both readable and writable though in 63 normal operation it is normal!) written to FFFF FFFF OFOO OFOO 63 3 0 clock event Definition def data *- AccessPhysιcalControl(pa op wdata) as Clock Watchdog case op of R Λ Machine Check is asserted when the value in the clock cycle register is equal to the value data «- 0 64 I I CoπtrolRegistcr in the clock watchdog register, which sets the watchdog timeout bit in the control register W ControlRegister *- w ata 0 3 o endcase Λ Machine Check or a Reset, of an) cause including a clock watchdog tiisablts the clock enddef watchdog machine check Λ write to the clock watchdog register enables the clock watchdog machine check MicroUnit) MicroUnit) Zeus System Architecture Tuc, Λug 17, 1999 Memory and Devices Zeus S)stcm Architecture Tuc, Λug 17 1999 Memory and Devices tally lilly Tally Control 15 14 13 12 87 6 5 4 3 2 1 0 1 i 1 0 | 1 | thread | flaq | n | E | X | T | G A | The tally counter control registers each select one mctnc for one of the tall) counters I I I 5 2 1 1 1 1 1 1 63 1615 0 flaq meaninq 1 0 Itally control 0| 0 count cycles in which a new instruction is issued 48 16 1 count cycles In which an execution unit is busy 63 1615 0 2 0 Itally control l| 3 1 count cycles in which an instruction is waiting for issue n select unit number for G or Λ unit Fach control register is loaded with a value in one of the following formats F X 1 G Λ include units of these classes (Ensemble, Crossbar, Translate, Group, Λddress) 15 14 1312 8 7 6 5 4 3 2 I 1 1 flag | thread | E x 15 14 13 12 I I 10 9 8 7 6 5 0 G s L B A | 1 2 5 1 1 1 1 1 1 1 1 I l| ι|o|o|o|θ|θ|o|θ|ol event select event number from event register 15 14 13 12 I I 10 9 8 7 6 5 0 1 i 1 1 o o o o o ° l other 1 F X G S B Λ include instructions of these classes Other vilid alues for the t ill) control fields arc given b) the following table 15 14 13 12 87 4 3 2 1 0 1 ' ° o | thread 1 flag I s L ! W | ' 1 tally control field interpretation Physical address The lallj Control registers appe ir at rwo different locations, for which the two registers arc mapped I ' he physical address of a 1 ally Control register f, byte b is 63 1098 32 0 FFFF FFFF OFOO 0900 63 32 54 S I I include instrucuons of these classes (Store, Load, Wide, Instrucuon fetch) Definition def ata «- AccessPhysicafTallylpa op wdata) as f <- a? case pag I t op of O U R data «- 0' 6 I I TallyCounter|f) 0 I I TallyCounter[fJ «- wdata3i 0 415 MicroUnity 416 MicroUnity Zeus S)stem Architecture Tuc, Λug 17, 1999 Mcmor)- and Devices /cus S)stem Architecture Tuc, Λug 17, 1999 Index A 111 read Register M I data «- 0" 2 I I TallyControlirj 1 I I W Index TallyControl| ]«- wdata 15 0 endcase enddef A Thread Register The Zeus processor includes a register that effectively contains the current thread number copy that reads the register In this way, threads running identical code can discover their own identity It is required that a sufficient number of bits be implemented so that each thread receives a distinct value Values must be consecutive, unsigned and include a zero value The remaining unimplcmcntcd bits must be zero whenever read ntcs to this register arc ignored Physical address The physical address of the Thread Register, byte b is 63 FFFF FFFF OFOO 0500 63 . 3 Ξ ?finιtιon uef data 4- AccessPhysιca(Thread|pa,op.wdataJ as case op of R data 4- 0 64 I I Thread W // nothing endcase enddef - 417 - MicroUniry MicroUnity o o _ δ rf b.'S-Sii >. r? ;= "S f>-r, 1 1, rf! _= "3 s S-SJ g-. s rS s s-Sj. S-S s g's sfs l-S-e g- Ii Hi ε ϋ . g s. E ^i i ϊ E ,-._ s i-s i'.. r i §-e,-= . » s l'S g,-s l , -s i 1 -=.2 = -5 § § ! S- 8 ■ =.- •=•= - •= - S-S ^ g 1° I B 8 S . E 8 S.S..J S z% 3-S -S 3 3 -ϊ 5 S « 5 S BroadMX Architecture Key architectural features for communi cati ons performance August 20, 1999 Decouples Access from Execution MicroUnity\ SuperThread Si mul taneous Expensive resources ($, X, E, T) shared among threads ♦ improves utilization of resources Cheap resources (A, B, L, S) dedicated per thread ♦ keeps branch latency low ♦ enables multiple front-end architectures MlcnfUn>lty SuperWide Memory operand in read-only cache Full width register operands Full width register result Peak utilization of data path bandwidth and flexibility MlcnUnlty\ nstructi on Formats 8 24 8 6 18 8 6 6 12 8 6 6 6 6 < MlϊcnfUn>Ky Address nstructions Fi xed-poi nt operati ons ov 64-bi addresses Add, Subtract, Set-conditional Boolean: 2-operand, MUX Shift immediate Shift left immediate add Compare ♦ type: signed, Unsigned ♦ size: 8, 16, 32, 64, 128 ♦ alignment: Aligned, unaligned ♦ ordering: Little-endian, Big-endian Synchronization: 64 ♦ add-, compare-, mux-swap; mux Addressing forms ♦ register + shifted immediate ♦ register + shifted register 4 MlcntfUn>lty Synchronization Aligned octlet operations ♦ Add-Swap ■ load mem->reg. add reg+mem->mem ♦ Compare-Swap ■ load mem->reg, compare reg<->reg, if equal, store reg- >mem ♦ Mux-Swap ■ load mem->reg, mux:mask.reg.mem->mem ♦ Mux ■ load mem, mux:mask,reg.mem->mem < MltcnϊUn>lty Branch Instructions B.I Unconditional Procedure return, switch B.DOWN Gateway return B.BACK Excepti on return B.HALT Interrupt wait B. BARRIER nstruction-fetch wait Branch conditional Branch hint Branch gateway 4 MlcnWUnlty Branch Conditional Floating-point: F16 F32 F64 F128 B.E.F, B.LG.F, B.L.F, B.GE.F Homogeneous Coordi nates: 4xF32 ♦ B.V.F, B.NV.F, B.I.F, B.NI.F ♦ Visible: line within viewing cube ♦ I nvi si bl e: I i ne outsi de vi ewi ng cube Fixed-point: 128 bits ♦ B.E, B.NE, B.L, B.GE, B.L.U, B.GE.U ♦ B.AND.E.Z, B.AND.NE.Z ♦ B.E.Z, B.NE.Z, B.L.Z, B.G.Z, B.LE.Z, B.GE.Z MlcnUnlty Branch Hint August 20, 1999 12 MlcnUnKy Data poi nter MlcnUnKy\ Procedure cal conventi ons Compatible with dynamic linking Register 63 (sp) is stack pointer Stack space al I ocated for parameters by cal I er Up to 8 parameters passed in registers 2-9 Register 0 (lp) loaded with procedure address Register 1 (dp) loaded with data pointer To enter: BLI NK lp=lp Register 2 contains return value To return: B lp MlcnUnlty Procedure Cal Structure Caller (non-leaf): ADDI sp.-size # al I ocate stack space SI64LA Ip.sp.off # save link pointer SI64LA dp,sp,off # save data poi nter # use data poi nter B.LINK.I callee # call procedure with shared dp # use data poi nter LI64LA lp=dp,off # I oad cal I ee code address LI64LA dp=dp,off # I oad cal I ee data poi nter B.LINK lp # call procedure # data pointer not available LI64LA dp=sp,off # reload data poi nter # use data poi nter LI64LA lp.sp.off # reload link pointer ADDI sp.size # deal I ocate stack space B lp # return to caller Callee (leaf): # args i n reg, use data poi nter B '" 0 # return to caller Fixed-point operati ons over 128-bit operands with 8..128 bit symbols Add, Subtract, Set-conditional 3-operand Add/Subtract Add/Subtract Halve, Limiting Boolean: 3-operand, MUX Shift left immediate add Compare < MlBcnUn>Ky Group tri pi operand Reduces operati ons Group tri pie add/subtract ♦ rd 12 s = rd 128 ± rc 128 + rb 28 ♦ 8-128 bit symbols Group shift 1-4 and add/subtract ♦ matches load/store with shifted index Group tri pi bool ean mmedi ate ♦ rd j = f(rd j ,rq,rb j ), i=0..127 ♦ 8 immediate bits specify f MlcnUnlty Typical boolean functions d Λ c Λ b 10010110 150 MlcnUnKy\ Crossbar nstructi ons Deposit, Withdraw Extract, Expand, Compress Swizzle, Select, Shuffle Shift Shift-Merge Rotate Wide Switch August 20, 1999 21 ♦ 2 size 8, 16, 32, or 64 bits ♦ 1 saturate signed, unsigned ♦ 2 round floor, ceil, zero, even August 20, 1999 23 < MlcmnUnKy Crossbar extract r i = (ra 128 || rb 128 ) f(rC32 i) , i=0..127 extract w/register operand control register specifies: ■ 8 fsize field size ■ 8 dpos destination position ■ 9 gssp group size and source position ■ 1 s signed vs unsigned ■ 1 n (real vs complex) ■ 1 m extract vs merge (or mixed sign) ■ 1 I saturation vs truncation ■ 2 rnd roundi ng August 20, 1999 26 thin hexlet XSHUFFLEI.128 rd=rcb,8,4 127 rd(128) August 20, 1999 27 MlcnUnKy Ensembl nstructi ons Multiply Floating-point ♦ Fixed-point ♦ Add, Subtract, Divide, ■ size-doubling Sum ■ extract ♦ Inflate, Deflate, Float, ♦ Floating-point Sink ♦ Complex ♦ Reciprocal Estimate ♦ Polynomial ♦ Galois Field ♦ Red procal Square Root Estimate ♦ Convolve Fixed-point ♦ Multi ply-add ♦ Sum ♦ Scale-add ♦ Log-most ♦ Multi ply-sum August 20, 1999 29 MlcnUnlty Multiply ■ rd 32 = rc 16 * rb 16 127 rd(128) August 20, 1999 30 rC *128 ~~ rC B4 ^64 August 20, 1999 31 4 MlcntfUnηKy Ensemble multiply August 20, 1999 32 DWD 63 rd(64) August 20, 1999 33 t MlcfrnUnlty Ensemble multiply extract ^128 ~~ rC 128 r '- > 128 MlcnUnlty Ensembl mul ti pi add extract August 20, 1999 35 MlcnUn y Ensemble multiply extract MlcnUn y Ensemble multiply add extract complex rd 128 - rc 128 rb 128 + rd 128 MlcnUnlty Ensembl seal add extract ra|28 - rd 128 rb g j Ze + rc 128 rb gjZe August 20, 1999 42 t MlcfrnUnKy Ensemble scale add extract complex ra 128 - rd 128 rb g j Ze *2 + rc 1,28 Q * rb ■ "'SJZ^ August 20, 1999 44 rc "128 ~ rC 128 rb 64 August 20, 1999 47 rd 128 = (rc||rd) 256 * rb 128 MlcnUnlty Ensembl convol ve oati ng-poi nt rd 128 ex floating-point rd 128 = (rc||rd) 256 rb 128 ti pi y f I oati ng-poi nt compl ex rC 28 " rC 128 r ^128 Wide Multiply Matrix Wide Switch Wide Table full size not always required optional bits set in address ♦ sets operand size ♦ sets operand wi dth operand aligned to specified size smal er si zemay use fewer cycles ♦ to load operand cache ♦ to perform operati on August 20, 1999 55 ra 128 - m[ rc] * 128/ size rc *i 28 y matrix extract immediate r 28 " m L rC Jl28*128/size ™ rc 128 - m[ rc] y matrix floating-point rd 128 - rn[rc] 128 * 128/size rb 128 ex floating-point rd 128 - m[ rc] ^ 128 siZΘ rb 128 floating-point rd 128 - m[ rc] * 128size rb 128 rix Galois ra 128 m - rC -128 * 128/size* rd 128 mθd r 8 MlcnUnlty Wide switch j (i ) m[ re] 7w+i ]6w+i 5w+j ]4w+j j3w+j 2w+j _ w+i,i re specif ies address and w August 20, 1999 71 ♦ gsize: Group size (table granularity) J( = b|vsize-1+i..i * sizei|wsize-1..0 rc specifies address, msize, wsize ♦ rc= base+ msize16 + wsize16 ♦ vsize = msizewsize August 20, 1999 72 increase ♦ matrix multiply ♦ convolve Wide switch: bit permutation Wide select: table lookup August 20, 1999 73 MMX Instructions ♦ 16 MOV ^ ♦ 16 PMADDWD 16 ♦ 12 PADDD rd(64) ♦ 08 PSHW ♦ 04 PSHR ♦ 02 PACK ♦ 58 total August 20, 1999 74 Software DES DES standard at end of 20 year life ♦ brute-force code-breaki ng ■ $10000 RSA DES Challenge ■ Electronic Frontier Foundation (EFF) ♦ 56 hours to crack ♦ $200k to design and bui I d ♦ Fl PS standard expi re this year Handles DES extensions ♦ larger keys, bigger S-boxes ♦ more rounds, larger blocks ♦ soft S-boxes and P-boxes ES standard in development ♦ 15 official candidates ♦ new standard unpredictable August 20, 1999 77 functional unit August 20, 1999 78 Software tool Compiler-based development tools ♦ C, C++ compiler ■ intrinsic functions, function inlining ■ register allocation, code scheduling ■ future: automati c paral I el i sati on ♦ obj ect-modul e tool s ■ linker, libraries, debugger OS: RT microkernel, Linux DSP libraries Sophisticated tools ■ M athemati ca: symbolic verification ■ GOPS: cross-development library August 20, 1999 79

Claims: We claim: 1. In a system having a data path functional unit having a functional unit data path width, a first memory system having a first data path width, and a second memory system having a data path width which is greater than the functional unit data path width and greater than the first data path width, the process including the steps of: copying a first memory operand portion from the first memory system to the second memory system data, the first memory operand portion having the first data path width; copying a second memory operand portion from the first memory system to the second memory system, the second memory operand portion having the first data path width and being catenated with the first memory operand portion; and reading at least a portion of the catenated data which is greater than the first data path width. 2. The process of claim 1 further including the step of: specifying a memory address indicia from which a plurality of data path widths of data can be read. 3. The process of claim 2 wherein memory address indicia includes at least a portion of first memory address and memory size and shape. 4. The process of claim 1 further including the step of checking the validity of the operand portion and, if valid, permitting a subsequent instruction to access the operand.

Inventors: HANSEN CRAIG, MOUSSOURIS JOHN, HANSEN, CRAIG
Applicants: HANSEN CRAIG, MICROUNITY SYSTEMS ENG, MOUSSOURIS JOHN, MICROUNITY SYSTEMS ENGINEERING, INC., MOUSSOURIS, JOHN
Application year: 1999
Main classification: G06F7
IPC codes: G06F7, G06F9