Summary of the invention
The present invention is directed to system power dissipation and the unbalanced problem of laser propagation effect that prior art exists, propose a kind of transmitting device and method of direct memory access (DMA) on the basis of existing technology.
A kind of transmitting device of direct memory access (DMA), this device comprises: the DMA control module, source end memory module, the destination memory module, deposit task module, first clock, second clock and the 3rd clock, first clock links to each other with the DMA control module, second clock and the 3rd clock insert source end memory module and destination memory module respectively, source end memory module, the destination memory module, depositing task module links to each other with the DMA control module respectively, depositing task module links to each other with CPU again
The DMA control module comprises the time-controllable module, two dimension task control module and fifo module, time-controllable module and two-dimentional task control module are carried out the configuration of time and task and are deposited first task in two-dimentional task control module by CPU, the time-controllable module is carried out the first time by CPU and is triggered, the two dimension task control module is transferred to destination memory module with target image from source end memory module according to the trigger pip control fifo module of time-controllable module, and the time-controllable module is controlled two-dimentional task control module according to the feedback information of fifo module and get task from deposited task module.
Described time-controllable module comprises time control module and time transmission control module, and time control module is controlled by CPU directly, and two-dimentional control module is controlled in time transmission control module time of reception control module order.
Described two-dimentional task control module comprises two-dimentional task register, two dimension task transmission control module and get task module, the two dimension task register is controlled by CPU directly, time transmission control module time of reception control module order, control two-dimentional task transmission control module and from two-dimentional task register, read task definition, and according to the feedback information of two-dimentional task transmission control module control is got task module and is read new task and write two-dimentional task register from depositing task module, two-dimentional task transmission control module control fifo module carries out the task transmission and with transmitting state information feedback time transmission control module and get task module respectively.
Described time-controllable module is subjected to CPU control rise time dimension, and definite dma operation trigger point is arranged on the described time dimension, and the time-controllable module preferentially disposes the transformation task on each operation trigger point.
Described configuration to two-dimentional task control module comprises the configuration to the start address of the image of transmission sources end and destination in the transformation task, size, width and height.
Described transmitting device can adopt link DMA transmission mode.
Described method comprises the steps:
Step 1, determine each dma operation trigger point on the time dimension;
Step 2, determine two-dimentional transformation task and being configured on each operation trigger point;
Step 3, dispose the priority orders of two-dimentional transformation task on each operation trigger point;
Step 4, all task configurations finish, and trigger first operation trigger point and begin the DMA data transmission.
Described step 2 also comprises the steps:
The start address of image in a, the source of configuration end memory module;
The width of image, height and row address are at interval in b, the source of configuration end memory module;
The starting point coordinate of c, configuration image to be transmitted, width and height;
The start address of image in d, the configuration purpose end memory module;
The width of image, height and row address are at interval in e, the configuration purpose end memory module;
The starting point coordinate of f, configuration image to be transmitted, width and height.
The operation trigger point can be the single cycle point in the described step 1.
The operation trigger point can be repeatedly to circulate a little in the described step 1.
The operation trigger point can be indefinite time point in the described step 1.
Described step also is included in the storage address of next transformation task of configuration in each link DMA transformation task, and at the transformation task configuration-direct of the storing step a of this place, address to step f.
The present invention is directed to the data transmission of portable mobile wireless or limited equipment, on the basis of existing common DMA transmission technology, increased time dimension, the two-dimensional graphical image data have been realized on time dimension, transmitting at regular time and quantity, this data transmission method, CPU carries out the initial configuration end to the DMA transmitting device after, the DMA transmitting device is the detachment system independent operating completely, so just can realize alap system power dissipation, this transmission mode also can be set the transmission priority of each task in advance; DMA transmitting device of the present invention has adopted the independently structure of clock zone of each several part, also can realize lower system power dissipation.DMA transmitting device of the present invention and method can better meet the requirement of portable class consumption electronic product when carrying out image data transmission, and have obviously reduced the use power consumption of system.
Embodiment
Below in conjunction with description of drawings the specific embodiment of the present invention is described in detail.
Embodiment 1
The structure of the transmitting device embodiment 1 of direct memory access (DMA) of the present invention comprises three-dimensional DMA control module 100, first data terminal 104, second data terminal 105, deposits task module 109, first clock 106, second clock 107 and the 3rd clock 108 as shown in Figure 1.
Three-dimensional DMA of the present invention is meant on the basis of described two-dimentional DMA in the prior art and adds a time dimension that all three-dimensional DMA of the present invention all do this explanation.
Wherein three-dimensional DMA control module 100 comprises: time control module 101, time transmission control module 102, first fifo module 103, two-dimentional task transmission control module 111, two-dimentional task register 110 and get task module 112.
Time control module 101 is used for being configured respectively operating trigger point priority on time dimension and the time dimension;
Time transmission control module 102 is used for the task transmission of respectively operating the trigger point on the time dimension is controlled;
The data such as height, width, origin coordinates point that two dimension task register 110 is used for the images task are configured and deposit first transformation task;
Two dimension task transmission control module 111 is used to control the transmission process of first fifo module 103 and the information of feedback transmission state;
Getting task module 112 is used for reading task and reading of task being write as two-dimentional task register 110 from depositing task module 109;
First fifo module 103 is used to connect first data terminal 104 and second data terminal 105 is carried out the task data transmission.
The output terminal of depositing task module 109 with get task module 112 and link to each other, its input end links to each other with CPU300, CPU300 deposits other all tasks inputs except that first transformation task in the task module 109.
Three-dimensional DMA control module 100 outside first clocks 106 that insert.
First data terminal 104 is connected first data terminal, 104 external second clock 107, the second data terminals 105 external the 3rd clocks 108 with second data terminal 105, first fifo module 103 direct respectively and in the three-dimensional DMA control module 100.
Present embodiment is an example with the ordinary two dimensional DMA of single-point single task, below in conjunction with Fig. 1 the concrete principle of work of the DMA transmitting device of embodiment 1 of the present invention is described:
Central processor CPU 300 links to each other with other peripheral hardware parts 303, other peripheral hardware parts 303 are furnished with independently the 4th clock 304, respectively time control module 101 and two-dimentional task register 110 in the three-dimensional DMA control module 100 are configured by second fifo module 301 by central processor CPU 300, and first transformation task is stored in the two-dimentional task register 110; Central processor CPU 300 directly will other all tasks except that first transformation task deposits in to be deposited in the task module 109.
Time dimension in the time control module 101 is configured, determined the operation trigger point of each DMA transformation task on the time dimension, operate the three kinds of patterns that dispose of trigger point, as shown in Figure 2, described operation trigger point can be the single cycle point, also can be repeatedly to circulate a little, or indefinite time point.
Need dispose a counter for the mode of single cycle point and carry out cycle count, send a pulse signal after each counting finishes, trigger the startup operation of 100 pairs of DMA transmitting devices of three-dimensional DMA control module;
The mode of putting for repeatedly circulating need dispose a state machine and circulate, and triggers 100 pairs of DMA transmitting devices of three-dimensional DMA control module in each cycle of states cycle the inside and carries out the startup operation several times;
Mode for indefinite time point, then need to dispose a storer and a counter, time interval numerical value to each operation trigger point is stored successively, counter finishes in triggering for the first time and carries out just reading second numerical value after the DMA transformation task operation, unison counter begins counting, carry out the second time and trigger when count value equals second numerical value, the rest may be inferred.But this mode has certain restriction, and it is limited by resting period memory size at interval, and the extension on time shaft can not exceed certain-length.
Transformation task on each operation trigger point is carried out the priority setting, if the task priority height on the current operation trigger point, and this when arriving, previous task is not finished as yet task start time, just cancel the task of previous operation trigger point, start new transmission; Otherwise, just continue previous task, all want register of specific assigned to come configuration task priority for the task of each dma operation trigger point.
Two-dimentional transformation task image in the two-dimentional task register 110 is configured, comprises configuration the transmission objectives graph image of transmission sources end and destination end, and the configuration of transmission objectives graph image size, it specifically is divided into following step:
The start address of a, source of configuration end image: disposing first data terminal, 104 interior image start addresses is 32 ' h1000_0000;
The width of b, source of configuration end image and height, interval, configuration line address: disposing the first data terminal picture traverse is 32, is 32 highly, and row address is spaced apart 64, then the first address of image second row is exactly 32 ' h1000_0040;
C, configuration image to be transmitted are at the starting point coordinate of source end, width and height: shown in Fig. 3 a, the starting point coordinate that disposes image to be passed is (2,3), width 3, height 4, by the numerical value that first two steps have been configured, the start address that can calculate this image to be passed is 32 ' h1000_0000+3*64+2;
The start address of d, configuration purpose end image: disposing second data terminal, 105 interior image start addresses is 32 ' h1000_0000;
The width of e, configuration purpose end image and height, and row address is at interval: shown in Fig. 3 b, the width of destination image is different with source end image, disposes second data terminal, 105 picture traverses 20, height 32, and row address is spaced apart 64;
F, configuration image to be transmitted are at the starting point coordinate of destination, and width and height: as shown in Figure 3, the starting point coordinate that disposes image to be transmitted is (1,1), width 3, height 4.
All to before transmission, carry out the configuration of above step a-f for each transformation task that is written into two-dimentional task register 110 according to mission requirements.
After all tasks configure in the three-dimensional DMA control module 100, just but independent operating DMA transmitting device carries out task and has transmitted, the DMA transmitting device triggers time control module 101 in the three-dimensional DMA control module 100 by CPU300, time transmission control module 102 starts two-dimentional task transmission control module 111 according to the order of time control module 101, two dimension task transmission control module 111 is read first transformation task from two-dimentional task register 110, and control first fifo module 103 the targeted graphical image is input to second data terminal 105 by first data terminal 104 by first fifo module 103, perhaps transformation task is input to first data terminal 104 by second data terminal 105 with the targeted graphical image by first fifo module 103.
Behind first task end of transmission, first fifo module 103 arrives two-dimentional task transmission control module 111 with this information feedback, two dimension task transmission control module 111 is got task module 112 transmission tasks to time transmission control module 102 respectively and is finished information, get task module 112 by 102 controls of time transmission control module and from deposit task module 109, read second task, second task write carry out two dimensional image configuration in the two-dimentional task register 110 by getting task module 112 then, and wait for that second operation trigger point is triggered; When second operation after the trigger point is triggered, carry out task by the two-dimentional task transmission control module 111 of time transmission control module 102 controls and transmit its detailed process process is identical as described above.
If when the priority of the 3rd operation trigger point is higher than second operation trigger point, second task as yet not during end of transmission the 3rd operation trigger point be triggered, then stop current task transmission, begin the transmission of the 3rd task.
If when the task of second operation trigger point is not finished as yet, and the 3rd operation trigger point has been triggered, and the priority of second operation trigger point is higher than the 3rd operation trigger point again, then triggers to invalid.
Behind all task end of transmissions, by time control module 101 and two-dimentional task register 110 respectively to CPU300 transmitting time dimension process finishes and two-dimentional task disposes feedback signal.
Finish after the configuration of control being deposited module 102 and depositing task module 109 at CPU300 and on the triggered time dimension behind first operation trigger point, the DMA transmitting device begins to work alone other peripheral hardware parts 303 and CPU300 had been closed interior, as long as guarantee DMA transmitting device inner first data terminal 104, second data terminal 105, deposit task module 109 and three-dimensional DMA control module 100 is not closed, the DMA transmitting device just can independently be finished transformation task automatically on time dimension.
Have three independent clocks in the whole DMA transmission system, be respectively first clock 106, second clock 107 and the 3rd clock 108, these three clocks can be homology also can be asynchronous.
Embodiment 2
The described DMA transmitting device of present embodiment is based on link DMA, and its characteristics are to comprise a plurality of tasks under single time point, and the structure of described DMA transmitting device concrete structure and embodiment 1 described DMA transmitting device is basic identical.The characteristics of link DMA exist for have n task on an operation trigger point, and another characteristics were for both to have comprised the memory address that task definition also comprises next task bag in each task bag.
The principle of work of the described DMA transmitting device of present embodiment and embodiment 1 described principle of work are basic identical:
Be configured by 301 pairs of DMA transmitting devices of second fifo module by central processor CPU 300, promptly respectively time control module 101 in the three-dimensional DMA control module 100 and two-dimentional task register 110 be configured.
Wherein, configuration and embodiment 1 to time control module 101 and two-dimentional task register 110 are described about time dimension, the configuration of two dimension transformation task image is basic identical, and with first the operation trigger point first task deposit two-dimentional task register 110 in, and the storage address of configuration link DMA transformation task, and the step a that has deposited two-dimentional task configuration at this place, address arrives the transfer instruction of step f, after current transformation task is finished, two dimension task register 110 is got task module 110 with the link address input automatically, goes out next task according to link address to this place, address by getting task module 110.Central processor CPU 300 will be on first operation trigger point all need transmitting of the tasks first task be stored in and deposit in the task module 109.
Trigger first operation trigger point by CPU300 then, the DMA transmitting device begins the task transmission, difference from Example 1 is after first task on first operation trigger point is finished, two dimension task transmission control module 111 sends the task end-of-transmission information to getting task module 112, after getting task module 112 and receiving task and finish signal, from deposit task module 109, read second task of first operation on trigger point according to the address of leaving next task in the last task in, and deposit two-dimentional task register 110 in and be configured, read task definition and control first fifo module 103 and carry out task transmission by two-dimentional task transmission control module 111, after all the task end of transmission (EOT) on first operation trigger point, two dimension task transmission control module 111 sends task end of transmission signal to time transmission control module 102, send order by time transmission control module 102 to getting task module 112, get task module 112 and from deposit task module 109, read second first task on the operation trigger point, begin to carry out the task transmission, by that analogy after second all task of operation trigger point finished, wait for that next operation trigger point is triggered, and begins the task of next operation trigger point again.
If when the priority of the 3rd operation trigger point is higher than second operation trigger point, when second the multi-task of operating in the trigger point also finishes, begin to carry out the task of the 3rd operation trigger point earlier, abandon ongoing second still uncompleted task in operation trigger point.There is not priority orders between the each task in the same operation trigger point.
Finish time control module 101, two-dimentional task register 110 and other peripheral hardware parts 303 and CPU300 had all been closed interior at CPU300, as long as guarantee DMA transmitting device inner first data terminal 104, second data terminal 105, deposit task module 109 and three-dimensional DMA control module 100 is not closed, the DMA transmitting device just can independently be finished transformation task automatically on time dimension.
Above content be in conjunction with concrete preferred implementation to further describing that the present invention does, can not assert that concrete enforcement of the present invention is confined to these explanations.For the general technical staff of the technical field of the invention, without departing from the inventive concept of the premise, can also make some simple deduction or replace, all should be considered as belonging to protection scope of the present invention.