This is a continuation of International Application No. PCT/JP2003/002270, filed on Feb. 27, 2003, the entire contents of which are hereby incorporated by reference.
1. Field of the Invention
The present invention generally relates to data transfer apparatuses, and particularly relates to a data transfer apparatus that performs DMA transfer of data in a dual-bus system.
2. Description of the Related Art
In computer systems, DMA (Direct Memory Access) transfer is an indispensable technology for attaining high system performance. The DMA transfer achieves direct data transfer between two devices without an intervention from the CPU.
Computer systems are generally comprised of a plurality of devices and a bus connecting therebetween. The devices connected to the bus are classified into master devices that transmit Read or Write requests and slave devices that receive these requests transmitted from the masters. The DMAC (DMA controller) that controls DMA (Direct Memory Access) and the CPU are master devices that transmit requests.
The DMAC performs data transfer between slave devices without an intervention from the CPU. In bus systems, addresses are used to identify individual slave devices and also to identify positions within the individual slave devices (e.g., individual addresses within a memory device).
A DMAC transmits a Read request to a slave device to read information from a specified position within the slave device specified by the address. The DMAC then transmits a Write request to transfer the retrieved information to another slave device. In this manner, the DMAC transmits Read and Write requests so as to achieve data transfer between the slave devices.
The dual-bus system of
The DMAC 10 includes two buffers (Buffer1) 21 and (Buffer2) 22. In the following, a DMA data transfer operation from the RAM 13 to the video display 15 will be described as an example.
The DMAC 10 transmits a Read request to the RAM 13, and stores data in the buffer 21 as the data is supplied from the RAM 13 as a result of the Read request. This Read operation is shown as RAM->buffer1 in
Since the configuration of
In this manner, a data transfer based on the double-buffer method in the dual-bus system utilizes two busses and two buffers, thereby attaining a transfer rate between slave devices that is twice as fast as that of a single-buffer method utilizing a single buffer.
The double-buffer method as described above needs to store twice as much information as that stored in the single-buffer method, resulting in increased consumption of chip areas. Moreover, in general, not many of the slave devices provided in the system require such high transfer performance as high as that attained by use of the double-buffer method. The double-buffer method thus can be meritorious because of its high data transfer performance only in limited cases while the demerit of needing an increased chip area is always in existence.
In consideration of this, the present invention is aimed at providing a data transfer apparatus that can achieve high-speed data transfer by operating according to a double-buffer method as need arises while normally operating according to a single-buffer method.
Patent Document 1: Japanese Patent Application Publication No. 1-229353
Patent Document 2: Japanese Patent Application Publication No. 64-78351
The data transfer apparatus according to the present invention includes a first channel unit configured to perform first data transfer in a first operation mode by using a first buffer as a relay, and a second channel unit configured to perform second data transfer different from the first data transfer in the first operation mode by using a second buffer as a relay, wherein a plurality of buffers including at least the first buffer and the second buffer are successively selected in a second operation mode so as to transfer data read from a source to a destination by using the successively selected buffers as relays, the reading of the data from the source being performed concurrently with writing of the data to the destination.
In the data transfer apparatus as described above, each channel operates as a separate channel to perform a separate data transfer in the first operation mode when there is no need for high-speed data transfer. When high-speed data transfer becomes necessary, data reading and data writing are concurrently performed in the second operation mode, thereby achieving a double-buffer-method data transfer. Accordingly, efficient data transfer is achieved by a plurality of channels performing single-buffer methods when there is no need for high-speed data transfer, while high-speed data transfer is achieved by a single channel performing a double-buffer method when there is a need for high-speed data transfer. With this provision, it is thus possible to take an advantage of the high-speed data transfer of a double-buffer method while reducing the demerits of the double-buffer method.
Other objects and further features of the present invention will be apparent from the following detailed description when read in conjunction with the accompanying drawings; in which:
In the following, embodiments of the present invention will be described with reference to the accompanying drawings.
A DMA controller (DMAC) 30 according to the present invention is used in a dual-bus system as shown in
The DMAC 30 has a plurality of channels (channel units) 31-1 through 31-N implemented therein, with each channel provided with a buffer. For example, the channel 31-1 is provided with a buffer 32-1, and the channel 31-2 is provided with a buffer 32-2. Each channel of the DMAC is provided with two registers S and D for address settings. The register S stores an address indicative of a position within the slave device serving as a source of transfer, and the register D stores an address indicative of a position within the slave device serving as a destination of transfer.
In the example shown in
The channel 31-1 of the DMAC 30 transmits a Read request to the RAM 13, and stores data in the buffer 32-1 as the data is supplied from the RAM 13 as a result of the Read request. This Read operation is shown as RAM->buffer1 in
The channel 31-2 detects the assertion of the odd-number read-completion signal to transmit a Read request to the RAM 13. This results in next data being read from the RAM 13 for storage in the buffer 32-2 (RAM->buffer2). This operation is performed concurrently with the operation (buffer1->video) by the channel 31-1 that writes the information stored in the buffer 32-1 to the video display 15. After the completion of transfer from the RAM 13 to the buffer 32-2, the channel 31-2 transmits an even-number read-completion signal so as to instruct the channel 31-1 to start a data transfer (arrows 4 and 7 in
Concurrently with the reading of data by the channel 31-1 from the RAM 13 for storage in the buffer 32-1 (RAM->Buffer1), the channel 31-2 writes the data stored in the buffer 32-2 to the video display 15 (buffer2->video).
In this manner, the two channels alternatively use their own buffers to operate virtually as a single channel, thereby achieving a double-buffer-method data transfer. This achieves high transfer performance as such need arises.
Round Robin scheduling or rotation priority scheduling may be used as priority control for determining which channel is selected for transfer via the bus. In such a case, the data transfer as described above that utilizes two channels as one channel can acquire priority twice as often as data transfers by other channels. This thus provides an advantage in that double the transfer rate is attainable without exception when data transfer is required for the slave devices that need a higher transfer rate.
The DMAC 30 shown in
The channel 31-1 of the DMAC 30 transmits a Read request to the RAM 13, and stores the information obtained as a result of the Read request in the buffer 32-1 of the channel 31-1 (RAM->CH1). The channel 31-1 then transmits a Write request to the UART 16 to write the contents of the buffer 32-1 to the UART 16 (CH1->UART).
Concurrently with writing by the channel 31-1 to the UART 16, the channel 31-2 transmits a Read request to the RAM 13 to store the retrieved information in the buffer 32-2 (RAM->CH2). The channel 31-2 then writes the contents of the buffer 32-2 to the video display 15 (CH2->Video).
In this manner, each channel operates as a separate channel to perform an individual data transfer when high-speed data transfer is not needed. If high-speed data transfer becomes necessary, two channels operate virtually as a single channel as previously described, thereby performing a double-buffer-method data transfer. Accordingly, efficient data transfer is achieved by a plurality of channels performing single-buffer methods when there is no need for high-speed data transfer, while high-speed data transfer is achieved by a single channel performing a double-buffer method when there is a need for high-speed data transfer. With this provision, it is thus possible to take an advantage of the high-speed data transfer of a double-buffer method while reducing the demerits of the double-buffer method.
In
The DMAC performs data transfer by incrementing the transfer-source address and the transfer-destination address. Normally, the addresses are incremented (+1) by the size of transfer data that is read or written by a single buffer transfer operation. In the embodiment shown in
In the construction of this embodiment, a double-buffer operation is achieved by slight modification to the address increment modules with almost no change to the construction of the controller for controlling the buffers. It should be noted that the address increment modules are configured such as to be able to switch between a +1 increment and a +2 increment so that it can provide +1 address increment to conform also to a single-buffer-method data transfer.
The content of the transfer-source register 41 of the channel 31-1 is denoted as Src1, and the content of the transfer-destination register 42 of the channel 31-1 is denoted as Dest1. The content of the transfer-source register 41 of the channel 31-2 is denoted as Src2, and the content of the transfer-destination register 42 of the channel 31-2 is denoted as Dest2.
In
Concurrently with the Read operation by the channel 31-2, the channel 31-1 performs a Write operation (Buffer1->Video) with respect to an address (1000) of Dest1. In response to the completion of the Write operation by the channel 31-1 (an arrow 3), Dest1 is updated by an outcome (1002) that is obtained by adding 2 to Dest1. By the same token, in response (an arrow 4) to the completion of the Write operation (Buffer2->Video) by the channel 31-2, Dest2 is updated by an outcome (1003) that is obtained by adding 2 to Dest2.
The embodiment of
In this manner, a double-buffer-method data transfer is achieved by the channel 31-1 and the channel 31-2 using the buffer 32-1 and the buffer 32-2, respectively, while attending to addressing by use of only the transfer-source register 41 and the transfer-destination register 42 of the channel 31-1. In this embodiment, the DMAC 30 needs to be configured such that the channel 31-1 is capable of controlling both of the buffers, but there is no need to provide the address increment module with the mechanism for providing a +2 increment.
First, the channel 31-1 performs a Read operation with respect to an address (0) of Src1 (RAM->Buffer1). In response to the completion of this Read operation (an arrow 1), Src1 is updated by an outcome (1) that is obtained by adding 1 to Src1. Then, the channel 31-2 performs a Read operation with respect to an address (1) of Src1 (RAM->Buffer2). In response to its completion (an arrow 2), the channel 31-1 adds 1 to the value of Src1 to update Src1 with the outcome (2) of the addition. This updating may be properly performed in response to an even-number read-completion signal issued from the channel 31-2 to the channel 31-1.
Concurrently with the Read operation by the channel 31-2, the channel 31-1 performs a Write operation (Buffer1->Video) with respect to an address (1000) of Dest1. In response to the completion of the Write operation by the channel 31-1 (an arrow 3), Dest1 is updated by an outcome (1001) that is obtained by adding 1 to the value of Dest1. After this, in response to the completion of the Write operation (Buffer2->Video) by the channel 31-2, the channel 31-2 transmits an even-number write-completion signal to the channel 31-1. In response to the assertion of this even-number write-completion signal (an arrow 4), the channel 31-1 adds 1 to the value of Dest1 to update Dest1 with the outcome (1002) of the addition.
A DMA controller (DMAC) 50 according to the present invention is used in a dual-bus system as shown in
The DMAC 50 has a plurality of channels (channel units) 51-1 through 51-N implemented therein, with each channel provided with a buffer-sequence-number queue. For example, the channel 51-1 is provided with a buffer-sequence-number queue 52-1, and the channel 51-2 is provided with a buffer-sequence-number queue 52-2. Separate from each channel, buffers 53-1 through 53-N are also provided. Further, validity flags 54-1 through 54-N are provided to indicate whether the respective buffers 53-1 through 53-N are available.
First, the channel 51-1 checks the validity flags 54-1 through 54-N to find an available buffer, and stores the sequence number (Buffer1) of this buffer in the buffer-sequence-number queue 52-1. Further, the channel 51-1 stores the data read from the RAM 13 in the above-noted buffer (i.e., the buffer having the sequence number at the end of the queue) (RAM->Buffer1). Then, the channel 51-1 checks the validity flags 54-1 through 54-N to find an available buffer, and stores the sequence number (Buffer2) of this buffer in the buffer-sequence-number queue 52-1. Further, the channel 51-1 stores the next data read from the RAM 13 in the above-noted buffer (i.e., the buffer having the sequence number at the end of the queue) (RAM->Buffer2).
When a write request arrives from the video display 15, the channel 51-1 writes to the video display 15. At this time, the data is transmitted (Buffer1->Video) to the video display 15 from the buffer indicated by the sequence number that is output from the buffer-sequence-number queue 52-1 (i.e., the sequence number at the head of the queue). As shown in
In the example of
Moreover, each channel may perform an individual data transfer operation by acquiring a buffer for its own use.
In the embodiment described above, the plurality of buffers are managed collectively, and each channel acquires a buffer on an as-needed basis. In this method, buffer control becomes more complex than in the system shown in
More than two buffers are also usable if they are available. Because of this, even if transfer from the transfer source to the DMAC 50 is interrupted halfway through the data transfer due to an interruption such as an access from another master, it is possible to continue transmitting data stored in the plurality of buffers to the transfer destination. For example, access from the CPU 60 to the RAM 13 (RAM->CPU) may be performed multiple times as shown in
The construction of this embodiment has a problem in that if a given channel takes up all the buffers for its own use, another channel cannot perform a Read transfer. In many cases, generally, it is required that the operation from a transfer request to the receipt of data be performed within a predetermined time limit. In order to obviate the problem described above, a straightforward solution is to perform such control operation that each channel is provided with a single corresponding buffer. In this case, it becomes essentially the same as the operation of
Although the present invention has been described with reference to embodiments, the present invention is not limited to these embodiments. Various variations and modifications may be made without departing from the scope of the claimed invention.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/JP03/02270 | Feb 2003 | US |
Child | 11064097 | Feb 2005 | US |