A second decoder (114) of an instruction decode unit (119) decodes an operation code for a multiply-add operation, and a second operation unit (117) receives two data stored in a register file (115) to perform the multiply-add operation. In parallel with the operations of the second decoder (114) and the second operation unit (117), a first decoder (113) of the instruction decode unit (119) decodes an operation code for 2 data load, and an operand access unit (104) causes two data (e.g., n bits each) stored in an internal data memory (105) to be transferred in parallel in the form of combined 2n-bit data to a first operation unit (116). Then, two predetermined registers of the register file (115) store the respective n-bit data from the first operation unit (116).
|
28. A method of processing data by a data processor connected to a memory and executing instructions described in a program, said method comprising the steps of:
transferring in parallel first and second data values included in a first area of the memory to said data processor; transferring in parallel third and fourth data value included in a second area of the memory to said data processor; calculating a product of the first and third data values in the data processor; and calculating a product of the second and fourth data values in the data processor.
23. A data processor comprising:
a first decoder for decoding operation codes including first and second operation codes; an operand access unit for outputting a first address to receive in parallel first and second data values included in a first area of a memory in accordance with decoding the first operation code by said first decoder, and for outputting a second address to receive in parallel third and fourth data values included in a second area of the memory in accordance with decoding the second operation code by said first decoder; and an operation unit coupled to said operand access unit and receiving said first to fourth data values, for calculating a first product of said first and third data values, and a second product of said second and fourth data values.
17. A data processor comprising:
an instruction decoder for decoding first and second operation codes to output first and second control signals, respectively; a register file including a plurality of registers; a memory for storing data; an operand access unit for performing a first memory access to transfer first and second data in parallel from a first area of said memory to said register file in response to said first control signal, and performing a second memory access to transfer third and fourth data in parallel from a second area of said memory to said register file in response to said second control signal; and an operation unit receiving said first to fourth data from said register file, for performing a first arithmetic operation on said first and third data and a second arithmetic operation on said second and fourth data.
0. 47. A data processor for executing a program, the data processor comprising:
storage devices configured to store data values; a first arithmetic operation unit configured to perform a multiplying operation utilizing data values stored in said storage devices; a second arithmetic operation unit configured to perform an adding operation utilizing data values stored in said storage devices; an operand access unit configured to output an operand address to a memory and to load plural operand data in parallel for at least one said operand address; and a control unit configured to control said first and second arithmetic operation units and said operand access unit, depending on said program, so that a result of the multiplying operation, a result of the adding operation unit, and the loaded plural operand data, are stored in parallel in said storage devices.
0. 29. A data processor comprising:
a first decoder configured to receive a decode a first operation code specifying a data load operation; a second decoder configured to receive and decode a second operation code specifying a multiply-add operation; a first operation unit configured to provide a memory with an operand address of said first operation code, at least one said operand address configured to cause plural operand data to be loaded in parallel from the memory in response to a first control signal being a decoded result of said first operation code output from said first decoder; a plurality of registers configured to receive and store data values included in operand data loaded from the memory; and a second operation unit configured to receive data values from said registers, and to perform the multiply-add operation in response to a second control signal being a decoded result of said second operation code output from said second decoder; wherein said multiply-add operation includes a multiplying operation of one by another of the data values received by the second operation unit, and an adding operation utilizing a result of said multiplying operation.
12. A method of processing data by a data processor which includes a memory for storing data, a register file connected to said memory and including a plurality of registers each for storing at least one of data and an operand address, an operation unit for receiving the data stored in said register file to perform an arithmetic operation, and a memory access device for causing the operand address stored in said register file to be applied to said memory, said method comprising the steps of:
(a) transferring, in parallel, first and second data stored in a first area of said memory to first and second registers of said register file, respectively; (b) transferring, in parallel, third and fourth data stored in a second area of said memory to third and fourth registers of said register file, respectively; (c) applying said first data stored in said first register and said third data stored in said third register to said operation unit to perform an arithmetic operation of said first and third data by said operation unit; and (d) applying said second data stored in said second register and said fourth data stored in said fourth register to said operation unit to perform an arithmetic operation of said second and fourth data by said operation unit.
1. A data processor comprising:
a first memory for storing an instruction including a first operation code and a second operation code; a second memory for storing data values; a first decoder receiving said first operation code from said first memory for decoding said first operation code; a second decoder receiving said second operation code from said first memory for decoding said second operation code, said first and second operation codes being decoded in parallel; a register file including a plurality of registers for storing data values to be transferred from and to said second memory; an operation unit for receiving a first data value stored in a first register of said register file to perform an arithmetic operation using said first data value in response to a first control signal, said first control signal being a decoded result of said first operation code output from said first decoder; and an operand access unit for performing a memory access to transfer in parallel second and third data values stored in said second memory to second and third registers of said register file, respectively, in response to a second control signal, said second control signal being a decoded result of said second operation code output from said second decoder, said memory access of said operand access unit and said arithmetic operation of said operation unit are performed in parallel.
7. A data processor comprising:
a first memory for storing an instruction including a first operation code and a second operation code; a second memory for storing data values; a first decoder receiving said first operation code from said first memory, for decoding said first operation code; a second decoder receiving said second operation code from said first memory, for decoding said second operation code, said first and second operation codes being decoded in parallel; a register file including a plurality of registers for storing data values to be transferred from and to said second memory; an operation unit for receiving a first data value stored in a first register of said register file to perform an arithmetic operation using said first data value in response to a first control signal, said first control signal being a decoded result of said first operation code output from said first decoder; and an operand access unit for performing a memory access to transfer in parallel second and third data values stored respectively in second and third registers of said register file to said second memory in response to a second control signal, said second control signal being a decoded result of said second operation code output from said second decoder, said memory access of said operand access unit and said arithmetic operation of said operation unit are performed in parallel.
0. 31. A data processor comprising:
a first decoder configured to receive and decode a first operation code specifying a data load operation; a second decoder configured to receive and decode a second operation code specifying a multiply-add operation; a first operation unit configured to provide a memory with an operand address of said first operation code to cause, for at least one said operand address, plural operand data to be loaded in parallel from the memory in response to a first control signal being a decoded result of said first operation code output from said first decoder; a register file configured to store first and second data values which are included in the plural operand data loaded in parallel from the memory; and a second operation unit configured to receive third and fourth data values stored in said register file and to perform the multiply-add operation in response to a second control signal being a decoded result of said second operation code output from said second decoder; wherein said multiply-add operation includes a multiplying operation of the third data value by the fourth data value and an adding operation utilizing a result of said multiplying operation; and wherein said second operation code has an operand specifying field capable of specifying one of the first and second data values as the third data value, and a data value different from said first and second data values as the fourth data value.
0. 30. A data processor comprising:
a first decoder configured to receive and decode a first operation code specifying a data load operation; a second decoder configured to receive and decode a second operation code specifying a multiply-add operation; a plurality of registers including a register configured to store an operand address of said first operation code and to output the operand address to a memory to cause, for at least one said operand address, plural operand data to be loaded in parallel from the memory, said plurality of registers including different two registers configured to receive and store first and second data values, respectively, included in the plural operand data loaded in parallel from the memory; an arithmetic unit configured to generate a new operand address using the operand address and to update contents of the register storing the operand address into the new operand address in response to a first control signal being a decoded result of the first operation code output from said first decoder; and an operation unit configured to receive third and fourth data values stored in different two of said plurality of registers, respectively, and to perform the multiply-add operation in response to a second control signal being a decoded result of said second operation code output from said second decoder; wherein said multiply-add operation includes a multiplying operation of the third data value by the fourth data value and an adding operation utilizing a result of said multiplying operation.
0. 45. A data processor for loading values A1 to Am and values D1 to Dm, and for performing a calculation:
in accordance with a program having a plurality of operation codes, wherein i and m are positive integers, said data processor comprising:
a first arithmetic operation circuit configured to multiply a value Aj by a value Dj and to multiply a value Ak by a value Dk, wherein j and k are integers; a second arithmetic operation circuit configured to add a value Pk=Ak·Dk to a value held in a register or in an accumulator; and an operand access unit configured to output an operand address to a memory, and to load a value Ah and a value An in parallel in accordance with at least one said operand address, wherein h and n are integers; and a control unit configured to control said first and second arithmetic operation circuits and said operand access unit in accordance with the program so that the multiplication of Aj·Dj, the addition of the value Pk to the value held in the register or in the accumulator, and the loading of the values Ah and An, are performed in parallel.
0. 32. A data processor comprising:
a first decoder configured to receive and decode a first operation code specifying a data load operation; a second decoder configured to receive and decode a second operation code specifying a multiply-add operation; a register file configured to store an operand address of said first operation code and to output the operand address to a memory to cause, for at least one said operand address, plural operand data to be loaded in parallel from the memory, said register file further configured to store first and second data values which are included in the operand data loaded in parallel from the memory; an arithmetic unit configured to generate a new operand address using the operand address and to update the operand address stored in said register file into the new operand address in response to a first control signal being a decoded result of the first operation code output from said first decoder; and an operation unit configured to receive third and fourth data values stored in said register file and to perform the multiply-add operation in response to a second control signal being a decoded result of said second operation code output from said second decoder; wherein said multiply-add operation includes a multiplying operation of the third data value by the fourth data value and an adding operation utilizing a result of said multiplying operation; and wherein said second operation code has an operand specifying field capable of specifying one of the first and second data values as the third data value, and a data value different from said first and second data values as the fourth data value.
0. 43. A data processor for loading values A1 to Am and values D1 to Dm, and for performing a calculation:
in accordance with a program having a plurality of operation codes, wherein i and m are positive integers, said data processor comprising:
a first decoder configured to decode a first operation code in the program; a second decoder configured to decode a second operation code in the program in parallel with the decoding of the first operation code by said first decoder; a first operation unit configured to output an operand address to a memory in response to a decoded result of the first operation code, the first operation unit configured to load values Ah and Aj in parallel from the memory for at least one said operand address, wherein h and j are different integers among 1 to m; and a second operation unit configured to perform a multiply-add operation in response to a decoded result of the second operation code output from said second decoder, the multiply-add operation including a multiply operation of a value Ak by a value Dk, wherein k is an integer among 1 to m other than h and j, and an adding operation of a result of the multiply operation to a value held in a register or in an accumulator.
11. A data processor comprising:
a memory for storing data; a first instruction decoder receiving first and second operation codes, for decoding said first and second operation codes to output first and second control signals respectively; a second instruction decoder receiving third and fourth operation codes, for decoding said third and fourth operation codes to output third and fourth control signals, respectively, said first and third operation codes being decoded in parallel and said second and fourth operation codes being decoded in parallel; a register file connected to said memory and including a plurality of registers each for storing at least one of data and an operand address; an operation unit for performing an arithmetic operation on the data stored in said register file; and a memory access device operated in parallel with said operation unit for causing said operand address stored in said register file to be applied to said memory and for updating said operand address, wherein, in a first processing, first and second decoders receive said first and third operation codes respectively, and executed in parallel are processing of: (a) said operation unit to receive first data stored in a first register of said register file to perform an arithmetic operation in response to said first control signal, and (b) said memory access device to cause a first operand address stored in a second register of said register file to be applied to said memory to cause second data stored in said memory to be transferred to a third register of said register file and to update said first operand address to write a second operand address into said second register in response to said third control signal, and wherein, in a second processing, said first and second decoders receive said second and fourth operations codes respectively, and executed in parallel are processing of: (c) said operation unit to receive said second data stored in said third register of said register file to perform an arithmetic operation in response to said second control signal, and (d) said memory access device to cause said second operand address stored in said second register of said register file to be applied to said memory to cause third data stored in said memory to be transferred to a fourth register of said register file and to update said second operand address to write a third operand address into said second register in response to said fourth control signal, said first processing and said second processing being executed by pipeline control.
2. The data processor of
wherein said second and third data values each are n bits in length, where n is an integral number, and said second and third data values are combined together into a 2n-bits data value when said second and third data values are transferred to said register file.
3. The data processor of
a multiplier for multiplying together a fourth data value stored in a fourth register of said register file and said first data value; and an adder for adding together at least a result from said multiplier and a value stored in said register file to cause said register file to store a result from said adder.
4. The data processor of
a multiplier for multiplying together a fourth data value stored in a fourth register of said register file and said first data value, an accumulator for holding an accumulated data value which is a result of an operation, and an adder for adding together at least a result from said multiplier and the accumulated data value held in said accumulator to cause said accumulator to hold a result from said adder.
5. The data processor of
wherein said operation unit receives a fourth data value stored in a fourth register of said register file, said arithmetic operation in said operation unit including a multiplying operation of said first and fourth data values and an adding operation at least on a result of said multiplying operation and a fifth data stored in said register file or an accumulator provided with said operation unit; said operand access unit causes an operand address to be applied to said second memory simultaneously with the multiplying operation of said operation unit in a first period, and causes said second and third data values to be transferred from said second memory in response to the operand address simultaneously with the adding operation of said operation unit in a second period following said first period.
6. The data processor of
wherein said operand address is stored in a fifth register of said register file and operand access unit causes said fifth register to be updated into another operand address in said first period.
8. The data processor of
wherein said second and third data values each are n bits in length, where n is an integral number, and said second and third data values are combined together into a 2n-bits data value when said second and third data values are transferred to said second memory.
9. The data processor of
a multiplier for multiplying together a fourth data value stored in a fourth register of said register file and said first data value, and an adder for adding together at least a result from said multiplier and a value stored in said register file to cause said register file to store a result from said adder.
10. The data processor of
a multiplier for multiplying together a fourth data value stored in a fourth register of said register file and said first data value, an accumulator for holding an accumulated data value which is a result of an operation, and an adder for adding together at least a result from said multiplier and the accumulated data value held in said accumulator to cause said accumulator to hold a result from said adder.
13. The method of
(e) transferring, in parallel, fifth and sixth data stored in a third area of said memory to fifth and sixth registers of said register file, respectively; and (f) transferring, in parallel, seventh and eighth data stored in a fourth area of said memory to seventh and eighth registers of said register file, respectively, wherein one of the steps (c) and (d) is executed in parallel with at least one of the steps (e) and (f).
14. The method of
wherein said third area is the same as said first area, and said fourth area is the same as said second area.
15. The method of
wherein said first and second data each are n bits in length, where n is an integral number, and wherein said first and second data are combined together into 2n-bit data when said first and second data are transferred to said register file.
16. The method of
wherein the step (c) comprises the sub-steps of: multiplying said first and third data together; and adding data stored in a ninth register to the result of multiplication to store the result of addition as ninth data in said ninth register, and wherein the step (d) comprises the sub-steps of: multiplying said second and fourth data together; and adding said ninth data stored in said ninth register to the result of multiplication to store the result of addition in said ninth register.
18. The data processor of
wherein said first arithmetic operation is a multiplying operation on said first and third data and said second arithmetic operation is multiplying operation on said second and fourth data, and said operation unit generates a value which is a result of adding a result of said first arithmetic operation, a result of said second arithmetic operation and fifth data in said register file or an accumulator provided with said operation unit.
19. The data processor of
wherein said instruction decoder decodes third and fourth operation codes to output third and fourth control signals, respectively; said operation unit performs said first arithmetic operation in response to said third control signal and performs said second arithmetic operation in response to said fourth control signal.
21. The data processor of
a first operand address is stored in a register of said register file, said operand access unit causes said first operand address to be applied to said memory and said register to be updated into a second operand address in response to said first control signal, and causes said second operand address stored in said register to be applied to said memory in response to said second control signal.
22. The data processor of
a first operand address is stored in a first register of said register file, and a second operand address is stored in a second register of said register file, and said operand access unit causes said first operand address to be applied to said memory and said first register to be updated into a third operand address in response to said first control signal, and causes said second operand address to be applied to said memory and said second register to be updated into a fourth operand address in response to said second control signal.
24. The data processor of
a first register for storing the first address and outputting the first address to said operand access unit; a second register for storing the second address and outputting the second address to said operand access unit; and an address calculator, for calculating a third address on the basis of the first address in a first period in accordance with decoding the first operation code by said first decoder to write back the third address to said first register, and calculating a fourth address on the basis of the second address in a second period following the first period in accordance with decoding the second operation code by said first decoder to write back the fourth address to said second register.
25. The data processor of
said address calculator calculates the third address by adding the first address with a predetermined value and calculates the fourth address by adding the second address with the same value as the predetermined value.
26. The data processor of
said operation unit includes an accumulator, said operation unit calculating a sum of a value stored in said accumulator, the first product and the second product.
27. The data processor of
a second decoder operative in parallel with said first decoder, for decoding operation codes, wherein an operation unit calculates the first product in accordance with decoding the a third operation code by said second decoder, and the second product of said second and fourth data values in accordance with decoding the a fourth operation code by said second decoder.
0. 33. The data processor according to
said first decoder sequentially decodes operation codes including said first operation code and specifying operations to be executed; and said second decoder, operative in parallel with said first decoder, sequentially decodes operation codes including said second operation code and specifying operations to be executed.
0. 34. The data processor according to
said plurality of registers have a same bit length; and said second operation code is capable of specifying each of said plurality of registers as an operand of said second operation code.
0. 35. The data processor according to
said data load operation is a plural-operand data load operation; and each operand address of said first operation code is configured to cause plural operand data to be loaded in parallel from the memory.
0. 36. The data processor according to
data values included in the plural operand data loaded from the memory are stored in different respective registers in the plurality of registers.
0. 37. The data processor according to
said data load operation is a plural-operand data load operation; and each operand address of said first operation code is configured to cause plural operand data to be loaded in parallel from the memory.
0. 38. The data processor according to
said first decoder sequentially decodes operation codes including said first operation code and specifying operations to be executed; and said second decoder, operative in parallel with said first decoder, sequentially decodes operation codes including said second operation code and specifying operations to be executed.
0. 39. The data processor according to
said data load operation is a plural-operand data load operation; and each operand address of said first operation code is configured to cause plural operand data to be loaded in parallel from the memory.
0. 40. The data processor according to
data values included in the plural operand data loaded from the memory are stored in different respective registers in the register file.
0. 41. The data processor according to
said data load operation is a plural-operand data load operation; and each operand address of said first operation code is configured to cause plural operand data to be loaded in parallel from the memory.
0. 42. The data processor according to
data values included in the plural operand data loaded from the memory are stored in different respective registers in the register file.
0. 44. The data processor according to
said first operation code specifies a plural-operand data load operation; and each operand address of said first operation code is configured to cause plural operand data to be loaded in parallel from the memory.
0. 46. The data processor according to
each operand address is configured to cause plural operand data to be loaded in parallel from a memory.
0. 48. The data processor according to
data values included in the plural operand data loaded by the operand access unit are stored in different respective registers in said storage devices.
|
1. Field of the Invention
The present invention relates to a data processor for high-speed digital signal processing and a method of processing data for high-speed digital signal processing.
2. Description of the Background Art
Digital signal processors (DSPs) having an architecture suitable for signal processing have been used as data processors designed specifically for high-speed digital signal processing. These DSPs execute processing frequently used in signal processing such as a multiply-add operation at high speeds. An example of a DSP is Motorola DSP56000. The DSP56000 includes two address pointers, two data memories, and a multiply-add operation unit. Parallel loading of data (e.g., the load of coefficients and data) from two 1-word memories specified respectively by the address pointers, updating of the two address pointers, and the execution of the combined multiply-add operation allows the multiply-add operation to be executed with a high throughput (See DSP56000 Digital Signal Processor Family Manual, 1992). In this manner, the DSP normally has two memories. Data are distributed to either of the memories. Some DSPs use a 2-port RAM for efficient data transfer.
An example of microprocessors incorporating the DSP function includes Motorola CPU16. The CPU16 may repeatedly perform the multiply-add operation and 2-word load in response to one RMAC instruction. However, the CPU16 wherein one multiply-add operation requires 12 cycles is difficult to achieve the performance competing with the DSPs (CPU16 Reference Manual, 1993).
In recent years, some microprocessors have been intended for implementing signal processing by means of software as the operating frequency improves. To improve the arithmetic performance, some of the microprocessors additionally provide the multiply-add operation instructions and make the most of sophisticated parallel processing techniques such as superpipeline and superscalar to achieve DSP-level performance. For example, PowerPC603 (Motorola and IBM) may execute a single-precision floating-point multiply-add operation with one clock cycle throughput by using 3-stage pipeline processing. This requires the amount of hardware and significantly complicated control. To perform one multiply-add operation for each clock cycle, one clock cycle requires 2-word data. The PowerPC603 may load a maximum of one word for each clock cycle, resulting in an insufficient supply of operands (Proceedings of COMPCON 1994: "The PowerPC603 Microprocessor: A High Performance, Low Power, Superscalar RISC Microprocessor", PowerPC603 RISC Microprocessor User's Manual, 1994).
The DSPs which must include two memories have a complicated memory construction and require very cumbersome data management for distribution of data between the two memories. The use of a 2-port RAM adds to the area and costs of the data processor. Additionally, the DSP is in general an accumulator machine and is difficult to execute complicated data processing.
The microprocessors which require one memory have a relatively simple memory construction. However, the microprocessors are not efficient in signal processing unlike the DSPs wherein hardware directly represents the flow of signal processing. To achieve the DSP-level performance, the state-of-the art microprocessors require an increased amount of hardware, adding to the costs of the data processor. Further, the microprocessors are difficult to reduce power consumption because of the need for operation at high frequencies.
According to a first aspect of the present invention, a data processor comprises: a first memory portion for storing an instruction including a first operation code and a second operation code; a second memory portion for storing data; an instruction decode unit for receiving the instruction stored in the first memory portion, the instruction decode unit including first and second decoders for decoding the first and second operation codes in parallel, respectively; a register file portion including a plurality of registers for storing data to transfer data from and to the second memory portion; an operation unit for receiving first data stored in a first register of the register file portion to perform an arithmetic operation using the first data in response to a control signal, the control signal being the first operation code decoded by the first decoder of the instruction decode unit; and an operand access unit operated in parallel with the operation unit for causing second and third data stored in the second memory portion to be transferred in parallel and stored in second and third registers of the register file portion, respectively, in response to a control signal, the control signal being the second operation code decoded by the second decoder of the instruction decode unit.
Preferably, according to a second aspect of the present invention, the second and third data each are n bit (n is a natural number) in length, and the second and third data are combined together into 2n-bit data when the second and third data are transferred to the register file portion.
According to a third aspect of the present invention, a data processor comprises: a first memory portion for storing an instruction including a first operation code and a second operation code; a second memory portion for storing data; an instruction decode unit for receiving the instruction stored in the first memory portion, the instruction decode unit including first and second decoders for decoding the first and second operation codes in parallel, respectively; a register file portion including a plurality of registers for storing data to transfer data from and to the second memory portion; an operation unit for receiving first data stored in a first register of the register file portion to perform an arithmetic operation using the first data in response to a control signal, the control signal being the first operation code decoded by the first decoder of the instruction decode unit; and an operand access unit operated in parallel with the operation unit for causing second and third data stored respectively in second and third registers of the register file portion to be transferred in parallel and stored in the second memory portion in response to a control signal, the control signal being the second operation code decoded by the second decoder of the instruction decode unit.
Preferably, according to a fourth aspect of the present invention, the second and third data each are n bit (n is a natural number) in length, and the second and third data are combined together into 2n-bit data when the second and third data are transferred to the second memory.
Preferably, according to a fifth aspect of the present invention, the operation unit includes a multiplier for multiplying together the first data and fourth data stored in a fourth register of the register file portion, and an adder for adding at least two data together, the adder adding together the result of multiplication of the multiplier and data stored in a register of the register file portion to cause a register of the register file portion to store the result of addition.
Preferably, according to a sixth aspect of the present invention, the operation unit includes a multiplier for multiplying together the first data and fourth data stored in a fourth register of the register file portion, and an adder for adding at least two data together, the adder adding together the result of multiplication of the multiplier and data stored in a register of the register file portion to cause a register of the register file portion to store the result of addition.
Preferably, according to a seventh aspect of the present invention, the operation unit includes a multiplier for multiplying together the first data and fourth data stored in a fourth register of the register file portion, an adder for adding at least two data together, and an accumulator for holding a result of an operation, the adder adding together the result of multiplication of the multiplier and the data held in the accumulator to cause the accumulator to hold the result of addition.
Preferably, according to an eighth aspect of the present invention, the operation unit includes a multiplier for multiplying together the first data and fourth data stored in a fourth register of the register file portion, an adder for adding at least two data together, and an accumulator for holding a result of an operation, the adder adding together the result of multiplication of the multiplier and the data held in the accumulator to cause the accumulator to hold the result of addition.
According to a ninth aspect of the present invention, a data processor comprises: a memory portion for storing data; an instruction decode unit for receiving a first instruction including first and second operation codes and a second instruction including third and fourth operation codes and to be processed after the first instruction to decode the first and second operation codes and the third and fourth operation codes in parallel; a register file portion connected to the memory portion and including a plurality of registers each for storing data or an operand address; an operation unit for performing an arithmetic operation of the data stored in the register file portion; and a memory access portion operated in parallel with the operation unit for causing the operand address stored in the register file portion to be applied to the memory portion and for updating the operand address, wherein, in a first processing, the instruction decode unit receives the first instruction, and executed is parallel processing of (a) the operation unit to receive first data stored in a first register of the register file portion to perform an arithmetic operation in response to a control signal which is outputted from the instruction decode unit decoding the first operation code, and (b) the memory access portion to cause a first operand address stored in a second register of the register file portion to be applied to the memory portion to cause second data stored in the memory portion to be transferred to a third register of the register file portion in response to a control signal which is outputted from the instruction decoded unit decoding the second operation code and to update the first operand address to write a second operand address into the second register in response to the control signal, and wherein, in a second processing, the instruction decode unit receives the second instruction, and executed is parallel processing of (c) the operation unit to receive the second data stored in the third register of the register file portion to perform an arithmetic operation in response to a control signal which is outputted from the instruction decode unit decoding the third operation code, and (d) the memory access portion to cause the second operand address stored in the second register of the register file portion to be applied to the memory portion to cause third data stored in the memory portion to be transferred to a fourth register of the register file portion in response to a control signal which is outputted from the instruction decode unit decoding the fourth operation code and to update the second operand address to write a third operand address into the second register in response to the control signal, the first processing and the second processing being executed by pipeline control.
A tenth aspect of the present invention is intended for a method of processing data by a data processor which includes a memory portion for storing data, a register file portion connected to the memory portion and including a plurality of registers each for storing data or an operand address, an operation unit for receiving the data stored in the register file portion to perform an arithmetic operation, and a memory access portion for causing the operand address stored in the register file portion to be applied to the memory portion. According to the present invention, the method comprises the steps of: (a) transferring first and second data stored in a first area of the memory portion in parallel to write the first and second data into first and second registers of the register file portion, respectively; (b) transferring third and fourth data stored in a second area of the memory portion in parallel to write the third and fourth data into third and fourth registers of the register file portion, respectively; (c) applying the first data stored in the first register and the third data stored in the third register to the operation unit to perform an arithmetic operation of the first and third data by the operation unit; and (d) applying the second data stored in the second register and the fourth data stored in the fourth register to the operation unit to perform an arithmetic operation of the second and fourth data by the operation unit.
Preferably, according to an eleventh aspect of the present invention, the method further comprises the steps of: (e) transferring fifth and sixth data stored in a third area of the memory portion in parallel to write the firth and sixth data into fifth and sixth registers of the register file portion, respectively; and (f) transferring seventh and eighth data stored in a fourth area of the memory portion in parallel to write the seventh and eighth data into seventh and eighth registers of the register file portion, respectively, wherein one of the steps (c) and (d) is executed in parallel with at least one of the steps (e) and (f).
Preferably, according to a twelfth aspect of the present invention, the third area is the same as the first area, and the fourth area is the same as the second area.
Preferably, according to a thirteenth aspect of the present invention, the first and second data each are n bits (n is a natural number) in length, and the first and second data are combined together into 2n-bit data when the first and second data are transferred to the register file portion.
Preferably, according to a fourteenth aspect of the present invention, the step (c) comprises the steps of: multiplying the first and third data together; and adding data stored in a ninth register to the result of multiplication to store the result of addition as ninth data in the ninth register, and the step (d) comprises the steps of: multiplying the first and fourth data together; and adding the ninth data stored in the ninth register to the result of multiplication to store the result of addition in the ninth register.
In accordance with the first aspect of the present invention, the data processor comprises the instruction decode unit including the first and second decoders, the register file, the operation unit, and the operand access unit. The first and second operation codes are decoded and executed in parallel, and the arithmetic operation and the access of two data to the memory are executed in parallel, achieving high-speed data processing. In particular, a DSP-level signal processing performance of a microprocessor is implemented.
The simple construction may reduce the costs of the data processor.
The parallel processing of the multiply-add operation instruction and the access of two data to the memory allows one multiply-add operation to be performed per clock cycle.
In accordance with the data processor of the ninth aspect of the present invention, a plurality of instructions including the operation code for specifying the application of a memory operand to the register file while updating an address by using the register contents as the address, and the operation code for specifying the execution of the arithmetic operation with reference to the register value are processed by means of pipeline processing technique. This permits the arithmetic operations to be executed without operand interference by means of software, improving the processing performance.
In accordance with the tenth aspect of the present invention, the method of processing data comprises loading the first and second data in parallel from the memory to the register, loading the third and fourth data in parallel from the memory to the register, performing the arithmetic operation of the first and third data, and performing the arithmetic operation of the second and fourth data. The access to the memory and the arithmetic operation are executed efficiently by using one memory, improving the performance of the data processor. In particular, digital signal processing performance is greatly improved under simple control.
It is therefore an object of the present invention to provide an inexpensive high-performance microprocessor-type data processor which readily reduces power consumption under relatively simple control.
It is another object of the present invention to provide a data processor having DSP-level digital signal processing performance.
It is still another object of the present invention to provide a method of processing data which may achieve high-performance data processing control.
These and other objects, features, aspects and advantages of the present invention will become more apparent from the following detailed description of the present invention when taken in conjunction with the accompanying drawings.
A data processor according to a first preferred embodiment of the present invention will be described below. The data processor of the first preferred embodiment is a 16-bit processor whose addresses and data are 16 bits in length.
Sixteen general-purpose registers R0 to R15 are provided for storing data and address values therein. The general-purpose registers R0 to R14 are designated by the numerals 1 to 15 in
The reference numerals 21 to 29 designate 16-bit control registers. The number of each of the control registers is represented by 4 bits, similar to those of the general-purpose registers. The control register CR0 designated at 21 is a register for the processor status word (PSW) including a bit for specifying the operating mode of the data processor and a flag indicative of the result of operations.
The control register CR2 designated at 23 in
The control register CR1 designated at 22 in
The control registers 25 to 27 are repeat-associated registers which allow a user to read and write the values thereof so that an interruption is accepted during a repeat. The control register CR7 designated at 25 in
The control registers 28 and 29 are provided to execute modulo addressing. The control register CR10 designated at 28 in
The reference numerals 31 and 32 designate 40-bit accumulators A0 and A1 for holding the result of a multiply-add operation in an integer format. The accumulators A0 and A1 designated at 31 and 32 in
The data processor of the first preferred embodiment processes a 2-way VLIW (very long instruction word) instruction set.
The FM bits 51 may specify the format of the instruction and the order of two short instructions to be executed. If the FM bits 51 are "11", the FM bits 51 indicate that the containers 52 and 53 hold the long instruction. If they are not "11", the FM bits 51 indicate that each of the containers 52 and 53 holds the short instruction. If the indication is that two short instructions are held, the FM bits 51 specify the order of execution. If the FM bits 51 are "00", the FM bits 51 indicate that two short instructions are executed in parallel. If they are "01", the FM bits 51 indicate that the short instruction held in the right-hand container 53 is executed after the short instruction held in the left-hand container 52 is executed. If they are "10", the FM bits 51 indicate that the short instruction held in the left-hand container 52 is executed after the short instruction held in the right-hand container 53 is executed. In this manner, the first preferred embodiment allows encoding into one 32-bit instruction including two short instructions to be executed sequentially, improving encoding efficiency.
Further, there are provided some operations having special instruction encodings, for example, an instruction wherein all 15 bits constitute an operation code such as a NOP (no operation) instruction, and a one-operand instruction.
Sub-instructions for the data processor of this preferred embodiment are a RISC-like instruction set. Only the load/store instruction accesses the memory data, and the operation instruction performs an arithmetic operation on an operand in the register/accumulator or using an immediate operand. There are five operand data addressing modes: a register indirect mode, a register indirect mode with post-increment, a register indirect mode with post-decrement, a push mode, and a register relative indirect mode whose mnemonics are "@Rsrc", "@Rsrc+", "@Rsrc-", "@-SP", "@(disp16, Rsrc)", respectively, when Rsrc is a register number for specifying a base address, and disp16 is the 16-bit displacement value. The address of the operand is specified by a byte address.
All of the modes except the register relative indirect mode have the instruction format shown in FIG. 4. The field 63 specifies a base register number, and the field 62 specifies the number of a register into which a value loaded from the memory is written or the number of a register for holding the value to be stored. In the register indirect mode, the value of the register specified as the base register serves as the operand address. In the register indirect mode with post-decrement, the value of the register specified as the base register serves as the operand address, and the value in the base register is post-incremented by the size (the number of bytes) of the operand and written back. In the register indirect mode with post-decrement, the value of the register specified as the base register serves as the operand address, and the value in the base register is post-decremented by the size (the number of bytes) of the operand and written back. The push mode is usable only when the store instruction is provided and the base register is the register R15. In the push mode, the stack pointer (SP) value pre-decremented by the size (the number of bytes) of the operand serves as the operand address, and the decremented value is written back to the SP.
The register relative indirect mode has the instruction format shown in FIG. 6. The field 83 specifies a base register number, and the field 82 specifies the number of a register into which the value loaded from the memory is written or the number of a register for holding the value to be stored. The field 84 specifies a displacement value for the position at which the operand is stored from the base address. In the register relative indirect mode, the 16-bit displacement value added to the value in the register specified as the base register serves as the operand address.
The post-increment type register indirect mode and the post-decrement type register indirect mode may use a modulo addressing mode by setting the MD bit 44 in the PSW 21 to "1".
Jump target addressing of a jump instruction includes register indirect addressing for specifying the jump target address by using a register value, and PC relative indirect addressing for specifying the jump target address by using a branch displacement of the jump instruction from the PC. PC relative indirect addressing includes short format addressing for specifying the branch displacement when using 8 bits, and long format addressing for specifying the branch displacement when using 16 bits. Further, the data processor has a repeat instruction which achieves loop processing without overhead.
The MPU core 101 includes an instruction queue 111, a control unit 112, a register file 115, a first operation unit 116, a second operation unit 117, and a PC unit 118.
The instruction queue 111 holds 2 entries of 32-bit instruction codes and a valid bit, and is controlled in a FIFO (first-in first-out) order. The instruction queue 111 temporarily holds instruction data fetched by the instruction fetch unit 102 to transmit the instruction data to the control unit 112.
The control unit 112 performs all control of the MPU core 101, for example, control of the instruction queue 111, pipeline control, execution of instructions, and interface with the instruction fetch unit 102 and operand access unit 104. The control unit 112 includes an instruction decode unit 119 for decoding an instruction code transmitted from the instruction queue 111. The instruction decode unit 119 includes two decoders, that is, first and second decoders 113 and 114. The first decoder 113 decodes the instruction to be executed in the first operation unit 116, and the second decoder 114 decodes the instruction to be executed in the second operation unit 117. In a first cycle of decoding of a 32-bit instruction, the first decoder 113 analyzes an instruction code in the left-hand container 52, and the second decoder 114 analyzes an instruction code in the right-hand container 53. The data in the FM bits 51, and the bit 0 and bit 1 of the left-hand container 52 are analyzed by both of the first and second decoder 113 and 114. The data in right-hand container 53 is sent to the first decoder 113 to extract the extended data but is not analyzed. Thus, the instruction to be executed first must be located in a position corresponding to a operation unit for executing the instruction. If two short instructions are executed in sequential order, the instruction to be executed later is transmitted to both of the first and second decoders 113 and 114, and an executable decode result becomes valid. If an instruction is executable by both of the first and second decoders 113 and 114, only the decoded result in the first decoder 113 is validated, and the decoded result in the second decoder 114 is invalidated.
The register file 115 includes the registers 1 to 17 and is connected to the first operation unit 116, second operation unit 117, and PC unit 118 by a plurality of buses.
An AA latch 151 and an AB latch 152 are input latches for an ALU 153. The AA latch 151 receives a register value read through the S1 bus 301 or S3 bus 303 and has a zero clear function. The AB latch 152 receives a register value read through the S3 bus 303 or a 16-bit immediate value generated by decoding in the first decoder 113, and has a zero clear function. The ALU 153 mainly performs transfer, comparison, arithmetic and logic operations, calculation/transfer of operand addresses, increment/decrement of the base address values of the operand addresses, and calculation/transfer of the jump target addresses. The results of operations and address modifications are written back to the register specified by the instruction in the register file 115 through a selector 155 and the D1 bus 311. An AO latch 154 is a latch for holding operand addresses, and selectively holds and outputs the result of address calculation in the ALU 153 or the base address value held in the AA latch 151 to the operand access unit 104 through an OA bus 321. For calculation or transfer of the jump target address, the output from the ALU 153 is transferred to the PC unit 118 through a JA bus 323.
An MOD_S 156 and an MOD_E 157 are control registers corresponding to the control registers CR10 (28) and CR11 (29) of
A store data (SD) register 160 includes two 16-bit registers and temporarily holds store data outputted to the S1 bus 301 or to both of the S1 bus 301 and S2 bus 302. Data held in the SD register 160 is transferred to an alignment circuit 162 through a latch 161. The alignment circuit 162 aligns the data into 32-bit form in accordance with the operand address to output the data to the operand access unit 104 through a latch 163 and an OD bus 322.
The data loaded by the operand access unit 104 is applied to a load data (LD) register 164 including two 16-bit registers through the OD bus 322. The value in the LD register 164 is transferred to an alignment circuit 166 through a latch 165. The alignment circuit 166 aligns the data to output data to be transferred to the even-numbered registers to the W1 bus 314 and data to be transferred to the odd-numbered registers to the W2 bus 315. When 1-word data are loaded, load data are outputted to one of the W1 bus 314 and the W2 bus 315. When 2-word data are loaded, the load data are outputted to both of the W1 bus 314 and the W2 bus 315. The outputted data are written into the specified register in the register file 115.
A PSW 171 in the control unit 112 is a register for holding the value in the control register CR0 (21) of
RPT_S 184, RPT_E 186, and RPT_C 188 are repeat control registers and correspond to the control registers CR8 (26), CR9 (27), and CR7 (25) in the register set of
An execution stage PC (EPC) 194 holds the PC value of the instruction being executed, and a next instruction PC (NPC) 191 calculates the PC value of the instruction to be executed next. If a jump occurs during execution, the NPC 191 receives the value on the JA bus 323 to which the jump target address is transferred. If a branch occurs during a repeat, the NPC 191 receives the first address in the block to be repeated from the latch 185. In other cases, the value in the NPC 191 transferred through a latch 192 is incremented by an incrementor 193 and then written back to the NPC 191. In the case of a subroutine jump instruction, the value in the latch 192 is outputted as a return address to the D1 bus 311 and then written back to the register R13 defined as the link register in the register file 115. If the next instruction is to be executed, the value in the latch 192 is transferred to the EPC 194. If the PC value of the instruction being executed is to be referred to, the value in the EPC 194 is outputted to the S3 bus 303 and transferred to the first operation unit 116. A BPC 196 corresponds to the control register CR3 (23) in the register set of FIG. 1. If an exception or interruption is detected, the value in the EPC 194 is transferred to the BPC 196 through a latch 195. The BPC 196 has an input port from the D1 bus 311 and an output port to the S3 bus 303, and transfer to/from the register file 115 is performed.
Accumulators 208 correspond to the two 40-bit accumulators A0 and A1 designated as 31 and 32 in FIG. 1.
The reference numeral 201 designates a 40-bit ALU including a guard bit adder for the accumulator which is 8 bits long (bit 0 to bit 7), an arithmetic and logic unit which is 16 bits long (bit 8 to bit 23), and an adder for adding the low-order 16 bits of the accumulator which is 16 bits long (bit 24 to bit 39). The ALU 201 performs addition and subtraction of up to 40 bits and a logic operation of 16 bits.
An A latch 202 and a B latch 203 are input latches for the ALU 201. The A latch 202 receives the data on the S4 bus 304 at the bit 8 to bit 23 positions, receives the value in the accumulator 208 intactly through a shifter 204, or receives the value in the accumulator 208 arithmetically 16 bits right-shifted through the shifter 204. A shifter 205 receives the value in the accumulator 208 through an interconnecting line 206 (8 guard bits), the S4 bus 304 (high-order 16 bits) and the S5 bus 305 (low-order 16 bits) or receives the value in the register subjected to sign extension into 40 bits through only the S5 bus 305 or through the S4 and S5 buses 304 and 305. Then, the shifter 205 receives the value arithmetically shifted by any amount ranging from 3 bits left-shift to 1 bit right-shift. The B latch 203 receives the data on the S5 bus 305 at the bit 8 to bit 23 positions or receives the output from a multiplier 211 through the P latch 214 or the output from the shifter 205. The A latch 202 and the B latch 203 have the function to clear the data therein to zero and to set the data therein to a constant value.
If a destination operand indicates the accumulator 208, the output from the ALU 201 is written into the accumulator 208 through a selector 207. If the designation operand indicates the register, the output from the ALU 201 is written into the register file 115 through the selector 207 and either the D2 bus 312 only (1-word data) or both of the D2 bus 312 and D3 bus 313 (2-word data). A saturation circuit 209 receives the output from the ALU 201 and has the function of clipping its output to a maximum or minimum value expressible as 16 bits or 32 bits with reference to the guard bits to output data containing high-order 16 bits or both high-order and low-order 32 bits. The output from the saturation circuit 209 may be written into the register file 115 through only the D2 bus 312 (1-word data) or through both of the D2 bus 312 and D3 bus 313 (2-word data). For calculation of absolute values and execution of maximum and minimum value setting instructions, the outputs of the A latch 202 and the B latch 203 are connected to the input of the selector 207.
A priority encoder (PENC) 210 receives the value in the B latch 203. The PENC 210 generates the shift count value required to normalize the input data as fixed point format, and outputs the results to the register file 115 through the D2 bus 312.
An X latch 212 and a Y latch 213 receive 16-bit values on the S4 bus 304 and S5 bus 305, respectively, and have the function of zero extension or sign extension of the 16-bit values to 17 bits.
The multiplier 211 is a 17-bit×17-bit multiplier for multiplying the value stored in the X latch 212 by the value stored in the Y latch 213. If the multiplier 211 receives a multiply-add instruction or a multiply-subtract instruction, the result of multiplication is applied to a P latch 214 and transmitted to the B latch 203. If the multiplier 211 receives a multiply instruction and the destination operand is the accumulator 208, the result of multiplication is written into the accumulator 208 through the selector 207.
A barrel shifter 215 may perform an up-to-16-bits left and right arithmetic/logic shift on 40-bit or 16-bit data. A shift data (SD) latch 217 receives as shift data the value in the accumulator 208 or the value in the register applied through the S4 bus 304. A shift count (SC) latch 216 receives as a shift count the immediate value of the register value through the S5 bus 305. The barrel shifter 215 performs a shift specified by the operation code on the data in the SD latch 217 by the shift count specified by the SC latch 216. The result of the shift operation is written back to the accumulator 208 or to the register file through the D2 bus 312. The shifter 215 has a 2-word transfer function. Specifically, the shifter 215 outputs the 2-word data received through the S4 bus 304 and S5 bus 305 to the D2 bus 312 and D3 bus 313 through the SD latch 217 and shifter 215 to write back the 2-word data into the register file 115. The shifter 215 may perform 1-word transfer.
An immediate value latch 218 extends a 6-bit immediate value generated by the second decoder 114 into a 16-bit value and then holds the 16-bit value to transfer the 16-bit value to an arithmetic unit through the S5 bus 305.
Pipeline processing in the data processor will be described below according to the first preferred embodiment of the present invention.
At the IF stage 401, a fetch of instructions, management of the instruction queue 111, and repeat control mainly are performed. The IF stage 401 controls the operations of the instruction fetch unit 102, the internal instruction memory 103, the external bus interface unit 106, the instruction queue 111, the IA register 181, latch 182, incrementor 183 and comparator 187 in the PC unit 118, and units for performing the stage control, the instruction fetch control, control of PC unit 118 and control of the instruction queue 11 in the control unit 113. The IF stage 401 is initialized by a jump at the E stage 403.
The fetch address is held in the IA register 181. If a jump occurs at the E stage 403, the IA register 181 receives the jump target address through the JA bus 323 to perform initialization. When the instruction data are fetched sequentially, the incrementor 182 increments the address. The sequence switching control is performed if the comparator 187 detects a coincidence between the value in the IA register 181 and the value in the RPT_E 186 during repeat processing and the value in the RPT_C 188 is not "1". Then, the value held in the RPT_S 184 is transferred to the IA register 181 through the latch 185 and JA bus 323.
The value in the IA register 181 is sent to the instruction fetch unit 102 which in turn fetches the instruction data. If the corresponding instruction data are stored in the internal instruction memory 103, an instruction code is read from the internal instruction memory 103. In this case, the instruction fetch is completed within one clock cycle. If the corresponding instruction data are not stored in the internal instruction memory 103, an instruction fetch request is sent to the external bus interface unit 106. The external bus interface unit 106 arbitrates between the instruction fetch request and a request from the operand access unit 104. When the external bus interface unit 106 accepts the instruction fetch request from the instruction fetch unit 102, the external bus interface unit 106 reads out the instruction data from an external memory, and transmits the fetched instruction to the instruction fetch unit 102. The external bus interface unit 106 requires a minimum of 2 clock cycles to access the external memory. The instruction fetch unit 102 transfers the received instruction to the instruction queue 111. The instruction queue 111 is a 2-entry queue and outputs the instruction code received under FIFO control to the instruction decoders 113 and 114.
At the D stage 402, the instruction decode unit 119 analyzes operation code and generates execution control signals to control the first operation unit 116, the second operation unit 117, and the PC unit 188 to execute instructions. The D stage 402 is initialized by a jump at the E stage 403. If the instruction code sent from the instruction queue 111 is invalid, the D stage 402 is placed in an idle cycle and waits for an valid instruction code to be received. If the E stage 403 is not permitted to start the next processing, the execution control signals are invalidated, and the D stage 403 waits for the termination of processing of the preceding instruction at the E stage 403. For example, such a condition occurs when the instruction being executed at the E stage 403 is a memory access instruction and the preceding memory access is not terminated at the M stage 404.
The D stage 402 also performs division of two instructions to be sequentially executed, sequence control of a 2-cycle execution instruction, a conflict check on a load operand using a scoreboard register (not shown), and a conflict check on a operation unit in the second operation unit 117. If any of these conflicts are detected, the output of the control signal is inhibited until the conflict is cancelled.
The first decoder 113 mainly generates operation control signals for control of the: first operation unit 116, control of parts of the PC unit 118 which are not controlled by the IF stage 401, read control of the register file 115 to the S1 bus 301, S2 bus 302, and S3 bus 303, and write control thereof from the D1 bus 311. The first decoder 113 also generates the instruction-dependent information to be used in the M stage 404 and the W stage 405, and this control information is sent through the pipeline. The second decoder 114 mainly generates an execution control signals in the second operation unit 117.
The E stage 403 performs processing of almost all instruction executions except the memory access and addition of the multiply-add/multiply-subtract operation instructions, such as an arithmetic operation, comparison, data transfer between registers including control registers, operand address calculation of the load/store instructions, calculation of the jump target address of the jump instruction, jump processing, EIT (exception, interruption, trap) detection, and jump to an EIT vector table.
With interrupts enables, an interrupt is detected at the end of a 32-bit instruction without fail. No interrupt is serviced between two short instructions to be sequentially executed in the 32-bit instruction.
The completion of the execution of the E stage 403 must stall when the instruction being processed at the E stage 403 is an operand access instruction and a preceding memory access at the M stage 404 has not completed. Stage control is performed in the control unit 112.
At the E stage 403, the first operation unit 116 performs arithmetic and logic operations, comparison, and transfer. The ALU 153 calculates the address of the memory operand including modulo control and a branch target address. The value in the register specified as the operand by an instruction is transferred to the first operation unit 116. Extended data, such as an immediate or displacement value, is also transferred to the first operation unit 116 from the first decoder 113 if necessary. Arithmetic and logical operations are performed by ALU 153, and an operation result is written back to the register file 115 through the D1 bus 311. If the load/store instruction is provided, the result of the arithmetic operation is transmitted to the operand access unit 104 through the AO latch 154 and OA bus 321. If the jump instruction is provided, the jump target address is transmitted to the respective units through the JA bus 323. The store data are read from the register file 115 through the S1 bus 301 and S2 bus 302 and are held and aligned. Then, the store data are transferred to the operand access unit 104 through the OD bus 322. The PC unit 118 manages the PC value of the instruction being executed and calculates the next instruction address. Data transfer between the control register (except the accumulator) and the register file 115 is carried out by both of the first operation unit 116 and the PC unit 118.
At the E stage 403, the second operation unit 116 executes all operations except addition of the multiply-add operation, such as arithmetic and logic operations, comparison, transfer, and shift. The value of an operand is transferred from the register file 115, immediate value register 218, and accumulator 208 to respective operation units through the S4 bus 304, S5 bus 305 and other exclusive paths, and is subjected to a specified operation. The result of the operation is written back to the accumulator 208, or to the register file 115 through the D2 bus 312 and the D3 bus 313.
The control signal generated in the second decoder 114 for execution of the addition and subtraction of the multiply-add/multiply-subtract operation is held under control of the E stage 403.
In the M stage 404, operand memory access is performed according to the address sent from the first operation unit 116. The operand access unit 104 reads/writes data from/to the internal data memory 105 or an on-chip IO (not shown) in one clock cycle if the operand is in the internal data memory 105 or the on-chip IO. The operand access unit 104 outputs a data access request to the external bus interface unit 106 if the operand is not in the internal data memory 105 or the on-chip IO (not shown). The external bus interface unit 106 accesses data in the external memory, and transfers the read data to the operand access unit 104 if a load instruction is executed. The external bus interface unit 106 requires a minimum of two clock cycles to access the external memory. If the load instruction is executed, the operand access unit 104 transfers the read data to the LD register 164 through the OD bus 322. The M stage 404 control is performed in the control unit 112.
In the W stage, alignment of loaded operands, zero/sign extension of byte data, and writing to the register file 115 are performed.
At the E2 stage 406, the ALU 201 executes the addition and subtraction of the multiply-add/multiply-subtract operation.
The data processor of this preferred embodiment uses for internal control an a clock signal generated by multiplying an input clock signal by four for an internal clock signal. Each of the pipeline stage requires a minimum of one internal clock cycle to terminate processing thereof. The details of the clock control are not directly related to the present invention and hence are not described.
An example of processing of the respective sub-instructions is discussed below. The processing of operation instructions such as addition, subtraction, logic operation, and comparison, and register-to-register transfer instructions is terminated in three stages: the IF stage 401, the D stage 402, and the E stage 403. The operations and data transfer are executed at the E stage 403.
The multiply-add/multiply-subtract instruction requires 2 clock cycles for execution of multiplication at the E stage 403 and addition and subtraction at the E2 stage 406, that is, substantially 4-stage processing.
The load instruction requires five stages: the IF stage 401, the D stage 402, the E stage 403, the M stage 404, and the W stage 405 to terminate the processing. The store instruction requires four stages: the IF stage 401, the D stage 402, the E stage 403, and the M stage 404 to terminate the processing.
An instruction which requires 2 cycles for execution directs that the first and second instruction decoders 113 and 114 perform the processing in two cycles. Each of the first and second instruction decoders 113 and 114 outputs an execution control signal for each cycle, and executes the operation in two cycles.
One long instruction performs the above described processing. Two instructions to be executed in parallel perform the above described processing in accordance with the instruction that takes a greater number of clock cycles to execute the instruction in the E stage 403. For example, a combination of the instruction to be executed in two cycles and the instruction to be executed in one cycle requires two cycles. Two short instructions to be executed sequentially are decoded sequentially in the D stage 402 and executed sequentially in the E stage 403. For example, two addition instructions to be terminated at the E stage 403 are divided into respective instruction processes at the D stage 402 and executed over 2 cycles at the E stage 403.
An example of processing is described below on the basis of some programs.
where A[i] is a coefficient array and D[i] is a data array. This calculation includes 256 multiply-add operations. The coefficient and the data each are 16 bits in length.
In
The processing in the loop is described in detail hereinafter. Each instruction includes the load instruction and the multiply-add operation instruction, and the two short instructions are executed in parallel. In
An example is given below based on the processing of 11 (511). At the IF stage 401, 11 (511) is fetched during T1 period (531). The contents of the IA register 181 are transferred to the instruction fetch unit 102. The comparator 187 compares the value in the IA register 181 with the value in the RPT_E 186. Since a mismatch occurs, the value in the IA register 181 is incremented by the incrementor 182 and written back. The instruction fetch unit 102 accesses the internal instruction memory 103 to transmit the read 32-bit instruction data to the instruction queue 111. The instruction queue 111 transmits the instruction data transferred thereto within the same cycle to the first decoder 113 and the second decoder 114.
At the D stage 402, 11 (511) is decoded during T2 period (537). The first decoder 113 decodes the LD2W instruction of I1a (511(a)) to produce the control signal, and the second decoder 114 decodes the MAC instruction of I1b (511(b)) to produce the control signal. The control signals from the first and second decoders 113 and 114 are outputted to the first and second operation units 116 and 117, respectively. The immediate value which is "4" is transmitted to the first operation unit 116. At the D stage 401, a conflict check is performed on the operands and arithmetic units, but no interference occurs. The value of the read operand of the MAC instruction has already been loaded. The MAC instruction of I1b (511(b)) is executed during T3 period (543). Writing a value to the register R0 has been completed during T1 period (535), and writing a value to the register R6 has been completed during T2 period (540).
At the E stage 403, 11 (511) is executed during T3 period (543). The first operation unit 116 produces the operand address of the LD2W instruction of I1a (511(a)) and updates the value of the address pointer. The value in the register R12 of the register file 115 which is the operand address is transferred through the S3 bus 303 to the AA latch 151. The value in the AA latch 151 is intactly outputted to the operand access unit 104 through the AO latch 154 and OA bus 321. The immediate value outputted form the first decoder 113 is transferred to the AB latch 152. The ALU 153 performs addition to write back the result of addition to the register R12 of the register file 115 through the selector 155 and D1 bus 311. The second operation unit 117 performs multiplication of the MAC instruction of I1b (511(b)). The value in the register R0 of the register file 115 is applied to the X register 212 through the S4 bus 304, and the value in the register R6 of the register file 115 is applied to the Y register 213 through the S5 bus 305. Both of the values are handled as signed values and multiplied together. The result of multiplication is applied to the P register 214.
At the M and E2 stages 404 and 406, 11 (511) is subjected to memory access and addition during T4 period (549), respectively. The operand access unit 104 loads the 4-byte data from the internal data memory 105 at the address transmitted from the first operation unit 116 to transfer the fetched value to the LD register 164 through the OD bus 322. The second operation unit 117 performs addition of the MAC instruction of I1b (511(b)). The value in the accumulator 208 (A0) is not shifted by the shifter 204 but is applied to the A latch 202. The value in the P register 214 is subjected to sign extension into 40 bits and applied to the B latch 203. The ALU 201 adds the values in the A and B latches 202 and 203 together to write back the result of addition to the accumulator 208 (A0).
At the W stage 405, writing back to the register is performed during T5 period (555). The first operation unit 116 outputs the data held in the LD register 164 to the W1 bus 314 and W2 bus 315 through the latch 161 and alignment circuit 166. Since the operand is aligned in 4 bytes, the high-order 2 bytes are outputted to the W1 bus 314, and the low-order 2 bytes are outputted to the W2 bus 315. The data on the W1 bus 314 are written into the register R4 of the register file 115, and the data on the W2 bus 315 are written into the register R5 of the register file 115.
The pipeline processing of one 32-bit instruction for each clock cycle achieved one multiply-add operation for each clock cycle. In this manner, the loaded data value is written two words at a time into the registers R0 and R1 of the register file 115 during T1 period 535 at the W stage 405, and the loaded coefficient value is written two words at a time into the registers R6 and R7 of the register file 115 during T2 period 540 at the W stage 405. The value in the register R0 of the register file 115 for holding the data and the value in the register R6 of the register file 115 for holding the corresponding coefficient are referred to and multiplied together during T3 period 543 at the E stage 403. The value in the register R1 of the register file 115 for holding the data and the value in the register R7 of the register file 115 for holding the corresponding coefficient are referred to and multiplied together during T4 period 548 at the E stage 403. Such pipeline processing by means of software without operand interference improves efficiency.
The repeat processing is not illustrated in detail in
An n-stage second-order direct-form type II (n biquad) IIR (infinite impulse response) filter is described below.
Processing in the loop is described in detail herein.
The register R0 holds input data to the next stage. The register R1 is used as update data Di1 (i is an integer not more than n). The registers R2 to R5 are used as a buffer for holding the data. The registers R6, and R8 to R11 are used as a buffer for coefficients. The register R12 is used as a data pointer. The register R14 is used as a pointer for coefficients. The register R7 holds invalid data to maintain 32-bit alignment of the coefficient data.
An example of IFFT (inverse fast Fourier transform) is described below. Unit processing is as follows:
where a and b are complex variables of input data, A and B are complex variables of output data (update data), tmp is a temporary complex variable, c is a complex constant, "_r" is a real part, and "_i" is an imaginary part.
The symbol "msu" indicates the multiply-subtract instruction which directs that the result of multiplication is subtracted from the accumulator. This is because the square of i (complex number) equals -1.
In this case, 15 cycles are required to implement two unit processings with respect to two pairs of complex numbers. The thirty sub-instructions include four 2-word load instructions, four 2-word store instructions, four additions, four subtractions, four multiplications, two multiply-add operations, two multiply-subtract operations, four rounding instructions, and two 2-word transfer instructions, providing very high efficiency of operations.
The ALU 221 performs a 16-bit arithmetic and logic operation. An A2 latch 222 connected to the S4 bus 304 and a B2 latch 223 connected to the S5 bus 305 are input latches for the ALU 221. An ALUO latch 225 is an output latch for the ALU 221. A selector 224 selects the output from the ALU 221, the value in the A2 latch 222, or the value in the B2 latch 223 to write back the selected value to the register file 115 through the D2 bus 312. The output from the ALUO latch 225 may be set to the low-order positions and subjected to sign extension by a shifter 235. A B latch 233 selectively receives the output from the shifter 235 or the value in the P latch 214 serving as the output latch of the multiplier 211. An A latch 232 receives data from the accumulator 208 through the shifter 204. Other elements of the second operation unit 120 are substantially identical with those of the second operation unit 117 of the first preferred embodiment.
An example of processing is described below.
The data processor of the second preferred embodiment may more efficiently process the subtract-absolute-add operation described in the first preferred embodiment.
The MPU core 850 comprises an instruction queue 851, a control unit 852, a register file 860, a first operation unit 858, a second operation unit 859, a third operation unit 861, and a fourth operation unit 862. The instruction queue 851 is an FIFO-controlled instruction buffer for holding a maximum of two 64-bit instructions. The first operation unit 858 includes an incrementor, a decrementor, and an adder and performs management of the PC value, calculation of the branch target address, and repeat control. The second operation unit 859 includes an ALU and an alignment circuit and performs operand address generation, updating of the pointer, arithmetic and logic operations, transfer, comparison, holding and alignment of loaded data, and holding and alignment of data to be stored. The third operation unit 861 includes an ALU and a shifter, and performs operation processing such as arithmetic and logic operations, transfer, comparison and shift. The fourth operation unit 862 includes a multiply-add operation unit, a shifter, and an accumulator, and mainly performs the multiply-add and multiply-subtract operations and accumulator shift. In this manner, the MPU core 850 has the four independent arithmetic operation units connected to the register file.
The control unit 852 includes an instruction decode unit 853. The instruction decode unit 853 has four decoders.
The first decoder 854 mainly decodes the operation code of the first container 872 to produce control signals for the register file 860 and first operation unit 858. The branch instruction is mainly specified in the field of the first container 872. The second decoder 855 mainly decodes the operation code of the second container 873 to produce control signals for the register file 860 and second operation unit 859. The load/store instruction, arithmetic and logic operation instruction, transfer instruction, and comparison instruction are mainly specified in the field of the second container 873. The third decoder 856 mainly decodes the operation code of the third container 874 to produce control signals for the register file 860 and third operation unit 861. The arithmetic and logic operation instruction, transfer instruction, comparison instruction, and shift instruction are mainly specified in the field of the third container 874. The fourth decoder 857 mainly decodes the operation code of the fourth container 875 to produce control signals for the register file 860 and fourth operation unit 862. The multiply-add operation instruction is mainly specified in the field of the fourth container 875.
Such an arrangement allows greatly sophisticated parallel processing. The present invention is applicable also in such a case. For example, to execute the subtract-square-add operation, the second, third, and fourth operation units 859, 861, 862 may execute the load, subtraction, and absolute-add operation in parallel, respectively, to provide the throughput of processing such that one subtract-square-add operation is executed per cycle. Similarly, the IFFT processing is also executed at high speeds. According to the present invention, the number of arithmetic units is not limited but may be determined on the basis of a trade-off between required performance and costs. If the throughput of data transfer is insufficient, four words should be transferred in parallel. If the number of registers is insufficient, the number of registers should be increased which requires the increase in bit length.
For improvement in the throughput of the multiply-add operation, a plurality of operation units should have multiply-add operation units to increase the number of operands to be transferred. The present invention is also applicable in this case.
In the fourth preferred embodiment, the result of the multiply-add operation is stored in the register for each operation, and no guard bits are provided. Additional guard bits may be provided if required in terms of operation accuracy.
The basic pipeline processing of the fourth preferred embodiment is similar to that of the first preferred embodiment, and the description thereof will be dispensed with. An S4 bus 913, an S5 bus 914, a D2 bus 915, and a D3 bus 916 operate at the E stage 403. These buses mainly transfer operand values of an ordinary integer operation instruction and the like. An S6 bus 911, an S7 bus 912, a D4 bus 917, and a D5 bus 918 operate at the E2 stage 406. These buses mainly transfer accumulated value. An adder 934 and its input and output units operate at the E stage 403 and E2 stage 406, but other arithmetic units and latches operate at the E stage 403.
A "mac" instruction for multiply-add operation is a 3-operand instruction. The processing specifications of "mac Rdest, Rsrc1, Rsrc2" are such that the register value specified by Rsrc1 and the register value specified by Rsrc2 are multiplied together and the result of multiplication is added to the value in the pair of registers specified by Rdest. The hardware processing is described in detail. First, at the E stage 403, the register values specified by Rsrc1 and Rsrc2 are transferred from a register file 903 through the S4 bus 913 and S5 bus 914 to an X latch 938 and a Y latch 939, respectively. A multiplier 940 performs multiplication, and the P register 941 holds the result of multiplication. Then, at the E2 stage 406, the values in the pair of registers specified by Rdest is applied to an A latch 931 from the register file 903 through the S6 bus 911, the S7 bus 912, and the shifter 930. The value in the P register 941 is applied to a B latch 933. The adder 934 adds the values in the A latch 931 and B latch 933 together. The result of addition is outputted through a saturation circuit 937 to the D4 bus 917 and D5 bus 918, and written back to the pair of registers specified by Rdest in the register file 903.
In this manner, the technique of the present invention is also effective when the cumulative result of the multiply-add operations is held in the register. The operands are not bypassed herein, but a bypass path may be provided as required.
In the data processor of the above described preferred embodiments, one word is assumed to be 16 bits in length. However, one word may be any number of bits in length. For example, audio processing requires about 24 bits in length, and one word may be 24 bits in length. One word may be 32 bits long in terms of alignment with a processor. In this case, the multiplier may not necessarily be of 1-word by 1-word form, but a multiplier of a size essential in terms of the accuracy of an application to be processed should be selected and implemented.
In the data processor of the above described preferred embodiments, the multiply-add operation is subjected to two-stage pipeline processing. However, the last addition stage of the multiplier and the adder for addition may be merged to execute the multiply-add operation in one cycle. Additionally, for high-speed operation, the multiplication may be performed by 2-stage pipeline to permit the multiply-add operation to be performed by 3-stage pipeline. Other pipelines may be freely selectable. For instance, the E stage 403 and M stage 404 may be merged into one pipeline stage for processing. Further, to improve the operating frequency, write back operation to the register may be performed in the different pipeline stage from E stage. In addition, data may be bypassed from the write path to the register, which is effective for high-speed processing.
In the above described preferred embodiments of the present invention, the microprocessor of VLIW architecture is illustrated as an example. However, the technique of the present invention is also applicable to a superscalar RISC processor and the like programmed if the details of hardware are noted and the conditions for parallel processing are seized. The difference is that the parallel execution is encoded in the program or the hardware determines whether or not the parallel execution is permitted. The FM bits may be absent in the VLIW architecture. The instructions may be always executed in parallel. In this case, the operation which is not executed in parallel should be set to NOP.
While the invention has been described in detail, the foregoing description is in all aspects illustrative and not restrictive. It is understood that numerous other modifications and variations can be devised without departing from the scope of the invention.
Yoshida, Toyohiko, Matsuo, Masahito
Patent | Priority | Assignee | Title |
7366352, | Mar 20 2003 | Meta Platforms, Inc | Method and apparatus for performing fast closest match in pattern recognition |
7680990, | May 30 2003 | Hewlett-Packard Development Company, L.P. | Superword memory-access instructions for data processor |
7724963, | Mar 20 2003 | Meta Platforms, Inc | Apparatus for performing fast closest match in pattern recognition |
8161090, | Dec 05 2008 | Crossfield Technology LLC | Floating-point fused add-subtract unit |
8447800, | May 10 2006 | Qualcomm Incorporated | Mode-based multiply-add recoding for denormal operands |
9047094, | Mar 31 2004 | ICERA, INC | Apparatus and method for separate asymmetric control processing and data path processing in a dual path processor |
9477475, | Mar 31 2004 | Nvidia Technology UK Limited | Apparatus and method for asymmetric dual path processing |
Patent | Priority | Assignee | Title |
4819152, | Apr 05 1985 | Micron Technology, Inc | Method and apparatus for addressing a memory by array transformations |
5134711, | May 13 1988 | AT&T Bell Laboratories; BELL TELEPHONE LABORATORIES, INCORPORATED, A CORP OF NY ; AMERICAN TELEPHONE AND TELEGRAPH COMPANY, A CORP OF NY | Computer with intelligent memory system |
5201039, | Sep 30 1987 | Mitsubishi Denki Kabushiki Kaisha | Multiple address-space data processor with addressable register and context switching |
5299321, | Dec 18 1990 | GROMENS ACQUISITIONS CO L L C | Parallel processing device to operate with parallel execute instructions |
5481734, | Dec 16 1989 | Mitsubishi Denki Kabushiki Kaisha | Data processor having 2n bits width data bus for context switching function |
5485629, | Jan 22 1993 | Intel Corporation | Method and apparatus for executing control flow instructions in a control flow pipeline in parallel with arithmetic instructions being executed in arithmetic pipelines |
5530817, | Feb 21 1992 | Kabushiki Kaisha Toshiba | Very large instruction word type computer for performing a data transfer between register files through a signal line path |
5630083, | Mar 01 1994 | Intel Corporation | Decoder for decoding multiple instructions in parallel |
5664136, | Jul 10 1995 | GLOBALFOUNDRIES Inc | High performance superscalar microprocessor including a dual-pathway circuit for converting cisc instructions to risc operations |
5761470, | Jul 12 1995 | Renesas Electronics Corporation | Data processor having an instruction decoder and a plurality of executing units for performing a plurality of operations in parallel |
5812810, | Jul 01 1994 | HEWLETT-PACKARD DEVELOPMENT COMPANY, L P | Instruction coding to support parallel execution of programs |
5881312, | Mar 19 1993 | Intel Corporation | Memory transfer apparatus and method useful within a pattern recognition system |
EP427245, | |||
JP5344130, | |||
JP57113144, | |||
JP60134938, | |||
JP60138640, | |||
JP7176380, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
May 04 2001 | Mitsubishi Denki Kabushiki Kaisha | (assignment on the face of the patent) | / | |||
Mar 07 2011 | Mitsubishi Denki Kabushiki Kaisha | Renesas Electronics Corporation | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 025980 | /0219 |
Date | Maintenance Fee Events |
Jul 26 2005 | ASPN: Payor Number Assigned. |
Jul 26 2005 | RMPN: Payer Number De-assigned. |
Oct 13 2006 | M1552: Payment of Maintenance Fee, 8th Year, Large Entity. |
Oct 06 2010 | M1553: Payment of Maintenance Fee, 12th Year, Large Entity. |
Date | Maintenance Schedule |
Dec 28 2007 | 4 years fee payment window open |
Jun 28 2008 | 6 months grace period start (w surcharge) |
Dec 28 2008 | patent expiry (for year 4) |
Dec 28 2010 | 2 years to revive unintentionally abandoned end. (for year 4) |
Dec 28 2011 | 8 years fee payment window open |
Jun 28 2012 | 6 months grace period start (w surcharge) |
Dec 28 2012 | patent expiry (for year 8) |
Dec 28 2014 | 2 years to revive unintentionally abandoned end. (for year 8) |
Dec 28 2015 | 12 years fee payment window open |
Jun 28 2016 | 6 months grace period start (w surcharge) |
Dec 28 2016 | patent expiry (for year 12) |
Dec 28 2018 | 2 years to revive unintentionally abandoned end. (for year 12) |