This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2013-056569, filed on Mar. 19, 2013, the entire contents of which are incorporated herein by reference.
The embodiments discussed herein are directed to a data processing device.
There is known a bridge for a computer system including a first bus and a second bus, the bridge being disposed between the first bus and the second bus (refer to Patent Document 1, for example). A shifter has an input connected for receiving a byte from one of the first bus and the second bus, and an output for performing, on a shifted byte, selectable shift regarding the received byte. An accumulator has an input connected for receiving an output of the shifter, and performs selective accumulation of shifted byte. The accumulator has an output for supplying a re-aligned byte to be sent from one of the first bus and the second bus to the other.
There is known a method of reading unaligned data in a processor (refer to Patent Document 2, for example). The unaligned data is stored in one memory, and the memory is divided into a plurality of m-bit words by word boundaries. The unaligned data is divided by word boundaries into a first part, a second part and a third part. This method includes a start capture step, an intermediate capture step, a first shift step, an end capture step, and a second shift step. In the start capture step, a first instruction is executed to capture a first word from a part of the memory including the first part. In the intermediate capture step, a second instruction is executed to capture a second word from a part of the memory including the second part. In the first shift step, the first word and the second word are connected in series, and the resultant is shifted to a first position. In the end capture step, a third instruction is executed to capture a third word from a part of the memory including the third part. In the second shift step, the second word and the third word are connected in series, and the resultant is shifted to the first position.
Among memories, there is one that reads data with a certain bit length for each cycle and outputs the data. It is not possible for such a memory to cut and output only valid data, so that the memory outputs data with the certain bit length including the valid data and/or invalid data. When such a memory is employed, a calculation unit is needed to perform calculation by ignoring the invalid data and using only the valid data out of the data output from the memory. When there is the invalid data, a waiting time is generated in the calculation of the calculation unit, which is a problem.
A data processing device has: a shift circuit that makes data with a certain bit length to be input therein for each cycle, and shifts the data to delete first invalid data in the data; and a gate circuit that cuts, when data as a result of combining pieces of the shifted data for each cycle has the certain bit length or more, first data with the certain bit length to output the data to an outside.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention.
When a read instruction including a read start address and a read data length is input from the processor 101 into each of the direct memory access controllers 103A to 103D, the direct memory access controllers 103A to 103D read data corresponding to the read instruction from the memory 102, and output pieces of data DA1 to DD1 to the data processing circuit 104. The data processing circuit 104 makes the pieces of data DA1 to DD1 to be input therein, deletes invalid data in the pieces of data DA1 to DD1, and outputs pieces of valid data DA2 to DD2. The respective first-in-first-out circuits 105A to 105D buffer the pieces of valid data DA2 to DD2 in a first-in-first-out order, and output pieces of data DA3 to DD3. The calculation unit 106 performs calculation by using all of or a part of the pieces of data DA3 to DD3, and outputs data DE1 and/or DF1. The respective first-in-first-out circuits 105E and 105F buffer the pieces of data DE1 and DF1 in a first-in-first-out order, and output pieces of data DE2 and DF2. When a write instruction including a write start address and a write data length is input from the processor 101 into each of the direct memory access controllers 103E and 103F, the direct memory access controllers 103E and 103F write the pieces of data DE2 and DF2 into an address of the memory 102 corresponding to the write instruction.
A0×B0=F0
A1×B1=F1
A2×B2=F2
A3×B0=F3
A4×B1=F4
A5×B2=F5
A6×B0=F6
A7×B1=F7
A8×B2=F8
A9×B0=F9
A10×B1=F10
A11×B2=F11
The data DA3 has pieces of data A0 to A11. The data DB3 has four sets of data B0 to B2. The data DF1 has pieces of data F0 to F11. In this case, the direct memory access controller 103A reads the twelve pieces of data A0 to A11 once as the data DA1. On the contrary, the direct memory access controller 103B repeatedly reads three pieces of data B0 to B2 four times as the data DB1.
A data stream 302A is stored on four memory lines, for example, and a first address and a final address thereof are positioned in addresses which are not boundaries of the memory lines. When the read instruction including the read start address and the read data length is input from the processor 101 into the direct memory access controller 103A, the direct memory access controller 103A reads, from the memory 102, data of four memory lines (4×512 bits) including the data stream 302A corresponding to the read instruction, and outputs the data DA1 to the data processing circuit 104.
A data stream 302B is stored on two memory lines, for example, and a first address and a final address thereof are positioned in addresses which are not boundaries of the memory lines. When the read instruction including the read start address and the read data length is input from the processor 101 into the direct memory access controller 103B, the direct memory access controller 103B reads, from the memory 102, data of two memory lines (2×512 bits) including the data stream 302B corresponding to the read instruction, and outputs the data DB1 to the data processing circuit 104.
The data DB1 is obtained by repeatedly reading the data of two memory lines including the data stream 302B four times from the memory 102, as illustrated in
Accordingly, the calculation unit 106 can perform the calculation illustrated in
As described above, the memory 102 reads the data in the unit of memory line 301 with the certain bit length for each cycle, and outputs the data. It is not possible for the memory 102 to cut and output only the valid data, so that the memory 102 outputs the data with the certain bit length including the valid data and the invalid data 401. When there is the invalid data 401, the calculation unit 106 is needed to perform calculation by ignoring the invalid data 401 and using only the valid data out of the data output from the memory 102, and accordingly, there exists a problem that a waiting time is generated in the calculation of the calculation unit 106.
In the present embodiment, the data processing circuit 104 can delete the invalid data 401 in the data with the certain bit length to generate the stream of valid data. Accordingly, it is possible to eliminate a loss caused by the waiting time in the calculation using the data.
The data processing circuit 104 makes the data DA1 to be input therein, deletes the invalid data 401, and outputs the data DA2 configured by the data stream 302A being the valid data to the first-in-first-out circuit 105A, as illustrated in
Further, the data processing circuit 104 makes the data DB1 to be input therein, deletes the invalid data 401, and outputs the data DB2 as a result of combining four data streams 302B being the valid data to the first-in-first-out circuit 105B, as illustrated in
Data DC1 is obtained by repeatedly reading data of three memory lines including a data stream 302C twice from the memory 102. Each data stream 302C is configured by six pieces of data C0 to C5. The data DC1 has the data stream 302C being valid data, and invalid data 401. The data processing circuit 104 makes the data DC1 to be input therein, deletes the invalid data 401, and outputs data DC2 as a result of combining two data streams 302C being the valid data to the first-in-first-out circuit 105C, as illustrated in
The data DD1 is obtained by reading data of four memory lines including a data stream 302D. The data stream 302D is configured by twelve pieces of data D0 to D11. The data DD1 has the data stream 302D being valid data, and invalid data 401. The data processing circuit 104 makes the data DD1 to be input therein, deletes the invalid data 401, and outputs the data DD2 configured by the data stream 302D being the valid data to the first-in-first-out circuit 105D, as illustrated in
In this case, the calculation unit 106 in
A0×B0+C0+D0=F0
A1×B1+C1+D1=F1
A2×B2+C2+D2=F2
A3×B0+C3+D3=F3
A4×B1+C4+D4=F4
A5×B2+C5+D5=F5
A6×B0+C0+D6=F6
A7×B1+C1+D7=F7
A8×B2+C2+D8=F8
A9×B0+C3+D9=F9
A10×B1+C4+D10=F10
A11×B2+C5+D11=F11
Further, the calculation part 701 calculates a shift amount SH through the following equation. Here, at an initial time, a valid data length BS of the buffer 704 in the next cycle is 0 bit.
Further, the calculation part 701 calculates a valid data length BSt in the next cycle through the following equation.
Since the valid data length BSt in the next cycle is less than 512 bits, the calculation part 701 sets the valid data length BS of the buffer 704 in the next cycle (
Further, since the valid data length BSt in the next cycle is less than 512 bits, the calculation part 701 sets the control signal MF to “0”.
Next, an operation of the shift selection circuit 705 will be described while referring to
In
n>BS/16
n>0/16
n>0
In
Next, in
Further, the calculation part 701 calculates the shift amount SH through the following equation.
Further, the calculation part 701 calculates the valid data length BSt in the next cycle through the following equation.
Since the valid data length BSt in the next cycle is 512 bits or more, the calculation part 701 sets the valid data length BS of the buffer 704 in the next cycle (
Further, since the valid data length BSt in the next cycle is 512 bits or more, the calculation part 701 sets the control signal MF to “1”.
Next, an operation of the shift selection circuit 705 will be described while referring to
In
n>BS/16
n>48/16
n>3
In
Next, in
Further, the calculation part 701 calculates the shift amount SH through the following equation.
Further, the calculation part 701 calculates the valid data length BSt in the next cycle through the following equation.
Since the valid data length BSt in the next cycle is less than 512 bits, the calculation part 701 sets the valid data length BS of the buffer 704 in the next cycle (
Further, since the valid data length BSt in the next cycle is less than 512 bits, the calculation part 701 sets the control signal MF to “0”.
Next, an operation of the shift selection circuit 705 will be described while referring to
In
n>BS/16
n>48/16
n>3
In
Next, in
Further, the calculation part 701 calculates the shift amount SH through the following equation.
Further, the calculation part 701 calculates the valid data length BSt in the next cycle through the following equation.
Since the valid data length BSt in the next cycle is less than 512 bits, the calculation part 701 sets the valid data length BS of the buffer 704 in the next cycle (
Further, since the valid data length BSt in the next cycle is less than 512 bits, the calculation part 701 sets the control signal MF to “0”.
Next, an operation of the shift selection circuit 705 will be described while referring to
In
n>BS/16
n>160/16
n>10
In
Next, in
Further, the calculation part 701 calculates the shift amount SH through the following equation.
Further, the calculation part 701 calculates the valid data length BSt in the next cycle through the following equation.
Since the valid data length BSt in the next cycle is 512 bits or more, the calculation part 701 sets the valid data length BS of the buffer 704 in the next cycle (
Further, since the valid data length BSt in the next cycle is 512 bits or more, the calculation part 701 sets the control signal MF to “1”.
Next, an example of processing of the shift selection circuit 705 in
The n-th selector SELn selects the data 802 when the following equation is satisfied, selects the data 708 when the following equation is not satisfied, and outputs the selected data. Here, BS indicates a current valid data length of the buffer 704 in
n>BS/16
n>208/16
n>13
The selectors SEL1 to SEL13 select the data 708, the selectors SEL14 to SEL32 select the data 802, and the 512-bit data 706L is output. As a result of this, the first-half 512-bit data 706L has the 48-bit valid data d2, the 112-bit valid data d3, the 48-bit valid data d4 and the 304-bit valid data d5. Further, the latter-half 512-bit data 706R has the 208-bit valid data d5 at the final portion.
Next, since the control signal MF is “1”, the gate circuit 707 outputs the 512-bit data 706L and the write request signal PD to the first-in-first-out circuits 105A to 105D in
Further, the calculation part 701 calculates the shift amount SH through the following equation.
Further, the calculation part 701 calculates the valid data length BSt in the next cycle through the following equation.
Since the valid data length BSt in the next cycle is less than 512 bits, the calculation part 701 sets the valid data length BS of the buffer 704 in the next cycle through the following equation.
Further, at the time of final cycle, the calculation part 701 sets the control signal MF to “1”.
Next, an example of processing of the shift selection circuit 705 in
The n-th selector SELn selects the data 802 when the following equation is satisfied, selects the data 708 when the following equation is not satisfied, and outputs the selected data. Here, BS indicates a current valid data length of the buffer 704 in
n>BS/16
n>208/16
n>13
The selectors SEL1 to SEL13 select the data 708, the selectors SEL14 to SEL32 select the data 802, and the 512-bit data 706L is output. As a result of this, the first-half 512-bit data 706L has the 208-bit valid data d5 and the 112-bit valid data d6. Further, the latter-half 512-bit data 706R is the same as latter-half 512-bit data of the 2×512-bit data 802.
Next, since the control signal MF is “1”, the gate circuit 707 outputs the 512-bit data 706L and the write request signal PD to the first-in-first-out circuits 105A to 105D in
As described above, when the data DA1 in
Concretely, the shift circuit 801 makes the data 702 with the certain bit length to be input therein for each cycle, shifts the data 702 to delete the first invalid data 401 in the data 702, and outputs the data 802. The gate circuit 707 cuts, when the data 706 as a result of combining pieces of the shifted data for each cycle has the certain bit length or more, the first data 706L with the certain bit length to output the data 706L to the outside. The calculation unit 106 performs the calculation using the data 706L output by the gate circuit 707.
When the data 706 as a result of combining the pieces of data of the continuous plurality of cycles shifted by the shift circuit 801 has a bit length which is less than the certain bit length, the buffer 704 buffers the first data 706L with the certain bit length. Further, when the data 706 as a result of combining the pieces of data of the continuous plurality of cycles shifted by the shift circuit 801 has a bit length which is equal to or more than the certain bit length, the buffer 704 buffers the remaining data 706R as a result of removing the first data 706L with the certain bit length.
The selectors SEL1 to SEL32 select the valid data in the data 708 of the buffer 704. The gate circuit 707 cuts, when the data 706 as a result of combining the valid data in the previous cycle selected by the selectors SEL1 to SEL32 and the valid data in the current cycle shifted by the shift circuit 801 has the certain bit length or more, the first data 706L with the certain bit length to output the data 706L to the outside.
The memory 102 reads the data 702 with the certain bit length for each cycle and outputs the data 702 to the shift circuit 801. The first-in-first-out circuits 105A to 105D are provided between the gate circuit 707 and the calculation unit 106.
As described above, the data processing device can generate the stream of valid data by deleting the invalid data in the data 702 with the certain bit length. Accordingly, it is possible to eliminate the loss caused by the waiting time in the calculation using the data. Further, by using the shift circuit 801 and the buffer 704, it is possible to reduce the circuit scale.
It is possible to generate a stream of valid data by deleting invalid data in data with a certain bit length. Accordingly, it is possible to eliminate a loss caused by a waiting time in a calculation using the data.
Note that the above-described embodiments merely illustrate concrete examples of implementing the present embodiments, and the technical scope of the present embodiments is not to be construed in a restrictive manner by these embodiments. That is, the present embodiments may be implemented in various forms without departing from the technical spirit or main features thereof.
All examples and conditional language provided herein are intended for the pedagogical purposes of aiding the reader in understanding the invention and the concepts contributed by the inventor to further the art, and are not to be construed as limitations to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although one or more embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2013-056569 | Mar 2013 | JP | national |