Patent Publication Number: US-6044448-A

Title: Processor having multiple datapath instances

Description:
BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     This invention pertains in general to a processor architecture and in particular to a processor architecture adapted to perform data-level parallelism. 
     2. Description of Background Art 
     Processor architectures have certain mechanisms for exploiting data- and instruction-level parallelism in order to scale processor performance. In short, data-level parallelism occurs when a single processor instruction performs simultaneous operations on multiple data. Instruction-level parallelism, in contrast, occurs when the processor simultaneously executes more than one instruction. These mechanisms have the disadvantage of requiring complex hardware and software for extending processor performance. In addition, the mechanisms generally concentrate more on the instruction level than the data level. Many media operations, however, including those that perform frequency impulse response, discrete cosine transforms, motion estimation, and motion compensation, require substantial amounts of data-level parallelism. 
     Single-instruction-multiple-data (SIMD) processor instructions can be used to exploit data-level parallelism. A single SIMD instruction operates on multiple data simultaneously. Typical processors have 32- or 64-bit datapaths while typical media operations operate on data requiring only 8- to 16-bit precision. Accordingly, some processors support SIMD through instruction set extensions and datapaths that simultaneously operate on 2 to 4 packed words. 
     Thus, a certain amount of data-level parallelism can be gained through the use of SIMD extensions to processor instruction sets. These extensions, however, are very hardware intensive. In addition, exploiting the SIMD architecture requires aggressive and complex assembly coding techniques to achieve the data-level parallelism and manage the resulting convoluted memory hierarchies and instruction scheduling requirements. Accordingly, the SIMD extensions cannot be used in the normal high-level language flow of program development because the data parallelism must be coded at a low level. Also, the functionality of the SIMD extensions is controlled by the width of the existing processor datapaths and programming models. 
     Processors supporting superscalar instruction scheduling exercise parallel functional units by dynamically extracting instruction-level parallelism from the instruction stream. When combined with SIMD data-level parallelism, superscalar processors can perform control flow operations in the instruction stream in parallel. Although these parallel operations can give very high performance, the processors must have very complex hardware. Moreover, such parallelism makes certain assumptions about the temporal and spatial locality of data that do not hold true when processing media data, thus reducing the effectiveness of these techniques in media applications. Finally, a programmer must use very complex programming techniques in order to fully utilize the hardware. 
     Processors supporting very long instruction word (VLIW) formats explicitly encode instruction parallelism into a very long instruction word. Basically, the VLIW format moves the complexity of extracting instruction-level parallelism from hardware to software. Thus, the use of a VLIW format makes the already complex task of coding data-level parallelism even harder. Another disadvantage of VLIW formats is that code must often be rewritten to support newer versions of the processors. 
     Accordingly, there is a need for a processor architecture that supports data-level parallelism in order to efficiently execute media operations. Such a processor should also include single scalar processor control to maintain simplicity in both hardware and software. 
     SUMMARY OF THE INVENTION 
     The above needs are met by a processor having an architecture capable of dividing its total datapath into multiple instances, or &#34;slices.&#34; The processor comprises one or more slices, core logic, and a data transfer unit. In addition, the processor includes two special registers that allow programs to utilize the sliceable architecture and is preferably coupled to a monolithic main memory. 
     The first register is a read-only version register that indicates the total number of slices available in that particular implementation of the processor. A programmer can read the value in this register and then alter program behavior in response. Accordingly, the register provides the programmer with a mechanism for determining at run time the amount of data-level parallelism that can be extracted from the particular processor implementation. 
     The second register is a Kernel Processor Status Register (KPSR) that controls the number of slices a program uses. The processor uses 2 N  slices, where N is the value stored in the KPSR. Thus, the programmer can use fewer than the total number of slices by storing a value indicating less than the total in the KPSR. 
     Each slice in the processor includes a register file and an arithmetic logic unit (ALU). The register file is preferably comprised of 32 32-bit wide registers. The register file of each slice is preferably a logically divided segment of a single register file having registers as wide as the total processor datapath. The ALU receives operands from the register and outputs a result to the register file. 
     The processor core logic comprises an instruction memory and an instruction decoder. The instruction memory holds program instructions and provides selected instructions to the instruction decoder. The instruction decoder decodes the received instruction and generates register indices and control signals therefrom. The register indices are sent to the register file of each slice. The control signals are replicated and sent to the controlled processor functional units, including the register files, the ALUs, and the data transfer unit, therefore making the total width of the datapath transparent to computational single-instruction-multiple-data (SIMD) instructions passing through the instruction decoder. 
     The data transfer unit receives an output from the register file of each slice and operates under the control of the instruction decoder to transfer data between the slices. The data transfer unit reads data from a register file of a first slice and writes the data to a register file in a second slice. 
     The instruction set executed by the processor has an underlying SIMD nature that allows programs to exploit data-level parallelism while maintaining a simple programming model. The instruction set supports several instructions for transferring data among the slices. The shlslice instruction moves register contents from slice m to slice m+1 while the shrslice instruction moves register contents from slice m to slice m-1. The shim instruction moves a variable amount of up to 31 bits of register content from a slice to the next higher slice while the shrm instruction moves a variable amount of up to 31 bits of register content from a slice to the next lower slice. 
     The instruction set also supports instructions for loading data from and storing data to memory. Two instructions, ldm and stm, are used to respectively load and store data having an effective address aligned on a double word * number of slices used=NSUSE boundary. Other instructions, including ldmh, ldml, stmh, and stml, are used to load and store data having an effective address (EA) not aligned on such a double word NSUSE boundary. The ldmh instruction fetches all bytes from the boundary one less than that of the EA to the EA from memory and loads the bytes in a register such that the byte at the EA is at the most significant byte position of slice 2 NSUSE  -1. The rest of the fetched bytes are loaded down towards slice 0. The stmh instruction loads memory positions from the boundary one less than that of the destination EA with bytes from a register such that the byte at the destination EA is filled with the byte at the most significant byte position of slice 2 NSUSE  -1. The ldml instruction fetches all bytes from the boundary one greater than that of the EA to the EA from memory and loads the bytes in a register such that the byte at the EA is at the least significant byte position of slice 0. The rest of the fetched bytes are loaded up towards slice 2 NSUSE  -1. The stml instruction loads memory positions from the boundary one greater than that of the destination EA with bytes from the register such that the byte at the EA in memory is filled with the byte at the least significant byte position of slice 0. The rest of the stored bytes are from byte locations in the source register up towards slice 2 NSUSE  -1. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a high-level block diagram illustrating the functional units of a media operations processor having multiple datapath instances and related components; 
     FIG. 2 is a diagram illustrating the operation of the ldm instruction; 
     FIG. 3 is a diagram illustrating the operation of the stm instruction; 
     FIG. 4 is a diagram illustrating the operation of the ldmh instruction; 
     FIG. 5 is a diagram illustrating the operation of the stmh instruction; 
     FIG. 6 is a diagram illustrating the operation of the ldml instruction; and 
     FIG. 7 is a diagram illustrating the operation of the stml instruction. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 1 is a high-level block diagram illustrating the functional units of a sliceable media operations processor (SMOP) 100 having multiple datapath instances. The SMOP of FIG. 1 has two slices, labeled &#34;A&#34; and &#34;B&#34; 106, although embodiments of the SMOP can have a number of slices equal to any power of two. Shown are a version register 102 and a kernel processor status register (KPSR) 104, the slices 106, SMOP core logic 108, and a data transfer unit 122. In addition, a memory 110 is coupled to the SMOP 100 via a memory bus 112. Each slice 106 comprises a register file 114 and an arithmetic logic unit (ALU) 116 The core logic 108 comprises an instruction memory 118 and an instruction decoder 120. 
     A single slice of the SMOP preferably has a 32-bit datapath, or number of bits that can be transferred in parallel from the memory 110 to the slice. The SMOP 100 architecture can instantiate multiple slices each having a 32-bit datapath. Thus, the SMOP 100 can have 2 n  slices, with each slice having a 32-bit datapath and the total processor datapath being 2 n  *32 bits. The first slice forms the least significant bits of the total datapath and all subsequent slices contribute to the most significant bits. As used herein, eight bits equal one byte, 2 bytes equal one word, and one double word equals 4 bytes. 
     The version register 102 is a hardwired read-only register containing a value indicating the maximum number of datapath slices available in the particular SMOP 100 implementation. The version register 102 can be read by a program instruction executing on the SMOP 100. In this manner, the program can determine at run time the amount of data-level parallelism that can be extracted from the particular SMOP. Then, for example, the program can appropriately fix the values of variables like loop counters to account for the amount of data parallelism. In this manner, code, such as computationally intensive inner loops of algorithms, can be written once and then run at maximum efficiency on different implementations of the SMOP 100 without modification. 
     The KPSR 104 is a writeable register holding a value indicating the number of slices in the SMOP 100 that are in use. A programmer can select the number of slices out of the total available slices 2 n  that a program will use by storing an NSUSE, or number of slices used, value in the KPSR 104. In response, the SMOP 100 will use 2 NSUSE  slices. Thus, if an algorithm is not amenable to very wide data vectors or if a code segment is fine tuned to a smaller slice implementation, the programmer can reduce the number of slices of the datapath that the program uses. 
     The register file 114 receives inputs from the instruction decoder 120, the ALU 116, and the data transfer unit 122, and has two outputs coupled to the ALU 116 and an output coupled to the data transfer unit 122. In addition, the register file 114 is bi-directionally coupled to the memory 110 via the memory bus 112. The SMOP 100 preferably has a single register file 114 of 32 registers. Each register preferably has a width of slice datapath * 2 n  slices. If the embodiment of the SMOP in FIG. 1 has a 32-bit slice datapath, then each register is 64 bits wide. The register file 114 supports byte enable. That is, the register file receives and transmits control signals along with data indicating which bits of the data are active. Though the use of byte enable signals, the register file can send and receive data as wide as the entire SMOP 100 datapath while identifying only certain bytes that contain relevant data. 
     Each register within the file 114 is logically divided into 2 n  equal-width slices. Thus, the separate register file blocks 114A, 114B illustrated in FIG. 1 are preferably logically divided from a single register file 114. Each of the logical register files has separate data and control paths as illustrated in FIG. 1 in order to support parallel operation as described herein. Moreover, the discussion below describes the operation of a single logical register file unless stated otherwise. 
     The register file 114 receives one or more indices selecting particular registers within the file 114 and associated control signals from the instruction decoder 120. In response, the register file 114 loads a value into the selected register from the memory 110 via the memory bus 112, loads a value from the ALU 116, stores a value to or loads a value from the data transfer unit 122, or presents the contents of two selected registers to the ALU 116. 
     In a preferred embodiment of the present invention, each slice 106 in the SMOP 100 has a separate ALU 116. Each ALU 116 receives two operands from the register file 114 within the respective slice and control signals from the instruction decoder 120. In addition, each ALU 116 has an output coupled to the register file 114 within the respective slice. Each ALU 116 performs an arithmetic logic operation on the operands received from the register file 114. The type of operation performed is specified by the control signals received from the instruction decoder 120. The result of the operation is presented at the output of the ALU 116 where it may be stored in the register file 114. 
     The instruction memory 118 within the core logic 108 receives an input from the instruction decoder 120 and has an output coupled to the instruction decoder 120. The instruction memory 118 holds program instructions for the program currently being executed by the SMOP 100. The input received from the instruction decoder 120 identifies a particular instruction within the memory 118. In response, the instruction memory 118 outputs the identified instruction. 
     The instruction decoder 120 has an input coupled to the instruction memory 118, and outputs coupled to the register file 114, the ALU 116, the instruction memory 118, and the data transfer unit 122. The instruction decoder 120 decodes instructions received from the instruction memory 118 and generates outputs and control signals in response thereto. The control signals destined for the slices 106 are replicated and sent to each slice enabled by the KPSR 104. The instructions supported by the instruction decoder 120 are described in more detail below. 
     The data transfer unit 122 is bi-directionally coupled to each register file 114 in the SMOP 100 implementation and receives control signals from the instruction decoder 120. The data transfer unit 122 operates, under the control of the instruction decoder 120, to transfer data among the register files 114 in different slices 106 of the SMOP 100. In general, the data transfer unit 122 reads data from a register in a first slice 106A and writes the data to a register in a second slice 106B or vice-versa This functionality is described in more detail below. 
     The memory 110 is preferably an addressable, monolithic memory that loads and stores data responsive to signals received via the bus 112. As with conventional memories, the memory 110 supports byte enable through control signals transmitted via the bus 112. Through byte enable, the SMOP 100 and memory 110 indicate to which slice or slices a data transfer pertains. When performing loads from memory, an alternative embodiment of the present invention loads the entire 2 NSUSE  double words from the destination register within the file 114, multiplexes the loaded bytes from memory into the loaded data, and writes back the combined result to the register file 114. This embodiment may be preferred in a pipelined implementation of the SMOP 100 as it eases data forwarding in the case of data dependencies. 
     The memory bus 112 transmits data and control signals between the SMOP 100 and the memory 112 and supports byte enable from both the register file 114 and the memory 110. Within the memory bus 112 is a shift register 113 operating at the byte level of granularity for moving bytes being loaded or stored into the proper positions. In addition, the memory bus 112 updates the byte enable signals to reflect the new shifted positions of the bytes. Shifts performed by the shift register 113 are apparent from the descriptions of the instructions for loading and storing described below. In addition, the shift register 113 and other functionality described as within the memory bus 112 may be located in the SMOP 100 or at the memory 114 rather than within the bus 112. 
     The instruction set implemented by the SMOP 100 exploits data parallelism by supporting single-instruction-multiple-data (SIMD) operations. Thus, each slice can be used in a SIMD manner by packing two or four 2-byte words into the slice datapath. The SMOP 100 supports four instructions for transferring data between the slices. The shlslice instruction moves the contents of the register in slice i to the register in slice i+1. Similarly, the shrslice instruction moves the contents of the register in slice i to the register in slice i-1. The shlm instruction moves a variable amount of up to 31 bits of the contents from the register in slice i to the register in slice i+1. The shrm instruction moves a variable amount of up to 31 bits of the contents of the register in slice i to the register in slice i-1. Each of these instructions is performed by transferring the contents of the selected register in the first slice to the data transfer unit 122 and then storing the manipulated register contents in the corresponding register in the second slice. 
     The DTU 122 performs the instructions discussed above by essentially acting as a shift register. The DTU 122 takes as input a concatenated 2 NSUSE  * 32-bit wide value from the selected register segments within the active slices. Then, the DTU 122 shifts the data in the specified direction and by the specified amount. For a shlm or a shrm instruction, the DTU 122 shifts the data by a variable amount from zero to 31 bits. For a shlslice or a shrslice instruction, the DTU 122 shifts the data by 32 bits. The DTU 122 partitions the resulting data into 32-bit chunks which are then sent to the appropriate slices. 
     The SMOP 100 also supports instructions for fetching data from and storing data to memory 114. Two instructions, load multiple (ldm) and store multiple (stm), are used to respectively fetch data from and store data to an address on an NSUSE double word (dword), or 32-bit, boundary. Other instructions, including load multiple high (ldmh), load multiple low (ldml), store multiple high (stmh), and store multiple low (stml), are used to respectively fetch data from and store data to a misaligned address not on an NSUSE dword aligned boundary. 
     The ldm instruction has the format ldm source, destination, where source specifies a 32-bit effective address (EA) in memory 110 and destination specifies a register in the register file 114. The ldm instruction fetches 2 NSUSE  dwords from the source and stores the dwords in the destination. The stm instruction has the same format, except that source specifies a register and destination specifies a 32-bit EA in memory. The stm instruction stores 2 NSUSE  dwords from the source to the destination. In both ldm and stm, the EA must be aligned on a 2 NSUSE  * four-byte (32-bit) boundary. 
     FIG. 2 is a diagram illustrating the operation of the ldm instruction when NSUSE=2. Shown are a memory 210, such as memory 110, and a register 212. The memory 210 is aligned along 2 NSUSE  * 4-byte (32-bit) boundaries, thereby dividing each line of the memory 210 into four 32-bit dwords 210A-D. The register is divided into four 32-bit slices 212A-D. When the SMOP 100 executes the ldm instruction, the four 32-bit dwords beginning at the source EA 210 are loaded into the corresponding slices of the register 212. 
     FIG. 3 is a diagram illustrating the operation of the stm instruction when NSUSE=2. Shown are a memory 310, such as memory 110, and a register 312. The memory 310 is aligned along 32-bit boundaries, thereby dividing each line of the memory 310 into four 32-bit dwords 310A-D. The register is divided into four 32-bit slices 312A-D. When the SMOP 100 executes the stm instruction, the four 32-bit dwords in the source register are stored to the respective positions in the memory 310 starting at the specified destination EA. 
     The ldmh instruction has the format ldmh source, destination, where source specifies a 32-bit EA in memory and destination specifies a register. The ldmh instruction fetches all bytes from the 2 NSUSE  * 4-byte boundary one less than that of the EA to the EA from memory and loads the bytes in the destination register such that the byte at the EA is at the most significant byte position of slice 2 NSUSE  -1. The rest of the fetched bytes are loaded down towards slice 0. 
     FIG. 4 is a diagram illustrating the operation of the ldmh instruction when NSUSE=2. Shown are a memory 410, such as memory 110, and a register 412. The memory 410 is aligned along 2 NSUSE  * 4-byte (32-bit) boundaries, thereby dividing each line of the memory 410 into four 32-bit dwords 410A-B. The register is divided into four slices 412A-B of 32 bits each. When the SMOP 100 executes the ldmh instruction, the bytes of memory 410 from the EA down to the next lower NSUSE dword aligned boundary 410A are stored to the register 412 from the most significant byte downward. As shown in FIG. 4, the bytes starting at the EA in dword 410B are placed in slice 3 412B of the register 412. The bytes in the next lower dword are stored in slice 2 412A. 
     Similarly, the stmh instruction has the format stmh source, destination, where source specifies a register and destination specifies a 32-bit EA in memory. The stmh instruction loads memory positions from the 2 NSUSE  * 4-byte boundary one less than that of the destination EA with bytes from the source register such that the byte at the destination EA is filled with the byte at the most significant byte position of slice 2 NSUSE  -1. 
     FIG. 5 is a diagram illustrating the operation of the stmh instruction when NSUSE=2. Shown are a memory 510, such as memory 110, and a register 512. The memory 510 is aligned along 2 NSUSE  * 4-byte (32-bit) boundaries, thereby dividing each line of the memory 510 into four 32-bit dwords. The register is divided into four 32-bit slices. When the SMOP 100 executes the stmh instruction, data are stored to the destination EA in the memory 510 down to the next lower NSUSE dword aligned boundary from the appropriate number of higher order bytes in the source register. As shown in FIG. 5, the EA points to a location in dword 510B. Accordingly, the dwords 510B and 510A are filled with bytes from slice 3 512B and slice 2 512A. 
     The ldml instruction has the format ldml source, destination, where source specifies a 32-bit EA in memory and destination specifies a register. The ldml instruction fetches all bytes from the 2 NSUSE  * 4-byte boundary one greater than that of the EA to the EA from memory and loads the bytes in the destination register such that the byte at the EA is at the least significant byte position of slice 0. The rest of the fetched bytes are loaded up towards slice 2 NSUSE  -1. 
     FIG. 6 is a diagram illustrating the operation of the ldml instruction when NSUSE=2. Shown are a memory 610, such as memory 110, and a register 612. The memory 610 is aligned along 2 NSUSE  * 4-byte (32-bit ) boundaries, thereby dividing each line of the memory 610 into four 32-bit dwords. The register is divided into four 32-bit slices. When the SMOP 100 executes the ldml instruction, the bytes of memory 610 from the EA up to the next higher NSUSE dword aligned boundary 612B are stored to the register 612 from the least significant byte upward. As shown in FIG. 6, the bytes starting at the EA in dword 610A are placed in slice 0 612A of the register 612. The bytes in the next higher dword 610B are stored in slice 2 612A. 
     Similarly, the stml instruction has the format stml source, destination, where source specifies a register and destination specifies 32-bit EA in memory. The stml instruction loads memory positions from the 2 NSUSE  * 4-byte boundary one greater than that of the destination EA with bytes from the source register such that the byte at the EA in memory is filled with the byte at the least significant byte position of slice 0. The rest of the stored bytes are from byte locations in the source register up towards slice 2 NSUSE  -1. 
     FIG. 7 is a diagram illustrating the operation of the stml instruction when NSUSE=2. Shown are a memory 710, such as memory 110, and a register 712. The memory 710 is aligned along 2 NSUSE  * 4-byte (32-bit) boundaries, thereby dividing each line of the memory 710 into four 32-bit dwords. The register is divided into four 32-bit slices. When the SMOP 100 executes the stml instruction, data are stored to the destination EA in the memory 510 up to the next higher NSUSE dword aligned boundary 710B from the appropriate number of higher bytes in the source register 712. As shown in FIG. 7, the EA points to a location in dword 710A. Accordingly, the dwords 710A and 710B are filled with bytes from slice 0 712A and slice 1 712B. 
     The instructions illustrated by FIGS. 2-7 are preferably performed using the byte enable signals and shift register 113 described above with respect to FIG. 1. For the ldm and stm instructions, the byte enable signals select all of the bytes in the active slices. For the ldmh, stmh, ldml, and stml instructions, the enabled bytes are sent to the shift register 113, shifted to the appropriate positions, and then sent to the destination. 
     In sum, the SMOP architecture is a relatively low complexity design tuned to exploit data parallelism while maintaining a simple programming model. Instructions executing on the SMOP 100 utilize data parallelism without necessarily considering the number of slices available or active.