Streaming engine with individually selectable elements and group replication
By managing data streams within the digital signal processor through a streaming engine, the problems of insufficient memory bandwidth and latency are solved, enabling efficient data processing and real-time filtering operations, thereby improving system performance.
Patent Information
- Application Number
- CN202310618020.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2016-12-30
- Filing Date
- 2017-12-29
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2037-12-29
AI Technical Summary
Modern digital signal processors face challenges such as increased workload, insufficient memory bandwidth, memory latency affecting algorithm performance, and memory unreliability, especially in real-time data processing where effective memory access and data scheduling are difficult to achieve.
Employing a streaming engine, a fixed data stream sequence is specified in the control register. The data stream is extracted using an address generator and a stream head register. The length of data elements is controlled by a vector mask/group copy unit, and element copying and group copying are managed independently to ensure efficient transmission and processing of the data stream.
It improves memory bandwidth utilization, reduces memory access latency, optimizes data processing efficiency, supports real-time filtering operations, and reduces memory miss pauses and computational requirements.
Smart Images

Figure CN116521237B_ABST
Abstract
Description
[0001] Information related to divisional application
[0002] This case is a divisional application. The parent application of this divisional application is the invention patent application filed on December 29, 2017, with application number 201780070308.5 and invention title "Streaming Engine with Individually Selectable Elements and Group Replication". Technical Field
[0003] This invention generally relates to digital data processing, and more specifically, to the control of a streaming engine used to extract operands. Background Technology
[0004] Modern digital signal processors (DSPs) face several challenges. Increasing workloads necessitate greater bandwidth. The size and complexity of system-on-a-chip (SoC) continue to grow. Memory system latency significantly impacts certain types of algorithms. As transistors shrink, memory and registers become less reliable. As software stacks increase, the number of potential interactions and errors grows.
[0005] Memory bandwidth and scheduling are problems for digital signal processors (DSPs) that operate on real-time data. DSPs that operate on real-time data typically receive an input data stream, perform filtering functions (e.g., encoding or decoding) on the data stream, and output a transformed data stream. The system is called real-time because the application fails if the transformed data stream is unavailable for output during scheduling. Typical video coding requires predictable but non-sequential input data patterns. Typically, corresponding memory access is difficult to implement within the available address generation and memory access resources. Typical applications require memory access to a data register file containing a load data register, which is then supplied to the functional unit performing data processing. Summary of the Invention
[0006] This invention relates to a streaming engine used in a digital signal processor. A fixed data stream sequence is specified by storing corresponding parameters in a control register. The data stream contains multiple nested loops. Once started, the data stream is read-only and cannot be written to. This typically corresponds to the need for real-time filtering operations.
[0007] The streaming engine includes an address generator that generates addresses for data elements and a stream head register that stores the data elements supplied to the functional unit for use as operands. The streaming engine extracts streaming data before it is used by the central processing unit core in the stream buffer. The size of the stream head register is preferably matched to the operational data size of the functional unit. Instructions preferably include operand fields with a first subset of decoders corresponding to the registers, stream read-only operand decoders, and stream read and forward operand decoders.
[0008] The streaming engine includes an element copying unit that optionally copies data elements a specified number of times. In a preferred embodiment, the product of the element data size and this element copying factor can cause the copied element to overflow the streaming head register.
[0009] The streaming engine includes a vector masking / group copying unit with two main functions. An independently specified vector length controls the data elements supplied to each output data vector. The vector masking / group copying unit limits the data elements received from the element copying unit to the least significant bits within the vector length specified by the instruction. When group copying is off, excess paths in the output data vector are zero-padded. When group copying is on, input data elements of the specified vector length are copied to fill the output data vector.
[0010] Element copying and group copying are independent. It should be noted that these features have independent specifications and parameter settings. Therefore, element copying and group copying can be used together or separately. Due to the way these are specified, element copying allows overflow to the next vector, while group copying does not. Attached Figure Description
[0011] The diagram illustrates these and other states, among which:
[0012] Figure 1 This describes a dual scalar / vector data path processor according to an embodiment of the present invention;
[0013] Figure 2 illustrate Figure 1 The registers and functional units in the dual scalar / vector data path processor described herein.
[0014] Figure 3 Description of the global scalar register file;
[0015] Figure 4 This describes the local scalar register file shared by the arithmetic function unit.
[0016] Figure 5 This describes the local scalar register file shared by the multiplication function unit;
[0017] Figure 6 This describes a local scalar register file shared by the load / store unit.
[0018] Figure 7 Description of the global vector register file;
[0019] Figure 8 Describe the predicate register file;
[0020] Figure 9 This describes the local vector register file shared by the arithmetic function unit;
[0021] Figure 10 This describes the local vector register file shared by the multiplication and related functional units;
[0022] Figure 11 This describes the pipeline stages of the central processing unit according to a preferred embodiment of the present invention;
[0023] Figure 12 This describes the sixteen instructions for extracting a single group;
[0024] Figure 13 This invention illustrates an example of instruction decoding of the instructions used in this invention;
[0025] Figure 14 Explain the bit decoding of the condition code extended slot 0;
[0026] Figure 15 Explain the bit decoding of the condition code extended slot 1;
[0027] Figure 16 Explain the bit decoding of constant extended slot 0;
[0028] Figure 17 A partial block diagram illustrating constant expansion;
[0029] Figure 18 This invention describes carry control for SIMD operations.
[0030] Figure 19 A conceptual diagram illustrating the streaming engine of this invention;
[0031] Figure 20 This describes the sequence of formatting operations of the present invention;
[0032] Figure 21 This describes the first instance of path assignment in a vector;
[0033] Figure 22 This illustrates a second instance of path assignment in a vector;
[0034] Figure 23 Describe a basic two-dimensional flow;
[0035] Figure 24 illustrate Figure 21 The order of elements within the instance stream;
[0036] Figure 25 This demonstrates how to extract a smaller rectangle from a larger rectangle.
[0037] Figure 26 This describes how the streaming engine will extract the stream of this instance with a 4-byte transpose granularity;
[0038] Figure 27 This describes how the streaming engine will extract the stream of this instance with an 8-byte transpose granularity;
[0039] Figure 28 Details of the streaming engine of this invention;
[0040] Figure 29 This invention describes the stream template register;
[0041] Figure 30 This describes the subfield definition of the flag field in the stream template register of this invention;
[0042] Figure 31 This invention describes the copying block;
[0043] Figure 32 Explain the vector length mask / group copy block;
[0044] Figure 33-37 This describes the definition of the bits in the stream template register used for the DIMFMT value;
[0045] Figure 38 Explain the decoding of stream input operands. Detailed Implementation
[0046] Figure 1 A dual scalar / vector data path processor according to a preferred embodiment of the present invention is described. Processor 100 includes separate Level 1 instruction cache (L1I) 121 and Level 1 data cache (L1D) 123. Processor 100 includes a Level 2 combined instruction / data cache (L2) 130 that stores both instructions and data. Figure 1 Explain the connection (bus 142) between the Level 1 instruction cache 121 and the Level 2 combined instruction / data cache 130. Figure 1 This describes the connection (bus 145) between the Level 1 data cache 123 and the Level 2 combined instruction / data cache 130. In a preferred embodiment of the processor 100, the Level 2 combined instruction / data cache 130 stores instructions to back up the Level 1 instruction cache 121 and stores data to back up the Level 1 data cache 123. In a preferred embodiment, the Level 2 combined instruction / data cache 130... Figure 1 The signal integrated circuit is further connected to higher-level caches and / or main memory in a manner not described herein. In a preferred embodiment, the central processing unit core 110, the level 1 instruction cache 121, the level 1 data cache 123, and the level 2 combined instruction / data cache 130 are formed on a single integrated circuit. This signal integrated circuit optionally includes other circuitry.
[0047] Central processing unit core 110, controlled by instruction fetch unit 111, fetches instructions from L1 instruction cache 121. Instruction fetch unit 111 determines the next set of instructions to be executed and recalls a set of fetch groups of such instructions. The nature and size of the fetch groups are further detailed below. As is known in the art, after a cache hit (if the instructions are stored in L1 instruction cache 121), these instructions are fetched directly from L1 instruction cache 121. After a cache miss (the specified instruction fetch group is not stored in L1 instruction cache 121), these instructions are searched in L2 combined cache 130. In a preferred embodiment, the cache line size in L1 instruction cache 121 is equal to the fetch group size. The memory location of these instructions is determined by a hit or miss in L2 combined cache 130. A hit is served by L2 combined cache 130. A miss is served by a higher-level cache (not described) or by main memory (not described). As is known in the field, the requested instruction can be supplied to both the Level 1 instruction cache 121 and the central processing unit core 110 simultaneously to accelerate its use.
[0048] In a preferred embodiment of the invention, the central processing unit core 110 includes multiple functional units for executing instruction-specified data processing tasks. An instruction scheduling unit 112 determines the target functional unit for each fetched instruction. In a preferred embodiment, the central processing unit 110 operates as a very long instruction word (VLIW) processor capable of simultaneously operating multiple instructions within corresponding functional units. Preferably, a compiler organizes instructions to be executed together in an execution group. The instruction scheduling unit 112 directs each instruction to its target functional unit. The functional unit assigned to an instruction is entirely specified by the instructions generated by the compiler. The hardware of the central processing unit core 110 does not have a portion of this functional unit assignment. In a preferred embodiment, the instruction scheduling unit 112 can operate multiple instructions in parallel. The number of such parallel instructions is determined by the size of the execution group, as will be described in further detail below.
[0049] Part of the scheduling task of instruction scheduling unit 112 is to determine whether an instruction is executed on a functional unit on the scalar data path side A 115 or the vector data path side B 116. An instruction bit, referred to as the s-bit, within each instruction determines the data path controlled by the instruction. This will be described in further detail below.
[0050] Instruction decoding unit 113 decodes each instruction in the currently executing group. Decoding includes identifying the functional unit executing the instruction, identifying the registers in the possible register file used to supply data for the corresponding data processing operation, and identifying the register destination of the result of the corresponding data processing operation. As further explained below, an instruction may contain a constant field instead of a register number operand field. The result of this decoding is a signal used to control the target functional unit to perform the data processing operation specified by the corresponding instruction on the specified data.
[0051] The central processing unit core 110 includes a control register 114. The control register 114 stores information for controlling the functional units in the scalar data path side A 115 and the vector data path side B 116 in a manner unrelated to this invention. This information may include mode information, etc.
[0052] The decoded instruction from instruction decoder 113 and the information stored in control register 114 are supplied to scalar data path side A 115 and vector data path side B 116. Therefore, the functional units within scalar data path side A 115 and vector data path side B 116 perform instruction-specified data processing operations after the instruction-specified data and store the results in one or more instruction-specified data registers. Each of scalar data path side A 115 and vector data path side B 116 contains multiple functional units, preferably operating in parallel. These will be combined... Figure 2 This will be further elaborated below. A data path 117, which allows data exchange, exists between the scalar data path side A115 and the vector data path side B116.
[0053] The central processing unit core 110 includes other non-instruction-based modules. The emulation unit 118, in response to instructions, allows determination of the machine state of the central processing unit core 110. This capability is typically used for algorithm development. The interrupt / exception unit 119 enables the central processing unit core 110 to respond to external, asynchronous events (interrupts) and to attempts to perform inappropriate operations (exceptions).
[0054] The central processing unit core 110 includes a streaming engine 125. The streaming engine 125 supplies two data streams from predetermined addresses, typically cached in a L2 combined cache 130, to the register file on the vector data path side B. This provides controlled data movement directly from memory (such as cached in L2 combined cache 130) to the function unit operand inputs. This is described in further detail below.
[0055] Figure 1This describes the exemplary data widths of the buses between the various components. The Level 1 instruction cache 121 supplies instructions to the instruction fetch unit 111 via bus 141. Bus 141 is preferably a 512-bit bus. Bus 141 is unidirectional, running from the Level 1 instruction cache 121 to the central processing unit core 110. The Level 2 combined cache 130 supplies instructions to the Level 1 instruction cache 121 via bus 142. Bus 142 is preferably a 512-bit bus. Bus 142 is unidirectional, running from the Level 2 combined cache 130 to the Level 1 instruction cache 121.
[0056] Level 1 data cache 123 exchanges data with the register file in scalar data path side A 115 via bus 143. Bus 143 is preferably a 64-bit bus. Level 1 data cache 123 exchanges data with the register file in vector data path side B 116 via bus 144. Bus 144 is preferably a 512-bit bus. Buses 143 and 144 are described as bidirectional, supporting both data reading and data writing to the central processing unit core 110. Level 1 data cache 123 exchanges data with Level 2 combined cache 130 via bus 145. Bus 145 is preferably a 512-bit bus. Bus 145 is described as bidirectional, supporting cache services for both data reading and data writing to the central processing unit core 110.
[0057] The secondary combined cache 130 supplies data of a first data stream to the streaming engine 125 via bus 146. Bus 146 is preferably a 512-bit bus. The streaming engine 125 supplies this first data stream to the functional unit of vector data path side B 116 via bus 147. Bus 147 is preferably a 512-bit bus. The secondary combined cache 130 supplies data of a second data stream to the streaming engine 125 via bus 148. Bus 148 is preferably a 512-bit bus. The streaming engine 125 supplies this second data stream to the functional unit of vector data path side B 116 via bus 149. Bus 149 is preferably a 512-bit bus. Buses 146, 147, 148, and 149 are described as unidirectional, from the secondary combined cache 130 to the streaming engine 125 and to the vector data path side B 116 according to a preferred embodiment of the invention.
[0058] In a preferred embodiment of the invention, according to U.S. Patent No. 6,606,686 entitled "Unified Memory System Architecture Including Cache and Directly Addressable Static Random Access Memory", both the Level 1 data cache 123 and the Level 2 combined cache 130 can be configured as a selected amount of cache or directly addressable memory.
[0059] Figure 2 This describes other details of the functional units and register files within scalar data path side A 115 and vector data path side B 116. Scalar data path side A 115 includes global scalar register file 211, L1 / S1 local register file 212, M1 / N1 local register file 213, and D1 / D2 local register file 214. Scalar data path side A 115 includes L1 unit 221, S1 unit 222, M1 unit 223, N1 unit 224, D1 unit 225, and D2 unit 226. Vector data path side B 116 includes global vector register file 231, L2 / S2 local register file 232, M2 / N2 / C local register file 233, and predicate register file 234. Vector data path side B 116 includes L2 unit 241, S2 unit 242, M2 unit 243, N2 unit 244, C unit 245, and P unit 246. There are restrictions on which functional units can read from or write to which register files. These will be detailed below.
[0060] The scalar data path side A 115 contains L1 unit 221. L1 unit 221 typically accepts two 64-bit operands and produces a 64-bit result. Each operand is recalled from an instruction specifying register in either the global scalar register file 211 or the L1 / S1 local register file 212. L1 unit 221 preferably performs the following instruction selection operations: 64-bit addition / subtraction; 32-bit minimum / maximum operations; 8-bit single-instruction multiple-data (SIMD) instructions, such as sums determined by absolute, minimum, and maximum values; looping minimum / maximum operations; and various move operations between register files. The result can be written to the instruction specifying register in the global scalar register file 211, the L1 / S1 local register file 212, the M1 / N1 local register file 213, or the D1 / D2 local register file 214.
[0061] The scalar data path side A 115 contains S1 unit 222. S1 unit 222 typically accepts two 64-bit operands and produces a 64-bit result. Each operand is recalled from an instruction specifying register in either the global scalar register file 211 or the L1 / S1 local register file 212. S1 unit 222 preferably performs the same type of operation as L1 unit 221. Optionally, minor variations may exist between the data processing operations supported by L1 unit 221 and S1 unit 222. The result may be written to an instruction specifying register in the global scalar register file 211, the L1 / S1 local register file 212, the M1 / N1 local register file 213, or the D1 / D2 local register file 214.
[0062] The scalar data path side A 115 contains M1 unit 223. M1 unit 223 typically accepts two 64-bit operands and produces a 64-bit result. Each operand is recalled from an instruction-specified register in either the global scalar register file 211 or the M1 / N1 local register file 213. M1 unit 223 preferably performs the following instruction selection operations: 8-bit multiplication; complex inner product; 32-bit bit counting; complex conjugate multiplication; and bitwise logical operations, shift, increment, and subtraction. The result can be written to the instruction-specified register in the global scalar register file 211, the L1 / S1 local register file 212, the M1 / N1 local register file 213, or the D1 / D2 local register file 214.
[0063] The scalar data path side A 115 contains N1 unit 224. N1 unit 224 typically accepts two 64-bit operands and produces a 64-bit result. Each operand is recalled from an instruction specifying register in either the global scalar register file 211 or the M1 / N1 local register file 213. N1 unit 224 preferably performs the same type of operation as M1 unit 223. Certain double operations (referred to as double-issue instructions) may occur using both M1 unit 223 and N1 unit 224 together. The result can be written to the instruction specifying register in the global scalar register file 211, the L1 / S1 local register file 212, the M1 / N1 local register file 213, or the D1 / D2 local register file 214.
[0064] The scalar data path A 115 includes D1 unit 225 and D2 unit 226. D1 unit 225 and D2 unit 226 typically each accept two 64-bit operands and each produce a 64-bit result. D1 unit 225 and D2 unit 226 typically perform address calculations and corresponding load and store operations. D1 unit 225 is used for 64-bit scalar load and store. D2 unit 226 is used for 512-bit vector load and store. D1 unit 225 and D2 unit 226 also preferably perform: swapping, packing, and unpacking of load and store data; 64-bit SIMD arithmetic operations; and 64-bit bitwise logical operations. The D1 / D2 local register file 214 typically stores the base address and offset address used in address calculations for corresponding load and store operations. Each operand is recalled from the instruction-specified register in the global scalar register file 211 or the D1 / D2 local register file 214. The calculated results can be written to the instruction-specified registers of the global scalar register file 211, the L1 / S1 local register file 212, the M1 / N1 local register file 213, or the D1 / D2 local register file 214.
[0065] The vector data path side B 116 contains an L2 unit 241. The L2 unit 241 typically accepts two 512-bit operands and produces a single 512-bit result. Each operand is recalled from an instruction specifying register in the global vector register file 231, the L2 / S2 local register file 232, or the predicate register file 234. In addition to the wider 512-bit data, the L2 unit 241 preferably executes instructions similar to those of the L1 unit 221. The result can be written to an instruction specifying register in the global vector register file 231, the L2 / S2 local register file 232, the M2 / N2 / C local register file 233, or the predicate register file 234.
[0066] The vector data path side B 116 contains S2 unit 242. S2 unit 242 typically accepts two 512-bit operands and produces a 512-bit result. Each operand is recalled from an instruction specifying register in the global vector register file 231, the L2 / S2 local register file 232, or the predicate register file 234. In addition to the wider 512-bit data, S2 unit 242 preferably executes instructions similar to those of S1 unit 222. The result can be written to the instruction specifying register in the global vector register file 231, the L2 / S2 local register file 232, the M2 / N2 / C local register file 233, or the predicate register file 234. There may be certain dual operations (referred to as double-issue instructions) using both L2 unit 241 and S2 unit 242 together. The result can be written to the instruction specifying register in the global vector register file 231, the L2 / S2 local register file 232, or the M2 / N2 / C local register file 233.
[0067] The vector data path side B 116 contains M2 unit 243. M2 unit 243 typically accepts two 512-bit operands and produces a single 512-bit result. Each operand is recalled from an instruction specifying register in either the global vector register file 231 or the M2 / N2 / C local register file 233. In addition to the wider 512-bit data, M2 unit 243 preferably executes instructions similar to those in M1 unit 223. The result can be written to an instruction specifying register in either the global vector register file 231, the L2 / S2 local register file 232, or the M2 / N2 / C local register file 233.
[0068] The vector data path side B 116 contains N2 unit 244. N2 unit 244 typically accepts two 512-bit operands and produces a 512-bit result. Each operand is recalled from an instruction specifying register in either the global vector register file 231 or the M2 / N2 / C local register file 233. N2 unit 244 preferably performs the same type of operation as M2 unit 243. There may be some dual operations (referred to as dual-issue instructions) using both M2 unit 243 and N2 unit 244 together. The result can be written to the instruction specifying register in either the global vector register file 231, the L2 / S2 local register file 232, or the M2 / N2 / C local register file 233.
[0069] The vector data path side B 116 contains C unit 245. C unit 245 typically accepts two 512-bit operands and produces a 512-bit result. Each operand is recalled from an instruction-specified register in either the global vector register file 231 or the M2 / N2 / C local register file 233. C unit 245 preferably executes: "Rake" and "Search" instructions; up to 512 2-bit PN*8-bit I / Q complex multiplications per clock cycle; 8-bit and 16-bit Sum-of-Absolute-Difference (SAD) calculations, up to 512 SADs per clock cycle; horizontal addition and horizontal minimum / maximum instructions; and vector arrangement instructions. C unit 245 also contains four vector control registers (CUCR0 to CUCR3) for controlling certain operations of C unit 245 instructions. Control registers CUCR0 to CUCR3 are used as operands in some C unit 245 operations. Control registers CUCR0 through CUCR3 are preferably used for: controlling the general permutation instruction (VPERM); and as masks for SIMD multiple DOT product operation (DOTPM) and SIMD multiple absolute difference sum (SAD) operation. Control register CUCR0 is preferably used to store polynomials for Galois field multiply operation (GFMPY). Control register CUCR1 is preferably used to store Galois field polynomial generator functions.
[0070] The vector data path side B 116 contains P unit 246. P unit 246 performs basic logical operations on the registers of the predicate register file 234. P unit 246 has direct access to the predicate register file 234 to read from and write to it. These operations include AND, ANDN, OR, XOR, NOR, BITR, NEG, SET, BITCNT, RMBD, BIT Decimate, and Expand. The typical intended use of P unit 246 includes manipulating the results of SIMD vector comparisons to control another SIMD vector operation.
[0071] Figure 3Description of Global Scalar Register File 211. There are 16 independent 64-bit wide scalar registers named A0 to A15. Each register in Global Scalar Register File 211 can be read from or written to as 64-bit scalar data. All scalar data path side A115 functional units (L1 unit 221, S1 unit 222, M1 unit 223, N1 unit 224, D1 unit 225, and D2 unit 226) can read from or write to Global Scalar Register File 211. Global Scalar Register File 211 can be read as 32 bits or 64 bits and may only be written as 64 bits. The executed instruction determines the size of the data read. Under the limitations detailed below, vector data path side B116 functional units (L2 unit 241, S2 unit 242, M2 unit 243, N2 unit 244, C unit 245, and P unit 246) can read from Global Scalar Register File 211 via cross path 117.
[0072] Figure 4 Description of D1 / D2 local register file 214. There are 16 independent 64-bit wide scalar registers named D0 to D16. Each register in D1 / D2 local register file 214 can be read or written as 64-bit scalar data. All scalar data path side A115 functional units (L1 unit 221, S1 unit 222, M1 unit 223, N1 unit 224, D1 unit 225, and D2 unit 226) can be written to global scalar register file 211. Only D1 unit 225 and D2 unit 226 can be read from D1 / D2 local scalar register file 214. It is expected that the data stored in D1 / D2 local scalar register file 214 will include the base address and offset address used in address calculations.
[0073] Figure 5 Explanation of L1 / S1 local register file 212. Figure 5 The embodiment described herein has eight independent 64-bit wide scalar registers named AL0 to AL7. Preferred instruction decoding (see...) Figure 13 The L1 / S1 local register file 212 is allowed to contain up to 16 registers. Figure 5 The implementation uses only eight registers to reduce circuit size and complexity. Each register in the L1 / S1 local register file 212 can be read or written as 64-bit scalar data. All scalar data path-side A115 functional units (L1 unit 221, S1 unit 222, M1 unit 223, N1 unit 224, D1 unit 225, and D2 unit 226) can be written to the L1 / S1 local scalar register file 212. Only L1 unit 221 and S1 unit 222 can be read from the L1 / S1 local scalar register file 212.
[0074] Figure 6Explanation of M1 / N1 local register file 213. Figure 6 The embodiment described herein has eight independent 64-bit wide scalar registers named AM0 to AM7. Preferred instruction decoding (see...) Figure 13 The M1 / N1 local register file 213 is allowed to contain up to 16 registers. Figure 6 The implementation uses only eight registers to reduce circuit size and complexity. Each register in the M1 / N1 local register file 213 can be read or written as 64-bit scalar data. All scalar data path-side A115 functional units (L1 unit 221, S1 unit 222, M1 unit 223, N1 unit 224, D1 unit 225, and D2 unit 226) can be written to the M1 / N1 local scalar register file 213. Only M1 unit 223 and N1 unit 224 can be read from the M1 / N1 local scalar register file 213.
[0075] Figure 7 Description of Global Vector Register File 231. There are 16 independent 512-bit wide scalar registers. Registers named B0 through B15 in Global Vector Register File 231 can be read or written as 64-bit scalar data. Registers named VB0 through VB15 in Global Vector Register File 231 can be read or written as 512-bit vector data. Instruction type determines data size. All vector data path side B 116 function units (L2 unit 241, S2 unit 242, M2 unit 243, N2 unit 244, C unit 245, and P unit 246) can be read or written to Global Vector Register File 231. Under the limitations detailed below, scalar data path side A 115 function units (L1 unit 221, S1 unit 222, M1 unit 223, N1 unit 224, D1 unit 225, and D2 unit 226) can be read from Global Vector Register File 231 via cross path 117.
[0076] Figure 8 Predicate register file 234 is described. It contains eight independent 64-bit wide registers named P0 through P7. Each register in predicate register file 234 can be read from or written as 64-bit scalar data. Functional units L2 241, S2 242, C 244, and P 246 on the vector data path side B 116 can be written to predicate register file 234. Only L2 241, S2 242, and P 246 can be read from predicate register file 234. Typical intended uses of predicate register file 234 include: writing a one-bit SIMD vector comparison result from L2 241, S2 242, or C 244; manipulating the SIMD vector comparison result via P 246; and using the manipulated result for another SIMD vector operation.
[0077] Figure 9 Explanation of L2 / S2 local register file 232. Figure 9 The embodiment described herein has eight independent 512-bit wide scalar registers. Preferred instruction decoding (see...) Figure 13 The L2 / S2 local register file 232 is allowed to contain up to 16 registers. Figure 9 The implementation uses only eight registers to reduce circuit size and complexity. Registers named BL0 through BL7 in the L2 / S2 vector register file 232 can be read or written as 64-bit scalar data. Registers named VBL0 through VBL7 in the L2 / S2 local vector register file 232 can be read or written as 512-bit vector data. The instruction type determines the data size. All vector data path-side B116 functional units (L2 unit 241, S2 unit 242, M2 unit 243, N2 unit 244, C unit 245, and P unit 246) can be written to the L2 / S2 local vector register file 232. Only L2 unit 241 and S2 unit 242 can be read from the L2 / S2 local vector register file 232.
[0078] Figure 10 Explanation of M2 / N2 / C local register file 233. Figure 10 The embodiment described herein has eight independent 512-bit wide scalar registers. Preferred instruction decoding (see...) Figure 13 The M2 / N2 / C local register file 233 is allowed to contain up to 16 registers. Figure 10 The implementation uses only eight registers to reduce circuit size and complexity. Registers named BM0 to BM7 in the M2 / N2 / C local vector register file 233 can be read or written as 64-bit scalar data. Registers named VBM0 to VBM7 in the M2 / N2 / C local vector register file 233 can be read or written as 512-bit vector data. All vector data path-side B116 functional units (L2 unit 241, S2 unit 242, M2 unit 243, N2 unit 244, C unit 245, and P unit 246) can be written into the M2 / N2 / C local vector register file 233. Only M2 unit 243, N2 unit 244, and C unit 245 can be read from the M2 / N2 / C local vector register file 233.
[0079] Providing a global register file accessible by all functional units on one side and a local register file accessible by only some functional units on one side is a design option. This invention can be practiced using only one type of register file corresponding to the disclosed global register file.
[0080] Cross path 117 permits limited data exchange between scalar data path side A 115 and vector data path side B 116. During each operating cycle, a 64-bit data word can be recalled from global scalar register file A 211 to be used as an operand by one or more functional units on vector data path side B 116, and a 64-bit data word can be recalled from global vector register file 231 to be used as an operand by one or more functional units on scalar data path side A 115. Any functional unit on scalar data path side A 115 (L1 unit 221, S1 unit 222, M1 unit 223, N1 unit 224, D1 unit 225, and D2 unit 226) can read a 64-bit operand from global vector register file 231. This 64-bit operand is the least significant bit of the 512-bit data in the accessed registers of global vector register file 231. Multiple scalar data path side A 115 functional units can use the same 64-bit cross-path data as the operands during the same operation cycle. However, in any single operation cycle, only one 64-bit operand is fed from the vector data path side B 116 to the scalar data path side A 115. Any vector data path side B 116 functional unit (L2 unit 241, S2 unit 242, M2 unit 243, N2 unit 244, C unit 245, and P unit 246) can read the 64-bit operand from the global scalar register file 211. If the corresponding instruction is a scalar instruction, the cross-path operand data is treated as any other 64-bit operand. If the corresponding instruction is a vector instruction, the higher 448 bits of the operand are padded with zeros. Multiple vector data path side B 116 functional units can use the same 64-bit cross-path data as the operands during the same operation cycle. In any single operation cycle, only one 64-bit operand is transported from the scalar data path side A115 to the vector data path side B116.
[0081] Under certain constraints, the streaming engine 125 delivers data. The streaming engine 125 controls two data streams. Each stream consists of a series of elements of a specific type. A program operating on the stream sequentially reads the data and then operates on each element. Each stream has the following basic characteristics: The stream data has clearly defined start and end times. The stream data has a fixed element size and type throughout the stream. The stream data has a fixed element order. Therefore, the program cannot randomly search within the stream. The stream data is read-only when active. The program cannot write to the stream while reading from it. Once the stream is open, the streaming engine 125: calculates the address; fetches the defined data type from the Level 2 unified cache (which may request cache services from higher-level memory); performs data type manipulations, such as zero extension, sign extension, data element sorting / swapping (e.g., matrix transpose); and delivers the data directly to a programmed data register file within the central processing unit core 110. The streaming engine 125 can therefore be used for real-time digital filtering operations on benign data. The streaming engine 125 is free from these memory fetching tasks from the corresponding central processing unit core 110 that implements other processing functions.
[0082] The streaming engine 125 provides the following benefits: Streaming engine 125 enables multidimensional memory access. Streaming engine 125 increases the available bandwidth to functional units. Streaming engine 125 minimizes the number of cache miss pauses caused by the streaming buffer bypassing the L1 data cache 123. Streaming engine 125 reduces the number of scalar operations required to maintain loops. Streaming engine 125 manages address pointers. Streaming engine 125 automatically releases address generation instruction slots and address generation for D1 unit 225 and D2 unit 226 for other computational processing.
[0083] The central processing unit core 110 operates the instruction pipeline. Instructions are extracted from fixed-length instruction blocks, as described further below. All instructions require the same number of pipeline stages for extraction and decoding, but require a different number of execution stages.
[0084] Figure 11 The following pipeline phases are described: Program fetch phase 1110, scheduling and decoding phase 1120, and execution phase 1130. Program fetch phase 1110 contains three levels for all instructions. Scheduling and decoding phase 1120 contains three levels for all instructions. Execution phase 1130 contains one to four levels depending on the instruction.
[0085] The fetch phase 1110 includes a program address generation stage 1111 (PG), a program access stage 1112 (PA), and a program receive stage 1113 (PR). During the program address generation stage 1111 (PG), a program address is generated in the central processing unit core 110, and a read request is sent to the memory controller of the Level 1 instruction cache (L1I). During the program access stage 1112 (PA), the L1I processes the request, accesses the data in its memory, and sends the fetch packet to the boundary of the central processing unit core 110. During the program receive stage 1113 (PR), the central processing unit core 110 registers the fetch packet.
[0086] The instruction always extracts sixteen 32-bit wide time slots at a time, forming an extraction group. Figure 12 This describes 16 instructions 1201 to 1216 for a single fetch group. The fetch group is aligned with a 512-bit (16-word) boundary. A preferred embodiment uses a fixed 32-bit instruction length. Fixed-length instructions are advantageous for several reasons. Fixed-length instructions facilitate decoder alignment. Properly aligned instruction fetches can load multiple instructions into a parallel instruction decoder. The properly aligned instruction fetches can be achieved through predetermined instruction alignment when stored in memory coupled to the fixed instruction group fetch (fetch groups aligned on 512-bit boundaries). Aligned instruction fetches allow the parallel decoder to operate on fetch bits of a set instruction size. Variable-length instructions require initial steps to locate each instruction boundary before they can be decoded. Fixed-length instruction sets generally allow for a more regular layout of instruction fields. This simplifies the construction of each decoder, which is an advantage for widely distributed VLIW CPUs.
[0087] The execution of individual instructions is partially controlled by a p-bit in each instruction. This p-bit is preferably bit 0 in a 32-bit time slot. The p-bit determines whether an instruction is executed in parallel with the next instruction. Instructions are scanned from lower to higher addresses. If the p-bit of an instruction is 1, then the next instruction (at a higher memory address) is executed in parallel with the instruction in the same cycle. If the p-bit of an instruction is 0, then the next instruction is executed in the cycle following the instruction.
[0088] The central processing unit core 110 and the L1 instruction cache 121 pipeline are decoupled from each other. Depending on the external environment, such as whether a hit occurs in the L1 instruction cache 121 or the L2 combined cache 130, the number of clock cycles required to fetch packets from the L1 instruction cache 1112 can vary. Therefore, program access level 1112 (PA) can consume several clock cycles instead of one clock cycle as in other levels.
[0089] Instructions executed in parallel constitute execution groups. In a preferred embodiment, an execution group may contain up to sixteen instructions. No two instructions in an execution group may use the same functional unit. The time slot is of one of five types: 1) an independent instruction executed on one of the functional units (L1 unit 221, S1 unit 222, M1 unit 223, N1 unit 224, D1 unit 225, D2 unit 226, L2 unit 241, S2 unit 242, M2 unit 243, N2 unit 244, C unit 245, and P unit 246) of the central processing unit core 110; 2) unitless instructions, such as NOP (no operation) instructions or multiple NOP instructions; 3) branch instructions; 4) constant field extensions; and 5) condition code extensions. Some of these time slot types will be further explained below.
[0090] The scheduling and decoding phase 1120 includes instruction scheduling to the appropriate instruction scheduling level (DS) 1121, instruction decoding level 1 (DC1) 1122, and instruction decoding level 2 (DC2) 1123. During instruction scheduling to the appropriate instruction scheduling level (DS) 1121, fetched packets are split into execution packets and assigned to the appropriate functional units. During instruction decoding level 1 (DC1) 1122, source registers, destination registers, and associated paths are decoded for instructions in the execution functional units. During instruction decoding level 2 (DC2) 1123, unit decoding is performed in more detail, and operands are read from the register file.
[0091] Execution phase 1130 comprises execution levels 1131 to 1135 (E1 to E5). Different types of instructions require different numbers of these levels to complete their execution. These levels of the pipeline play a crucial role in understanding the device state at the cycle boundaries of the central processing unit core 110.
[0092] During the execution of Level 1 1131 (E1), the instruction conditions are evaluated and the operands are operated on. For example... Figure 11 As shown, execution of level 1 1131 receives an operand from stream buffer 1141 and register file, schematically shown as 1142. For load and store instructions, address generation is executed and address modification is written to the register file. For branch instructions, the branch fetch group in level PG 1111 is affected. Figure 11 As shown, the load and store instruction access memory is schematically represented herein as memory 1151. For single-cycle instructions, the result is written to the destination register file. This assumes that any condition of the instruction evaluates to true. If the condition evaluates to false, then the instruction does not write any result or have any pipeline operation after executing level 1 1131.
[0093] During the execution of Level 2 1132 (E2), the load instruction sends the address to memory. The store instruction sends the address and data to memory. The single-cycle instruction that saturates the result sets the SAT bit in the Control Status Register (CSR) when saturation occurs. For two-cycle instructions, the result is written to the destination register file.
[0094] During the execution of level 3 1133 (E3), data memory access is performed. Any multiplication instruction that saturates the result sets the SAT bit in the control status register (CSR) when saturation occurs. For 3-cycle instructions, the result is written to the destination register file.
[0095] During the execution of Level 4 1134 (E4), a load instruction loads data into the boundary of the central processing unit core 110. For a 4-cycle instruction, the result is written to the destination register file.
[0096] During the execution of level 5 1135 (E5), a load instruction writes data into a register. This is in Figure 11 The diagram illustrates the process of input from memory 1151 to execution level 5 1135.
[0097] Figure 13 An example of instruction decoding 1300 for the functional unit instructions used in this invention is described. Those skilled in the art will recognize that other instruction decoding is feasible and within the scope of this invention. Each instruction consists of 33 bits and controls the operation of one of the individually controllable functional units (L1 unit 221, S1 unit 222, M1 unit 223, N1 unit 224, D1 unit 225, D2 unit 226, L2 unit 241, S2 unit 242, M2 unit 243, N2 unit 244, C unit 245, and P unit 246). The bit fields are defined as follows.
[0098] The creg field 1301 (bits 29 to 31) and z bit 1302 (bit 28) are optional fields used in conditional instructions. These bits are used in conditional instructions to identify the predicate register and the condition. z bit 1302 (bit 28) indicates whether the predicate is based on zero or non-zero in the predicate register. If z=1, then the test is equal to zero. If z=0, then the test is non-zero. The case where creg=0 and z=0 is considered always true to allow unconditional instructions to execute. The creg field 1301 and z field 1302 are encoded in the instruction as shown in Table 1.
[0099]
[0100] Table 1
[0101] The condition for executing a conditional instruction is the value stored in a designated data register. This data register resides in the global scalar register file 211, which is used for all functional units. Note that "z" in the z-bit column refers to the zero / non-zero comparison selection mentioned above, and "x" is an irrelevant state. This decoding may specify only a subset of the 16 global registers as predicate registers. This selection is made to retain the bits in the instruction decoding. Note that unconditional instructions do not have these optional bits. For unconditional instructions, these bits (28 to 31) in fields 1301 and 1302 are preferably used as additional opcode bits.
[0102] The dst field 1303 (bits 23 to 27) specifies the register in the corresponding register file as the destination of the instruction result.
[0103] The src2 / cst field 1304 (bits 18 to 22) has several meanings depending on the instruction opcode field (bits 3 to 12 are used for all instructions and additional bits 28 to 31 are used for unconditional instructions). The first meaning designates a register in the corresponding register file as the second operand. The second meaning is an immediate constant. Depending on the instruction type, this is treated as an unsigned integer with zeros extended to the specified data length, or as a signed integer with the sign extended to the specified data length.
[0104] The src1 field 1305 (bits 13 to 17) designates the register in the corresponding register file as the first source operand.
[0105] The opcode field 1306 (bits 3 to 12) for all instructions (and additional bits 28 to 31 for unconditional instructions) specifies the type of instruction and indicates the appropriate instruction options. This includes a clear identifier of the functional unit used and the operation performed. A detailed explanation of the opcodes, except for the instruction options described below, is beyond the scope of this invention.
[0106] Bit 1307 (bit 2) of the `e` bit is used only for immediate constant instructions, where the constant is expandable. If `e=1`, the immediate constant is expanded as detailed below. If `e=0`, the immediate constant is not expanded. In this case, the immediate constant is specified by field 1304 (bits 18 to 22) of `src2 / cst`. It should be noted that this bit 1307 of the `e` bit is only used for some instructions. Therefore, with proper decoding, this bit 1307 of the `e` bit can be omitted from instructions that do not require it, and this bit is used as an additional opcode bit.
[0107] Bit 1308 (bit 1) of the s parameter specifies either scalar data path side A 115 or vector data path side B 116. If s=0, then scalar data path side A 115 is selected. This limits the functional unit to... Figure 2The L1 unit 221, S1 unit 222, M1 unit 223, N1 unit 224, D1 unit 225, and D2 unit 226, and their corresponding register files, are described herein. Similarly, s=1 selects the vector data path side B 116, thereby limiting the functional unit to Figure 2 The L2 unit 241, S2 unit 242, M2 unit 243, N2 unit 244, P unit 246 and their corresponding register files are described in the document.
[0108] Bit p1309 (bit 0) marks the execution group. The p bit determines whether an instruction is executed in parallel with subsequent instructions. Instructions are scanned from lower to higher addresses. If p=1 for the current instruction, the next instruction is executed in parallel with the current instruction. If p=0 for the current instruction, the next instruction is executed in the cycle following the current instruction. All instructions executed in parallel constitute an execution group. An execution group can contain up to twelve instructions. Each instruction in an execution group must use a different functional unit.
[0109] There are two distinct condition code extension slots. Each execution group may contain each of these unique 32-bit condition code extension slots, each slot containing a 4-bit creg / z field for instructions within the same execution group. Figure 14 Explain the decoding of condition code extended slot 0, and Figure 15 Explain the decoding of condition code extended slot 1.
[0110] Figure 14This describes the decoding of a 33-bit condition code extended slot 0. Field 1401 (bits 28 to 31) specifies the 4 creg / z bits assigned to instruction 221 in unit L1 within the same execution group. Field 1402 (bits 27 to 24) specifies the 4 creg / z bits assigned to instruction 241 in unit L2 within the same execution group. Field 1403 (bits 19 to 23) specifies the 4 creg / z bits assigned to instruction 222 in unit S1 within the same execution group. Field 1404 (bits 16 to 19) specifies the 4 creg / z bits assigned to instruction 242 in unit S2 within the same execution group. Field 1405 (bits 12 to 15) specifies the 4 creg / z bits assigned to instruction 225 in unit D1 within the same execution group. Field 1406 (bits 8 to 11) specifies the 4 creg / z bits assigned to instruction 226 in unit D2 within the same execution group. Field 1407 (bits 6 and 7) is unused / reserved. Field 1408 (bits 0 to 5) decodes a unique set of bits (CCEX0) to identify condition code extension slot 0. Once this unique ID of condition code extension slot 0 is detected, the corresponding creg / z bits are used to control the conditional execution of any L1 unit 221, L2 unit 241, S1 unit 222, S2 unit 242, D1 unit 225, and D2 unit 226 instructions within the same execution group. These creg / z bits are explained as shown in Table 1. If the corresponding instruction is conditional (including the creg / z bits), then the corresponding bits of condition code extension slot 0 overwrite the condition code bits in the instruction. It should be noted that a non-execution group may have more than one instruction directed to a particular execution unit. A non-instruction execution group may contain more than one condition code extension slot 0. Therefore, the mapping of creg / z bits to function unit instructions is explicit. Setting the creg / z bit to "0000" makes the instruction unconditional. Therefore, properly decoded condition code extension slot 0 can make some corresponding instructions conditional and some unconditional.
[0111] Figure 15This describes the decoding of a 33-bit condition code extended slot 1. Field 1501 (bits 28 to 31) specifies the 4 creg / z bits assigned to instruction 223 in unit M1 within the same execution group. Field 1502 (bits 27 to 24) specifies the 4 creg / z bits assigned to instruction 243 in unit M2 within the same execution group. Field 1503 (bits 19 to 23) specifies the 4 creg / z bits assigned to instruction 245 in unit C within the same execution group. Field 1504 (bits 16 to 19) specifies the 4 creg / z bits assigned to instruction 224 in unit N1 within the same execution group. Field 1505 (bits 12 to 15) specifies the 4 creg / z bits assigned to instruction 244 in unit N2 within the same execution group. Field 1506 (bits 6 to 11) is unused / reserved. Field 1507 (bits 0 to 5) is decoded with a unique set of bits (CCEX1) to identify Condition Code Extension Slot 1. Once this unique ID of Condition Code Extension Slot 1 is detected, the corresponding creg / z bits are used to control the conditional execution of any instructions in M1 Unit 223, M2 Unit 243, C Unit 245, N1 Unit 224, and N2 Unit 244 within the same execution group. These creg / z bits are explained as shown in Table 1. If the corresponding instruction is conditional (including the creg / z bits), then the corresponding bits of Condition Code Extension Slot 1 overwrite the condition code bits in the instruction. It should be noted that a no-execution group may have more than one instruction directed to a particular execution unit. A no-instruction execution group may contain more than one Condition Code Extension Slot 1. Therefore, the mapping of creg / z bits to function unit instructions is explicit. Setting the creg / z bit to "0000" makes the instruction unconditional. Therefore, a properly decoded Condition Code Extension Slot 1 can make some instructions conditional and some unconditional.
[0112] As mentioned above Figure 13 As described, it is feasible for both condition code extension slot 0 and condition code extension slot 1 to include p bits used to define the execution packet. In a preferred embodiment, as... Figure 14 and 15 As shown, code extension slot 0 and condition code extension slot 1 preferably have bits 0 (p bits) that are always encoded as 1. Therefore, neither condition code extension slot 0 nor condition code extension slot 1 can be in the last instruction slot of the execution group.
[0113] There are two distinct constant extension slots. Each execution group may contain each of these unique 32-bit constant extension slots, each containing 27 bits to be concatenated with the 5-bit constant field 1305 to form a 32-bit constant. As mentioned in the instruction decoding description above, only some instructions qualify the src2 / cst field 1304 as a constant rather than a source register identifier. At least some of these instructions may use constant extension slots to extend this constant to 32 bits.
[0114] Figure 16 This describes the fields for constant extended slot 0. Each execution group may contain one instance of constant extended slot 0 and one instance of constant extended slot 1. Figure 16 The description includes a constant extension slot 0 1600 containing two fields. Field 1601 (bits 5 to 31) constitutes the most significant 27 bits of an extended 32-bit constant containing the target instruction scr2 / cst field 1304 as five least significant bits. Field 1602 (bits 0 to 4) is decoded with a unique set of bits (CSTX0) to identify constant extension slot 0. In a preferred embodiment, constant extension slot 0 1600 may be used only to extend the constant of one of the following instructions in the same execution group: L1 unit 221 instruction, D1 unit 225 instruction, S2 unit 242 instruction, D2 unit 226 instruction, M2 unit 243 instruction, N2 unit 244 instruction, branch instruction, or C unit 245 instruction. Constant extension slot 1 is similar to constant extension slot 0, except that bits 0 to 4 are decoded with a unique set of bits (CSTX1) to identify constant extension slot 1. In a preferred embodiment, the constant extension slot 1 may be used only to extend the constant of one of the following instructions in the same execution group: L2 unit 241 instruction, D2 unit 226 instruction, S1 unit 222 instruction, D1 unit 225 instruction, M1 unit 223 instruction, or N1 unit 224 instruction.
[0115] The following uses constant extension slots 0 and 1. The target instruction must be of a type that allows constant specifications. As is known in the art, this is implemented by replacing an input operand register specification field with the least significant bit of the constant as described above with respect to the scr2 / cst field 1304. The instruction decoder 113 determines this from the instruction opcode bit, referred to as the immediate field. The target instruction also includes a constant extension bit (e bit 1307), which is dedicated to signaling whether the specified constant is not extended (preferably constant extension bit = 0) or the constant is extended (preferably constant extension bit = 1). If the instruction decoder 113 detects constant extension slot 0 or constant extension slot 1, it further examines other instructions within the execution group corresponding to the instruction of the detected constant extension slot. Constant extension is performed only if a corresponding instruction has a constant extension bit (e bit 1307) equal to 1.
[0116] Figure 17 The block diagram 1700 is used to illustrate the extension of constants. Figure 17Assume that instruction decoder 113 detects a constant extended timeslot and the corresponding instruction in the same execution group. Instruction decoder 113 supplies 27 extended bits (bit field 1601) from the constant extended timeslot and 5 constant bits (bit field 1305) from the corresponding instruction to connector 1701. Connector 1701 forms a single 32-bit word from these two parts. In a preferred embodiment, the 27 extended bits (bit field 1601) from the constant extended timeslot are the most significant bits, and the 5 constant bits (bit field 1305) are the least significant bits. This combined 32-bit word is supplied to one input of multiplexer 1702. The 5 constant bits from the corresponding instruction field 1305 supply a second input to multiplexer 1702. The selection of multiplexer 1702 is controlled by the state of the constant extended bits. If the constant extension bit (e bit 1307) is 1 (extended), then multiplexer 1702 selects the cascaded 32-bit input. If the constant extension bit is 0 (unextended), then multiplexer 1702 selects 5 constant bits from the corresponding instruction field 1305. Multiplexer 1702 supplies this output to the input of sign extension unit 1703.
[0117] The symbol extension unit 1703 forms the final operand value from the input from the multiplexer 1702. The symbol extension unit 1703 receives control inputs (scalar / vector) and data size. The scalar / vector input indicates whether the corresponding instruction is a scalar instruction or a vector instruction. The functional units (L1 unit 221, S1 unit 222, M1 unit 223, N1 unit 224, D1 unit 225, and D2 unit 226) on the data path side A 115 can execute only scalar instructions. Any instruction involving one of these functional units is a scalar instruction. The functional units L2 unit 241, S2 unit 242, M2 unit 243, N2 unit 244, and C unit 245 on the data path side B can execute either scalar or vector instructions. The instruction decoder 113 determines whether the instruction is a scalar or vector instruction from the opcode bits. The P unit 246 can execute only scalar instructions. Data size can be 8 bits (byte B), 16 bits (half-word H), 33 bits (word W), or 64 bits (double word D).
[0118] Table 2 lists the operations of the symbol extension unit 1703 for various options.
[0119]
[0120] Table 2
[0121] As mentioned above Figure 13As described, it is feasible for both constant extension slot 0 and constant extension slot 1 to include p bits used to define the execution group. In a preferred embodiment, as with regard to the condition code extension slot, constant extension slot 0 and constant extension slot 1 preferably have bits 0 (p bits) that are always encoded as 1. Therefore, neither constant extension slot 0 nor constant extension slot 1 can be in the last instruction slot of the execution group.
[0122] It is technically feasible for an execution group to include constant extension slot 0 or 1 and more than one corresponding instruction marker constant extension (e bit = 1). For constant extension slot 0, this would mean that more than one of the following instructions in the execution group—the L1 unit 221 instruction, the data in the D1 unit 225 instruction, the S2 unit 242 instruction, the offset in the D2 unit 226 instruction, the M2 unit 243 instruction, or the N2 unit 244 instruction—has an e bit of 1. For constant extension slot 1, this would mean that more than one of the following instructions in the execution group—the L2 unit 241 instruction, the data in the D2 unit 226 instruction, the S1 unit 222 instruction, the offset in the D1 unit 225 instruction, the M1 unit 223 instruction, or the N1 unit 224 instruction—has an e bit of 1. It is not a useful function to supply the same constant extension to more than one instruction. Therefore, in one embodiment, the instruction decoder 113 may determine that this is an invalid operation and is not supported. Alternatively, this combination can be supported by the extension bits of the constant extension slot applied to the constant extension of the instruction marker for each corresponding functional unit.
[0123] Special vector predicate instructions use registers in predicate register file 234 to control vector operations. In the current embodiment, all these SIMD vector predicate instructions operate on a selected data size. The data size may include bytes (8 bits), half-words (16 bits), words (32 bits), double-words (64 bits), quad-words (128 bits), and half-vectors (256 bits). Each bit of the predicate register controls whether the SIMD operation is performed on the corresponding byte of data. The operation of P unit 245 allows various composite vector SIMD operations based on more than one vector comparison. For example, two comparisons can be used for range determination. A candidate vector is compared with a first reference vector having the minimum value of the range packed in a first data register. A second comparison is made with a second reference vector having the maximum value of the range packed in a second data register. The logical combination of the two resulting predicate registers will allow vector conditional operations to determine whether each data portion of the candidate vector is within or outside the range.
[0124] Units L1 221, S1 222, L2 241, S2 242, and C 245 typically operate in Single Instruction Multiple Data (SIMD) mode. In this SIMD mode, the same instruction is applied to packed data from two operands. Each operand holds multiple data elements placed in a predetermined time slot. SIMD operations are enabled by carry control at data boundaries. This type of carry control allows operation on data widths of varying sizes.
[0125] Figure 18 Carry control is explained. The AND gate 1801 receives the carry output of bit N within the operand-wide arithmetic logic unit (64 bits for scalar data path side A 115 function unit and 512 bits for vector data path side B 116 function unit). The AND gate 1801 also receives a carry control signal, which will be explained further below. The output of the AND gate 1801 is supplied to the carry input of bit N+1 of the operand-wide arithmetic logic unit. For example, the AND gates of the AND gate 1801 are positioned between each pair of bits at possible data boundaries. For instance, for 8-bit data, such AND gates would be positioned between bits 7 and 8, bits 15 and 16, bits 23 and 24, etc. Each such AND gate receives a corresponding carry control signal. If the data size is minimum, then each carry control signal is 0, effectively blocking carry transmission between adjacent bits. If the selected data size requires two arithmetic logic unit portions, then the corresponding carry control signal is 1. Table 3 below shows example carry control signals in the case of a 512-bit wide operand, for example, used by the B116 functional unit on the vector data path side. This operand can be divided into 8-bit, 16-bit, 32-bit, 64-bit, 128-bit, or 256-bit portions. In Table 3, the higher 32 bits control the carry of the higher bits (bits 128 to 511), and the lower 32 bits control the carry of the lower bits (bits 0 to 127). There is no need to control the carry output of the most significant bit, therefore only 63 carry control signals are required.
[0126]
[0127] Table 3
[0128] Typically, in this field, operations are performed on data sizes that are powers of 2 (2^N). However, this carry control technique is not limited to powers of 2. Those skilled in the art will understand how to apply this technique to other data sizes and other operand widths.
[0129] Figure 19 A conceptual diagram illustrating the streaming engine of this invention. Figure 19The process for a single stream is described below. The streaming engine 1900 includes a stream address generator 1901. The stream address generator 1901 sequentially generates addresses of the elements of the stream and supplies these element addresses to system memory 1910. Memory 1910 recalls the data (data elements) stored at the element addresses and supplies these data elements to a first-in-first-out (FIFO) data memory 1902. The data FIFO 1902 provides a buffer between memory 1910 and CPU 1920. The data formatter 1903 receives data elements from the data FIFO memory 1902 and formats the data according to the stream definition. This process will be described below. The streaming engine 1900 supplies formatted data elements from the data formatter 1903 to CPU 1920. The program on CPU 1920 consumes the data and produces output.
[0130] Stream elements typically reside in regular memory. Memory itself does not impose a specific structure on the stream. The program defines the stream and therefore imposes a structure by specifying the following stream properties: the address of the first element of the stream; the size and type of the elements in the stream; the formatting of the data in the stream; and the address sequence associated with the stream.
[0131] The streaming engine defines the sequence of addresses of elements in the stream in terms of pointers traversing memory. Multiple levels of nested loops control the path taken by the pointers. The iteration count of a loop level indicates the number of times the level is repeated. The size gives the distance between the pointer positions of the loop levels.
[0132] In the basic forward flow, the innermost loop always consumes physically contiguous elements from memory. The implicit size of this innermost loop is 1 element. The pointer itself moves between elements in a continuous, increasing order. At each level outside the inner loop, the loop moves the pointer to a new position based on the size of the loop level.
[0133] This addressing mode allows a program to specify a regular path through memory with a few parameters. Table 4 lists the addressing parameters for basic streams.
[0134]
[0135] Table 4
[0136] The definition above maps consecutive elements of a stream to incrementing addresses in memory. This works well for most algorithms, but not all. Some algorithms serve this better by reading elements from decrementing memory addresses, using backward stream addressing. For example, discrete convolution calculates the vector dot product as follows:
[0137]
[0138] In most DSP code, f[] and g[] represent arrays in memory. For each output, the algorithm reads f[] in the forward direction but g[] in the reverse direction. Practical filters limit the index range of [x] and [tx] to a finite number of elements. To support this mode, the streaming engine supports reading elements in descending address order.
[0139] Matrix multiplication presents unique problems for streaming engines. Each element in a matrix product is a vector inner product between rows from the first matrix and columns from the second matrix. Programs typically store all matrices in either row-major or column-major order. Row-major order stores all elements of a single row contiguously in memory. Column-major order stores all elements of a single column contiguously in memory. Matrices are typically stored in the same order as the language's default array order. Therefore, only one of the two matrices in matrix multiplication maps to the streaming engine's 2D stream definition. In a typical instance, the first index spans columns in the first array, except for rows in the second array. This problem is not unique to streaming engines. The access patterns of matrix multiplication do not mesh well with most general memory hierarchies. Some software libraries transpose one of the two matrices so that both can be accessed row-wise (or column-wise) during multiplication. Streaming engines support implicit matrix transposition via transposed streams. Transposed streams avoid the cost of explicitly converting data in memory. The streaming engine efficiently swaps the two inner loop sizes by traversing the data in a strict sequential order rather than accessing the data in a strict consecutive element order, thereby extracting elements along the second size in the connected vector path.
[0140] This algorithm works, but its implementation is impractical for small element sizes. Some algorithms work for matrices with multiple columns and rows together. Therefore, the streaming engine limits the granularity of the transpose. The hardware imposes a minimum granularity. The transpose granularity must also be at least as large as the element size. The transpose granularity allows the streaming engine to extract one or more consecutive elements from size 0 before moving along size 1. When the granularity is equal to the element size, this allows a single column to be extracted from the row-first array. Otherwise, the granularity specifies that two, four, or more columns are extracted from the row-first array at a time. This can also be applied to column-first layouts by swapping rows and columns in the description. The GRANULE parameter indicates the transpose granularity in the bytes.
[0141] Another common matrix multiplication technique swaps the two innermost loops of the matrix multiplication. The resulting inner loop, while reading rows across one matrix, no longer reads columns of the other matrix. For example, the algorithm could propose a term outside the inner loop and replace that term with a scalar value. On a vector machine, the innermost loop can be implemented very efficiently with a single scalar-wise multiplication followed by vector addition. The central processing unit core 110 of this invention lacks vector-wise multiplication. Instead, the program must copy scalar values across the vector length and use vector-wise multiplication. The streaming engine of this invention directly supports this and related usage models through an element-copying mode. In this mode, the streaming engine reads particles smaller than the full vector size and copies the particles to fill the next vector output.
[0142] The streaming engine processes each complex number as a single element with two sub-elements, which give the real and imaginary (rectangular) or magnitude and angle (polarity) parts of the complex number. Not all programs or peripherals agree on the order in which these sub-elements should appear in memory. Therefore, the streaming engine provides the ability to swap two sub-elements of a complex number at no cost. This feature swaps half of an element without interpreting its contents and can be used to exchange any type of sub-element pair, not just complex numbers.
[0143] Algorithms typically operate with high precision, but high-precision values require more storage and bandwidth compared to lower-precision values. Generally, programs store data in memory with low precision, boost the value to a higher precision for computation, and then downgrade the value to a lower precision for storage. Streaming engines directly support this action by allowing algorithms to specify a level of type boosting. In a preferred embodiment of the invention, each sub-element can be boosted to a larger type size using sign or zero extension of an integer type. Streaming engines can support floating-point boosting, making it possible to boost 16-bit and 32-bit floating-point values to 32-bit and 64-bit formats, respectively.
[0144] The streaming engine defines a stream as a discrete sequence of data elements, while the central processing unit core 110 consumes data elements consecutively packed in a vector. A vector, similar to a stream, contains multiple elements of the same type with a certain implicit sequence. Because the streaming engine reads streams, but the central processing unit core 110 consumes vectors, the streaming engine must map streams to vectors in a consistent manner.
[0145] A vector consists of paths of equal size, each containing sub-elements. The central processing unit core 110 designates the rightmost path of the vector as path 0, regardless of the device's current end-order mode. The number of paths increases from right to left. The actual number of paths within a vector varies depending on the length of the vector and the data size of its sub-elements.
[0146] Figure 20This describes the sequence of formatting operations of formatter 1903. Formatter 1903 comprises three parts: input section 2010; formatting section 2020; and output section 2030. Input section 2010 receives data recalled from system memory 1910 when accessed by stream address generator 1901. This data may be a path-line fetch stream 2011 or a transposed fetch stream 2012.
[0147] The formatting section 2020 contains various formatting blocks. The formatting performed by the formatter 1903 using these blocks will be further described below. The complex number transposition block 2021 optionally transposes two sub-elements forming a complex number element. The type promotion block 2022 optionally promotes each data element to a larger data size. Promotion includes zero expansion for unsigned integers and sign expansion for signed integers. The decimation block 2023 optionally decimates data elements. In a preferred embodiment, decimation may be a 4:1 hold every fourth data element and a 2:1 hold every other data element. The element copying block 2024 optionally copies individual data elements. In a preferred embodiment, this data element copying is a power of 2 (2N, when N is an integer), including 2x, 4x, 8x, 16x, 32x, and 64x. In a preferred embodiment, data copying may be extended across multiple destination vectors. The vector length mask / group copying block 2025 has two main functions. The independently specified vector length VECLEN controls the data elements supplied to each output data vector. When group copying is disconnected, excess paths in the output data vector are zero-padded. When group copying is on, input data elements of a specified vector length are copied to fill the output data vector.
[0148] The output section 2030 stores data for output to the corresponding functional unit. The CPU's registers and buffers 2031 store the formatted vector of data to be used as operands by the functional units of the central processing unit core 110.
[0149] Figure 21 This illustrates the first instance of path allocation in a vector. Vector 2100 is divided into eight 64-bit paths (8 × 64 bits = 512 bits of vector length). Path 0 contains bits 0 to 63; path 1 contains bits 64 to 127; path 2 contains bits 128 to 191; path 3 contains bits 192 to 255; path 4 contains bits 256 to 319; path 5 contains bits 320 to 383; path 6 contains bits 384 to 447; and path 7 contains bits 448 to 511.
[0150] Figure 22This illustrates a second instance of path allocation in a vector. Vector 2210 is divided into 16 32-bit paths (16 × 32 bits = 512 bits of vector length). Path 0 contains bits 0 to 31; Path 1 contains bits 32 to 63; Path 2 contains bits 64 to 95; Path 3 contains bits 96 to 127; Path 4 contains bits 128 to 159; Path 5 contains bits 160 to 191; Path 6 contains bits 192 to 223; Path 7 contains bits 224 to 255; Path 8 contains bits 256 to 287; Path 9 occupies bits 288 to 319; Path 10 contains bits 320 to 351; Path 11 contains bits 352 to 383; Path 12 contains bits 384 to 415; Path 13 contains bits 416 to 447; Path 14 contains bits 448 to 479; and Path 15 contains bits 480 to 511.
[0151] The streaming engine directly maps the innermost stream size to vector paths. It maps earlier elements within the size to lower path numbers and later elements to higher path numbers. This is always true regardless of whether the particular stream proceeds in ascending or descending address order. Regardless of the order in which the stream is defined, the streaming engine deposits elements into the vector in ascending path order. For non-complex data, it places the first element extracted by the central processing unit core 110 in path 0 of the first vector, the second element in path 1, and so on. For complex data, the streaming engine places the first element in paths 0 and 1, the second element in paths 2 and 3, and so on. Regardless of the stream direction, the sub-elements within an element retain the same relative order. For unswapped complex elements, the sub-elements with lower addresses in each pair are placed in even-numbered paths, and the sub-elements with higher addresses in each pair are placed in odd-numbered paths. Swapping complex elements reverses this mapping.
[0152] The streaming engine fills each vector, with the central processing unit core 110 extracting as many elements as possible from the innermost stream size. If the innermost size is not a multiple of the vector length, the streaming engine fills the size with zeros to make it a multiple of the vector length. Thus, for higher-size streams, the first element from each iteration of the outer size reaches path 0 of the vector. The streaming engine always maps the innermost size to consecutive paths in the vector. For transposed streams, due to the transpose swapping of the two sizes, the innermost size consists of a group of sub-elements along size 1, not size 0.
[0153] Two-dimensional streams exhibit more variety compared to one-dimensional streams. A basic two-dimensional stream extracts a smaller rectangle from a larger one. A transposed 2D stream reads rectangles column-wise rather than row-wise. A cyclic stream, where the second dimension overlaps with the first dimension, performs either a finite impulse response (FIR) filter tap (which repeatedly cycles) or an FIR filter sample (which provides a sliding window of input samples).
[0154] Figure 23 This describes the basic two-dimensional flow. Two internal dimensions, represented by ELEM_BYTES, ICNT0, DIM1, and ICNT1, provide sufficient flexibility to describe the extraction of a smaller rectangle 2320 with dimensions 2321 and 2322 from a larger rectangle 2310 with dimensions 2311 and 2312. In this example, rectangle 2320 is a 9x13 rectangle with 64-bit values, and rectangle 2310 is the larger 11x19 rectangle. The following flow parameters define this flow:
[0155] ICNT0 = 9
[0156] ELEM_BYTES = 8
[0157] ICNT1 = 13
[0158] DIM1 = 88 (11 multiplied by 8)
[0159] Therefore, the iteration count for size 0 (2321) is 9. The iteration count for direction 1 (2322) is 13. It should be noted that ELEM_BYTES only scales the innermost size. The first size has ICNT0 elements of size ELEM_BYTES. The stream address generator does not scale the outer size. Therefore, DIM1 = 88, which is 11 elements scaled at 8 bytes per element.
[0160] Figure 24 This describes the order of elements within the stream in this instance. The streaming engine extracts the elements of the stream in the order described in sequence 2400. The first 9 elements come from the first row of rectangle 2320, from left to right in hops 1 to 8. Elements 10 through 24 come from the second row, and so on. When the stream moves from the 9th element to the 10th element... Figure 24 At hop 9, the streaming engine calculates the new position based on the pointer position at the beginning of the inner loop, rather than the pointer position at the end of the first dimension. This makes DIM1 independent of ELEM_BYTES and ICNT0. DIM1 always represents the distance between the first bytes of each consecutive line.
[0161] The transposed flow is accessed along dimension 1 before dimension 0. The following example illustrates a coupled transposed flow that changes the transpose granularity. Figure 25 This describes how to extract a smaller rectangle 2520 (12×8) with dimensions 2521 and 2522 from a larger rectangle 2510 (14×13) with dimensions 2511 and 2512. Figure 25 In this context, ELEM_BYTES equals 2.
[0162] Figure 26This describes how the streaming engine will extract the stream of this instance with a 4-byte transpose granularity. Extraction mode 2600 extracts element pairs from each row (since granularity 4 is twice that of ELEM_BYTES 2), but also moves down the columns. Once it reaches the bottom of a pair of columns, it repeats this mode with respect to the next pair of columns.
[0163] Figure 27 This describes how the streaming engine will extract the stream of this instance with an 8-byte transpose granularity. The overall structure remains the same. As shown in extraction mode 2700, the streaming engine extracts 4 elements from each row before moving to the next row in the column (because granularity 8 is four times that of ELEM_BYTES 2).
[0164] The stream being examined has read each element from memory exactly once so far. A stream can read a given element from memory multiple times, effectively cycling through a single memory location. FIR filters exhibit two common cyclic modes. FIR rereads the same filter tap for each output. FIR also reads input samples from a sliding window. Two consecutive outputs will require inputs from two overlapping windows.
[0165] Figure 28 Details of the streaming engine 2800 are described below. The streaming engine 2800 comprises three main parts: Stream 0 2810, Stream 1 2820, and a shared L2 interface 2830. Stream 0 2810 and Stream 1 2820 both contain the same hardware for parallel operation. Stream 0 2810 and Stream 1 2820 share the L2 interface 2830. Each stream 2810 and 2820 provides up to 512 bits per cycle to the central processing unit core 110. The streaming engine architecture enables this through its dedicated streaming paths and shared dual L2 interfaces.
[0166] Each streaming engine 2800 includes a dedicated 6D stream address generator 2811 / 2821, which generates a new misalignment request each cycle. The address generator 2811 / 2821 outputs a 512-bit aligned address that overlaps with elements in a sequence defined by stream parameters. This will be described further below.
[0167] Each address generator 2811 / 2811 is connected to a dedicated microtable backing buffer (μTLB) 2812 / 2822. Each μTLB 2812 / 2822 translates a single 48-bit virtual address into a 44-bit physical address per cycle. Each μTLB 2812 / 2822 has 8 entries, covering a minimum of 32kB with 4kB pages or a maximum of 16MB with 2MB pages. Each address generator 2811 / 2821 generates 2 addresses per cycle. Each μTLB 2812 / 2822 translates only 1 address per cycle. To maintain throughput, the streaming engine 2800 utilizes the fact that most stream references will be within the same 4kB page. Therefore, address translation does not modify bits 0 through 11 of the address. If the aout0 and aout1 lines are in the same 4kB page (aout0[47:12] is the same as aout1[47:12]), then μTLB 2812 / 2822 only translates aout0 and reuses the translation for the higher bits of the two addresses.
[0168] The translated addresses are queued in command queues 2813 / 2823. These addresses are aligned with information from the corresponding memory allocation and trace blocks 2814 / 2824. The streaming engine 2800 does not explicitly manage μTLBs 2812 / 2822. The system memory management unit (MMU) invalidates μTLBs as needed during context switching.
[0169] Internal storage is allocated and tracked for 2814 / 2824 management flows, enabling data reuse and tracking the lifetime of each data slice. This will be described further below.
[0170] Reference queues 2815 / 2825 store sequences of references generated by corresponding address generators 2811 / 2821. This information drives the data formatting network so that it can present data to the central processing unit core 110 in the correct order. Each entry in reference queues 2815 / 2825 contains data to be read from the data storage and information necessary to align the data with respect to the central processing unit core 110. Reference queues 2815 / 2825 maintain the following information listed in Table 5 in each time slot:
[0171]
[0172] Table 5
[0173] Storage allocation and tracking 2814 / 2824 inserts references into reference queues 2815 / 2825 to generate new addresses for address generators 2811 / 2821. Storage allocation and tracking 2814 / 2824 removes references from reference queues 2815 / 2825 when data becomes available and there is space in the stream head register. When storage allocation and tracking 2814 / 2824 removes time slot references from reference queues 2815 / 2825 and formats the data, it checks whether the reference represents the last reference to the corresponding time slot. Storage allocation and tracking 2814 / 2824 compares the removal pointer of reference queues 2815 / 2825 with the recorded last reference for the time slot. If they match, then storage allocation and tracking 2814 / 2824 marks the time slot as inactive after it has processed the data.
[0174] The streaming engine 2800 has data storage 2816 / 2826 for an arbitrary number of elements. Deep buffering allows the streaming engine to fetch data far before the stream, thus hiding memory system latency. The appropriate amount of buffering may vary within the range of generational products. In the currently preferred embodiment, the streaming engine 2800 fetches 32 time slots into each stream. Each time slot holds 64 bytes of data.
[0175] The butterfly network 2817 / 2827 consists of a 7-stage butterfly network. The butterfly network 2817 / 2827 receives 128 bytes of input and produces 64 bytes of output. The first stage of the butterfly is actually a half-stage. It collects bytes that match misaligned extractions from two time slots and merges them into a single, rotated 64-byte array. The remaining 6 stages form the standard butterfly network. The butterfly network 2817 / 2827 performs the following operations: rotates the next element down to byte path 0; promotes the data type by powers of 2 if necessary; swaps the real and imaginary components of complex numbers if necessary; and converts big-endian to little-endian if the central processing unit core 110 is currently in big-endian mode. The user specifies the element size, type promotion, and real / imaginary swapping as part of the stream's parameters.
[0176] The streaming engine 2800 attempts to fetch and format data before the central processing unit core 110 requests, so that it can maintain full throughput. The streaming head registers 2818 / 2828 provide a small amount of buffering to keep the process fully pipelined. Besides the fact that the streaming engine 2800 provides full throughput, the holding registers 2818 / 2828 are not directly structurally visible.
[0177] The two streams 2810 / 2820 share a pair of independent L2 interfaces 2830: L2 interface A (IFA) 2833 and L2 interface B (IFB) 2834. Each L2 interface provides 512 bits / cycle throughput directly to the L2 controller for a combined bandwidth of 1024 bits / cycle. The L2 interfaces use a credit-based Multicore Bus Architecture (MBA) protocol. The L2 controller assigns each interface to its own command credit pool. The pool should have sufficient credit so that each interface can send enough requests to achieve full read return bandwidth when reading L2 RAM, L2 cache, and Multicore Shared Memory Controller (MSMC) memory (described below).
[0178] To maximize performance, the two streams can use two L2 interfaces, allowing a single stream to send peak commands at a rate of 2 requests / cycles. Each interface favors one stream over the other, but this preference changes dynamically between requests. IFA 2833 and IFB 2834 always favor the opposite stream; when IFA 2833 favors stream 0, IFB 2834 favors stream 1, and vice versa.
[0179] Arbitrators 2831 / 2832 apply the following basic protocol to each cycle with available credit before each interface 2833 / 2834. Arbitrators 2831 / 2832 check if the preferred flow has a command ready to be sent. If so, arbitrators 2831 / 2832 select the command. Arbitrators 2831 / 2832 then check if the alternative flow has at least two requests ready to be sent, or one command with no credit. If so, arbitrators 2831 / 2832 pull a command from the alternative flow. If either interface issues a command, the concepts of preferred and alternative flows are swapped for the next request. Using this simple algorithm, the scheduling of requests between the two interfaces is as fast as possible while maintaining fairness between the two flows. The first rule ensures that each flow can send a request on each cycle with available credit. The second rule provides a mechanism for one flow to borrow the other's interface when the second interface is idle. The third rule diffuses the bandwidth requirements for each flow across the two interfaces, ensuring that the interface itself does not become a bottleneck.
[0180] The coarse-grain rotators 2835 / 2836 enable the streaming engine 2800 to support a transposed matrix addressing mode. In this mode, the streaming engine 2800 swaps the two innermost dimensions of its multidimensional loop. This accesses the array column-wise, rather than row-wise. The rotators 2835 / 2836 are not structurally visible except when this transposed access mode is enabled.
[0181] The stream definition template provides the complete structure of a stream containing data. Iteration counts and dimensions provide most of the structure, while various flags provide the remaining details. For all streams containing data, the streaming engine defines a single stream template. All supported stream types fit this template. The streaming engine defines six levels of nested loops for addressing elements within the stream. Most fields in the stream template directly map to parameters in the algorithm. Figure 29 This describes stream template register 2900. The numbers above the fields are bit numbers within a 256-bit vector. Table 6 shows the stream field definitions for the stream template.
[0182]
[0183] Table 6
[0184] Loop 0 is the innermost loop and loop 5 is the outermost loop. In the current instance, DIM0 is always equal to ELEM_BYTES, which defines the physically contiguous data. Therefore, the stream template register 2900 does not define DIM0. The streaming engine 2800 interprets all iteration counts as unsigned integers and all sizes as unsealed signed integers. The template above fully specifies the element type, stream length, and size. The stream instruction specifies the start address separately. This will typically be determined by the specifications of the scalar register in the global scalar register file 211 that stores this start address. This allows the program to open multiple streams using the same template.
[0185] Figure 30 This describes the subfield definition of flag field 2911. For example... Figure 30 As shown, the flag field 2911 is 6 bytes or 48 bits. Figure 30 The field designation is shown. Table 7 shows the definitions of these fields.
[0186]
[0187] Table 7
[0188] The ELTYPE field 3001 specifies the data type of the elements in the stream. The four bits of the ELTYPE field 3001 are decoded as shown in Table 8.
[0189]
[0190] Table 8
[0191] The real / complex number type determines whether the streaming engine treats each element as either a real number or two parts of a complex number (real / imaginary or magnitude / angle). This field also specifies whether the two parts of a complex number are swapped. Complex numbers have a total element size that is twice the size of their child elements. Otherwise, the child element size is equal to the total element size.
[0192] The size of child elements is determined for the purpose of type promotion and vector path width. For example, when a streaming request type is promoted, a 16-bit child element is promoted to a 32-bit or 64-bit child element. Vector path width is critical when the CPU core 110 operates in big-endian mode because it always lays out vectors in little-endian order.
[0193] The total element size determines the smallest granularity of the stream. In the stream addressing model, it determines the number of bytes the stream fetches for each iteration of the innermost loop. The stream always reads all elements in ascending or descending order. Therefore, the innermost size of the stream spans ICNT0 × total element size bytes.
[0194] The TRANSPOSE field 3002 determines whether the streaming engine accesses the stream in transposed order. Transposed order swaps the two internal addressing levels. The TRANSPOSE field 3002 also indicates the granularity of its transposed stream. The decoding of the three bits of the TRANSPOSE field 3002 is defined for normal 2D operation as shown in Table 9.
[0195]
[0196] Table 9
[0197] The streaming engine 2800 can transpose data elements at granularities different from the element size. This allows programs to extract multiple columns from each row of elements. The transpose granularity must be no smaller than the element size. The TRANSPOSE field 3002 interacts with the DIMFMT field 3009 in a manner further described below.
[0198] The PROMOTE field 3003 controls whether the streaming engine promotes child elements in the stream and the type of promotion. When enabled, the streaming engine 2800 promotes types in powers of 2. The decoding of the three bits of the PROMOTE field 3003 is defined as shown in Table 10.
[0199]
[0200] Table 10
[0201] When PROMOTE is 000, it corresponds to 1x promotion, where each child element remains unchanged and occupies a vector path with a width equal to that specified by ELTYPE. When PROMOTE is 001, it corresponds to 2x promotion and zero extension, where each child element is treated as an unsigned integer and zero-extended to a vector path twice the width specified by ELTYPE. 2x promotion has no effect on 64-bit initial child element sizes. When PROMOTE is 010, it corresponds to 4x promotion and zero extension, where each child element is treated as an unsigned integer and zero-extended to a vector path four times the width specified by ELTYPE. 4x promotion has no effect on 32-bit or 64-bit initial child element sizes. When PROMOTE is 011, it corresponds to 8x promotion and zero extension, where each child element is treated as an unsigned integer and zero-extended to a vector path eight times the width specified by ELTYPE. 8x promotion has no effect on 16-bit, 32-bit, or 64-bit initial child element sizes. When PROMOTE is 101, it corresponds to 2x promotion and sign extension. Each child element is treated as a signed integer, and the sign extension is doubled to the width of the vector path specified by ELTYPE. 2x promotion has no effect on initial child element sizes of 64 bits. When PROMOTE is 110, it corresponds to 4x promotion and sign extension. Each child element is treated as a signed integer, and the sign extension is doubled to the width of the vector path specified by ELTYPE. 4x promotion has no effect on initial child element sizes of 32 or 64 bits. When PROMOTE is 111, it corresponds to 8x promotion and zero extension. Each child element is treated as a signed integer, and the sign extension is doubled to the width of the vector path specified by ELTYPE. 8x promotion has no effect on initial child element sizes of 16, 32, or 64 bits.
[0202] The VECLEN field 3004 defines the stream vector length of the stream in bytes. The streaming engine 2800 splits the stream into groups of elements of length VECLEN bytes. The decoding of the three bits defining the VECLEN field 3004 is shown in Table 11.
[0203]
[0204] Table 11
[0205] VECLEN must be greater than or equal to the product of the element size in the byte and the replication factor. As shown in Table 11, the maximum VECLEN for 64 bytes is equal to the preferred vector size of the vector data path side B 116. When VECLEN is shorter than the natural vector width of the central processing unit core 110, the streaming engine 2800 fills in additional paths in the vector to the central processing unit core 110. The GRDUP field 3006 determines the filling type. The VECLEN field 3004 interacts with the ELDUP field 3005 and the GRDUP field 3006 in a manner detailed below.
[0206] The ELDUP field 3005 specifies the number of times each element is copied. The element size multiplied by the number of element copies must not exceed 64 bytes. The decoding of the three bits of the ELDUP field 3005 is defined as shown in Table 12.
[0207]
[0208] Table 12
[0209] The ELDUP field 3005 interacts with the VECLEN field 3004 and the GRDUP field 3006 in the manner detailed below.
[0210] Tables 13A to 13D show the connections between input and output bytes for different values of ELEM_BYTES (1) and ELDUP (1 to 64). The columns in Tables 13A to 13D list the output bytes from byte 0 to byte 63. The bodies of Tables 13A to 13D list the corresponding input bytes for the element replication factor of the rows.
[0211]
[0212] Table 13A
[0213]
[0214] Table 13B
[0215]
[0216] Table 13C
[0217]
[0218] Table 13D
[0219] The rows in Tables 13A to 13D with ELDUP=000 (indicating no replication) show that the output byte is the corresponding input byte. The rows in Tables 13A to 13D with ELDUP=110 (indicating replication factor 64) show that all output bytes are equal to the input byte 0.
[0220] Tables 14A to 14D illustrate the connections between input and output bytes for different values 1 to 64 of ELEM_BYTES value 2 and ELDUP. A copy of ELEM_BYTES value 2 with value 64 extends the vector beyond the vector size B 116 on the vector data path side into the next vector.
[0221]
[0222] Table 14A
[0223]
[0224] Table 14B
[0225]
[0226] Table 14C
[0227]
[0228] Table 14D
[0229] In Tables 14A to 14D, each element is two bytes and occupies a pair of adjacent input bytes 0 / 1, 2 / 3, 4 / 5...62 / 63. The row in Tables 14A to 14D where ELDUP=000 (indicating no copy) shows that the output byte is the corresponding input byte. This is the same as when ELEM_BYTES=1. The rows in Tables 14A to 14D where ELDUP=101 (indicating a copy factor of 32) and ELDUP=110 (indicating a copy factor of 64) show that the output byte is a repeat of the first input element from input byte 0 / 1.
[0230] Tables 15A to 15D illustrate the connections between input and output bytes for different values of 1 to 64 for ELEM_BYTES value 4 and ELDUP. A copy of ELEM_BYTES value 4, with values 32 or 64, extends the vector data path by more than the vector size B 116 before entering the next vector.
[0231]
[0232] Table 15A
[0233]
[0234] Table 15B
[0235]
[0236] Table 15C
[0237]
[0238] Table 15D
[0239] In Tables 15A to 15D, each element is four bytes and occupies four input bytes 0 / 1 / 2 / 3, 4 / 5 / 6 / 7...60 / 61 / 62 / 63. The row in Tables 15A to 15D where ELDUP=000 (indicating no replication) shows that the output byte is the corresponding input byte. This is the same as when ELEM_BYTES=1. The rows in Tables 15A to 15D where ELDUP=011 (indicating replication factor 16), ELDUP=101 (indicating replication factor 32), and ELDUP=110 (indicating replication factor 64) show that the output byte is a repeat of the first input element from input bytes 0 / 1 / 2 / 3.
[0240] Tables 16A to 16D illustrate the connections between input and output bytes for different values of ELEM_BYTES (8) and ELDUP (1 to 64). A copy of ELEM_BYTES (8) with values 16, 32, or 64 extends the vector data path by more than vector size B116 before entering the next vector.
[0241]
[0242] Table 16A
[0243]
[0244] Table 16B
[0245]
[0246] Table 16C
[0247]
[0248] Table 16D
[0249] In Tables 16A to 16D, each element is eight bytes and occupies a set of eight input bytes 0 / 1 / 2 / 3 / 4 / 5 / 6 / 7……56 / 57 / 58 / 59 / 60 / 61 / 62 / 63. The row in Tables 16A to 16D where ELDUP=000 (indicating no replication) shows that the output byte is the corresponding input byte. This is the same as when ELEM_BYTES=1. The rows in Tables 16A to 16D where ELDUP=011 (indicating replication factor 8), ELDUP=011 (indicating replication factor 16), ELDUP=101 (indicating replication factor 32), and ELDUP=110 (indicating replication factor 64) show that the output byte is a repeat of the first input element from input bytes 0 / 1 / 2 / 3 / 4 / 5 / 6 / 7.
[0250] Tables 17A to 17D show the connections between input and output bytes for different values 1 to 64 of ELEM byte value 16 and ELDUP. A copy of ELEM_BYTES value 16 with values 8, 16, 32, or 64 extends the vector data path by a vector size of B 116 into the next vector.
[0251]
[0252] Table 17A
[0253]
[0254] Table 17B
[0255]
[0256] Table 17C
[0257]
[0258] Table 17D
[0259] In Tables 17A to 17D, each element is sixteen bytes and occupies a set of sixteen input bytes 0 / 1…14 / 15…32 / 33…62 / 63. The row in Tables 17A to 17D where ELDUP=000 (indicating no replication) shows that the output byte is the corresponding input byte. This is the same as when ELEM_BYTES=1. The rows in Tables 17A to 17D where ELDUP=010 (indicating replication factor 4), ELDUP=011 (indicating replication factor 8), ELDUP=011 (indicating replication factor 16), ELDUP=101 (indicating replication factor 32), and ELDUP=110 (indicating replication factor 64) show that the output byte is a repetition of the first input element from input bytes 0 / 1…14 / 15.
[0260] Tables 18A to 18D show the connections between input and output bytes for different values 1 to 64 of ELEM byte value 32 and ELDUP. A copy of ELEM_BYTES value 32 with values 4, 8, 16, 32, or 64 extends the vector data path by a vector size of B 116 into the next vector.
[0261]
[0262] Table 18A
[0263]
[0264] Table 18B
[0265]
[0266] Table 18C
[0267]
[0268] Table 18D
[0269] In Tables 18A to 18D, each element is thirty-two bytes and occupies a set of thirty-two input bytes 0 / 1…30 / 31 and 32 / 33…62 / 63. The rows in Tables 18A to 18D where ELDUP=000 (indicating no replication) show that the output byte is the corresponding input byte. This is the same as when ELEM_BYTES=1. The rows in Tables 18A to 18D where ELDUP=001 (indicating replication factor 2), ELDUP=010 (indicating replication factor 4), ELDUP=011 (indicating replication factor 8), ELDUP=011 (indicating replication factor 16), ELDUP=101 (indicating replication factor 32), and ELDUP=110 (indicating replication factor 64) show that the output byte is a repetition of the first input element from input bytes 0 / 1…30 / 31.
[0270] Tables 19A to 19D show the connections between input and output bytes for different values 1 to 64 of ELEM byte value 64 and ELDUP. A copy of ELEM_BYTES value 64 with values 2, 4, 8, 16, 32, or 64 extends the vector data path by a vector size B 116 into the next vector.
[0271]
[0272] Table 19A
[0273]
[0274] Table 19B
[0275]
[0276] Table 19C
[0277]
[0278] Table 19D
[0279] In Tables 19A to 19D, each element is sixty-four bytes and occupies a set of sixty-four input bytes 0 / 1…62 / 63. The row in Tables 19A to 19D where ELDUP=000 (indicating no copy) shows that the output byte is the corresponding input byte. This is the same as when ELEM_BYTES=1. All other rows show that the output byte is a repeat of the first input element from input bytes 0 / 1…62 / 63.
[0280] Figure 31 This describes an exemplary embodiment of element copy block 2024. Input register 3100 receives vector input from extraction block 2023. Input register 3100 contains 64 bytes arranged in 64 one-byte blocks byte0 to byte63. Note that the length of each byte from byte0 to byte63 is equal to the minimum value of ELEM_BYTES. Multiple multiplexers 3101 to 3163 couple input bytes from source register 3100 to output register 3170. Each multiplexer 3101 to 3163 supplies input to the corresponding byte1 to byte63 of output register 3170. Not all input bytes from input register 3100 are coupled to each multiplexer 3101 to 3163. Note that there is no multiplexer supplying byte0 of output register 3170. Byte0 of output register 3170 is always supplied by byte0 of input register 3100.
[0281] Multiplexers 3101 to 3163 are controlled by multiplexer control encoder 3180. Multiplexer control encoder 3180 receives the ELEM_BYTES and ELDUP input signals and generates corresponding control signals for multiplexers 3101 to 3163. Tables 13A to 13D, 14A to 14D, 15A to 15D, 16A to 16D, 17A to 17D, 18A to 18D, and 19A to 19D are directly translated into multiplexer control for multiplexers 3101 to 3163 to achieve the desired element copying. Referring to Tables 13A to 13D, 14A to 14D, 15A to 15D, 16A to 16D, 17A to 17D, 18A to 18D, and 19A to 19D shows that not all input bytes are available for every output byte. Therefore, Tables 13A to 13D, 14A to 14D, 15A to 15D, 16A to 16D, 17A to 17D, 18A to 18D, and 19A to 19D show Figure 31 The required connections between input register 3100 and multiplexers 3101 to 3163 are shown. Furthermore, Tables 13A to 13D, 14A to 14D, 15A to 15D, 16A to 16D, 17A to 17D, 18A to 18D, and 19A to 19D show the required codes in multiplexer control codes 3180.
[0282] As mentioned above, there are combinations of element size and replication factor (ELDUP) that produce more bits than the size of destination register 3170 (preferably 512 bits). In this case, after destination register 3170 is full, this data is supplied from element copy block 2024 to vector length mask / group copy block 2025 for final supply to the corresponding stream head registers 2818 / 2828. The rate at which data moves in formatter 1903 is set by central processing unit core 110 via the rate at which stream read and forward instructions consume data, as described below.
[0283] Next, element copy block 2024 supplies the copied elements to another destination vector. The inherent relationship between the permitted element size, the element copy factor, and the destination vector length requires that copied elements overflowing the first destination register will fill an integer number of destination registers after copying is complete. Data in these additional destination registers is ultimately supplied to the corresponding stream head registers 2818 / 2828. After the copying of the first data element is complete, the next data element is rotated down to the least significant bit of the source register 3100 that discarded the first data element. The process is then repeated for this new data element.
[0284] The GRDUP bit 3006 determines whether group replication is enabled. If the GRDUP bit 3006 is 0, group replication is disabled. If the GRDUP bit 3006 is 1, group replication is enabled. When enabled by the GRDUP bit 3006, the streaming engine 2800 replicates a group of elements to fill the vector width. The VECLEN field 3004 limits the length of the replicated group. When the VECLEN field 3004 is less than the vector length of the central processing unit core 110 and the GRDUP bit 3006 enables group replication, the streaming engine 2800 fills additional paths with additional copies of the streaming vector (see [link to relevant documentation]). Figure 20 and 21 Since the stream vector length and the vector length of the central processing unit core 110 are always powers of two, group replication always produces a power of two number of copies. It should be noted that GRDUP and VECLEN do not specify the number of replications. The number of replications is based on the ratio of VECLEN to the natural vector length, which in the preferred embodiment is 64 bytes / 512 bits.
[0285] The GRDUP field 3006 specifies how the streaming engine 2800 pads the streaming vector with bits after the VECLEN length exceeds the vector length of the central processing unit core 110. When the GRDUP bit 3006 is 0, the streaming engine 2800 fills the extra paths with zeros and marks these extra vector paths as invalid. When the GRDUP bit 3006 is 1, the streaming engine 2800 fills the extra paths with a group of copies of the elements in each streaming vector. Setting the GRDUP bit 3006 to 1 has no effect when the VECLEN is set to the natural vector width of the central processing unit core 110. The VECLEN must be at least as large as the product of ELEM_BYTES and the element replication factor ELDUP. That is, the number of elements or the replication factor of elements cannot be separated using VECLEN.
[0286] Group replication operates only on the destination vector size. When the product of the element size ELEM_BYTES and the element replication factor ELDUP is equal to or greater than the destination vector width, group replication does not change the supplied data. Under these conditions, the state of GRDUP bit 3006 and VECLEN field 3004 has no effect on the supplied data.
[0287] The following set of examples illustrates the interaction between VECLEN and GRDUP. Each of the following examples shows how the streaming engine maps streams to vectors across different stream vector lengths and vector data path sizes (B 116). This example's stream consists of 29 elements (E0 to E28), each element being 64 bits / 8 bytes. This stream can be a linear stream of 29 elements or an inner loop of 29 elements. These tables illustrate, for example... Figure 20 The 8-byte path is illustrated in the diagram. Each illustrated vector is then stored in the corresponding stream head register 2818 / 2828.
[0288] Table 20 illustrates how instance streams are mapped to bits within a 64-byte CPU vector when VECLEN is 64 bytes.
[0289]
[0290] Table 20
[0291] As shown in Table 20, the flow extends across four vectors. As previously described, paths extending beyond the four vectors of the flow are zero-padded. Whether GRDUP is 0 or 1 is irrelevant when the size of VECLEN is equal to the natural vector length. Replication cannot occur through the VECLEN.
[0292] Except for the 32-byte VECLEN, Table 21 shows the same parameters as those shown in Table 20. Group replication is disabled (GRDUP=0).
[0293]
[0294] Table 21
[0295] The 29 elements of the stream are distributed across paths 0 to 3 in 8 vectors. The additional paths 4 to 7 in vectors 1 to 7 are zero-padded.
[0296] Except for the 16-byte VECLEN, Table 22 shows the same parameters as shown in Table 20. Group replication is disabled (GRDUP=0).
[0297]
[0298] Table 22
[0299] The 29 elements of the stream are distributed across paths 0 to 1 in 15 vectors. The additional paths 2 to 7 in vectors 1 to 14 are zero-padded. In vector 15, only path 1 has a stream element (E28), and all other paths are zero-padded.
[0300] Except for the 8-byte VECLEN, Table 23 shows the same parameters as shown in Table 20. Group replication is disabled (GRDUP=0).
[0301]
[0302] Table 23
[0303] All 29 elements of the stream appear on path 0 in the 29 vectors. The additional paths 1 to 7 in vectors 1 to 29 are zero-padded.
[0304] Except for the 32-byte VECLEN and the enabled group replication (GRDUP=1), Table 24 shows the same parameters as those shown in Table 20.
[0305]
[0306] Table 24
[0307] The 29 elements of the stream are distributed across paths 0 through 7 in 8 vectors. Each vector 1 through 7 contains four replicated elements. The replication factor (2) is generated because VECLEN (32 bytes) is half the natural vector length of 64 bytes. In vector 8, path 0 has the stream element (E28), and paths 1 through 3 are zero-padded. Paths 4 through 7 of vector 9 replicate this pattern.
[0308] Except for the 16-byte VECLEN, Table 25 shows the same parameters as shown in Table 20. Group replication is enabled (GRDUP=1).
[0309]
[0310] Table 25
[0311] The 29 elements of the stream are distributed across paths 0 through 7 in 15 vectors. Each vector 1 through 7 contains two elements that have been copied four times. The replication factor (4) is generated because VECLEN (16 bytes) is one-quarter of the natural vector length of 64 bytes. In vector 15, path 0 has the stream element (E28), and path 1 is zero-padded. This pattern is replicated in paths 2 and 3, paths 4 and 5, and paths 6 and 7 of vector 15.
[0312] Except for the 8-byte VECLEN, Table 26 shows the same parameters as shown in Table 20. Group replication is enabled (GRDUP=1).
[0313]
[0314] Table 26
[0315] All 29 elements of the stream appear on paths 0 through 7 in the 29 vectors. Each vector 1 through 7 contains one element that has been copied eight times. The replication factor (8) is generated because VECLEN (8 bytes) is one-eighth the length of a natural vector of 64 bytes. Therefore, each path is identical in vectors 1 through 29.
[0316] Figure 32 This describes an exemplary embodiment of the vector length mask / group copy block 2025. Input register 3200 receives vector input from element copy block 2024. Input register 3200 contains 64 bytes arranged in 64 one-byte blocks byte0 to byte63. Note that the length of each byte from byte0 to byte63 is equal to the minimum value of ELEM_BYTES. Multiple multiplexers 3201 to 3263 couple the input bytes from source register 3200 to output register 3270. Each multiplexer 3201 to 3263 supplies input to the corresponding byte1 to byte63 of output register 3270. Not all input bytes byte0 to byte63 of input register 3200 are coupled to each multiplexer 3201 to 3263. Note that there is no multiplexer supplying byte0 of output register 3270. Byte0 of output register 3270 is always supplied by byte0 of input register 3200.
[0317] Multiplexers 3201 to 3263 are controlled by multiplexer-controlled encoder 3280. Multiplexer-controlled encoder 3280 receives the ELEM_BYTES, ELDUP, VECLEN, and GRDUP input signals and generates corresponding control signals for multiplexers 3201 to 3263. ELEM_BYTES and ELDUP are supplied to multiplexer-controlled encoder 3280 for checking to ensure that VECLEN is at least as large as the product of ELEM_BYTES and ELDUP. In operation, multiplexer-controlled encoder 3280 controls multiplexers 3201 to 3263 to send the least significant bit of VECLEN from input register 3200 to output register 3270. If GRDUP=0 indicates that group copying is disabled, then the multiplexer-controlled encoder 3280 controls the remaining multiplexers 3201 to 3263 to feed zeros to all bits in the remaining most significant path of the output register 3270. If GRDUP=1 indicates that group copying is enabled, then the multiplexer-controlled encoder 3280 controls the remaining multiplexers 3201 to 3263 to copy the VECLEN value of the least significant bit of the input register 3200 to the most significant path of the output register 3270. This control is similar to the element copying control described above. The output register 3270 is filled with the first vector. For the next vector, the data in the input register 3200 is rotated down by VECLEN, discarding the previous least significant bit of VECLEN. The rate at which data moves in the formatter 1903 is set by the central processing unit core 110 via the rate at which the stream read and forward instructions consume data, as described below. This group copying formatting is repeated as long as the stream contains additional data elements.
[0318] Element copy (ELDUP) and group copy (GRUDP) are independent. It should be noted that these features have independent specifications and parameter settings. Therefore, element copy and group copy can be used together or separately. Due to the way these are specified, element copy allows overflow to the next vector, while group copy does not.
[0319] The DECIM field 3007 controls the extraction of data elements from the corresponding stream. The streaming engine 2800 removes data elements from the stream after storing them in the stream head registers 2818 / 2828 for presentation to the request function unit. Extraction always removes all data elements, not just sub-elements. The DECIM field 3007 is defined as listed in Table 27.
[0320]
[0321] Table 27
[0322] If DECIM field 3007 equals 00, decimation does not occur. Data elements are passed to the corresponding stream head registers 2818 / 2828 without modification. If DECIM field 3007 equals 01, 2:1 decimation occurs. The streaming engine 2800 removes odd-numbered elements from the data stream after storing them in the stream head registers 2818 / 2828. Constraints in the formatted network require 2:1 decimation with at least 2x data boost (PROMOTE cannot be 000), ICNT0 must be a multiple of 2, and the total vector length (VECLEN) must be large enough to maintain a single boosted, copied element. For transposed streams (TRANSPOSE ≠ 0), the transpose granules must be at least twice the size of the element in the byte before boosting. If DECIM field 3007 equals 10, 4:1 decimation occurs. The streaming engine 2800 retains every fourth data element after storing it in the stream head registers 2818 / 2828, removing three elements from the data stream. Constraints in the formatted network require a 4:1 decimation with at least 4x data boost (PROMOTE cannot be 000, 001, or 101), ICNT0 must be a multiple of 4, and the total vector length (VECLEN) must be large enough to maintain a single boosted, copied element. For transposed streams (TRANSPOSE ≠ 0), decimation always removes columns and never rows. Therefore, the transpose granularity must be at least twice the size of the element in the byte before the boost (GRANULE ≥ 2 × ELEM_BYTES) used for 2:1 decimation; and at least four times the size of the element in the byte before the boost (GRANULE ≥ 4 × ELEM_BYTES) used for 4:1 decimation.
[0323] The THROTTLE field 3008 controls the intensity to which the streaming engine retrieves data before the central processing unit core 110. The decoding of the two bits of this field is defined as shown in Table 28.
[0324]
[0325] Table 28
[0326] `THROTTLE` does not change the meaning of the stream and is only used as a hint. The streaming engine can ignore this field. For program correctness, programs should not rely on specific throttling characteristics because the architecture does not specify precise throttling characteristics. Throttling allows programmers to provide hints to the hardware about the characteristics of the program itself. By default, the streaming engine attempts to provide full streaming throughput to the CPU core 110 well ahead of the CPU core 110, as it can hide as much latency as possible (equivalent to `THOTTLE=11`). While some critical applications require this level of throughput, it can cause undesirable system-level characteristics for others. For example, the streaming engine discards all fetched data during context switching. Therefore, aggressive fetching can lead to wasted bandwidth in systems with a large number of context switches. Aggressive fetching is only meaningful in systems where the CPU core 110 consumes data extremely rapidly.
[0327] The DIMFMT field 3009 implements the redefinition of the cycle count fields ICNT0 2901, ICNT1 2902, ICNT2 2903, ICNT3 2904, ICNT4 2905, and ICNT5 2906, the cycle size fields DIM1 2922, DIM2 2923, DIM3 2924, DIM4 2925, and DIM5 2926, and the addressing mode fields AM0 3013, AM1 3014, AM2 3015, AM3 3016, AM4 3017, and AM5 3018 (part of the FLAGS field 2911) of the stream template register 2900. This allows some cycle size fields and cycle counts to contain more bits at the cost of fewer cycles. Table 29 lists the size of the cycle size field for different values of the DIMFMT field 3009. 9
[0329] Table 29
[0330] It should be noted that DIM0 is always equal to the data element size ELEM_BYTES. Table 30 lists the size of the loop count field for different values of the DIMFMT field 3009.
[0331]
[0332] Table 30
[0333] The DIMFMT field 3009 effectively defines the loop size and the loop count bits of the stream template register 2800. Figure 28 This explains the default behavior when DIMFMT is 111.
[0334] Figures 33 to 37This describes the bit definitions for the stream template register for other values of DIMFMT. Note that the positions and meanings of the FLAGS fields (3311, 3411, 3511, 3611, and 3711) are the same for all values of DIMFMT.
[0335] Figure 33 This describes the bit definitions for stream template register 3300 with a DIMFMT value of 000. For a DIMFMT value of 000, there are three loops: loop0, loop2, and loop4. For loop0, ICNT0 field 3301 contains bits 0 to 33, and the DIM0 field is equal to ELEM_BYTES. For loop2, ICNT2 field 3302 contains bits 32 to 63, and DIM2 field 3321 contains bits 160 to 191. For loop4, INTC4 field 3303 contains bits 64 to 95, and DIM4 field 3322 contains bits 192 to 223.
[0336] Figure 34 This describes the bit definitions for stream template register 3400 with a DIMFMT value of 001. For a DIMFMT value of 001, there are four loops: loop0, loop1, loop2, and loop4. For loop0, ICNT0 field 3401 contains bits 0 to 16, and the DIM0 field is equal to ELEM_BYTES. For loop1, ICNT1 field 3402 contains bits 16 to 31, and DIM1 field 3423 contains bits 224 to 255. For loop2, INTC2 field 3403 contains bits 32 to 63, and DIM2 field 3421 contains bits 160 to 191. For loop4, INTC4 field 3404 contains bits 64 to 95, and DIM4 field 3422 contains bits 192 to 223.
[0337] Figure 35 This describes the bit definitions for stream template register 3500 with a DIMFMT value of 010. For a DIMFMT value of 010, there are four loops: loop0, loop2, loop3, and loop4. For loop0, ICNT0 field 3501 contains bits 0 to 32, and the DIM0 field is equal to ELEM_BYTES. For loop2, ICNT2 field 3502 contains bits 32 to 47, and DIM2 field 3521 contains bits 160 to 191. For loop3, INTC3 field 3503 contains bits 48 to 63, and DIM3 field 3523 contains bits 224 to 255. For loop4, INTC4 field 3504 contains bits 64 to 95, and DIM4 field 3522 contains bits 192 to 223.
[0338] Figure 36This describes the bit definitions for stream template register 3600 with a DIMFMT value of 011. For a DIMFMT value of 011, there are five loops: loop0, loop1, loop2, loop3, and loop4. For loop0, ICNT0 field 3601 contains bits 0 to 15, and the DIM0 field is equal to ELEM_BYTES. For loop1, ICNT1 field 3602 contains bits 16 to 31, and DIM1 field 3621 contains bits 144 to 159. For loop2, ICNT2 field 3603 contains bits 32 to 47, and DIM2 field 3621 contains bits 160 to 191. For loop3, INTC3 field 3604 contains bits 48 to 63, and DIM3 field 3624 contains bits 224 to 255. For loop4, INTC4 field 3605 contains bits 64 to 95, and DIM4 field 3623 contains bits 192 to 223.
[0339] Figure 37 This describes the bit definitions for the stream template register 3700 for a DIMFMT value of 101. For a DIMFMT value of 110, there are six loops: loop0, loop1, loop2, loop3, loop4, and loop5. For loop0, the ICNT0 field 3701 contains bits 0 to 15, and the DIM0 field is equal to ELEM_BYTES. For loop1, the ICNT1 field 3702 contains bits 16 to 31, and the DIM1 field 3721 contains bits 144 to 159. For loop2, the ICNT2 field 3703 contains bits 32 to 47, and the DIM2 field 3722 contains bits 160 to 191. For loop3, the INTC3 field 3704 contains bits 48 to 63, and the DIM3 field 3725 contains bits 224 to 255. For loop4, the INTC4 field 3705 contains bits 64 to 79, and the DIM4 field 3723 contains bits 192 to 207. For loop 5, INTC5 field 3706 contains bits 80 to 95, and DIM5 field 3724 contains bits 208 to 223.
[0340] DIR bit 3010 determines the fetch direction of the inner loop (Loop0). If DIR bit 3010 is 0, then Loop0 fetches in the forward direction for incrementing addresses. If DIR bit 3010 is 1, then Loop0 fetches in the backward direction for decrementing addresses. The fetch direction of the other loops is determined by the sign of the corresponding loop sizes DIM1, DIM2, DIM3, DIM4, and DIM5, which are signed integers.
[0341] CBK0 field 3011 and CBK1 field 3012 control the circular block size after circular addressing is selected. The method for determining the circular block size will be described in more detail below.
[0342] Fields AM0 (3013), AM1 (3014), AM2 (3015), AM3 (3016), AM4 (3017), and AM5 (3018) control the addressing mode for the corresponding cycle. This allowed addressing mode is specified independently for each cycle. Each of fields AM0 (3013), AM1 (3014), AM2 (3015), AM3 (3016), AM4 (3017), and AM5 (3018) is three bits and decoded as listed in Table 31.
[0343]
[0344] Table 31
[0345] In linear addressing, the address proceeds forward or backward according to address arithmetic. In circular addressing, the address remains within a defined address block. After reaching the end of the circular address block, the address wraps around other constraints of the block. A circular address block is typically limited to 2^N addresses, where N is an integer. Circular address arithmetic operates by cutting carry chains between bits rather than allowing a selected number of most significant bits to be changed. Therefore, arithmetic beyond the end of the circular block only changes the least significant bits.
[0346] The block size is set as listed in Table 32.
[0347]
[0348] Table 32
[0349] In a preferred embodiment, the circular block size is set by the number of CBK0 encoded (first circular address mode 01) or the number of CBK0+CBK1+1 encoded (second circular address mode 10). For example, in the first circular address mode, the circular address block size can be from 512 bytes to 16 M bytes. For the second circular address mode, the circular address block size can be from 1 K bytes to 64 G bytes. Therefore, the encoded block size is 2(B+9) bytes, where B is the number of encoded blocks, which is CBK0 for the first block size (AMx is 01) and CBK0+CBK1+1 for the second block size (AMx is 10).
[0350] The central processing unit core 110 exposes the streaming engine to the program through a small number of instructions and special-purpose registers. The STROPEN instruction opens a stream. The STROPEN command specifies the stream number that indicates stream 0 or stream 1 to be opened. STROPEN specifies the stream template register that stores the stream template as described above. The arguments of the STROPEN instruction are listed in Table 33.
[0351]
[0352] Table 33
[0353] The stream start address register is preferably a scalar register in the global scalar register file 211. The STROPEN instruction specifies stream 0 or stream 1 via its opcode. The stream template register is preferably a vector register in the general-purpose vector register file 221. If the specified stream is active, the STROPEN instruction closes the previous stream and replaces it with the specified stream.
[0354] The STRCLOSE command closes a stream. The STRCLOSE command specifies the stream number of the stream to be closed.
[0355] The STRSAVE instruction captures enough status information for a specified stream to restart the stream in the future. The STRRSTR instruction restores a previously saved stream. The STRSAVE instruction does not save any of the stream's data. The STRSAVE instruction only saves metadata. The stream responds to the STRRSTR instruction to retrieve data again.
[0356] The streaming engine exists in one of three states: inactive, active, or frozen. When inactive, the streaming engine is inactive. Any attempt to extract data from an inactive streaming engine is incorrect. The streaming engine remains inactive until a program opens the stream. The streaming engine also becomes inactive after a program consumes all elements in the stream or closes the stream. Programs using the stream explicitly activate and deactivate the streaming engine. The operating environment manages the stream at context switching boundaries via the implicit freeze feature of the streaming engine, which is coupled with its own explicit save and restore actions.
[0357] An active streaming engine has a stream associated with it. A program can extract new stream elements from an active streaming engine. A streaming engine remains active until one of the following occurs: it becomes inactive when the stream extracts its last element; or it becomes inactive when the program explicitly closes the stream. A streaming engine freezes when the CPU core 110 responds to an interrupt or exception. When a streaming engine freezes, the frozen streaming engine captures all the states necessary to restore the stream it is in. Streaming engines freeze in response to interrupts and exceptions. This, combined with special instructions for saving and restoring the frozen stream context, allows for a clean context switch in the operating environment. The frozen stream is reactivated when the CPU core 110 returns to the interrupt context.
[0358] Figure 38A partial schematic diagram 3800 is provided to illustrate the stream input operand decoding described above. Figure 38 This describes the decoding of the src1 field 1305 of an instruction corresponding to the src1 input of functional unit 3820. These same circuits are replicated for the src2 / cst field 1304 and the src2 input of functional unit 3820. Additionally, these circuits are replicated to execute each instruction that can be simultaneously scheduled within a group.
[0359] The instruction decoder 113 receives bits 13 to 17 of the src1 field 1305, which includes the instruction. The opcode field (bits 4 to 12 for all instructions, and bits 28 to 31 for unconditional instructions) explicitly specifies the corresponding functional unit 3820. In this embodiment, functional unit 3820 may be L2 unit 241, S2 unit 242, M2 unit 243, N2 unit 244, or C unit 245. Figure 38 The relevant part of the instruction decoder 113, as described herein, decodes the src1 bit field 1305. Sub-decoder 3811 determines whether the src1 bit field 1305 is in the range 00000 to 01111. If so, sub-decoder 3811 supplies the corresponding register number to the global vector register file 231. In this example, this register field is the four least significant bits of the src1 bit field 1305. The global vector register file 231 recalls the data stored in the register corresponding to this register number and supplies this data to the src1 input of functional unit 3820. This decoding is generally known in the art.
[0360] Sub-decoder 3812 determines whether the src1 bit field 1305 is within the range of 10000 to 10111. If so, sub-decoder 3812 supplies the corresponding register number to the corresponding local vector register file. If the instruction involves L2 unit 241 or S2 unit 242, the corresponding local vector register file is local vector register field 232. If the instruction involves M2 unit 243, N2 unit 244, or C unit 245, the corresponding local vector register file is local vector register field. In this example, this register field is the three least significant bits of the src1 bit field 1305. Local vector register file 231 recalls the data stored in the register corresponding to this register number and supplies this data to the src1 input of function unit 3820. Corresponding local vector register files 232 / 233 recall the data stored in the register corresponding to this register number and supply this data to the src1 input of function unit 3820. This decoding is generally known in the art.
[0361] Sub-decoder 3813 determines whether the src1 bit field 1305 is 11100. If so, sub-decoder 3813 supplies the stream 0 read signal to streaming engine 2800. Streaming engine 2800 then supplies the stream 0 data stored in holding register 2818 to the src1 input of functional unit 3820.
[0362] Sub-decoder 3814 determines whether the src1 bit field 1305 is 11101. If so, sub-decoder 3814 supplies a stream 0 read signal to streaming engine 2800. Streaming engine 2800 then supplies the stream 0 data stored in holding register 2818 to the src1 input of functional unit 3820. Sub-decoder 3814 also supplies a forward signal to stream 0. As previously described, streaming engine 2800 advances to store the next sequential vector of data elements of stream 0 in holding register 2818.
[0363] Sub-decoder 3815 determines whether the src1 bit field 1305 is 11110. If so, sub-decoder 3815 supplies the Stream 1 read signal to streaming engine 2800. Streaming engine 2800 then supplies the Stream 1 data stored in holding register 2828 to the src1 input of functional unit 3820.
[0364] Sub-decoder 3816 determines whether the src1 bit field 1305 is 11111. If so, sub-decoder 3816 supplies a stream 1 read signal to streaming engine 2800. Streaming engine 2800 then supplies the stream 1 data stored in holding register 2828 to the src1 input of functional unit 3820. Sub-decoder 3814 also supplies a forward signal to stream 1. As previously described, streaming engine 2800 advances to store the next sequential vector of data elements of stream 1 in holding register 2828.
[0365] A similar circuit is used to select the data supplied to the scr2 input of functional unit 3802 in response to the bit decoding of the src2 / cst field 1304. The src2 input of functional unit 3820 can be supplied with a constant input in the manner described above.
[0366] The exact number of instruction bits is dedicated to the operand specification, and the number of data registers and streams is a design choice. Those skilled in the art will recognize that other number choices described in the application are feasible. Specifically, a single global vector register file specification and omitting the local vector register file is feasible. This invention employs bit decoding of the input operand selection field to specify stream reads, and employs another bit decoding to specify stream reads and advance the stream.
Claims
1. A method comprising: Receive multiple data elements stored in the memory of the computing system; Based on the element replication factor, replication is applied to each of the plurality of data elements to produce a set of replicated data elements; and The set of copied data elements is provided as at least part of the data stream to the functional unit of the processing core of the computing system.
2. The method of claim 1, wherein the element replication factor is determined by accessing a register configured to store a stream definition template, the stream definition template including a field containing the element replication factor.
3. The method according to claim 2, wherein the element replication factor is an integer power of 2.
4. The method according to claim 3, wherein the element repetition factor may be selected as one of factor 2, 4, 8, 16, 32 and 64.
5. The method of claim 1, wherein the memory is the first memory of the hierarchical memory system of the computing system, and wherein the first memory is not the closest to the processing core in the hierarchy.
6. The method of claim 5, wherein the hierarchical memory system includes a second memory as a level 1 L1 cache, and wherein the first memory is hierarchically higher than the L1 cache.
7. The method according to claim 6, wherein, The first memory is a level 2 L2 cache.
8. A data processing device, comprising: Memory; A processing core having functional units configured to perform data processing operations based on operands corresponding to instructions provided to the processing core; and A streaming data processing logic configured to receive a first set of data elements stored in the memory and provide a second set of data elements based on the first set of data elements as a data stream to the processing core, wherein the streaming data processing logic includes: An address generator is configured to generate addresses corresponding to locations in the memory; A buffer configured to store the first set of data elements received from the memory at the location corresponding to the generated address; A vector length mask unit configured to limit the first set of data elements to a plurality of least significant bits according to the vector length to generate the second set of data elements; A first register, configured to store the second set of data elements received from the vector length mask unit; and The output provides the processing core with the second set of data elements stored in the first register as at least a portion of the data stream.
9. The data processing apparatus of claim 8, further comprising a second register accessible by the streaming data processing logic and configured to store a streaming definition template, the streaming definition template including an element size field specifying the element size of the second set of data elements and a vector length field specifying the vector length.
10. The data processing apparatus of claim 9, wherein the first register can be divided into multiple channels based on the element size, and the first register is configured to store one data element per channel.
11. The data processing apparatus according to claim 10, wherein: The operand corresponding to the instruction provided to the processing core has a size corresponding to the functional unit data size of the functional unit; The first register has a size corresponding to the data size of the functional unit; and The vector length mask unit is configured to store a zero value in the redundant path of the first register when the vector length is less than the data size of the functional unit.
12. The data processing apparatus according to claim 10, wherein: The operand corresponding to the instruction provided to the processing core has a size corresponding to the functional unit data size of the functional unit; The first register has a size corresponding to the data size of the functional unit; The vector length mask unit is configured to store a zero value in the redundant path of the first register when the vector length is less than the data size of the functional unit and the group copy state of the vector length mask unit is disabled. and The vector length mask unit is configured to store a copy of the least significant bit of the first group of data elements in the redundant path of the first register when the vector length is less than the data size of the functional unit and the group copy state of the vector length mask unit is enabled.
13. The data processing apparatus of claim 12, wherein the stream definition template further includes a grouped copy field to specify whether the grouped copy state of the vector length mask unit is enabled or disabled.
14. The data processing apparatus of claim 8, comprising a data bus coupled to the output of the streaming data processing logic and coupled to the processing core, wherein the data stream is provided to the processing core via the data bus, and the data bus can be divided into a plurality of equal-sized paths.
15. The data processing apparatus according to claim 8, comprising a hierarchical memory system, the hierarchical memory system comprising a level 1 L1 cache and a level 2 L2 cache, wherein the memory is the L2 cache.
16. The data processing apparatus of claim 15, wherein the streaming data processing logic is configured to provide the transfer of the second set of data elements of the data stream via a data path from the L2 cache to the processing core, the data path excluding the L1 cache.
17. A circuit device comprising: A processor, which includes vector data paths; A controller, which is coupled to the vector data path of the processor; and A memory coupled to the controller and configured to store a set of data elements, wherein the controller includes: A first register, coupled to receive the set of data elements from the memory; A set of multiplexers, each of which includes: A corresponding set of data inputs is coupled to the first register; The corresponding control inputs; and The corresponding output; A multiplexer controller includes an input coupled to receive an element replication factor and a set of outputs coupled to the control input of the set of multiplexers, wherein the multiplexer controller is configured to determine, based on the element replication factor, whether to cause the set of multiplexers to copy elements from the set of data elements or to provide uncopied elements of the set of data elements to generate a vector; and A second register is coupled to the set of multiplexers to receive the vector and to the vector data path to provide the vector to the vector data path of the processor.
18. The circuit arrangement according to claim 17, wherein: The vector data path includes a vector template register configured to store the element replication factor; and The multiplexer controller is coupled to receive the element replication factor from the vector template register.
19. The circuit arrangement according to claim 18, wherein: The vector data path includes a set of vector template registers, and the set of vector template registers includes the vector template registers; The controller is configured to provide the vector to the vector data path of the processor in response to an instruction; and The instruction specifies the vector template register in the set of vector template registers.
20. The circuit arrangement according to claim 17, wherein: The input to the multiplexer controller is the first input; The multiplexer controller further includes a second input, which is coupled to receive an element size factor; and The multiplexer controller is further configured to control the set of multiplexers to generate the vector based on the element size factor.
21. The circuit arrangement according to claim 17, wherein: The input to the multiplexer controller is the first input; The multiplexer controller further includes a second input, the second input being coupled to receive a vector length factor; and The multiplexer controller is further configured to control the set of multiplexers to generate the vector based on the vector length factor.
22. The circuit arrangement according to claim 21, wherein: The multiplexer controller further includes a third input, which is coupled to receive a grouped replication factor; and The multiplexer controller is further configured to: Based on the group replication factor, it is determined whether to perform zero expansion on a portion of the group of data elements or to replicate a portion of the group of data elements to produce a portion of the vector that exceeds the vector length factor. and The multiplexer set is controlled based on the group replication factor to generate the vector.
23. The circuit device according to claim 17, wherein: The first register includes a first part; The second register includes a first part; and The first portion of the first register is coupled to the first portion of the second register in the absence of the intervention multiplexer of the set of multiplexers.
24. The circuit arrangement according to claim 23, wherein: The first register includes a second part; The second register includes a second part; and The set of multiplexers includes a 2:1 multiplexer, and the 2:1 multiplexer includes: A first data input, coupled to the first portion of the first register; A second data input, coupled to the second portion of the first register; and The output is coupled to the second portion of the second register.
25. The circuit arrangement according to claim 24, wherein: The first register includes a third part; The second register includes a third part; and The set of multiplexers includes a 3:1 multiplexer, and the 3:1 multiplexer includes: A first data input, coupled to the first portion of the first register; A second data input, which is coupled to the second portion of the first register; A third data input, coupled to the third portion of the first register; and The output is coupled to the third part of the second register.
26. The circuit arrangement according to claim 17, wherein: The memory is a two-level cache with a cache hierarchy; The circuit device further includes a first-level cache of the cache hierarchy; and The controller is configured to provide the vector to the processor via a vector data path that does not include the first-level cache.
27. The circuit arrangement of claim 17, wherein the element replication factor is an integer power of 2.
28. The circuit arrangement according to claim 17, wherein: The vector is the first vector; and The controller is further configured to: Determine whether to copy the set of data elements to span a set of vectors including the first vector and the second vector; and When it is determined that the set of data elements will be copied across the set of vectors, the set of vectors is provided to the vector data path of the processor.
29. A method comprising: Receive a set of data elements from memory at the first register of the controller; The element replication factor determines whether to copy elements from the set of data elements or to provide an uncopied set of data elements to generate a vector; This causes a set of multiplexers to be coupled to the first register to generate the vector; The vector is stored in the second register of the controller; and The vector from the second register is provided to the processor.
30. The method of claim 29, further comprising retrieving the element replication factor from the vector template register of the processor.
31. The method according to claim 30, wherein: Receiving the set of data elements, determining whether to copy the elements or provide uncopied elements, causing the set of multiplexers to generate the vector, storing the vector, and providing the vector are all performed in response to instructions; and The instruction specifies the vector template register from a set of vector template registers of the processor.
32. The method of claim 29, further comprising causing the set of multiplexers to be coupled to generate the vector according to an element size factor specifying the size of the elements to be copied.
33. The method of claim 29, further comprising causing the set of multiplexers to be coupled to generate the vector according to a vector length factor specifying the length of the vector.
34. The method of claim 33, further comprising determining, based on a group replication factor, whether to perform zero expansion on a portion of the group of data elements or to replicate a portion of the group of data elements to produce a portion of the vector exceeding the length specified by the vector length factor.
35. The method according to claim 29, wherein: The memory is a two-level high-speed cache memory; and The process of receiving the set of data elements from the secondary cache and providing the vector to the processor is performed via a data path that does not include the primary cache.
36. The method of claim 29, wherein the element replication factor is an integer power of 2.
Citation Information
Patent Citations
Unified memory system architecture including cache and directly addressable static random access memory
US6606686B1
Successive approximation register analog-to-digital converter with integral non-linearity correction
CN102859882A
System and method to reduce memory access latencies using selective replication across multiple memory ports
CN103959255A
