This invention relates to digital signal processors and, more particularly, to digital signal processor computation core architectures that facilitate complex digital signal processing computations.
A digital signal computer, or digital signal processor (DSP), is a special purpose computer that is designed to optimize performance for digital signal processing applications, such as, for example, Fast Fourier transforms, digital filters, image processing and speech recognition. Digital signal processor applications are typically characterized by real-time operation, high interrupt rates and intensive numeric computations. In addition, digital signal processor applications tend to be intensive in memory access operations and to require the input and output of large quantities of data. Digital signal processor architectures are typically optimized for performing such computations efficiently.
Microcontrollers, by contrast, involve the handling of data but typically do not require extensive computation. Microcontroller application programs tend to be longer than DSP programs. In order to limit the memory requirements of microcontroller application programs, it is desirable to provide a high degree of code density in such programs. Thus, architectures that are optimized for DSP computations typically do not operate efficiently as microcontrollers. Also, microcontrollers typically do not perform well as digital signal processors. Nonetheless, a particular application may require both digital signal processor and microcontroller functionality.
Digital signal processor designs may be optimized with respect to different operating parameters, such as computation speed and power consumption, depending on intended applications. Furthermore, digital signal processors may be designed for 16-bit words, 32-bit words, or other word sizes. A 32-bit architecture that achieves very high operating speed is disclosed in U.S. Pat. No. 5,954,811 issued Sep. 21, 1999 to Garde.
Digital signal processors frequently utilize architectures wherein two or more data words are stored in each row of memory, and two or more data words are provided in parallel to the computation unit. Such architectures provide enhanced performance, because several instructions and/or operands may be accessed simultaneously.
Notwithstanding the performance levels of current digital signal processors, there is a need for further enhancements in digital signal processor performance.
According to a first aspect of the invention, a computation unit is provided. The computation unit is preferably configured for performing digital signal process computations. The computation unit comprises an execution unit for performing an operation on a first operand and a second operand in response to an instruction, a register file for storing operands, first and second operand buses coupled to the register file, and first and second data selectors. The first and second operand buses each carry a high operand and a low operand. The first data selector supplies the high operand or the low operand from the first operand bus to the execution unit in response to a first operand select value contained in the instruction. The second data selector supplies the high operand or the low operand from the second operand bus to the execution unit in response to a second operand select value contained in the instruction.
The execution unit may comprise an arithmetic logic unit, a multiplier and an accumulator. In one embodiment, the register file comprises first and second register banks, each having two read ports and two write ports. In another embodiment, the register file comprises a single register bank having four read ports and four write ports.
According to another aspect of the invention, a computation unit is provided. The computation unit comprises an execution unit for performing an operation on first and second operands in response to an instruction, a register file for storing operands, an operand bus coupled to the register file, the operand bus carrying a high operand and a low operand, and a data selector, responsive to an operand select value contained in the instruction, for supplying the high operand or the low operand from the operand bus to the execution unit.
According to another aspect of the invention, a method is provided for performing a digital computation. The method comprises the steps of storing operands for the computation in a register file, supplying operands from the register file on first and second operand buses, each carrying a high operand and a low operand, selecting the high operand or the low operand from the first operand bus in response to a first operand select value contained in an instruction and supplying a selected first operand to the execution unit, selecting the high operand or the low operand from the second operand bus in response to a second operand select value contained in the instruction and supplying a selected second operand to the execution unit, and performing an operation specified by the instruction on the operands selected from the first and second operand buses.
According to another aspect of the invention, a digital signal processor computation unit is provided. The digital signal processor computation unit comprises first and second execution units for performing operations in response to an instruction and for producing first and second results, a result register for storing the results of the operations, the result register having first and second locations, and result swapping logic, coupled between the first and second execution units and the result register, for swapping the first and second results between the first and second locations in the result register in response to result swapping information contained in the instruction.
The first and second execution units may comprise first and second arithmetic logic units for performing add and subtract operations. The first and second execution units are separately controllable and may perform the same or different operations in response to operation code information contained in the instruction. The first and second arithmetic logic units may comprise 16-bit arithmetic logic units which are configurable as a 32-bit arithmetic logic unit. The first and second locations in the result register may comprise high and low halves of the result register. The result register may comprise a register in a register file.
According to another aspect of the invention, a method is provided for performing digital signal computations. The method comprises the steps of performing operations in first and second execution units in response to an instruction and producing first and second results, storing the results of the operations in a result register having first and second locations, and swapping the first and second results with respect to the first and second locations in the result register, in response to result swapping control information contained in the instruction.
According to another aspect of the invention, a digital signal processor computation unit is provided. The digital signal processor computation unit comprises first and second execution units for performing operations in response to an instruction and for producing first and second results, a result register for storing the results of the operations, the result register having first and second locations, and means for swapping the first and second results with respect to the first and second locations in the result register, in response to result swapping control information contained in the instruction.
According to another aspect of the invention, a digital signal processor computation core is provided. The digital signal processor computation core comprises first and second execution units for performing first and second operations in response to control signals, and control logic for providing the control signals to the first and second execution units in response to control information contained in an instruction for individually controlling the first and second operations.
In one example, the first and second execution units comprise first and second arithmetic logic units. The first and second operations may be selected from add operations and subtract operations, and may be the same or different.
The computation core may further comprise a register file for storing operands and results of the first and second operations, and first and second operand buses coupled between the register file and the first and second execution units, each of the first and second operand buses carrying a high operand and a low operand, wherein the first execution unit performs the first operation on the high operands and the second execution unit performs the second operation on the low operands.
According to another aspect of the invention, a method is provided for performing digital signal computations. The method comprises the steps of performing first and second operations in first and second execution units, and individually controlling the first and second operations in response to control information contained in an instruction.
According to a further aspect of the invention, a digital signal processor computation core is provided. The digital signal processor computation core comprises first and second execution units for performing first and second operations in response to control signals, and means responsive to control information contained in an instruction for providing the control signals to the first and second execution units for individually controlling the first and second operations, wherein the first and second operations may be the same or different.
According to a further aspect of the invention, a computation core is provided for executing programmed instructions. The computation core comprises an execution block for performing digital signal processor operations in response to digital signal processor instructions and for performing microcontroller operations in response to microcontroller instructions, a register file for storing operands for and results of the digital signal processor operations and the microcontroller operations, and control logic for providing control signals to the execution block and the register file in response to the digital signal processor instructions and the microcontroller instructions for executing the digital signal processor instructions and the microcontroller instructions.
Preferably, the digital signal processor instructions are configured for high efficiency digital signal computations, and the microcontroller instructions are configured for code storage density. In one example, the microcontroller instructions have a 16-bit format and the digital signal processor instructions have a 32-bit format. The digital signal processor instructions may contain information indicating whether one or more related instructions follow. The related instructions may comprise load instructions.
According to a further aspect of the invention, a method is provided for executing programmed instructions. The method comprises the steps of executing digital signal processor operations in an execution block in response to digital signal processor instructions configured for efficient digital signal computation, and executing microcontroller operations in the execution block in response to microcontroller instructions configured for code storage density. An application program having a mixture of digital signal processor instructions and microcontroller instructions is characterized by high code storage density and efficient digital signal computation.
According to another aspect of the invention, a digital signal processor having a pipeline structure is provided. The digital signal processor comprises a computation block for executing computation instructions, the computation block having one or more computation stages of the pipeline structure, and a control block for fetching and decoding the computation instructions and for accessing a memory, the control block having one or more control stages of the pipeline structure. The computation stages and the control stages are positioned in the pipeline structure such that a result of the memory access is available to the computation stages without stalling the computation stages.
The computation stages and the control stages may be positioned in the pipeline structure so as to avoid stalling the computation stages when a computation instruction immediately follows a memory access instruction and requires the result of the memory access instruction. The computation stages and the control stages may be positioned in the pipeline structure such that the control block has one or more idle stages following completion of the memory access. The computation stages and the control stages may be positioned in the pipeline structure such that the computation block has one or more idle stages prior to a first computation stage.
According to another aspect of the invention, a method is provided for a digital signal computation. The method comprises the steps of executing computation operations in a computation block having one or more computation stages, executing control operations, including fetching instructions, decoding instructions and accessing a memory, in a control block having one or more control stages, wherein the computation stages and the control stages are configured in a pipeline structure, and positioning the computation stages relative to the control stages in the pipeline structure such that a result of a memory access is available to the computation stages without stalling the computation stages.
According to a further aspect of the invention, a method is provided for determining an output of a finite impulse response digital filter having L filter coefficients in response to a set of M input samples. The method comprises the steps of (a) loading a first input sample into a first location in a first register, (b) loading a second input sample into a second location in the first register, (c) loading two coefficients into a second register, (d) computing intermediate results using the contents of the first and second registers, (e) loading a new input sample into the first location in the first register, (f) computing intermediate results using the contents of the first and second registers, (g) repeating steps (b)–(f) for L iterations to provide two output samples, and (h) repeating steps (a)–(g) for M/2 iterations to provide M output samples.
Step (d) may comprise a multiply accumulate operation on a first coefficient in the second register and the input sample in the first location in the first register, and a multiply accumulate operation on the first coefficient in the second register and the input sample in the second location in the first register. Step (f) may comprise a multiply accumulate operation on a second coefficient in the second register and the input sample in the first location in the first register, and a multiply accumulate operation on the second coefficient in the second register and the input sample in the second location in the first register.
It will be understood that the foregoing aspects of the invention may be practiced separately or in any combination.
For a better understanding of the present invention, reference is made to the accompanying drawings, which are incorporated herein by reference and in which:
A block diagram of an embodiment of a computation core 10 in accordance with the invention is shown in
Computation core 10 includes a computation block 24 and an addressing block 26 coupled through operand buses 30 and result buses 32 to a memory interface 34. Address buses 40 and 42 are coupled between addressing block 26 and memory interface 34. Computation core 10 further includes an instruction sequencer 50 coupled by an instruction address bus 52 and an instruction bus 54 to memory interface 34. Memory interface 34 is connected by memory buses 60 and 62 to a memory 64 (
As shown in
The addressing block 26 includes an address register file 120 and data address generators 124. In a preferred embodiment, address register file 120 has a capacity of 8 address values. The address register file 120 may be used for microcontroller programs that require simple addressing, and may access different word widths (8-bit bytes, 16-bit half words, and 32-bit words). The addressing block 26 may include four data address generators (DAGs) 124 for generating address sequences or patterns. The addresses generated by addressing block 26 are supplied through address buses 40 and 42, memory interface 34 and memory buses 60 and 62 to memory 64 (
Instruction sequencer 50 includes a loop buffer 130, an instruction decoder 132 and sequencer/control logic 134. Instructions are received from memory 64 through one of the memory buses 60 or 62 and are delivered to the instruction sequencer 50 via instruction bus 54. The instructions are temporarily stored in loop buffer 130. The loop buffer 130 is used for implementing repetitive code sequences with no overhead. The instructions are decoded in the instruction decoder 132 and are interpreted by the sequencer/control logic 134 to control operations by the rest of the computation core.
The integration of computation core 10 into digital signal processor 20 is shown in
A block diagram of a first embodiment of register file 80, execution units 82 and 84 and memory 64, and the interconnection between these elements, is shown in
Register file 80 is connected to execution units 82 and 84 and to memory 64 by operand buses 30 and result buses 32. Operand buses 30 include operand bus 210, operand bus 212, operand bus 214 and operand bus 216. Operand buses 210 and 212 are connected between register file banks 200 and 202 and memory 64 for writing results of computations to memory. In another embodiment, a single operand bus may be used for writing data from register file 80 to memory 64. Operand buses 214 and 216 are connected between register file banks 200 and 202 and execution units 82 and 84 for supplying operands to execution units 82 and 84. Result buses 32 include result bus 220, result bus 222, result bus 224 and result bus 226. Result buses 220 and 222 are connected between memory 64 and register file banks 200 and 202 for reading operands from memory 64. Result buses 224 and 226 are connected between execution units 82 and 84 and register file banks 200 and 202 for writing results of computations in register file 80. In a preferred embodiment, each of operand buses 210, 212, 214 and 216 and each of result buses 220, 222, 224 and 226 is 32 bits wide. As described above, memory 64 is external to computation core 10. Thus, the connections to memory 64 are via memory interface 34 and memory buses 60 and 62, as described above in connection with
A block diagram of a second embodiment of register file 80, execution units 82 and 84 and memory 64, and the interconnection between these elements, is shown in
A block diagram of execution units 82 and 84 is shown in
In multiply operations, the multiplier arrays 250 and 260 and the ALUs 252 and 262 are utilized. In multiply accumulate (MAC) operations, multiplier arrays 250 and 260, ALU's 252 and 262 and accumulators 254 and 264 are utilized. In add/subtract operations, ALUs 252 and 262 are utilized. The appropriate outputs are selected by output select muxes 282 and 286 and are supplied on result buses 226 and 224 to register file 80. The operations of the execution units 82 and 84 are described in more detail below.
It will be understood that
Each of the operand buses 214 and 216 is 32 bits wide and carries two 16-bit operands, designated as a high operand and a low operand. The computation block 24 is preferably provided with an arrangement of data selectors which permits the multiplier in each of execution units 82 and 84 to select the high or low operand from each of the operand buses 214 and 216. As shown in
A schematic representation of a dual multiply accumulate operation by execution units 82 and 84 is shown in
In the example of
Selection of different operands for computation by execution unit 82 is illustrated in the schematic representations of
The operand selection technique is described above in connection with dual multiply accumulate (MAC) units. However, since this technique relates to the data movement and selection aspects of computation, it is generally applicable to data selection for any execution unit that performs any arbitrary arithmetic operation. In addition, although the description relates to selection of one of two 16-bit operands, the operand selection technique can be implemented with operands of any width and with two or more operands. When using the operand selection technique, the programmer selects two pairs of adjacent 16-bit data elements that reside in register file 80. When these two pairs of 16-bit data elements are selected and transferred to the execution units 82 and 84 via operand buses 214 and 216, the programmer selects a high or low 16-bit operand from a 32-bit data element to serve as one input to one of the MACs. The other input to the same MAC is a high or low 16-bit operand selected from the other operand bus.
The execution units 82 and 84 also execute instructions which specify ALU operations, i.e., operations which involve addition or subtraction and which do not require the multiplier array or the accumulator. The ALUs 252 and 262 may be configured for performing various ALU operations. In most cases, only one of the ALU's 252 and 262 is active in performing ALU operations. An exception is shown in
The ALU 252 may be configured for performing two 16-bit addition or subtraction operations, as illustrated in
As described above, ALU operations typically utilize only one of the execution units 82 and 84. An exception is described with reference to
A further feature of execution units 82 and 84 is described with reference to
As shown in
The result swapping technique is described above in connection with swapping of ALU outputs. However, since this technique relates to the data movement aspects of computation, it is generally applicable to result swapping for any execution unit that produces two or more results. As described below in connection with
An example of a DSP type MAC instruction format for controlling execution units 82 and 84 to perform multiply accumulate operations is shown in
An example of a DSP type ALU instruction format for controlling execution units 82 and 84 to perform ALU operations is shown in
In the case of a single 16-bit add or subtract, the aop field indicates the two operands that are to be added or subtracted, i.e., low and low; low and high; high and low; or high and high. The HL field indicates whether the 16-bit result is to be deposited in the high or low half of the destination register. In the case of a dual 16-bit add or subtract, the aop field indicates the two operations to be performed by the two 16-bit ALUs, i.e., add/add; add/subtract; subtract/add; or subtract/subtract. In the dual 16-bit add or subtract operations, the aop field controls the individual operations performed by ALUs 360 and 362 (see
The instruction formats shown in
An example of a microcontroller type instruction format for controlling execution units 82 and 84 to perform arithmetic operations is shown in
As described above, code density is an important factor in microcontroller applications. A typical microcontroller application may have a relatively large number of instructions requiring relatively simple computations and data handling. Because the number of instructions in a microcontroller application may be large, code density is an important factor in minimizing memory requirements. By contrast, DSP applications typically include a relatively small number of instructions which may be executed repetitively in performing DSP computations. Thus, code density is less important than efficient execution in achieving high performance in DSP applications. By providing instruction formats of the type described above in connection with
The computation core 10 preferably has a pipeline architecture, as illustrated in
In
The pipeline shown in
A timing diagram for a conventional pipeline is illustrated in
The early memory access pipeline structure shown in
As noted above, the computation core structure described herein facilitates efficient digital signal computations. One example of a DSP algorithm that may be implemented efficiently on computation core 10 is a finite impulse response (FIR) digital filter. An FIR filter may be defined mathematically as
where x (n) are samples of an input signal, c(k) are L filter coefficients and z(n) are output signal samples. Each output z(n) is obtained by computing the vector product of L samples of the input signal x(n) times L filter coefficients c(k) and summing the products. All signals and coefficients are 16-bit data values in this example.
The dual multiply accumulate operations shown in FIGS. 5 and 6A–6D and described above, may be utilized to perform FIR filter computations. In particular, execution units 82 and 84 may be utilized to perform two multiply accumulate operations simultaneously. In order to perform two multiply accumulate operations, a conventional implementation of an FIR filter on a DSP with dual execution units would require that a total of four data values be loaded from memory: two input values from x(n) and two filter coefficients from c(n). These data loads are achieved by loading a pair of adjacent data values and a pair of adjacent filter coefficient values.
A problem with this technique is that for half of the total number of memory accesses, the pairs of data values must come from locations that are not 32-bit aligned in memory. That is, the memory must be able to deliver data elements x(0) and x(1) into a register in an aligned 32-bit access, and must also be able to deliver data elements x(1) and x(2) to a register in a misaligned 32-bit access. Note that either the data elements x(n) or the coefficients c(n) must be accessed as misaligned 32-bit element pairs, but not both. One of these signals may always be accessed as 32-bit aligned pairs, and here it is assumed that coefficients c(n) are accessed as aligned 32-bit pairs. The delivery of misaligned 32-bit element pairs in prior art systems requires two memory accesses and, therefore, is relatively inefficient.
A novel FIR filter implementation avoids misaligned 32 bit data accesses as follows. Let execution unit 82 (MAC0) compute all of the even indexed outputs and execution unit 84 (MAC1) compute all of the odd indexed outputs. For example, outputs z(0) through z(3) may computed as follows.
z(0)=x(0)·c(0)+x(1)·c(1)+x(2)·c(2)+ (2)
z(1)=x(1)·c(0)+x(2)·c(1)+x(3)·c(2)+ (3)
z(2)=x(2)·c(0)+x(3)·c(1)+x(4)·c(2)+ (4)
z(3)=x(3)·c(0)+x(4)·c(1)+x(5)·c(2)+ (5)
where execution units 82 computes z(0) and z(2), and execution unit 84 computes z(1) and z(3).
Assume that data sample pair x(0) and x(1) is loaded into register R0, as shown in
z(0)+=x(0)·c(0), and z(1)+=x(1)·c(0), (6)
where the symbol “+=” represents the multiply accumulate operation. The value z(0) is computed in execution unit 82, and the value z(1) is computed in computation unit 84. Both memory accesses illustrated in
Next, rather than loading a data pair, a single data sample x(2) is loaded into the low half of register R0, as shown in
z(0)+=x(1)·c(1), and z(1)+=x(2)·c(1) (7)
Again, the value z(0) is computed in execution unit 82, and the value z(1) is computed in execution unit 84.
For the next set of two multiply accumulate computations, coefficient pair c(2) and c(3) is loaded into register R1 and a single data sample x(3) is loaded into the high half of register R0, as shown in
z(0)+=x(2)·c(2), and z(1)+=x(3)·c(2), (8)
where the value of z(0) is computed in execution unit 82, and the value of z(1) is computed in execution unit 84.
With this technique, not only are all accesses aligned, but the execution units 82 and 84 are able to obtain all of the required input operands from only two 32-bit registers in the register file. This is the reason why this technique can be implemented in the architecture with high or low operand selection as described above. The inputs are loaded into register halves in a “ping pong” sequence. Without this ping pong sequence, the register file would be required to supply four 16-bit data elements to the execution units, rather than two 32-bit data elements (in addition to the filter coefficients), which would result in a more complex register file.
A pseudo-code representation of an algorithm for performing FIR digital filter computations as described above is shown in
The inner loop performs the multiply accumulate operations for values of an index variable k for values of k from 0 to L−1. In the inner loop, a 16-bit data element x(n+k+1) is loaded into register RH0, the high half of register R0. Two 16-bit coefficients c(k+1) and c(k) are loaded into register R1. The multiply accumulate value z(n+1) is computed in execution unit 84, and the result is stored in accumulator A1. The multiply accumulate value z(n) is computed in execution unit 82, and the result is stored in accumulator A0. Next, a 16-bit data element x(n+k+2) is loaded into register RL0, the low half of register R0, and the multiply accumulate values z(n+1) and z(n) are computed. As noted above, the inner loop is executed L times.
While there have been shown and described what are at present considered the preferred embodiments of the present invention, it will be obvious to those skilled in the art that various changes and modifications may be made therein without departing from the scope of the invention as defined by the appended claims.
This application claims the benefit of provisional application Ser. No. 60/133,766, filed May 12, 1999, which is hereby incorporated by reference.
Number | Name | Date | Kind |
---|---|---|---|
4777591 | Chang et al. | Oct 1988 | A |
4777612 | Tomimitsu | Oct 1988 | A |
5043868 | Kitamura et al. | Aug 1991 | A |
5258939 | Johnstone et al. | Nov 1993 | A |
5282155 | Jones | Jan 1994 | A |
5297069 | Asato et al. | Mar 1994 | A |
5297071 | Sugino | Mar 1994 | A |
5343404 | Girgis | Aug 1994 | A |
5428741 | Ho et al. | Jun 1995 | A |
5502747 | McGrath | Mar 1996 | A |
5517436 | Andreas et al. | May 1996 | A |
5532938 | Kondo et al. | Jul 1996 | A |
5588118 | Mandava et al. | Dec 1996 | A |
5590352 | Zuraski et al. | Dec 1996 | A |
5613152 | VanMeerbergen et al. | Mar 1997 | A |
5642382 | Juan | Jun 1997 | A |
5680335 | Ikeyama et al. | Oct 1997 | A |
5710914 | Verbauwhede | Jan 1998 | A |
5748515 | Glass et al. | May 1998 | A |
5764553 | Hong | Jun 1998 | A |
5787025 | Muwafi et al. | Jul 1998 | A |
5787026 | Orenstein et al. | Jul 1998 | A |
5790826 | Thusoo et al. | Aug 1998 | A |
5839108 | Daberko et al. | Nov 1998 | A |
5867726 | Ohsuga et al. | Feb 1999 | A |
5896543 | Garde | Apr 1999 | A |
5926644 | Hays | Jul 1999 | A |
5941940 | Prasad et al. | Aug 1999 | A |
5987490 | Alidina et al. | Nov 1999 | A |
6058408 | Fischer et al. | May 2000 | A |
6078941 | Jiang et al. | Jun 2000 | A |
6092184 | Wechsler | Jul 2000 | A |
6119217 | Suzuoki | Sep 2000 | A |
6167497 | Nakatsuka et al. | Dec 2000 | A |
6175370 | Kunimatsu | Jan 2001 | B1 |
6175912 | Alidina et al. | Jan 2001 | B1 |
6230180 | Mohamed | May 2001 | B1 |
6230238 | Langan et al. | May 2001 | B1 |
6230257 | Roussel et al. | May 2001 | B1 |
6247036 | Landers et al. | Jun 2001 | B1 |
6260137 | Fleck et al. | Jul 2001 | B1 |
6266807 | McGarity et al. | Jul 2001 | B1 |
6286023 | Purcell et al. | Sep 2001 | B1 |
6292886 | Makineni et al. | Sep 2001 | B1 |
6321327 | Makineni et al. | Nov 2001 | B1 |
6327690 | Zhang et al. | Dec 2001 | B1 |
6349382 | Feiste et al. | Feb 2002 | B1 |
6425070 | Zou et al. | Jul 2002 | B1 |
6496705 | Ng et al. | Dec 2002 | B1 |
6532273 | Mobin et al. | Mar 2003 | B1 |
6532530 | Kim et al. | Mar 2003 | B1 |
20020002574 | Jennings, III | Jan 2002 | A1 |
20020041658 | Henderson et al. | Apr 2002 | A1 |
20020152250 | Staszewski | Oct 2002 | A1 |
20030009659 | DiSanto et al. | Jan 2003 | A1 |
20030028743 | Catherwood et al. | Feb 2003 | A1 |
Number | Date | Country |
---|---|---|
0 425 410 | May 1991 | EP |
0 580 924 | Feb 1994 | EP |
0 741 358 | Nov 1996 | EP |
0 789 297 | Aug 1997 | EP |
0 901 068 | Mar 1999 | EP |
WO 9914663 | Mar 1999 | WO |
Number | Date | Country | |
---|---|---|---|
60133766 | May 1999 | US |