US20100064071A1 - DMA device having plural buffers storing transfer request information and DMA transfer method - Google Patents
DMA device having plural buffers storing transfer request information and DMA transfer method Download PDFInfo
- Publication number
- US20100064071A1 US20100064071A1 US12/461,432 US46143209A US2010064071A1 US 20100064071 A1 US20100064071 A1 US 20100064071A1 US 46143209 A US46143209 A US 46143209A US 2010064071 A1 US2010064071 A1 US 2010064071A1
- Authority
- US
- United States
- Prior art keywords
- transfer
- request
- buffer
- transfer request
- dma
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/28—Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
Definitions
- micros microcomputers
- DMA Direct Memory Access
- a DMA device incorporates transfer information equivalent to the number of channels in DMA. Therefore, when the number of channels is increased, the amount of incorporated transfer information is increased and this leads to the expanded physical scale of the DMA.
- transfer information is placed in rewritable memory, such as RAM (Random Access Memory). At each time of transfer the transfer information is read from the RAM and the read information is placed in the DMA device to carry out DMA transfer.
- RAM Random Access Memory
- this device is comprised of: a first buffer including a DMA count register 91 , a DMA command register 92 , a DMA address register 93 , a DMA offset register 94 , and a request number register 81 ; a data bus 95 for carrying out data transfer; a transfer request signal 84 ; a request number 82 corresponding to the request signal 84 ; a request number comparator 83 , and a DMA control circuit 99 .
- This device is DMA of such a type that transfer information placed in RAM is read.
- FIG. 10 illustrates an example of transfer information placed in RAM.
- One piece of transfer information is composed of transfer information TIA, TIB, TIC equivalent to 3 words.
- FIG. 11 illustrates an example of multiple pieces of transfer information placed in RAM. Transfer information items to be read are displaced in positions predetermined by a user program in the RAM like transfer information TIA000, TIB000, . . . .
- a transfer request is made by the transfer request signal 84 .
- the request number corresponding to a transfer request signal 84 is given starting from the request number 82 .
- the request number comparator 83 the request number 82 is compared with a value stored in the request number register 81 . Initially, the request number register 81 is empty and the result of comparison at the request number comparator 83 is disagreement. When the result of comparison is disagreement, the request number 82 is stored in the request number register 81 and transfer information corresponding to the request number 82 is read from the RAM.
- transfer information TIA is read from the RAM and placed in the DMA count register 91 and the DMA command register 92 . Subsequently, transfer information TIB and transfer information TIC are sequentially read from the DMA and placed in the DMA address register 93 . Then DMA transfer is carried out.
- the request number 82 and a value stored in the request number register 81 are compared with each other at the request number comparator 83 . Since the request number of the transfer request of this time is the same as the previous request number, the result of comparison is agreement. Therefore, reading of transfer information TIA, TIB, TIC is skipped and DMA transfer is immediately carried out.
- the request number 82 and a value stored in the request number register 81 are compared with each other at the request number comparator 83 . Since the request number of the transfer request of this time is different from the previous request number, the result of comparison is disagreement. Consequently, transfer information TIA, TIB, TIC are written back and saved to the RAM area corresponding to the previous request number because the transfer information TIA, TIB, TIC corresponding to the previous request number remain in the DMA device. Thereafter, the transfer information TIA, TIB, TIC corresponding to the request number 82 of this time are read and DMA transfer is carried out.
- the request number comparator 83 determines whether or not to skip reading of transfer information according to whether or not the previous request number and the request number of this time are matched with each other.
- FIG. 12 is a timing chart of an example where request numbers are matched with each other, illustrating how the effect of the related art is exerted.
- request number 02 is inputted together with a transfer request.
- request number 02 is set in the request number register 81 and transfer information TIA, TIB, TIC corresponding to request number 02 are read during period T 02 R. Thereafter, DMA transfer is carried out during period TDMA.
- FIG. 13 illustrates an example where the previous request number and the request number are not matched with each other.
- the following processing is carried out when a transfer request with request number 00 occurs during period T 0 : during period T 00 R, transfer information TIA, TIB, TIC corresponding to request number 00 are read and during period TDMA, DMA transfer is carried out.
- transfer information TIA, TIB, TIC corresponding to request number 00 is written back and saved during period T 00 W because request number 01 is different from the previous request number 00 .
- transfer information items TIA, TIB, and TIC corresponding to request number 01 are read, and DMA transfer is carried out based on these items of transfer information.
- period T 00 W and period T 01 R occur without exception when a transfer request whose request number is different from that of the previous transfer request occurs. In the related art, for this reason, time for rewriting becomes overhead and this poses a problem of degradation in response performance.
- a Direct Memory Access (DMA) device includes a first buffer which holds a first transfer information required for a first transfer request, a second buffer which holds a second transfer information required for a second transfer request, and a transfer request comparison circuit which determines whether or not a current transfer request, which is newly inputted, matches with the first transfer request or the second transfer request.
- DMA Direct Memory Access
- the DMA device further includes a priority determination circuit that, in case where the transfer request comparison circuit determines that the current transfer request is not matched with the first transfer request or the second transfer request, updates the second transfer information to a transfer information for the current transfer request when a priority of the current transfer request is higher than a priority of the second transfer request, and updates the first transfer information to the transfer information for the current transfer request when the priority of the current transfer request is lower than the priority of the second transfer request.
- the DMA device further includes a DMA transfer control circuit which carries out a DMA transfer using the transfer information held in the first buffer or the second buffer updated by the priority determination circuit.
- first and second buffers for holding transfer information are provided and transfer information held in the second buffer is updated based on the priority level of transfer information.
- transfer information of a higher priority level is continuously held in the second buffer.
- the following can be implemented by, for example, setting a higher priority level for transfer information higher in transfer frequency: the preferential information is held in the second buffer and thus it is possible to reduce overhead produced when this transfer request occurs. This makes it possible to enhance the response performance of the DMA device.
- FIG. 1 is a block diagram illustrating a host system including a DMA device in a first exemplary embodiment of the invention
- FIG. 2 is a block diagram illustrating an example of the configuration of a DMA device in the first exemplary embodiment of the invention
- FIG. 3 illustrates a timing chart indicating single transfer in a DMA device
- FIG. 4 illustrates a timing chart indicating block transfer in a DMA device
- FIG. 5 is a drawing illustrating transfer information in a DMA device in the first exemplary embodiment of the invention.
- FIG. 6 is a flowchart illustrating the operation of a DMA device in the first exemplary embodiment of the invention
- FIG. 7 is a block diagram illustrating an example of the configuration of a DMA device in a second exemplary embodiment of the invention.
- FIG. 8 is a drawing illustrating transfer information in a DMA device in the second exemplary embodiment of the invention.
- FIG. 9 is a block diagram illustrating the configuration of a device disclosed in Patent Document.
- FIG. 10 illustrates a conceptual drawing of a memory map of a common microcomputer, illustrating multiple pieces of transfer information placed in RAM;
- FIG. 11 is a drawing illustrating transfer information placed in RAM in Patent Document
- FIG. 12 illustrates a timing chart indicating a case where identical transfer requests are inputted in the device disclosed in Patent Document.
- FIG. 13 illustrates a timing chart indicating a case where different transfer requests are inputted in the device disclosed in Patent Document.
- FIG. 1 is a block diagram illustrating an example of the configuration of a host system including a DMA device in a first exemplary embodiment of the invention.
- This host system includes CPU (Central Processor Unit) 120 , an interrupt controller 121 , a transfer factor selector 115 , a DMA (Direct Memory Access) device 116 , and a bus control unit 117 .
- CPU Central Processor Unit
- interrupt controller 121 interrupt controller
- transfer factor selector 115 a DMA (Direct Memory Access) device 116
- DMA Direct Memory Access
- the CPU 120 executes various programs stored in RAM (Random Access Memory) 125 .
- the CPU 120 is connected to the bus control unit 117 through a data bus 228 .
- the CPU 120 uses BCU (Bus Control Unit) control information 227 and the data bus 228 and invokes and writes programs and data stored in the RAM 125 or an external memory 124 .
- BCU Bus Control Unit
- the interrupt controller 121 temporarily stops a program running on the CPU 120 in accordance with interrupt requests 229 , 230 inputted from a peripheral I/O (Input/Output) 122 or an external peripheral I/O 123 .
- the transfer factor selector 115 is inputted with interrupt request 229 outputted from the peripheral I/O 122 and interrupt request 230 outputted from the external peripheral I/O 123 and selects one transfer request according to preprogrammed priorities. The transfer factor selector 115 then makes the selected transfer request to the DMA device 116 . The transfer factor selector 115 outputs the request number 202 of the selected transfer request 200 and a current priority level 203 preset for this transfer request by a user to the DMA device 116 . A higher priority level is set for, for example, transfer requests higher in transfer frequency.
- the DMA device 116 is connected to the bus control unit 117 through a data bus 220 .
- the DMA device 116 is inputted with the transfer request 200 , the current priority level 203 , and the current priority level 203 from the transfer factor selector 115 and inputs and outputs BCU control information 226 from and to the bus control unit 117 .
- the bus control unit 117 uses the BCU control information 226 , data bus 220 , BCU control information 227 , and data bus 228 and inputs and outputs data between it and the peripheral I/O 122 , external peripheral I/O 123 , external memory 124 , and RAM 125 .
- the transfer factor selector 115 is inputted with the interrupt request 229 outputted from the peripheral I/O 122 and the interrupt request 230 outputted from the external peripheral I/O 123 . Then it selects one transfer request according to the preprogrammed priorities and makes a transfer request by the transfer request 200 . At this time, it outputs the current request number 202 and the current priority level 203 corresponding to the selected transfer request.
- the DMA device 116 is inputted with the current request number 202 , current priority level 203 , and transfer request 200 and reads transfer information corresponding to the current request number 202 from the RAM 125 . Then the DMA device 116 , in accordance with the transfer information read from the RAM 125 , uses the BCU control information 226 and the data bus 220 and carries out DMA transfer between it and the peripheral I/O 122 , external peripheral I/O 123 , external memory 124 , and RAM 125 .
- FIG. 2 is a block diagram illustrating an example of the configuration of the DMA device.
- the DMA device 116 includes: a request number comparator 107 , a transfer information input/output circuit 112 , a priority control circuit 105 , a first buffer 101 and a second buffer 102 , a transfer information selection circuit 100 , and a DMA transfer control circuit 114 .
- the priority control circuit 105 includes a priority level comparison circuit 110 , a number of times of transfer comparison circuit 111 , and a determination circuit 113 .
- the priority circuit 105 holds a transfer request of a higher priority in the second buffer 102 . Specifically, when the priority of a newly inputted transfer request is higher than the priority of a transfer request stored in the second buffer 102 , the priority control circuit 105 selects the second buffer 102 . As a result, transfer information corresponding to the newly selected transfer request is stored in the second buffer 102 through the transfer information input/output circuit 112 .
- the priority control circuit 105 selects the first buffer 101 .
- transfer information corresponding to the newly selected transfer request is stored in the first buffer 101 through the transfer information input/output circuit 112 .
- both the first buffer 101 and the second buffer 102 are empty. Therefore, the priority control circuit 105 selects the second buffer 102 . In the initial state, as a result, a transfer request that newly occurs is stored in the second buffer 102 .
- a request number, a source address register SAR, a destination address register DAR, a number of times of transfer register DBC, and control information CI are stored.
- a priority level request number, a source address register SAR, a destination address register DAR, a number of times of transfer register DBC, and control information CI are stored.
- the request number comparator 107 is inputted with the transfer request 200 and the current request number 202 from the transfer factor selector 115 .
- the request number comparator 107 compares the inputted current request number 202 with the request numbers stored in the first buffer 101 and the second buffer 102 . Then it outputs a transfer request signal 215 , a buffer selection signal 201 , and a transfer information read request 210 according to the result of the comparison.
- the transfer request signal 215 is a signal that requests DMA transfer of the DMA transfer control circuit 114 .
- the transfer information read request 210 is a signal that requests the transfer information input/output circuit 112 to retrieve transfer information from the RAM 125 .
- the buffer selection signal 201 is a signal that instructs the transfer information selection circuit 100 to select either the first buffer 101 or the second buffer 102 .
- the transfer information input/output circuit 112 is inputted with the transfer information read request 210 and outputs number of times of transfer information 216 and a transfer request signal 214 . Further, the transfer information input/output circuit 112 uses the BCU control information 226 and the data bus 220 and inputs and outputs transfer information 221 between it and the first buffer 101 and the second buffer 102 .
- the priority level comparison circuit 110 is inputted with the current priority level 203 and the priority level stored in the second buffer 102 and outputs comparison result 225 according to the result of the comparison.
- the priority level comparison circuit 110 outputs a number of times of transfer comparison request 218 to the number of times of transfer comparison circuit 111 .
- the circuit 111 When the number of times of transfer comparison circuit 111 receives the number of times of transfer comparison request 218 , the circuit 111 receives the number of times of transfer information 216 of the transfer request newly inputted through the transfer information input/output circuit 112 , and the number of times of transfer information 217 from the second buffer 102 . The circuit 111 compares the number of times of DMA transfer set for one time of transfer request in the newly inputted transfer request and the number of times of DMA transfer set for one time of transfer request stored in the second buffer 102 . The number of times of transfer comparison circuit 111 outputs the obtained comparison result 232 to the determination circuit 113 .
- FIG. 3 is a timing chart indicating a transfer pattern generally designated as single transfer. In a single transfer, one DMA transfer is caused by one DMA request. FIG. 3 illustrates how 100 DMA transfers are carried out by 100 DMA requests.
- FIG. 4 is a timing chart indicating a transfer pattern generally designated as block transfer.
- block transfer a specified number of times of transfer are carried out by one time of DMA request.
- FIG. 4 illustrates how 100 times of DMA transfer are carried out by one time of DMA request.
- the single transfer and the block transfer are further repeatedly carried out a preset number of times.
- the number of times of repetition of transfer request in the single transfer illustrated in FIG. 3 is, for example, 5, DMA transfer is carried out 5 times in total.
- DMA transfer is carried out 500 times in total.
- the determination circuit 113 is inputted with the comparison result 225 pertaining to priority level and the comparison result 232 pertaining to the number of times of DMA transfer and outputs a buffer selection signal 212 based thereon.
- the buffer selection signal 212 is outputted to the first buffer 101 and the second buffer 102 .
- the first buffer 101 and the second buffer 102 input and output transfer information between them and the transfer information input/output circuit 112 . Based on the buffer selection signal 212 , the first buffer 101 and the second buffer 102 take in the transfer information 221 inputted from the transfer information input/output circuit 112 .
- the first buffer When the first buffer receives the buffer selection signal 212 indicating that the first buffer 101 has been selected, the first buffer 101 takes in the transfer information 221 from the transfer information input/output circuit 112 , and outputs the information as transfer information 222 to the transfer information selection circuit 100 .
- the second buffer receives the buffer selection signal 212 indicating that the second buffer 102 has been selected, the second buffer 102 takes in the transfer information 221 from the transfer information input/output circuit 112 , and outputs the information as transfer information 223 to the transfer information selection circuit 100 .
- the transfer information selection circuit 100 selects the transfer information 222 inputted from the first buffer 101 or the transfer information 224 inputted from the second buffer 102 and outputs the selected transfer information 222 or 224 to the DMA transfer control circuit 114 .
- the DMA transfer control circuit 114 in accordance with the transfer request signal 215 inputted from the request number comparator 107 or the transfer request signal 214 inputted from the transfer information input/output circuit 112 , outputs the transfer information 224 selected by the transfer information selection circuit 100 to the external peripheral I/O 123 , peripheral I/O 122 , RAM 125 , and the like through the BCU control information 226 .
- FIG. 5 illustrates transfer information transferred in the DMA device in the first exemplary embodiment.
- the transfer information read by the transfer information input/output circuit 112 is composed as one piece of transfer information of transfer information TIA, TIB, TIC equivalent to 3 words.
- the transfer information TIA contains a number of times of transfer register DBC and control information CI.
- the transfer information TIB contains a source address register SAR.
- the transfer information TIC contains a destination address register DAR.
- FIG. 6 is a flowchart illustrating the operation of the DMA device in the first exemplary embodiment.
- the transfer information stored in the first buffer 101 is directly used to carry out DMA transfer (S 2 ).
- the transfer information in the second buffer 102 is directly used to carry out DMA transfer (S 6 ).
- step S 1 When at step S 1 the current request number 202 is not matched with the request number in the first buffer 101 or the second buffer 102 (C), the following processing is carried out: the priority level of the transfer request stored in the second buffer 102 and the priority level of the transfer request that has newly occurred are compared with each other (S 3 ).
- step S 3 When at step S 3 the priority level of the transfer request stored in the second buffer 102 is higher than the priority level of the new transfer request (A), the following processing is carried out: transfer information corresponding to the new transfer request is read and stored in the first buffer 101 and DMA transfer is carried out based on the transfer information stored in the first buffer 101 (S 5 ).
- step S 3 When at step S 3 the priority level of the transfer request stored in the second buffer 102 is lower than the priority level of the new transfer request (B), the following processing is carried out: transfer information corresponding to the new transfer request is read and stored in the second buffer 102 and DMA transfer is carried out based on the transfer information stored in the second buffer 102 (S 7 ).
- step S 3 When at step S 3 the priority level in the second buffer 102 and the priority level of the new transfer request are equal to each other (C), the following processing is carried out: the number of times of DMA transfer of the transfer request held in the second buffer 102 and the number of times of DMA transfer in the new transfer information are compared with each other (S 4 ).
- step S 4 When at step S 4 the number of times of DMA transfer for one time of transfer request in the transfer request stored in the second buffer 102 is smaller than the number of times of DMA transfer for one time of transfer request in the new transfer request (A), the following processing is carried out. Specifically, when the transfer request held in the second buffer 102 is the transfer request illustrated in FIG. 3 and the new transfer request is the transfer request illustrated in FIG. 4 , it is determined that the priority of the transfer request held in the second buffer 102 is higher. Then the transfer information for the new transfer request is stored in the first buffer 101 and DMA transfer is carried out by this transfer information (S 5 ).
- step S 4 When at step S 4 the number of times of DMA transfer for one time of transfer request held in the second buffer 102 is larger than the number of times of DMA transfer for one time of transfer request in the new transfer request (B), the following processing is carried out. Specifically, when the transfer request held in the second buffer 102 is the transfer request illustrated in FIG. 4 and the new transfer request is the transfer request illustrated in FIG. 3 , it is determined that the priority of the new transfer request is higher. Then the new transfer request is stored in the second buffer 102 and DMA transfer is carried out by the transfer information stored in the second buffer 101 (S 7 ).
- the following processing is carried out: the preset numbers of times of repetition of single transfer or block transfer are compared with each other (S 8 ). Then a higher priority is set for a transfer request larger in the preset number of times of repetition of transfer request transfer.
- step S 8 When at step S 8 the number of times of repetition stored in the second buffer 102 is larger than the number of times of repetition of the new transfer request (A) or they are equal to each other (C), the second buffer 102 is not updated and the transfer information for the new transfer request is stored in the first buffer 101 . Then DMA transfer is carried out using the transfer information stored in the first buffer 101 (S 5 ).
- step S 8 When at step S 8 the number of times of repetition stored in the second buffer 102 is smaller than the number of times of repetition of the new transfer request, the second buffer 102 is updated and transfer information for the new transfer request is stored in the second buffer 102 . Then DMA transfer is carried out using the transfer information stored in the second buffer 102 .
- the numbers of times of DMA transfer for one time of transfer request are equal, as mentioned above, the numbers of times of repetition of transfer request are compared with each other. This makes it possible to hold transfer information involving a larger total number of operations of reading and writing back the transfer information in the second buffer 102 .
- the following processing is carried out: according to the determination of priority, the newly inputted transfer request and the transfer request stored in the second buffer 102 are compared with each other with respect to priority level and number of times of transfer information.
- the result of the priority determination reveals that the priority in the second buffer 102 is higher or they are equal to each other, the first buffer 101 is updated.
- the priority in the second buffer 102 is lower, the second buffer 102 is updated.
- the request number comparator 107 compares the current request number 202 of transfer request “1” with the request numbers stored in the first buffer 101 and the second buffer 102 (S 1 ). Since both the first buffer 101 and the second buffer 102 are empty at this time, the comparison result is disagreement. Since the comparison result is disagreement, the request number comparator 107 outputs the transfer information read request 210 to the transfer information input/output circuit 112 . It thereby causes the transfer information input/output circuit 112 to read transfer information for transfer request “1.”
- the transfer information input/output circuit 112 reads transfer information TIA corresponding to the newly inputted transfer request from the RAM 125 .
- the priority control circuit 105 determines the priorities of transfer request “1” and the transfer request stored in the second buffer 102 (S 3 ). This priority determination is carried out in two stages. First, the current priority level 203 of the inputted transfer request and the priority level stored in the second buffer 102 are compared with each other by the priority level comparison circuit 110 . When their priority levels are equal to each other, the priority level comparison circuit 110 outputs the number of times of transfer comparison request 218 to the number of times of transfer comparison circuit 111 .
- the circuit 111 compares the number of times of transfer information 216 read through the transfer information input/output circuit 112 and the number of times of transfer information 217 stored in the second buffer 102 . Then it determines the transfer request smaller in the number of times of DMA transfer for one time of transfer request to have a higher priority. As mentioned above, the priorities are determined in two stages. When the second buffer 102 is empty, the circuit 111 determines that the priority of the current priority level 203 is higher.
- the priority control circuit 105 compares the priority of transfer request “1” with that in the second buffer 102 by the above determination method (S 4 ). Since the second buffer 102 is empty, the priority control circuit 105 determines transfer request “1” is higher in priority than the transfer request stored in the second buffer and selects the second buffer 102 by the buffer selection signal 212 . The priority control circuit 105 outputs the transfer information 221 and thereby places the already read transfer information TIA in the number of times of transfer register DBC and the control information CI in the second buffer 102 .
- transfer information TIB is read through the transfer information input/output circuit 112 and is placed in the source address register SAR in the second buffer 102 by the transfer information 221 .
- transfer information TIC is read through the transfer information input/output circuit 112 and is placed in the destination address register DAR in the second buffer 102 by the transfer information 221 .
- the transfer information selection circuit 100 selects the transfer information 223 from the second buffer 102 based on the buffer selection signal 212 outputted from the determination circuit 113 .
- the transfer information selection circuit 100 outputs transfer information stored in the selected second buffer 102 as the transfer information 224 to the DMA transfer control circuit 114 .
- DMA transfer is carried out by the DMA transfer control circuit 114 based on the transfer information stored in the second buffer 102 (S 5 ). In this case, the transfer information read to the second buffer 102 is not written back.
- the request number comparator 107 compares the request number of the inputted transfer request “1” with the request numbers stored in the first buffer 101 and the second buffer 102 (S 1 ). In this case, the request number of the newly inputted transfer request “1” is the same as the request number previously stored in the second buffer 102 . Therefore, the request number comparator 107 outputs the buffer selection signal 201 to the transfer information selection circuit 100 so as to select the second buffer 102 .
- transfer information stored in the first buffer 101 or the second buffer 102 is not updated.
- the transfer information selection circuit 100 selects the transfer information 223 stored in the second buffer 102 by the buffer selection signal 201 inputted by the request number comparator 107 , and outputs this transfer information 223 as the transfer information 224 to the DMA transfer control circuit 114 .
- the DMA transfer control circuit 114 carries out DMA transfer for transfer request “1” based on the transfer information 224 inputted from the transfer information selection circuit 100 according to the transfer request signal 215 inputted from the request number comparator 107 (S 6 ).
- the request number comparator 107 compares the following request numbers (S 1 ): the current request number 202 of the inputted transfer request “2” with the request numbers stored in the first buffer 101 and the second buffer 102 . In this case, the first buffer 101 is empty and the second buffer has the request number of transfer request “1” stored therein.
- the request number comparator 107 Since the request number of the newly inputted transfer request “2” is not matched with the request number stored in the first buffer 101 or the second buffer 102 , the request number comparator 107 outputs the transfer information read request 210 to the transfer information input/output circuit 112 to cause the transfer information input/output circuit 112 to read transfer information corresponding to transfer request “2.”
- the transfer information input/output circuit 112 reads transfer information TIA from the RAM 125 when the circuit 112 receives the transfer information read request 210 from the request number comparator 107 .
- the priority control circuit 105 compares the priority of transfer request “1” in the second buffer 102 with the priority of the newly inputted transfer request “2” (S 3 ). First, as mentioned above, the priority levels are compared and when the priority levels are identical, the priorities are determined by comparing the numbers of times of DMA transfer for one time of transfer request.
- the determination circuit 113 When the result of this priority comparison reveals that the priority in the second buffer 102 is higher, the determination circuit 113 outputs the buffer selection signal 212 to the first buffer 101 , second buffer 102 , and transfer information selection circuit 100 so as to select the first buffer 101 . As a result, the first buffer 101 is selected.
- the transfer information input/output circuit 112 places the already read transfer information TIA as the transfer information 221 in the number of times of transfer register DBC and the control information CI in the first buffer 101 .
- the transfer information input/output circuit 112 reads transfer information TIB and places it in the source address register SAR in the first buffer 101 by the transfer information 221 .
- the transfer information input/output circuit 112 reads transfer information TIC and places it in the destination address register DAR in the first buffer 101 by the transfer information 221 .
- the transfer information selection circuit 100 selects the transfer information 222 placed in the first buffer 101 according to the buffer selection signal 212 inputted from the determination circuit 113 .
- the DMA transfer control circuit 114 carries out DMA transfer based on the transfer information in the first buffer 101 , inputted as the transfer information 224 , according to the transfer request signal 214 (S 5 ). In this case, the transfer information stored in the first buffer 101 is written back.
- the second buffer 102 is selected according to the buffer selection signal 212 .
- the transfer information for transfer request “1” has been already placed.
- the information in the second buffer 102 is once written back and the already read transfer information TIA is placed in the number of times of transfer register DBC and the control information CI in the second buffer 102 according to the transfer information 221 .
- the transfer information input/output circuit 112 reads transfer information TIB and places the information in the source address register SAR in the second buffer 102 by the transfer information 221 . Subsequently, the transfer information input/output circuit 112 reads transfer information TIC and places the information in the destination address register DAR in the second buffer 102 by the transfer information 221 . Based on the buffer selection signal 212 inputted from the priority control circuit 105 , the transfer information selection circuit 100 selects the transfer information 223 stored in the second buffer 102 , and outputs the information as the transfer information 224 to the DMA transfer control circuit 114 . The DMA transfer control circuit 114 carries out DMA transfer based on the inputted transfer information 223 (S 7 ).
- the priority of the transfer request that has newly occurred and the priority of the transfer request stored in the second buffer 102 are compared with each other.
- the priority of the transfer request is higher, it is stored in the second buffer 102 .
- a transfer request having a higher priority is continuously placed in the second buffer 102 .
- this transfer information is held in the second buffer 102 and it is possible to reduce overhead that is otherwise produced by writing-back when this transfer request occurs. This makes it possible to achieve the enhancement of DMA transfer processing speed.
- the invention is not limited to this and may be so configured that multiple second buffers 102 are provided. Though this increases the scale of circuitry, a large number of pieces of transfer information can be held and thus the operations of reading and writing back transfer information can be reduced.
- FIG. 7 is a block diagram illustrating an example of the configuration of a DMA device in a second exemplary embodiment of the invention.
- the second exemplary embodiment is characterized in that the priority control circuit 105 in the first exemplary embodiment is replaced with a priority control circuit 105 with enable.
- the transfer information input/output circuit 112 in the first exemplary embodiment is modified so that it outputs a hold enable signal 219 to the priority control circuit 105 with enable.
- the hold enable signal 219 is a signal that prevents the use of the second buffer 102 and provides an instruction to continuously use the first buffer 101 regardless of determination by the determination circuit 113 .
- the transfer information input/output circuit 112 When it inputs transfer information, the transfer information input/output circuit 112 outputs HEN as the hold enable signal 219 .
- This hold enable signal 219 is inputted to the determination circuit 113 .
- the determination circuit 113 When the inputted transfer information contains the hold enable signal 219 , the determination circuit 113 outputs the buffer selection signal 212 so as to continuously select the first buffer 101 regardless of determination by the determination circuit 113 .
- the hold enable signal 219 is provided as HEN as an enable bit in the control information CI in the transfer information.
- the position of the hold enable signal 219 is not limited to that in the transfer information illustrated in FIG. 8 and it can be provided in any position.
- the following measure is taken in the DMA device in the second exemplary embodiment: when there is such a special transfer request that the number of times of DMA transfer is large (the intervals between requests are long) for one time of transfer request as in block transfer illustrated in FIG. 4 , the following processing is carried out: the use of the second buffer 102 is prevented by the hold enable signal 219 .
- This makes it possible for other transfer requests involving the frequent reading and writing-back of transfer information as in single transfer to continuously use the second buffer 102 .
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Bus Control (AREA)
Abstract
Description
- This application is based upon and claims the benefit of priority from Japanese Patent Application No. 2008-229600 which was filed on Sep. 8, 2008, the disclosure of which is incorporated herein in its entirety by reference.
- 1. Field of the Invention
- The present invention relates to microcomputers (hereafter, referred to as “micros”) and in particular to a DMA (Direct Memory Access) device and a DMA transfer method incorporated in a micro.
- 2. Description of Related Art
- With the aim of reducing load on CPU (Central Processor Unit) associated with increase in the number of peripheral I/Os (Input/Output Ports) incorporated in micros, there is demand for multichannel DMA. In general, a DMA device incorporates transfer information equivalent to the number of channels in DMA. Therefore, when the number of channels is increased, the amount of incorporated transfer information is increased and this leads to the expanded physical scale of the DMA.
- As one means for avoiding the expansion of physical scale due to channel multiplication, there is a technique in which transfer information is placed in rewritable memory, such as RAM (Random Access Memory). At each time of transfer the transfer information is read from the RAM and the read information is placed in the DMA device to carry out DMA transfer.
- In DMA of such a type that transfer information placed in RAM is read, the expansion of physical scale due to channel multiplication can be avoided. However, overhead due to reading of transfer information from RAM at each time of transfer is produced and this poses a problem of degradation in transfer performance.
- In recent years, re-specification of data paths have been frequently carried out to cope with increase in micro clock frequency and this tends to increase clock counts in transfer. Because of bus multiplication in conjunction with diversification of peripheral I/Os and the complication of systems, it has been required to displace the access path from DMA to RAM to a different bus and overhead tends to further increase. For this reason, it is demanded to reduce overhead arising from reading of transfer information.
- Description will be given to the configuration of a device disclosed in Patent Document (Japanese Patent Application Laid Open No. 2000-99452) with reference to
FIG. 9 ,FIG. 10 , andFIG. 11 . As illustrated inFIG. 9 , this device is comprised of: a first buffer including aDMA count register 91, aDMA command register 92, aDMA address register 93, aDMA offset register 94, and arequest number register 81; adata bus 95 for carrying out data transfer; atransfer request signal 84; arequest number 82 corresponding to therequest signal 84; arequest number comparator 83, and aDMA control circuit 99. This device is DMA of such a type that transfer information placed in RAM is read. -
FIG. 10 illustrates an example of transfer information placed in RAM. One piece of transfer information is composed of transfer information TIA, TIB, TIC equivalent to 3 words.FIG. 11 illustrates an example of multiple pieces of transfer information placed in RAM. Transfer information items to be read are displaced in positions predetermined by a user program in the RAM like transfer information TIA000, TIB000, . . . . - Description will be given to the operation of the thus configured device. A transfer request is made by the
transfer request signal 84. The request number corresponding to atransfer request signal 84 is given starting from therequest number 82. At this time, at therequest number comparator 83, therequest number 82 is compared with a value stored in therequest number register 81. Initially, therequest number register 81 is empty and the result of comparison at therequest number comparator 83 is disagreement. When the result of comparison is disagreement, therequest number 82 is stored in therequest number register 81 and transfer information corresponding to therequest number 82 is read from the RAM. - First, transfer information TIA is read from the RAM and placed in the
DMA count register 91 and theDMA command register 92. Subsequently, transfer information TIB and transfer information TIC are sequentially read from the DMA and placed in theDMA address register 93. Then DMA transfer is carried out. - When a transfer request whose request number is the same as the previous request number occurs, the
request number 82 and a value stored in therequest number register 81 are compared with each other at therequest number comparator 83. Since the request number of the transfer request of this time is the same as the previous request number, the result of comparison is agreement. Therefore, reading of transfer information TIA, TIB, TIC is skipped and DMA transfer is immediately carried out. - When a transfer request whose request number is different from the previous request number occurs, the
request number 82 and a value stored in therequest number register 81 are compared with each other at therequest number comparator 83. Since the request number of the transfer request of this time is different from the previous request number, the result of comparison is disagreement. Consequently, transfer information TIA, TIB, TIC are written back and saved to the RAM area corresponding to the previous request number because the transfer information TIA, TIB, TIC corresponding to the previous request number remain in the DMA device. Thereafter, the transfer information TIA, TIB, TIC corresponding to therequest number 82 of this time are read and DMA transfer is carried out. - In the related art, as mentioned above, the
request number comparator 83 determines whether or not to skip reading of transfer information according to whether or not the previous request number and the request number of this time are matched with each other. -
FIG. 12 is a timing chart of an example where request numbers are matched with each other, illustrating how the effect of the related art is exerted. During period T0, first,request number 02 is inputted together with a transfer request. In response thereto, in the DMA device,request number 02 is set in therequest number register 81 and transfer information TIA, TIB, TIC corresponding torequest number 02 are read during period T02R. Thereafter, DMA transfer is carried out during period TDMA. When a request withrequest number 02, identical with the previous request number, occurs during period T1, the following processing is carried out: since the value in therequest number register 81 and the request number in period T1 are identical with each other, reading of the transfer information TIA, TIB, TIC is skipped and the cycle in period TDMA is immediately carried out. -
FIG. 13 illustrates an example where the previous request number and the request number are not matched with each other. In the related art, the following processing is carried out when a transfer request withrequest number 00 occurs during period T0: during period T00R, transfer information TIA, TIB, TIC corresponding torequest number 00 are read and during period TDMA, DMA transfer is carried out. When a transfer request withrequest number 01 thereafter occurs during period T1, transfer information TIA, TIB, TIC corresponding torequest number 00 is written back and saved during period T00W becauserequest number 01 is different from theprevious request number 00. During period T01R, transfer information items TIA, TIB, and TIC corresponding torequest number 01 are read, and DMA transfer is carried out based on these items of transfer information. - In the related art, as illustrated in
FIG. 13 , period T00W and period T01R occur without exception when a transfer request whose request number is different from that of the previous transfer request occurs. In the related art, for this reason, time for rewriting becomes overhead and this poses a problem of degradation in response performance. - A Direct Memory Access (DMA) device includes a first buffer which holds a first transfer information required for a first transfer request, a second buffer which holds a second transfer information required for a second transfer request, and a transfer request comparison circuit which determines whether or not a current transfer request, which is newly inputted, matches with the first transfer request or the second transfer request. The DMA device further includes a priority determination circuit that, in case where the transfer request comparison circuit determines that the current transfer request is not matched with the first transfer request or the second transfer request, updates the second transfer information to a transfer information for the current transfer request when a priority of the current transfer request is higher than a priority of the second transfer request, and updates the first transfer information to the transfer information for the current transfer request when the priority of the current transfer request is lower than the priority of the second transfer request. The DMA device further includes a DMA transfer control circuit which carries out a DMA transfer using the transfer information held in the first buffer or the second buffer updated by the priority determination circuit.
- As mentioned above, first and second buffers for holding transfer information are provided and transfer information held in the second buffer is updated based on the priority level of transfer information. As a result, transfer information of a higher priority level is continuously held in the second buffer. For this reason, the following can be implemented by, for example, setting a higher priority level for transfer information higher in transfer frequency: the preferential information is held in the second buffer and thus it is possible to reduce overhead produced when this transfer request occurs. This makes it possible to enhance the response performance of the DMA device.
- The above and other exemplary aspects, advantages and features of the present invention will be more apparent from the following description of certain exemplary embodiments taken in conjunction with the accompanying drawings, in which:
-
FIG. 1 is a block diagram illustrating a host system including a DMA device in a first exemplary embodiment of the invention; -
FIG. 2 is a block diagram illustrating an example of the configuration of a DMA device in the first exemplary embodiment of the invention; -
FIG. 3 illustrates a timing chart indicating single transfer in a DMA device; -
FIG. 4 illustrates a timing chart indicating block transfer in a DMA device; -
FIG. 5 is a drawing illustrating transfer information in a DMA device in the first exemplary embodiment of the invention; -
FIG. 6 is a flowchart illustrating the operation of a DMA device in the first exemplary embodiment of the invention; -
FIG. 7 is a block diagram illustrating an example of the configuration of a DMA device in a second exemplary embodiment of the invention; -
FIG. 8 is a drawing illustrating transfer information in a DMA device in the second exemplary embodiment of the invention; -
FIG. 9 is a block diagram illustrating the configuration of a device disclosed in Patent Document; -
FIG. 10 illustrates a conceptual drawing of a memory map of a common microcomputer, illustrating multiple pieces of transfer information placed in RAM; -
FIG. 11 is a drawing illustrating transfer information placed in RAM in Patent Document; -
FIG. 12 illustrates a timing chart indicating a case where identical transfer requests are inputted in the device disclosed in Patent Document; and -
FIG. 13 illustrates a timing chart indicating a case where different transfer requests are inputted in the device disclosed in Patent Document. -
FIG. 1 is a block diagram illustrating an example of the configuration of a host system including a DMA device in a first exemplary embodiment of the invention. This host system includes CPU (Central Processor Unit) 120, an interruptcontroller 121, atransfer factor selector 115, a DMA (Direct Memory Access)device 116, and abus control unit 117. - The
CPU 120 executes various programs stored in RAM (Random Access Memory) 125. TheCPU 120 is connected to thebus control unit 117 through adata bus 228. TheCPU 120 uses BCU (Bus Control Unit)control information 227 and thedata bus 228 and invokes and writes programs and data stored in theRAM 125 or anexternal memory 124. - The interrupt
controller 121 temporarily stops a program running on theCPU 120 in accordance with interrupt 229, 230 inputted from a peripheral I/O (Input/Output) 122 or an external peripheral I/requests O 123. - The
transfer factor selector 115 is inputted with interruptrequest 229 outputted from the peripheral I/O 122 and interruptrequest 230 outputted from the external peripheral I/O 123 and selects one transfer request according to preprogrammed priorities. Thetransfer factor selector 115 then makes the selected transfer request to theDMA device 116. Thetransfer factor selector 115 outputs therequest number 202 of the selectedtransfer request 200 and acurrent priority level 203 preset for this transfer request by a user to theDMA device 116. A higher priority level is set for, for example, transfer requests higher in transfer frequency. - The
DMA device 116 is connected to thebus control unit 117 through adata bus 220. TheDMA device 116 is inputted with thetransfer request 200, thecurrent priority level 203, and thecurrent priority level 203 from thetransfer factor selector 115 and inputs and outputsBCU control information 226 from and to thebus control unit 117. - The
bus control unit 117 uses theBCU control information 226,data bus 220,BCU control information 227, anddata bus 228 and inputs and outputs data between it and the peripheral I/O 122, external peripheral I/O 123,external memory 124, andRAM 125. - Description will be given to the operation at the level of the thus configured host system. The
transfer factor selector 115 is inputted with the interruptrequest 229 outputted from the peripheral I/O 122 and the interruptrequest 230 outputted from the external peripheral I/O 123. Then it selects one transfer request according to the preprogrammed priorities and makes a transfer request by thetransfer request 200. At this time, it outputs thecurrent request number 202 and thecurrent priority level 203 corresponding to the selected transfer request. - The
DMA device 116 is inputted with thecurrent request number 202,current priority level 203, andtransfer request 200 and reads transfer information corresponding to thecurrent request number 202 from theRAM 125. Then theDMA device 116, in accordance with the transfer information read from theRAM 125, uses theBCU control information 226 and thedata bus 220 and carries out DMA transfer between it and the peripheral I/O 122, external peripheral I/O 123,external memory 124, andRAM 125. -
FIG. 2 is a block diagram illustrating an example of the configuration of the DMA device. TheDMA device 116 includes: arequest number comparator 107, a transfer information input/output circuit 112, apriority control circuit 105, afirst buffer 101 and asecond buffer 102, a transferinformation selection circuit 100, and a DMAtransfer control circuit 114. - The
priority control circuit 105 includes a prioritylevel comparison circuit 110, a number of times oftransfer comparison circuit 111, and adetermination circuit 113. Thepriority circuit 105 holds a transfer request of a higher priority in thesecond buffer 102. Specifically, when the priority of a newly inputted transfer request is higher than the priority of a transfer request stored in thesecond buffer 102, thepriority control circuit 105 selects thesecond buffer 102. As a result, transfer information corresponding to the newly selected transfer request is stored in thesecond buffer 102 through the transfer information input/output circuit 112. - Meanwhile, when the priority of a newly inputted transfer request is lower than that of a transfer request stored in the
second buffer 102, thepriority control circuit 105 selects thefirst buffer 101. As a result, transfer information corresponding to the newly selected transfer request is stored in thefirst buffer 101 through the transfer information input/output circuit 112. In the initial state before the occurrence of a transfer request, both thefirst buffer 101 and thesecond buffer 102 are empty. Therefore, thepriority control circuit 105 selects thesecond buffer 102. In the initial state, as a result, a transfer request that newly occurs is stored in thesecond buffer 102. - In the
first buffer 101, a request number, a source address register SAR, a destination address register DAR, a number of times of transfer register DBC, and control information CI are stored. In thesecond buffer 102, a priority level request number, a source address register SAR, a destination address register DAR, a number of times of transfer register DBC, and control information CI are stored. - The
request number comparator 107 is inputted with thetransfer request 200 and thecurrent request number 202 from thetransfer factor selector 115. Therequest number comparator 107 compares the inputtedcurrent request number 202 with the request numbers stored in thefirst buffer 101 and thesecond buffer 102. Then it outputs atransfer request signal 215, abuffer selection signal 201, and a transfer information read request 210 according to the result of the comparison. - The
transfer request signal 215 is a signal that requests DMA transfer of the DMAtransfer control circuit 114. The transfer information read request 210 is a signal that requests the transfer information input/output circuit 112 to retrieve transfer information from theRAM 125. Thebuffer selection signal 201 is a signal that instructs the transferinformation selection circuit 100 to select either thefirst buffer 101 or thesecond buffer 102. - The transfer information input/
output circuit 112 is inputted with the transfer information read request 210 and outputs number of times oftransfer information 216 and atransfer request signal 214. Further, the transfer information input/output circuit 112 uses theBCU control information 226 and thedata bus 220 and inputs and outputs transferinformation 221 between it and thefirst buffer 101 and thesecond buffer 102. - The priority
level comparison circuit 110 is inputted with thecurrent priority level 203 and the priority level stored in thesecond buffer 102 andoutputs comparison result 225 according to the result of the comparison. When thecurrent priority level 203 and the priority level stored in thesecond buffer 102 are equal to each other, the prioritylevel comparison circuit 110 outputs a number of times oftransfer comparison request 218 to the number of times oftransfer comparison circuit 111. - When the number of times of
transfer comparison circuit 111 receives the number of times oftransfer comparison request 218, thecircuit 111 receives the number of times oftransfer information 216 of the transfer request newly inputted through the transfer information input/output circuit 112, and the number of times oftransfer information 217 from thesecond buffer 102. Thecircuit 111 compares the number of times of DMA transfer set for one time of transfer request in the newly inputted transfer request and the number of times of DMA transfer set for one time of transfer request stored in thesecond buffer 102. The number of times oftransfer comparison circuit 111 outputs the obtainedcomparison result 232 to thedetermination circuit 113. -
FIG. 3 is a timing chart indicating a transfer pattern generally designated as single transfer. In a single transfer, one DMA transfer is caused by one DMA request.FIG. 3 illustrates how 100 DMA transfers are carried out by 100 DMA requests. - When this single transfer is carried out in the
first buffer 101, a series of operations of reading of transfer information TIA, TIB, TIC, DMA transfer, and writing-back of transfer information TIA, TIB, TIC is performed 100 times. Therefore, reading and writing-back of transfer information TIA, TIB, TIC occur 100 times. -
FIG. 4 is a timing chart indicating a transfer pattern generally designated as block transfer. In block transfer, a specified number of times of transfer are carried out by one time of DMA request.FIG. 4 illustrates how 100 times of DMA transfer are carried out by one time of DMA request. When block transfer is carried out in thefirst buffer 101, transfer information TIA, TIB, TIC are read only once at the beginning, DMA transfer is carried out 100 times, and then transfer information TIA, TIB, TIC are written back only once at the end. - The single transfer and the block transfer are further repeatedly carried out a preset number of times. In case the number of times of repetition of transfer request in the single transfer illustrated in
FIG. 3 is, for example, 5, DMA transfer is carried out 5 times in total. In case the number of times of repetition of transfer request in the block transfer illustrated inFIG. 4 is set to 5, DMA transfer is carried out 500 times in total. - When the number of times of DMA transfer set for one time of transfer request in the newly inputted transfer request and the number of times of DMA transfer set for one time of transfer request stored in the
second buffer 102 are equal to each other, the following takes place: at the number of times oftransfer comparison circuit 111, the preset numbers of times of repetition in single transfer or block transfer are compared. Then a higher priority is set for a transfer request larger in the preset number of times of repetition and is outputted as thecomparison result 232 to thedetermination circuit 113. - The
determination circuit 113 is inputted with thecomparison result 225 pertaining to priority level and thecomparison result 232 pertaining to the number of times of DMA transfer and outputs abuffer selection signal 212 based thereon. Thebuffer selection signal 212 is outputted to thefirst buffer 101 and thesecond buffer 102. - The
first buffer 101 and thesecond buffer 102 input and output transfer information between them and the transfer information input/output circuit 112. Based on thebuffer selection signal 212, thefirst buffer 101 and thesecond buffer 102 take in thetransfer information 221 inputted from the transfer information input/output circuit 112. - When the first buffer receives the
buffer selection signal 212 indicating that thefirst buffer 101 has been selected, thefirst buffer 101 takes in thetransfer information 221 from the transfer information input/output circuit 112, and outputs the information astransfer information 222 to the transferinformation selection circuit 100. When the second buffer receives thebuffer selection signal 212 indicating that thesecond buffer 102 has been selected, thesecond buffer 102 takes in thetransfer information 221 from the transfer information input/output circuit 112, and outputs the information astransfer information 223 to the transferinformation selection circuit 100. - Based on the
buffer selection signal 201 inputted from therequest number comparator 107 or thebuffer selection signal 212 inputted from thepriority control circuit 105, the transferinformation selection circuit 100 selects thetransfer information 222 inputted from thefirst buffer 101 or thetransfer information 224 inputted from thesecond buffer 102 and outputs the selected 222 or 224 to the DMAtransfer information transfer control circuit 114. - The DMA
transfer control circuit 114, in accordance with thetransfer request signal 215 inputted from therequest number comparator 107 or thetransfer request signal 214 inputted from the transfer information input/output circuit 112, outputs thetransfer information 224 selected by the transferinformation selection circuit 100 to the external peripheral I/O 123, peripheral I/O 122,RAM 125, and the like through theBCU control information 226. -
FIG. 5 illustrates transfer information transferred in the DMA device in the first exemplary embodiment. The transfer information read by the transfer information input/output circuit 112 is composed as one piece of transfer information of transfer information TIA, TIB, TIC equivalent to 3 words. The transfer information TIA contains a number of times of transfer register DBC and control information CI. The transfer information TIB contains a source address register SAR. The transfer information TIC contains a destination address register DAR. - Description will be given to an example of the operation of the thus configured DMA device in the first exemplary embodiment.
FIG. 6 is a flowchart illustrating the operation of the DMA device in the first exemplary embodiment. When a transfer request occurs, thecurrent request number 202 and the request numbers in thefirst buffer 101 and thesecond buffer 102 are compared with each other (S1). - When the
current request number 202 and the request number in thefirst buffer 101 are matched with each other (A), the transfer information stored in thefirst buffer 101 is directly used to carry out DMA transfer (S2). Similarly, when thecurrent request number 202 and the request number in thesecond buffer 102 are matched with each other (B), the transfer information in thesecond buffer 102 is directly used to carry out DMA transfer (S6). - When at step S1 the
current request number 202 is not matched with the request number in thefirst buffer 101 or the second buffer 102 (C), the following processing is carried out: the priority level of the transfer request stored in thesecond buffer 102 and the priority level of the transfer request that has newly occurred are compared with each other (S3). - When at step S3 the priority level of the transfer request stored in the
second buffer 102 is higher than the priority level of the new transfer request (A), the following processing is carried out: transfer information corresponding to the new transfer request is read and stored in thefirst buffer 101 and DMA transfer is carried out based on the transfer information stored in the first buffer 101 (S5). - When at step S3 the priority level of the transfer request stored in the
second buffer 102 is lower than the priority level of the new transfer request (B), the following processing is carried out: transfer information corresponding to the new transfer request is read and stored in thesecond buffer 102 and DMA transfer is carried out based on the transfer information stored in the second buffer 102 (S7). - When at step S3 the priority level in the
second buffer 102 and the priority level of the new transfer request are equal to each other (C), the following processing is carried out: the number of times of DMA transfer of the transfer request held in thesecond buffer 102 and the number of times of DMA transfer in the new transfer information are compared with each other (S4). - When at step S4 the number of times of DMA transfer for one time of transfer request in the transfer request stored in the
second buffer 102 is smaller than the number of times of DMA transfer for one time of transfer request in the new transfer request (A), the following processing is carried out. Specifically, when the transfer request held in thesecond buffer 102 is the transfer request illustrated inFIG. 3 and the new transfer request is the transfer request illustrated inFIG. 4 , it is determined that the priority of the transfer request held in thesecond buffer 102 is higher. Then the transfer information for the new transfer request is stored in thefirst buffer 101 and DMA transfer is carried out by this transfer information (S5). - When at step S4 the number of times of DMA transfer for one time of transfer request held in the
second buffer 102 is larger than the number of times of DMA transfer for one time of transfer request in the new transfer request (B), the following processing is carried out. Specifically, when the transfer request held in thesecond buffer 102 is the transfer request illustrated inFIG. 4 and the new transfer request is the transfer request illustrated inFIG. 3 , it is determined that the priority of the new transfer request is higher. Then the new transfer request is stored in thesecond buffer 102 and DMA transfer is carried out by the transfer information stored in the second buffer 101 (S7). - When the number of times of DMA transfer set for one time of transfer request in the newly inputted transfer request and the number of times of DMA transfer set for one time of transfer request stored in the
second buffer 102 are equal to each other (C), the following processing is carried out: the preset numbers of times of repetition of single transfer or block transfer are compared with each other (S8). Then a higher priority is set for a transfer request larger in the preset number of times of repetition of transfer request transfer. - When at step S8 the number of times of repetition stored in the
second buffer 102 is larger than the number of times of repetition of the new transfer request (A) or they are equal to each other (C), thesecond buffer 102 is not updated and the transfer information for the new transfer request is stored in thefirst buffer 101. Then DMA transfer is carried out using the transfer information stored in the first buffer 101 (S5). - When at step S8 the number of times of repetition stored in the
second buffer 102 is smaller than the number of times of repetition of the new transfer request, thesecond buffer 102 is updated and transfer information for the new transfer request is stored in thesecond buffer 102. Then DMA transfer is carried out using the transfer information stored in thesecond buffer 102. When the numbers of times of DMA transfer for one time of transfer request are equal, as mentioned above, the numbers of times of repetition of transfer request are compared with each other. This makes it possible to hold transfer information involving a larger total number of operations of reading and writing back the transfer information in thesecond buffer 102. - When different request numbers are inputted to the
DMA device 116, as mentioned above, the following processing is carried out: according to the determination of priority, the newly inputted transfer request and the transfer request stored in thesecond buffer 102 are compared with each other with respect to priority level and number of times of transfer information. When the result of the priority determination reveals that the priority in thesecond buffer 102 is higher or they are equal to each other, thefirst buffer 101 is updated. When the priority in thesecond buffer 102 is lower, thesecond buffer 102 is updated. - Description will be given to the DMA transfer operation based on a concrete example. In the following description, it is required to discriminate between cases where the previous transfer request and the transfer request of this time are identical with each other and cases where they are not. In the following description, therefore, two transfer requests, transfer request “1” and transfer request “2” will be taken as an example.
- When transfer request “1” is inputted to the
DMA device 116, therequest number comparator 107 compares thecurrent request number 202 of transfer request “1” with the request numbers stored in thefirst buffer 101 and the second buffer 102 (S1). Since both thefirst buffer 101 and thesecond buffer 102 are empty at this time, the comparison result is disagreement. Since the comparison result is disagreement, therequest number comparator 107 outputs the transfer information read request 210 to the transfer information input/output circuit 112. It thereby causes the transfer information input/output circuit 112 to read transfer information for transfer request “1.” - As the result of the transfer information read request 210 being inputted, the transfer information input/
output circuit 112 reads transfer information TIA corresponding to the newly inputted transfer request from theRAM 125. - When the reading of transfer information TIA is completed, the
priority control circuit 105 determines the priorities of transfer request “1” and the transfer request stored in the second buffer 102 (S3). This priority determination is carried out in two stages. First, thecurrent priority level 203 of the inputted transfer request and the priority level stored in thesecond buffer 102 are compared with each other by the prioritylevel comparison circuit 110. When their priority levels are equal to each other, the prioritylevel comparison circuit 110 outputs the number of times oftransfer comparison request 218 to the number of times oftransfer comparison circuit 111. - When the number of times transfer
comparison circuit 111 receives the number of times oftransfer comparison request 218, thecircuit 111 compares the number of times oftransfer information 216 read through the transfer information input/output circuit 112 and the number of times oftransfer information 217 stored in thesecond buffer 102. Then it determines the transfer request smaller in the number of times of DMA transfer for one time of transfer request to have a higher priority. As mentioned above, the priorities are determined in two stages. When thesecond buffer 102 is empty, thecircuit 111 determines that the priority of thecurrent priority level 203 is higher. - The
priority control circuit 105 compares the priority of transfer request “1” with that in thesecond buffer 102 by the above determination method (S4). Since thesecond buffer 102 is empty, thepriority control circuit 105 determines transfer request “1” is higher in priority than the transfer request stored in the second buffer and selects thesecond buffer 102 by thebuffer selection signal 212. Thepriority control circuit 105 outputs thetransfer information 221 and thereby places the already read transfer information TIA in the number of times of transfer register DBC and the control information CI in thesecond buffer 102. - Subsequently, transfer information TIB is read through the transfer information input/
output circuit 112 and is placed in the source address register SAR in thesecond buffer 102 by thetransfer information 221. Subsequently, transfer information TIC is read through the transfer information input/output circuit 112 and is placed in the destination address register DAR in thesecond buffer 102 by thetransfer information 221. - The transfer
information selection circuit 100 selects thetransfer information 223 from thesecond buffer 102 based on thebuffer selection signal 212 outputted from thedetermination circuit 113. The transferinformation selection circuit 100 outputs transfer information stored in the selectedsecond buffer 102 as thetransfer information 224 to the DMAtransfer control circuit 114. As a result, DMA transfer is carried out by the DMAtransfer control circuit 114 based on the transfer information stored in the second buffer 102 (S5). In this case, the transfer information read to thesecond buffer 102 is not written back. - When transfer request “1” is inputted to the
DMA device 116 again, therequest number comparator 107 compares the request number of the inputted transfer request “1” with the request numbers stored in thefirst buffer 101 and the second buffer 102 (S1). In this case, the request number of the newly inputted transfer request “1” is the same as the request number previously stored in thesecond buffer 102. Therefore, therequest number comparator 107 outputs thebuffer selection signal 201 to the transferinformation selection circuit 100 so as to select thesecond buffer 102. When the newly inputted transfer request “1” is already stored in thefirst buffer 101 or thesecond buffer 102, as mentioned above, transfer information stored in thefirst buffer 101 or thesecond buffer 102 is not updated. - The transfer
information selection circuit 100 selects thetransfer information 223 stored in thesecond buffer 102 by thebuffer selection signal 201 inputted by therequest number comparator 107, and outputs thistransfer information 223 as thetransfer information 224 to the DMAtransfer control circuit 114. The DMAtransfer control circuit 114 carries out DMA transfer for transfer request “1” based on thetransfer information 224 inputted from the transferinformation selection circuit 100 according to thetransfer request signal 215 inputted from the request number comparator 107 (S6). - When transfer request “2” different in request number from transfer request “1” is inputted to the
DMA device 116, therequest number comparator 107 compares the following request numbers (S1): thecurrent request number 202 of the inputted transfer request “2” with the request numbers stored in thefirst buffer 101 and thesecond buffer 102. In this case, thefirst buffer 101 is empty and the second buffer has the request number of transfer request “1” stored therein. Since the request number of the newly inputted transfer request “2” is not matched with the request number stored in thefirst buffer 101 or thesecond buffer 102, therequest number comparator 107 outputs the transfer information read request 210 to the transfer information input/output circuit 112 to cause the transfer information input/output circuit 112 to read transfer information corresponding to transfer request “2.” - The transfer information input/
output circuit 112 reads transfer information TIA from theRAM 125 when thecircuit 112 receives the transfer information read request 210 from therequest number comparator 107. When the reading of transfer information TIA is completed, thepriority control circuit 105 compares the priority of transfer request “1” in thesecond buffer 102 with the priority of the newly inputted transfer request “2” (S3). First, as mentioned above, the priority levels are compared and when the priority levels are identical, the priorities are determined by comparing the numbers of times of DMA transfer for one time of transfer request. - When the result of this priority comparison reveals that the priority in the
second buffer 102 is higher, thedetermination circuit 113 outputs thebuffer selection signal 212 to thefirst buffer 101,second buffer 102, and transferinformation selection circuit 100 so as to select thefirst buffer 101. As a result, thefirst buffer 101 is selected. The transfer information input/output circuit 112 places the already read transfer information TIA as thetransfer information 221 in the number of times of transfer register DBC and the control information CI in thefirst buffer 101. - Subsequently, the transfer information input/
output circuit 112 reads transfer information TIB and places it in the source address register SAR in thefirst buffer 101 by thetransfer information 221. The transfer information input/output circuit 112 reads transfer information TIC and places it in the destination address register DAR in thefirst buffer 101 by thetransfer information 221. - The transfer
information selection circuit 100 selects thetransfer information 222 placed in thefirst buffer 101 according to thebuffer selection signal 212 inputted from thedetermination circuit 113. The DMAtransfer control circuit 114 carries out DMA transfer based on the transfer information in thefirst buffer 101, inputted as thetransfer information 224, according to the transfer request signal 214 (S5). In this case, the transfer information stored in thefirst buffer 101 is written back. - When the results (S3, S4) of determination by the
determination circuit 113 reveal that the priority in thesecond buffer 102 is lower, thesecond buffer 102 is selected according to thebuffer selection signal 212. In thesecond buffer 102, the transfer information for transfer request “1” has been already placed. To save the already placed transfer information, the information in thesecond buffer 102 is once written back and the already read transfer information TIA is placed in the number of times of transfer register DBC and the control information CI in thesecond buffer 102 according to thetransfer information 221. - Subsequently, the transfer information input/
output circuit 112 reads transfer information TIB and places the information in the source address register SAR in thesecond buffer 102 by thetransfer information 221. Subsequently, the transfer information input/output circuit 112 reads transfer information TIC and places the information in the destination address register DAR in thesecond buffer 102 by thetransfer information 221. Based on thebuffer selection signal 212 inputted from thepriority control circuit 105, the transferinformation selection circuit 100 selects thetransfer information 223 stored in thesecond buffer 102, and outputs the information as thetransfer information 224 to the DMAtransfer control circuit 114. The DMAtransfer control circuit 114 carries out DMA transfer based on the inputted transfer information 223 (S7). - When a transfer request different in request number occurs, as mentioned above, the priority of the transfer request that has newly occurred and the priority of the transfer request stored in the
second buffer 102 are compared with each other. When the priority of the transfer request is higher, it is stored in thesecond buffer 102. Thus a transfer request having a higher priority is continuously placed in thesecond buffer 102. - As a result, the following can be implemented by setting a higher priority level for, for example, transfer information higher in transfer frequency: this transfer information is held in the
second buffer 102 and it is possible to reduce overhead that is otherwise produced by writing-back when this transfer request occurs. This makes it possible to achieve the enhancement of DMA transfer processing speed. - Even when the priority levels are identical, the following is implemented by giving a higher priority to a transfer request smaller in the number of times of DMA transfer for one time of transfer request: transfer information for a transfer request smaller in the number of times of DMA transfer for one time of transfer request as in single transfer is held in the
second buffer 102. As a result, writing-back operation can be reduced to reduce overhead. - In the first exemplary embodiment, only one
second buffer 102 holding transfer information for a transfer request having a higher priority is provided. However, the invention is not limited to this and may be so configured that multiplesecond buffers 102 are provided. Though this increases the scale of circuitry, a large number of pieces of transfer information can be held and thus the operations of reading and writing back transfer information can be reduced. -
FIG. 7 is a block diagram illustrating an example of the configuration of a DMA device in a second exemplary embodiment of the invention. The second exemplary embodiment is characterized in that thepriority control circuit 105 in the first exemplary embodiment is replaced with apriority control circuit 105 with enable. The transfer information input/output circuit 112 in the first exemplary embodiment is modified so that it outputs a hold enablesignal 219 to thepriority control circuit 105 with enable. The hold enablesignal 219 is a signal that prevents the use of thesecond buffer 102 and provides an instruction to continuously use thefirst buffer 101 regardless of determination by thedetermination circuit 113. - When it inputs transfer information, the transfer information input/
output circuit 112 outputs HEN as the hold enablesignal 219. This hold enablesignal 219 is inputted to thedetermination circuit 113. When the inputted transfer information contains the hold enablesignal 219, thedetermination circuit 113 outputs thebuffer selection signal 212 so as to continuously select thefirst buffer 101 regardless of determination by thedetermination circuit 113. - As illustrated in
FIG. 8 , the hold enablesignal 219 is provided as HEN as an enable bit in the control information CI in the transfer information. The position of the hold enablesignal 219 is not limited to that in the transfer information illustrated inFIG. 8 and it can be provided in any position. - In case of block transfer (
FIG. 4 ) in which the number of times of DMA transfer is large for one time of transfer request, the following takes place: the same operation as in the state in which single transfer (FIG. 3 ) is continuously held in thesecond buffer 102 is performed even though thefirst buffer 101 is used. In this case, if a higher priority is set for DMA transfer in which the operations of reading and writing back transfer information are smaller in number as in block transfer, then the following takes place: this transfer information is continuously held in thesecond buffer 102. Therefore, a transfer request involving a large number of the operations of reading and writing back transfer information as in single transfer is not held in thesecond buffer 102 and thesecond buffer 102 cannot be effectively used. - To cope with this, the following measure is taken in the DMA device in the second exemplary embodiment: when there is such a special transfer request that the number of times of DMA transfer is large (the intervals between requests are long) for one time of transfer request as in block transfer illustrated in
FIG. 4 , the following processing is carried out: the use of thesecond buffer 102 is prevented by the hold enablesignal 219. This makes it possible for other transfer requests involving the frequent reading and writing-back of transfer information as in single transfer to continuously use thesecond buffer 102. Thus it is possible to effectively reduce overhead arising from the reading and writing-back of transfer information. - The invention is not limited to the above-mentioned exemplary embodiments and can be variously modified without departing from the subject matter of the invention, needless to add.
- Further, it is noted that Applicant's intent is to encompass equivalents of all claim elements, even if amended later during prosecution.
Claims (16)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2008229600A JP5108690B2 (en) | 2008-09-08 | 2008-09-08 | DMA apparatus and DMA transfer method |
| JP2008-229600 | 2008-09-08 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| US20100064071A1 true US20100064071A1 (en) | 2010-03-11 |
| US8065449B2 US8065449B2 (en) | 2011-11-22 |
Family
ID=41800135
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US12/461,432 Expired - Fee Related US8065449B2 (en) | 2008-09-08 | 2009-08-11 | DMA device having plural buffers storing transfer request information and DMA transfer method |
Country Status (2)
| Country | Link |
|---|---|
| US (1) | US8065449B2 (en) |
| JP (1) | JP5108690B2 (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8521921B1 (en) * | 2009-05-22 | 2013-08-27 | Marvell International Ltd. | Automatic direct memory access (DMA) |
| US20140047058A1 (en) * | 2012-08-09 | 2014-02-13 | Spectra Logic Corporation | Direct memory access of remote data |
| US20150304416A1 (en) * | 2014-04-17 | 2015-10-22 | Haruomi HIGASHI | Information processing apparatus, information processing system, and communication control method |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8949500B2 (en) * | 2011-08-08 | 2015-02-03 | Lsi Corporation | Non-blocking processor bus bridge for network processors or the like |
| US9461930B2 (en) | 2009-04-27 | 2016-10-04 | Intel Corporation | Modifying data streams without reordering in a multi-thread, multi-flow network processor |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6557052B1 (en) * | 1999-06-07 | 2003-04-29 | Matsushita Electric Industrial Co., Ltd. | DMA transfer device |
| US20060080478A1 (en) * | 2004-10-11 | 2006-04-13 | Franck Seigneret | Multi-threaded DMA |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0962610A (en) * | 1995-08-22 | 1997-03-07 | Mitsubishi Electric Corp | DMA controller |
| JP2000099452A (en) * | 1998-09-21 | 2000-04-07 | Seiko Epson Corp | DMA controller |
| JP2002207691A (en) * | 2001-01-11 | 2002-07-26 | Matsushita Electric Ind Co Ltd | Data transfer control device |
| JP2003256356A (en) * | 2002-03-04 | 2003-09-12 | Toshiba Corp | DMA controller |
| JP2003271542A (en) * | 2002-03-18 | 2003-09-26 | Fujitsu Ltd | Direct access controller |
| JP2004118300A (en) * | 2002-09-24 | 2004-04-15 | Rohm Co Ltd | Dma controller |
| JP4855864B2 (en) * | 2006-08-11 | 2012-01-18 | 富士通セミコンダクター株式会社 | Direct memory access controller |
-
2008
- 2008-09-08 JP JP2008229600A patent/JP5108690B2/en not_active Expired - Fee Related
-
2009
- 2009-08-11 US US12/461,432 patent/US8065449B2/en not_active Expired - Fee Related
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6557052B1 (en) * | 1999-06-07 | 2003-04-29 | Matsushita Electric Industrial Co., Ltd. | DMA transfer device |
| US20060080478A1 (en) * | 2004-10-11 | 2006-04-13 | Franck Seigneret | Multi-threaded DMA |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8521921B1 (en) * | 2009-05-22 | 2013-08-27 | Marvell International Ltd. | Automatic direct memory access (DMA) |
| US9032112B1 (en) * | 2009-05-22 | 2015-05-12 | Marvell International Ltd. | Automatic direct memory access (DMA) |
| US20140047058A1 (en) * | 2012-08-09 | 2014-02-13 | Spectra Logic Corporation | Direct memory access of remote data |
| US9645738B2 (en) * | 2012-08-09 | 2017-05-09 | Spectra Logic Corporation | Direct memory access of remote data |
| US20150304416A1 (en) * | 2014-04-17 | 2015-10-22 | Haruomi HIGASHI | Information processing apparatus, information processing system, and communication control method |
| US10142413B2 (en) * | 2014-04-17 | 2018-11-27 | Ricoh Company, Ltd. | Information processing apparatus, information processing system, and communication control method |
Also Published As
| Publication number | Publication date |
|---|---|
| US8065449B2 (en) | 2011-11-22 |
| JP2010061620A (en) | 2010-03-18 |
| JP5108690B2 (en) | 2012-12-26 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| TWI399645B (en) | Memory device and method for managing data read from a memory | |
| US8195845B2 (en) | Memory system having high data transfer efficiency and host controller | |
| US8365031B2 (en) | Soft error correction method, memory control apparatus and memory system | |
| US9563565B2 (en) | Apparatuses and methods for providing data from a buffer | |
| US8065449B2 (en) | DMA device having plural buffers storing transfer request information and DMA transfer method | |
| US20130036426A1 (en) | Information processing device and task switching method | |
| KR20030040021A (en) | Microcomputer | |
| US9081657B2 (en) | Apparatus and method for abstract memory addressing | |
| US9256556B2 (en) | RAM memory device capable of simultaneously accepting multiple accesses | |
| US20150278037A1 (en) | Transfer device, determination method, and data processing device | |
| JP2008009721A (en) | Evaluation system and evaluation method thereof | |
| US7185122B2 (en) | Device and method for controlling data transfer | |
| US11886290B2 (en) | Information processing apparatus and information processing method for error correction and read modify write processing | |
| US7596036B2 (en) | Memory control circuit, microcomputer, and data rewriting method | |
| US7761280B2 (en) | Data processing apparatus simulation by generating anticipated timing information for bus data transfers | |
| US20120210108A1 (en) | Semiconductor device | |
| CN109147847B (en) | Semiconductor device and flash memory control method | |
| US20230335198A1 (en) | Semiconductor device | |
| US8452920B1 (en) | System and method for controlling a dynamic random access memory | |
| JP2007066118A (en) | Memory controller, flash memory system, and flash memory control method | |
| JP3767521B2 (en) | Cache fill control method and CPU | |
| US10120819B2 (en) | System and method for cache memory line fill using interrupt indication | |
| US20100153610A1 (en) | Bus arbiter and bus system | |
| US11681527B2 (en) | Electronic device and multiplexing method of spatial | |
| US11650738B2 (en) | Integrity check of a memory |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| AS | Assignment |
Owner name: NEC ELECTRONICS CORPORATION,JAPAN Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:SHIMOKAWA, HIROKI;REEL/FRAME:023123/0903 Effective date: 20090731 Owner name: NEC ELECTRONICS CORPORATION, JAPAN Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:SHIMOKAWA, HIROKI;REEL/FRAME:023123/0903 Effective date: 20090731 |
|
| AS | Assignment |
Owner name: RENESAS ELECTRONICS CORPORATION, JAPAN Free format text: CHANGE OF NAME;ASSIGNOR:NEC ELECTRONICS CORPORATION;REEL/FRAME:025193/0165 Effective date: 20100401 |
|
| STCF | Information on status: patent grant |
Free format text: PATENTED CASE |
|
| FEPP | Fee payment procedure |
Free format text: PAYOR NUMBER ASSIGNED (ORIGINAL EVENT CODE: ASPN); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY |
|
| FPAY | Fee payment |
Year of fee payment: 4 |
|
| AS | Assignment |
Owner name: RENESAS ELECTRONICS CORPORATION, JAPAN Free format text: CHANGE OF ADDRESS;ASSIGNOR:RENESAS ELECTRONICS CORPORATION;REEL/FRAME:044928/0001 Effective date: 20150806 |
|
| FEPP | Fee payment procedure |
Free format text: MAINTENANCE FEE REMINDER MAILED (ORIGINAL EVENT CODE: REM.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY |
|
| LAPS | Lapse for failure to pay maintenance fees |
Free format text: PATENT EXPIRED FOR FAILURE TO PAY MAINTENANCE FEES (ORIGINAL EVENT CODE: EXP.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY |
|
| STCH | Information on status: patent discontinuation |
Free format text: PATENT EXPIRED DUE TO NONPAYMENT OF MAINTENANCE FEES UNDER 37 CFR 1.362 |
|
| FP | Lapsed due to failure to pay maintenance fee |
Effective date: 20191122 |