A method of transferring data through a bus includes the steps of: occupying the bus by a first device serving as a bus master; transferring a first predetermined number of data items of all data items to be transferred while the first device is occupying the bus; determining if the first predetermined number of data items have been transferred; determining if the first device should release the bus based on whether or not there is a request from a second device after it is determined that the first predetermined number of data items have been transferred; and releasing the bus by the first deice when it is determined that the first device should release the bus.
|
0. 19. A method of transferring data through a bus, said method comprising the steps of:
continuously occupying the bus by a first device serving as a bus master, said first device continuously occupying the bus for a period of transferring a first predetermined number of data items to be transferred;
transferring said first predetermined number of data items of all data items to be transferred while the first device occupies the bus the first predetermined number of data items being transferred despite a request from a second device;
determining if the first predetermined number of data items have been transferred;
negating a request from the first device for bus access so as to grant the second device bus access, if the first predetermined number of data items have been transferred;
reasserting a request for bus access from the first device; and
repeatedly transferring by said first device additional sets of a predetermined number of data items while said first device occupies said bus.
1. A method of transferring data through a bus, comprising the steps of:
continuously occupying the bus by a first device serving as a bus master, said first device continuously occupying the bus for a predetermined period of time;
transferring a first predetermined number of data items of all data items to be transferred while the first device is occupying the bus, the first predetermined number of data items transferring without interruption based on said predetermined period time;
determining if the first predetermined number of data items have transferred;
repeatedly transferring by said first device additional sets of a predetermined number of data items of all data items to be transferred while said first device occupies said bus despite a request from a second device for access to said bus,
determining if the first device should release the bus based on whether or not there is a request from a the second device after it is determined that he first predetermined number of data items of all data items to be transferred have been transferred; and
releasing the bus by the first device when it is determined that the first device should release the bus.
0. 11. A method of transferring data through a bus, comprising the steps of:
continuously occupying the bus by a first device serving as a bus master, said first device continuously occupying the bus for a period of time for transferring a first predetermined number of data items of all data items to be transferred;
transferring said first predetermined number of data items while the first device is occupying the bus, the first predetermined number of data items transferring without interruption during said period by a second device;
determining if said first predetermined number of data items have been transferred;
determining if the bus should be occupied by said second device based on whether or not there is a request from said second device; and
occupying the bus by said second device when it is determined that the bus should be occupied by said second device,
repeatedly transferring by said first device additional sets of a predetermined number of data items of all data items to be transferred while said first device occupied said bus despite a request from said second device for access to said bus,
wherein said interruption corresponds to a request for occupying said bus by said second device.
6. A master control device for controlling an operation of a bus master for transferring data through a bus, the device comprising:
bus occupation request means for outputting a signal requesting to occupy the bus in response to a data transfer request;
data transfer means for transferring a first predetermined number of data items of all data items to be transferred while the bus master is continuously occupying the bus for a predetermined period of time, said data transfer means configured to transfer said first predetermined number of data items of all data items to be transferred without interruption based on said predetermined period of time;
first determination means for determining if the first predetermined number of data items have been transferred;
bus release instruction means for outputting a signal instructing said bus master to release the bus based on whether or not there is a request from a first device after it is determined that the first predetermined number of data items have been transferred; and
bus release means for releasing the bus by the bus master when said bus master release instruction means outputs said signal instructing said bus master to release the bus,
wherein the data transfer means comprises a first counter for counting a number of data items which have been transferred out of the first predetermined number of data items, and a second counter for counting a number of data items which have been transferred out of all the data items to be transferred; and the first determination means determines if the first predetermined number of data items have been transferred based on an output from the first counter,
said data transfer means further comprising a second determination means for determining if all the data items to be transferred have been transferred based on an output from the second counter.
0. 15. A master control device for controlling an operation of a bus master for transferring data through a bus, the device comprising:
bus occupation request means for outputting a signal requesting to occupy the bus in response to a data transfer request;
data transfer means for transferring a first predetermined number of data items of all data items to be transferred while the bus master is continuously occupying the bus for a period of time necessary for transferring said first predetermined number of data items, said data transfer means configured to transfer said first predetermined number of data items of all data items to be transferred without interruption;
first determination means for determining if the first predetermined number of data items have been transferred;
bus release instruction means for outputting a signal instructing said bus master to release the bus based on whether or not there is a request from a second device after it is determined that the first predetermined number of data items have been transferred; and
bus release means for releasing the bus by the bus master when said bus master release instruction means outputs said signal instructing said bus master to release the bus,
wherein the data transfer means comprises a first counter for counting a number of data items which have been transferred out of the first predetermined number of data items, and a second counter for counting a number of data items which have been transferred out of all the data items to be transferred; and the first determination means determines if the first predetermined number of data items have been transferred based on an output from the first counter,
said data transfer means further comprising a second determination means for determining if all the data items to be transferred have been transferred based on an output from the second counter.
2. A method of transferring data through a bus according to
occupying the bus by the second device serving as the bus master after the first device releases the bus;
releasing the bus by the second device after the second device complete access to the bus;
occupying the bus again by the first device after the second device releases the bus; and
transferring a second predetermined number of data items subsequent to the first predetermined number of the data items which have been transferred while the first device is occupying the bus again.
3. A method of transferring data through a bus according to
4. A method of transferring data through a bus according to
determining if all the data items to be transferred have been transferred; and
releasing the bus after it is determined that all the data items to be transferred have been transferred.
5. A method of transferring data through a bus according to
the first device is a DMA controller; and
the second device is a CPU.
7. A bus master control device according to
the bus occupation request means outputs again the signal requesting to occupy the bus after the bus release instruction means outputs the signal instructing to release the bus; and
the data transfer means transfers a second predetermined number of data items subsequent to the first predetermined number of the data items which have been transferred while the bus master is occupying the bus again.
8. A bus master control device according to
0. 9. A bus master control device according to
the data transfer means comprises a first counter for counting a number of data items which have been transferred out of the first predetermined number of data items, and
the first determination means determines if the first predetermined number of data items have been transferred based on an output from the first counter.
0. 10. A bus master control device according to
a second counter for counting a number of data items which have been transferred out of all the data items to be transferred; and
second determination means for determining if all the data items to be transferred have been transferred based on an output from the second counter.
0. 12. A method of transferring data through a bus according to
occupying the bus by the second device serving as the bus master after the first device releases the bus;
releasing the bus by the second device after the second device completes access to the bus;
occupying the bus again by the first device after the second device releases the bus; and
transferring a second predetermined number of data items subsequent to the first predetermined number of data items which have been transferred while the first device is occupying the bus again.
0. 13. A method of transferring data through a bus according to
determining if all data items to be transferred have been transferred; and
releasing the bus after it is determined that all the data items to be transferred have been transferred.
0. 14. A method of transferring data through a bus according to
the first device is a DMA controller; and
the second device is a CPU.
0. 16. A bus master control device according to
the bus occupation request means outputs again the signal requesting to occupy the bus after the bus release instruction means outputs the signal instructing to release the bus; and
the data transfer means transfers a second predetermined number of data items subsequent to the first predetermined number of data items which have been transferred while the bus master is occupying the bus again.
0. 17. A bus master control device according to
0. 18. The method of
0. 20. The method of
|
1. Field of the Invention
The present invention relates to a method of transferring data through a bus and a bus master control device used in an information processing unit.
2. Description of the Related Art
A DMA (Direct Memory Access) controller is a control device used for performing high-speed data transfers directly between peripheral units (e.g., a memory, an I/O (Input/Output) device) connected to a common bus without involving the CPU.
For data transfers (e.g., DMA transfers) in a system where a plurality of devices which can serve as bus masters share a common bus, there has been a demand for improving the transfer efficiency for both the DMA controller and the other devices.
In the “word-by-word transfer method”, however, the DMA transfer operations cannot be performed successively. Therefore, this method cannot be used to access a memory employing a high-speed transfer mode (e.g., the page mode of a DRAM). This results in a very poor DMA transfer efficiency.
In the “cycle-steal transfer method”, besides the above-noted problem, the other devices serving as bus masters may occupy the bus for a long time during which the DMA controller cannot access the bus. In such a case, the DMA controller has to wait for a long time until it is allowed to perform a DMA transfer and, therefore, the DMA transfer may not be completed within a predetermined period of time.
In the “timer interruption transfer method”, a first device currently serving as the bus master (i.e., occupying the bus) is forcibly switched to a second device (to act as the bus master) upon a timer-based interrupt even at an undesirable time for the first device currently occupying the bus. This also results in a poor data transfer efficiency.
According to one aspect of this invention, a method of transferring data through a bus includes the steps of: occupying the bus by a first device serving as a bus master; transferring a first predetermined number of data items of all data items to be transferred while the first device is occupying the bus; determining if the first predetermined number of data items have been transferred; determining if the first device should release the bus based on whether or not there is a request from a second device after it is determined that the first predetermined number of data items have been transferred; and releasing the bus by the first device when it is determined that the first device should release the bus.
In one embodiment of the invention, the method of transferring data through a bus further includes the steps of: occupying the bus by the second device serving as the bus master after the first device releases the bus; releasing the bus by the second device after the second device completes access to the bus; occupying the bus again by the first device after the second device releases the bus; and transferring a second predetermined number of data items subsequent to the first predetermined number of the data items which have been transferred while the first device is occupying the bus again.
In another embodiment of the invention, the method of transferring data through a bus further includes the step of, when it is determined that the first device should not release the bus, transferring by the first device a second predetermined number of data items subsequent to the first predetermined number of the data items which have been transferred while the first device continues to occupy the bus.
In still another embodiment of the invention, the method of transferring data through a bus further includes the steps of: determining if all the data items to be transferred have been transferred; and releasing the bus after it is determined that all the data items to be transferred have been transferred.
In still another embodiment of the invention, the first device is a DMA controller; and the second device is a CPU.
According to another aspect of this invention, a bus master control device for controlling an operation of a bus master for transferring data through a bus includes: bus occupation request means for outputting a signal requesting to occupy the bus in response to a data transfer request; data transfer means for transferring a first predetermined number of data items of all data items to be transferred while the bus master is occupying the bus; and bus release instruction means for outputting a signal instructing to release the bus after the first predetermined number of data items have been transferred.
In one embodiment of the invention, the bus occupation request means outputs again the signal requesting to occupy the bus after the bus release instruction means outputs the signal instructing to release the bus. The data transfer means transfers a second predetermined number of data items subsequent to the first predetermined number of the data items which have been transferred while the bus master is occupying the bus again.
In another embodiment of the invention, the bus release instruction means outputs the signal instructing to release the bus after all the data items to be transferred have been transferred.
In still another embodiment of the invention, the data transfer means includes: a first counter for counting a number of data items which have been transferred out of the first predetermined number of data items; and first determination means for determining if the first predetermined number of data items have been transferred based on an output from the first counter.
In still another embodiment of the invention, the data transfer means includes: a second counter for counting a number of data items which have been transferred out of all the data items to be transferred; and second determination means for determining if all the data items to be transferred have been transferred based on an output from the second counter.
In accordance with the present invention having such a configuration, after a predetermined number of data items are transferred by the first device serving as the bus master, the first device releases the bus according to the presence of a request from the second device. Therefore, the second device does not have to wait for a long time to serve as the bus master even when the first device is performing a data transfer.
After the second device releases the bus, the first device occupies the bus again as the bus master and transfers a predetermined number of data items subsequent to the predetermined number of data items which have been previously transferred. By transferring a predetermined number of data items at a time as described above, the data transfer efficiency is improved for the first device.
Thus, the invention described herein makes possible the advantages of: (1) providing a method of transferring data where, a first device serving as the bus master can occupy the bus until a predetermined number of data items are successively and completely transferred (e.g, in a DMA transfer), while the other device does not have to wait for a long time to perform a data transfer, thereby improving data transfer efficiency for both devices; and (2) providing a bus master control device which also realizes the above effects.
These and other advantages of the present invention will become apparent to those skilled in the art upon reading and understanding the following detailed description with reference to the accompanying figures.
Hereinafter, an example of the present invention will be described with reference to
The CPU 401 is a central processing unit for performing arithmetic operations and for controlling the whole process of the information processing unit 408. The peripheral unit 404 performs a specified group of processes based on instructions from the CPU 401. The peripheral unit 404 is typically an external memory device (e.g., a hard disk drive or an optical disk drive), a printer or the like. The bus controller 9 controls access to the internal bus 406 and the external bus 407, with the CPU 401 and the DMA controller 11 being devices which may serve as the bus master. When these devices request occupation over the internal bus 406 and the external bus 407, the bus controller 9 arbitrates between the devices 401 and 11 and determines which one of the devices 401 and 11 is to occupy the bus as the bus master. The DMA controller 11 controls data transfers (i.e., DMA transfers) performed directly between the peripheral unit 404 and the external memory 405 without involving the CPU 401 based on a request from the peripheral unit 404.
The DMA controller 11 includes a source address register 1a, a destination address register 1b and an address generation section 7. The source address register 1a stores a source address for a DMA transfer operation, whereas the destination address register 1b stores a destination address for a DMA transfer operation. An output signal from the source address register 1a and an output signal from the destination address register 1b are input to the address generation section 7. A read acknowledge signal 106 and a write acknowledge signal 110 output from the bus controller 9 are input to the address generation section 7. The read acknowledge signal 106 indicates that the bus controller 9 has accepted a DMA transfer request and has begun to read out data to be transferred by a DMA transfer. The write acknowledge signals 110 indicates that the bus controller 9 has begun to write data to be transferred by a DMA transfer. The address generation section 7 reads out the contents of the source address register 1a and the destination address register 1b as data transfer start addresses, and output the data transfer start addresses to the bus controller 9 as a source address 105a and a destination address 105b. Then, based on the read acknowledge signal 106 and the write acknowledge signals 110, the address generation section 7 updates the address from which data is to be read out next and the address into which the data is to be written next, and outputs the updated addresses to the bus controller 9 as the source address 105a and the destination address 105b. Thus, a predetermined number of data items are transferred successively.
The DMA controller 11 further includes a transfer count register 2 and a subset transfer count register 3. The transfer count register 2 stores the number of DMA transfer operations to be performed. The subset transfer count register 3 stores a predetermined number as the number of data items to be transferred in a single subset transfer. The DMA controller 11 intermittently transfers all data items to be transferred by a DMA transfer by transferring a data subset including the predetermined number of data items at a time. In this specification, a “subset transfer” is referred to as an operation of successively transferring a data subset including a predetermined number of data items while the bus is being occupied by the bus master.
The DMA controller 11 further includes counters 4 and 5 and a decrementor 6. The counter 4, which is reset at the beginning of a subset transfer, counts the read acknowledge signal 106 input from the bus controller 9. Thus, the counter 4 indicates the number of data items which have been read out from the respective source addresses out of the predetermined number of data items to be transferred in a single subset transfer. The counter 5, which is also reset at the beginning of the subset transfer, counts a transfer completion signal 102 input from the bus controller 9. The transfer completion signal 102 is output from the bus controller 9 indicating that a single DMA transfer operation for a single data item is completed. Thus, the counter 5 indicates the number of data items which have been written into the respective destination addresses (i.e., the number of data items for which the transfer operation has been completed) out of the predetermined number of data items to be transferred in a single subset transfer. The transfer completion signal 102 is also input to the transfer count register 2 and the decrementor 6. Each time the transfer completion signal 102 is asserted, the decrementor 6 decrements the output value from the transfer count register 2 by one and outputs the resultant value to the transfer count register 2. Thus, the number of data items which have been transferred out of the number of all the data items to be transferred is counted by the transfer count register 2 and the decrementor 6. Consequently, the number of the remaining data items to be transferred is stored in the transfer count register 2.
The DMA controller 11 further includes a DMA transfer control section 8 for controlling DMA transfers. The DMA transfer control section 8 receives as inputs the DMA transfer activation request signal 101, the read acknowledge signal 106, the write acknowledge signals 110, the transfer completion signal 102, an output signal 108 from the counter 4, an output signal 109 from the counter 5, an output signal 111 from the subset transfer count register 3 and an output signal 112 from the transfer count register 2, and the DMA transfer control section 8 outputs an entire transfer completion signal 103 and a DMA transfer request signal 104. The DMA transfer control section 8 asserts the DMA transfer request signal 104 to the bus controller 9 in response to the DMA transfer activation request signal 101 from the peripheral unit 404, thus requesting bus occupation. Based on the output signal 108 from the counter 4, the output signal 109 from the counter 5 and the output signal 111 from the subset transfer count register 3, the DMA transfer control section 8 determines if all the predetermined number of data items to be transferred in a single subset transfer have been transferred. When it is determined that the predetermined number of data items have been transferred, the DMA transfer control section 8 terminates the assertion of the DMA transfer request signal 104 to the bus controller 9, thus instructing bus release. The DMA transfer control section 8 determines if all the data items to be transferred have been transferred based on the output signal 112 from the transfer count register 2. When it is determined that all the data items to be transferred have not been transferred, the DMA transfer control section 8 asserts the DMA transfer request signal 104 again to the bus controller 9 after completion of the current subset transfer, thus requesting to occupy the bus again and similarly control the subsequent subset transfer. When it is determined that all the data items to be transferred have been transferred, the DMA transfer control section 8 terminates the assertion of the DMA transfer request signal 104 to the bus controller 9, thus instructing bus release.
Based on the DMA transfer request signal 104 from the DMA transfer control section 8 and the CPU transfer request signal 301 from the CPU 401, the bus controller 9 arbitrates between the DMA controller 11 and the CPU 401 to determine which one of the devices 11 and 401 is to occupy the internal bus 406 and the external bus 407 as the bus master. When it is determined that the DMA controller 11 is to occupy these buses, the bus controller 9 outputs the source address 105a and the destination address 105b output from the address generation section 7 of the DMA controller 11 to the external bus 407 and internal bus 406, respectively, (or the source address 105a and the destination address 105b to the internal bus 406 and the external bus 407, respectively,) thus controlling read and write operations. The bus controller 9 outputs to the DMA controller 11 the read acknowledge signal 106 indicating that a read operation has begun, and the write acknowledge signal 110 indicating that a write operation has begun.
Hereinafter, the operation of the DMA controller 11 will be described referring to
In both cases, the number of data items to be transferred in a single subset transfer is constant.
It should be noted that the DMA transfer activation request signal 101 and the CPU transfer request signal 301 are active-high signals which are asserted when high, whereas the DMA transfer request signal 104, the read acknowledge signal 106, the write acknowledge signal 110 and the transfer completion signal 102 are active-low signals which are asserted when low.
Next, the operation of the DMA controller 11 transferring data from the external memory 405 to the peripheral unit 404 in the above-described information processing unit 408 will be described for each cycle. Herein, three subset transfers are performed to transfer 12 data items from addresses #1000 to #1011 in the external memory 405 to addresses #2000 to #2011 in the peripheral unit 404 with a subset of four data items being successively transferred in a single subset transfer.
(Initial Processes)
First, based on an instruction from the CPU 401 or other external units, the DMA transfer control section 8 sets the source address register 1a to “1000” which is to be the source address, and the destination address register 1b to “2000” which is to be the destination address, and sets the transfer count register 2 and the subset transfer count register 3 to “12” and “4”, respectively.
(Cycle t0)
The peripheral unit 404 asserts the DMA transfer activation request signal 101 to the DMA transfer control section 8 of the DMA controller 11.
(Cycle t1)
When detecting that the DMA transfer activation request signal 101 is high and asserted, the DMA transfer control section 8 outputs the DMA transfer request signal 104 (low) to the bus controller 9. Based on an instruction from the DMA transfer control section 8, the address generation section 7 reads out the values of the source address register 1a and the destination address register 1b, and outputs address #1000 as the source address 105a and address #2000 as the destination address 105b to the bus controller 9. The DMA transfer control section 8 also resets the counters 4 and 5.
(Cycle t2)
When detecting that the DMA transfer request signal 104 from the DMA transfer control section 8 is low, the bus controller 9 determines to allow the DMA controller 11 to occupy the bus because the CPU transfer request signal 301 is not asserted. The bus controller 9 begins to read out data from address #1000 in the external memory 405 through the external bus 407 and, simultaneously, outputs the read acknowledge signal 106 (low) to the DMA transfer control section 8.
(Cycle t3)
When detecting that the read acknowledge signal 106 (low) has been input, the address generation section 7 updates the source address 105a to the next address #1001 and outputs the updated source address 105a to the bus controller 9. The counter 4 counts the read acknowledge signal 106, thereby incrementing the value thereof to 1
(Cycle t4)
Upon completion of the read operation from address #1000 through the external bus 407, the bus controller 9 begins to read out data from the next address #1001 in the external memory 405 and begins to write the data, which have been read out from address #1000 in the external memory 405, into address #2000 in the peripheral unit 404 through the internal bus 406. Simultaneously, the bus controller 9 outputs the read acknowledge signal 106 (low) and the write acknowledge signal 110 (low) to the DMA transfer control section 8.
(Cycle t5)
The address generation section 7 updates the source address 105a to the next address #1002 when detecting that the read acknowledge signal 106 (low) has been input, updates the destination address 105b to the next address #2001 when detecting that the write acknowledge signal 110 (low) has been input, and outputs the updated addresses to the bus controller 9. The counter 4 counts the read acknowledge signal 106, thereby incrementing the value thereof to “2”. After the read acknowledge signal 106 and the write acknowledge signal 110 are received by the address generation section 7, the bus controller 9 resets these signals to be high again. These signals are reset to be high at the same time in the subsequent data transfer operations, but will not be described hereinafter.
(Cycle t6)
Upon completion of the read operation from address #1001 through the external bus 407, the bus controller 9 begins to read out data from the next address #1002 in the external memory 405 and begins to sprite the data, which have been read out from address #1001 in the external memory 405, into address #2001 in the peripheral unit 404 through the internal bus 406. Simultaneously, the bus controller 9 outputs the read acknowledge signal 106 (low) and the write acknowledge signal 110 (low) to the DMA transfer control section 8. Upon completion of the write operation into address #2000 through the internal bus 406, the bus controller 9 sends the transfer completion signal 102 (low) to the DMA transfer control section 8.
(Cycle t7)
The address generation section 7 updates the source address 105a to the next address #1003 when detecting that the read acknowledge signal 106 (low) has been input, updates the destination address 105b to the next address #2002 when detecting that the write acknowledge signal 110 (low) has been input, and outputs the updated addresses to the bus controller 9. The counter 4 counts the read acknowledge signal 106, thereby incrementing the value thereof to “3”, whereas the counter 5 counts the transfer completion signal 102, thereby incrementing the value thereof to “1”. Upon receipt of the transfer completion signal 102, the value “12” stored in the transfer count register 2 is decremented by one by the decrementor 6, and the resultant value is output to the transfer count register 2. Thus, a new value “11” is stored in the transfer count register 2.
(Cycle t8)
Upon completion of the read operation from a address #1002 through the external bus 407, the bus controller 9 begins to read out data from the next address #1003 in the external memory 405 and begins to write the data, which have been read out from address #1002 in the external memory 405, into address #2002 in the peripheral unit 404 through the internal bus 406. Simultaneously, the bus controller 9 outputs the read acknowledge signal 106 (low) and the write acknowledge signal 110 (low) to the DMA transfer control section 8. Upon completion of the write operation into address #2001 through the internal bus 406, the bus controller 9 sends the transfer completion signal 102 (low) to the DMA transfer control section 8.
(Cycle t9)
The address generation section 7 updates the destination address 105b to the next address #2003 when detecting that the write acknowledge signal 110 (low) has been input, and outputs the updated addresses to the bus controller 9. The counter 4 counts the read acknowledge signal 106, thereby incrementing the value thereof to “4”, whereas the counter 5 counts the transfer completion signal 102, thereby incrementing the value thereof to “2”. Upon receipt of the transfer completion signal 102, the value “11” stored in the transfer count register 2 is decremented by one by the decrementor 6, and the resultant value is output to the transfer count register 2. Thus, a new value “10” is stored in the transfer count register 2.
(Cycle t10)
Upon completion of the read operation from address #1003 through the external bus 407, the bus controller 9 begins to write the data, which have been read out from address #1003 in the external memory 405, into address #2003 in the peripheral unit 404 through the internal bus 406. Simultaneously, the bus controller 9 outputs the write acknowledge signal 110 (low) to the DMA transfer control section 8. Upon completion of the write operation into address #2002 through the internal bus 406, the bus controller 9 sends the transfer completion signal 102 (low) to the DMA transfer control section 8.
When detecting that the signal 111 from the subset transfer count register 3 and the signal 108 from the counter 4, which have been input to DMA transfer control section 8, match each other both having the same value “4”, the DMA transfer control section 8 determines that a data subset including four data items have been all read out from the respective source addresses, thus terminating the assertion of the DMA transfer request signal 104 and instructing bus release.
(Cycle t11)
The counter 5 counts the transfer completion signal 102, thereby incrementing the value thereof to “3”. Upon receipt of the transfer completion signal 102, the value “10” stored in the transfer count register 2 is decremented by one by the decrementor 6, and the resultant value is output to the transfer count register 2. Thus, a new value “9” is stored in the transfer count register 2.
(Cycle t12)
Upon completion of the write operation into address #2003 through the internal bus 406, the bus controller 9 sends the transfer completion signal 102 (low) to the DMA transfer control section 8.
(Cycle t13)
The counter 5 counts the transfer completion signal 102, thereby incrementing the value thereof to “4”. Upon receipt of the transfer completion signal 102, the value “9” stored in the transfer count register 2 is decremented by one by the decrementor 6, and the resultant value is output to the transfer count register 2. Thus, a new value “8” is stored in the transfer count register 2.
At this point of time, the CPU transfer request signal 301 from the CPU 401 is high, indicating that the CPU 401 is requesting bus occupation. As the bus controller 9 detects the CPU transfer request signal 301 from the CPU 401, the bus controller 9 performs an arbitration in bus occupation. Since the DMA controller 11 is not requesting bus occupation at this point of time with the DMA transfer request signal 104 being high, the bus controller 9 determines to allow the CPU 401 to occupy the bus at cycle t14.
(Cycle t14)
When detecting that the signal 111 from the subset transfer count register 3 and the signal 109 from the counter 5, which have been input to the DMA transfer control section 8, match each other both having the same value “4”, the DMA transfer control section 8 determines that a data subset including four data items have been all written into the respective destination addresses. The DMA transfer control section 8 again outputs the DMA transfer request signal 104 (low) to the bus controller 9 in order to perform the second subset transfer. However, the bus controller 9 has detected the CPU transfer request signal 301 from the CPU 401 at cycle t13 and, as a result of the bus occupation arbitration, the bus controller 9 has allowed the CPU 401 to occupy the bus as the bus master from cycle t14 and has already activated a data transfer operation. This data transfer operation corresponds to the CPU's transfer between the first and second subset transfers in FIG. 3A. Thus, the DMA transfer request signal 104 remains asserted by the DMA controller 11 and is accepted by the bus controller 9 after the CPU 401 releases the bus.
If there is no transfer request signal 301 from the CPU 401, the bus controller 9 accepts the DMA transfer request signal 104 at the cycle following cycle t14. In such a case, the DMA controller 11 consequently retains bus occupation without releasing the bus and performs the subsequent subset transfer.
The first subset transfer is performed as described above while reading out data through the external bus 407 from addresses #1000 to #1003 in the external memory 405 and writing the data through the internal bus 406 into respective addresses #2000 to #2003 in the peripheral unit 404. Subsequently, the second subset transfer shown in
When a DMA data transfer is interrupted by a DRAM refresh operation having a higher priority, the bus may become unavailable for data transfer operations for some cycles. However, since completion of a subset transfer is determined based on the number of data items which have been transferred but not a period of time, the number of data items to be transferred in a subset transfer is always ensured.
Although, in the present example, four data items are transferred in a single subset transfer, the number of data items to be transferred in a single subset transfer is not limited to four. In fact, the number may be set to any appropriate value by setting the subset transfer count register 3 from the CPU 401 or an external unit.
Although the other device which is not the DMA controller 11 is the CPU 401 in the present example, the present invention functions substantially in the same manner with other units serving as the bus master. Moreover, the present invention may be applied to situations where more than two devices that may serve as bus masters coexist.
In the present example, the DMA controller 11 performs data transfers on the intermittent basis by transferring a data subset including a predetermined number of data items at a time. However, the intermittent data transfers may be performed by the CPU 401 while the DMA controller 11 transfers data during intervals between subset transfer operations performed by the CPU 401.
In the present example, completion of a single subset transfer is detected when it is determined that the data subset have been read out from the corresponding source addresses based on the signal 111 from the subset transfer count register 3 and the signal 108 from the counter 4, thus terminating the assertion of the DMA transfer request signal 104 and instructing bus release. However, it is also applicable to detect the completion of a single subset transfer when it is determined that the data subset read out from the corresponding source addresses have been written into the corresponding destination addresses based on the signal 111 from the subset transfer count register 3 and the signal 109 from the counter 5, thus terminating the assertion of the DMA transfer request signal 104 and instructing bus release.
As described above, in accordance with the present invention, after a predetermined number of data items are transferred by the first device currently serving as the bus master, the first device releases the bus according to the presence of a request from the second device desiring to serve as the bus master in order to occupy the bus. Therefore, the second device does not have to wait for a long time to serve as the bus master even when the first device currently serving as the bus master is performing a data transfer of a large amount of data.
After the second device releases the bus, the first device occupies the bus again and transfers a predetermined number of data items subsequent to the predetermined number of data items which have been previously transferred. Moreover, the number of data items to be transferred in a subset transfer is always ensured. Therefore, the data transfer efficiency is improved for the first device serving as the bus master.
Unlike the conventional techniques, the first device currently occupying the bus as the bus master is not forcibly switched to release the bus to a second device based on a predetermined period of time during which the first device is allowed to continuously occupy the bus. Therefore, the number of data items to be successively transferred in a single transfer operation can be ensured even when the period of time from the assertion of the DMA transfer activation request signal to the acceptance of the signal is not constant, or when a DMA data transfer is interrupted by a DRAM refresh operation having a higher priority so that the bus may become unavailable for data transfers for some cycles. In the present invention, the number of data items to be successively transferred in a single subset transfer is always ensured since completion of a data subset transfer is detected based on the number of data items which have been transferred but not on a time period. Data may be transferred more efficiently when each data transfer operation transfers a particular number of data items (e.g., 8 bytes) so as to better correspond to the data processing procedures of the CPU or the peripheral unit. Moreover, data may be transferred even more efficiently when successively transferring, for example, 256-byte data being on the same page as in the high-speed page mode of DRAMs. This is particularly the case where the present invention is most effectively embodied.
While the bus is being occupied by the second device serving as the bus master, the second device is never forced to release the bus based on a time period. Therefore, the data transfer efficiency is also improved for the second device.
As described above, in accordance with the present invention, it is possible to provide a method of transferring data and a bus master control device where the data transfer efficiency can be improved for both devices which may serve as bus masters.
Various other modifications will be apparent to and can be readily made by those skilled in the art without departing from the scope and spirit of this invention. Accordingly, it is not intended that the scope of the claims appended hereto be limited to the description as set forth herein, but rather that the claims be broadly construed.
Suzuki, Masato, Hashimoto, Yuichi, Kakiage, Touru, Kasuga, Yoshiaki, Yasui, Jyunichi
Patent | Priority | Assignee | Title |
Patent | Priority | Assignee | Title |
4490788, | Sep 29 1982 | Schlumberger Technology Corporation | Well-logging data processing system having segmented serial processor-to-peripheral data links |
4658350, | Aug 12 1981 | International Business Machines Corp. | Extended addressing apparatus and method for direct storage access devices |
5212795, | Oct 11 1988 | California Institute of Technology | Programmable DMA controller |
5287486, | Oct 05 1989 | Mitsubishi Denki Kabushiki Kaisha | DMA controller using a programmable timer, a transfer counter and an or logic gate to control data transfer interrupts |
5297242, | Dec 15 1989 | NEC Corporation | DMA controller performing data transfer by 2-bus cycle transfer manner |
5333274, | Oct 15 1991 | International Business Machines Corp.; INTERNATIONAL BUSINESS MACHINES CORPORATION A CORPORATION OF NEW YORK | Error detection and recovery in a DMA controller |
5402421, | Oct 30 1992 | Fujitsu Limited | Bus control device and bus control method |
5507005, | Mar 18 1991 | Hitachi, Ltd. | Data transferring system between host and I/O using a main buffer with sub-buffers where quantity of data in sub-buffers determine access requests |
5517196, | Aug 14 1992 | BENDIX COMMERCIA VEHICLE SYSTEMS, LLC | Smart blind spot sensor with object ranging |
5517325, | Mar 10 1994 | Mita Industrial Co., Ltd. | Direct memory access (DMA) controller with programmable bus release period for timing DMA transfers |
5535362, | Mar 06 1992 | Mitsubishi Denki Kabushiki Kaisha | Data transfer control apparatus wherein a time value is compared to a clocked timer value with a comparison of the values causing the transfer of bus use right |
5584033, | Sep 16 1991 | International Business Machines Corporation | Apparatus and method for burst data transfer employing a pause at fixed data intervals |
5664197, | Apr 21 1995 | Intel Corporation | Method and apparatus for handling bus master channel and direct memory access (DMA) channel access requests at an I/O controller |
5717852, | Mar 10 1993 | Hitachi, Ltd. | Multiple bus control method and a system thereof |
5724583, | Sep 18 1991 | LENOVO SINGAPORE PTE LTD | System for handling requests for DMA data transfers between a host processor and a digital signal processor |
5729681, | Oct 10 1995 | Intel Corporation | Method of communicating data from a host to a network controller |
5752078, | Jul 10 1995 | International Business Machines Corporation | System for minimizing latency data reception and handling data packet error if detected while transferring data packet from adapter memory to host memory |
5752081, | Jun 08 1995 | VLSI Technology, Inc. | Signalling system and method for allowing a direct memory access (DMA) input/output (I/O) device on the peripheral component interconnect (PCI) bus to perform DMA transfers |
5754567, | Oct 15 1996 | U S BANK NATIONAL ASSOCIATION, AS COLLATERAL AGENT | Write reduction in flash memory systems through ECC usage |
5771356, | Jan 04 1995 | Cirrus Logic, Inc. | Apparatus for controlling FIFO buffer data transfer by monitoring bus status and FIFO buffer thresholds |
5787484, | Aug 08 1996 | U S BANK NATIONAL ASSOCIATION, AS COLLATERAL AGENT | System and method which compares data preread from memory cells to data to be written to the cells |
6199121, | Aug 07 1998 | OAK TECHNOLOGY, INC | High speed dynamic chaining of DMA operations without suspending a DMA controller or incurring race conditions |
6438665, | Aug 08 1996 | U S BANK NATIONAL ASSOCIATION, AS COLLATERAL AGENT | System and method which compares data preread from memory cells to data to be written to the cells |
JP623364, | |||
JP6329867, | |||
WO99172212, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Sep 04 2002 | Matsushita Electric Industrial Co., Ltd. | (assignment on the face of the patent) | / |
Date | Maintenance Fee Events |
Feb 02 2009 | ASPN: Payor Number Assigned. |
Jan 11 2012 | ASPN: Payor Number Assigned. |
Jan 11 2012 | RMPN: Payer Number De-assigned. |
Feb 20 2012 | M1553: Payment of Maintenance Fee, 12th Year, Large Entity. |
Date | Maintenance Schedule |
Apr 22 2011 | 4 years fee payment window open |
Oct 22 2011 | 6 months grace period start (w surcharge) |
Apr 22 2012 | patent expiry (for year 4) |
Apr 22 2014 | 2 years to revive unintentionally abandoned end. (for year 4) |
Apr 22 2015 | 8 years fee payment window open |
Oct 22 2015 | 6 months grace period start (w surcharge) |
Apr 22 2016 | patent expiry (for year 8) |
Apr 22 2018 | 2 years to revive unintentionally abandoned end. (for year 8) |
Apr 22 2019 | 12 years fee payment window open |
Oct 22 2019 | 6 months grace period start (w surcharge) |
Apr 22 2020 | patent expiry (for year 12) |
Apr 22 2022 | 2 years to revive unintentionally abandoned end. (for year 12) |