WO2021179218A1 - Direct memory access unit, processor, device, processing method, and storage medium - Google Patents

Direct memory access unit, processor, device, processing method, and storage medium Download PDF

Info

Publication number
WO2021179218A1
WO2021179218A1 PCT/CN2020/078852 CN2020078852W WO2021179218A1 WO 2021179218 A1 WO2021179218 A1 WO 2021179218A1 CN 2020078852 W CN2020078852 W CN 2020078852W WO 2021179218 A1 WO2021179218 A1 WO 2021179218A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
memory access
direct memory
data
tasks
Prior art date
Application number
PCT/CN2020/078852
Other languages
French (fr)
Chinese (zh)
Inventor
任子木
韩彬
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2020/078852 priority Critical patent/WO2021179218A1/en
Priority to CN202080005135.0A priority patent/CN112823343A/en
Publication of WO2021179218A1 publication Critical patent/WO2021179218A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • G06F13/282Cycle stealing DMA

Definitions

  • This application relates to the field of communication technology, and in particular to a direct memory access unit, a processor, a device, a processing method, and a storage medium.
  • DSP Digital Signal Processing
  • DMA Direct Memory Access
  • DDR Double Data Rate
  • DSP Digital Signal Processing
  • DSP uses A single-threaded approach or a queue approach to manage the execution of these different types of multiple direct memory access tasks is inefficient.
  • the present application provides a direct memory access unit, a processor, a device, a processing method, and a storage medium to improve the execution efficiency of the direct memory access task.
  • this application provides a direct memory access unit, including at least one data path and a direct memory access unit controller;
  • the at least one data path is used to transmit data of direct memory access tasks, wherein the at least one data path correspondingly transmits data of different types of direct memory access tasks;
  • the direct memory access control unit controller includes a task management module connected to the at least one data path and a reduced instruction set processor located outside the direct memory access unit; wherein,
  • the task management module obtains at least one task description parameter information corresponding to data of a plurality of direct memory access tasks from the reduced instruction set processor to determine at least one task description parameter information currently to be executed according to the at least one task description parameter information Direct memory access tasks.
  • the present application also provides a digital signal processor, the digital signal processor including a reduced instruction set processor and the direct memory access unit as described above.
  • this application also provides a direct memory access task processing device, the direct memory access task processing device including the above-mentioned digital signal processor.
  • this application also provides a method for processing multiple direct memory access tasks, which is applied to the above-mentioned direct memory access unit, including:
  • At least one direct memory access task currently to be executed is determined.
  • the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor realizes the multiple direct commands described above. Memory access task processing method.
  • the direct memory access unit, digital signal processor, direct memory access task processing equipment, multiple direct memory access task processing methods, and computer-readable storage medium disclosed in the present application improve the execution efficiency of direct memory access tasks.
  • Figure 1 is a schematic diagram of the data interaction process of the digital signal processor
  • Figure 2 is a schematic diagram of a data transfer channel in direct memory access
  • Fig. 3 is a schematic block diagram of a digital signal processor according to an embodiment of the present application.
  • FIGS. 4a and 4b are schematic diagrams of task description parameter information provided by an embodiment of the present application.
  • FIG. 5 is a schematic block diagram of a direct memory access unit interaction provided by an embodiment of the present application.
  • 6a, 6b, and 6c are schematic diagrams of execution of direct memory access tasks provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of a virtual queue provided by an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a virtual queue provided by an embodiment of the present application.
  • FIG. 9 is a schematic diagram of state marking information provided by an embodiment of the present application.
  • FIG. 10 is a schematic flowchart of steps of a method for processing multiple direct memory access tasks provided by an embodiment of the present application
  • FIG. 11 is a schematic block diagram of a direct memory access unit provided by an embodiment of the present application.
  • DMA Direct Memory Access
  • DSP Digital Signal Processing
  • DMA is used to implement the Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate) external to the DSP.
  • DDR Double Data Rate Synchronous Dynamic Random Access Memory
  • BLK_MEM DSP internal cache
  • the data interaction process of the DSP the data of the direct memory access task is stored on the DDR, and the data is moved through DMA, moved to the DSP internal buffer BLK_MEM inside the DSP, and then loaded through the storage unit (load store unit, hereinafter referred to as LSU) completes the loading of data from the DSP internal cache BLK_MEM to the vector process unit (hereinafter referred to as VPU), processes the data through the VPU, and after the data processing is completed, writes the result through the LSU In the DSP internal buffer BLK_MEM, the data in the DSP internal buffer BLK_MEM is finally written out to the DDR through DMA.
  • LSU load store unit
  • read/write nd These two channels perform the transfer of data with a large amount of data (mass data), nd can be divided into 1d/2d/3d, 1d corresponds to one-dimensional linear data, 2d corresponds to two-dimensional planar data, and 3d corresponds to three-dimensional Block data is generally moved from the DDR external to the DSP to the BLK MEM.
  • these two channels are used to perform the movement of data with a small amount of data (for example, immediate data).
  • the immediate data is generally stored in the data buffer inside the DSP, and the reduced instruction set processor (Reduced Instruction Set Computer (RISC) can directly and quickly access the data buffer.
  • RISC Reduced Instruction Set Computer
  • DSP uses A single-threaded approach or a queue approach to manage the execution of these different types of multiple direct memory access tasks is inefficient.
  • the embodiments of the present application provide a direct memory access unit, a digital signal processor, a direct memory access task processing device, multiple direct memory access task processing methods, and a computer-readable storage medium. To improve the execution efficiency of direct memory access tasks.
  • FIG. 3 is a schematic block diagram of a digital signal processor according to an embodiment of the application.
  • the digital signal processor 1000 may include a direct memory access unit 100 and a reduced instruction set processor 200, and the reduced instruction set processor 200 and the direct memory access unit 100 are in communication connection.
  • the direct memory access unit 100 includes at least one data path (not shown in the figure) and a direct memory access unit controller 110, wherein at least one data path is used to transmit data of the direct memory access task, At least one data path corresponds to transmitting data of different types of direct memory access tasks.
  • At least one data path includes, but is not limited to, read large-batch data path, write large-batch data path, read small-batch data path, write small-batch data path, etc.
  • Different types of direct memory access tasks include but are not limited to read large-batch data tasks , Write large-batch data tasks, read small-batch data tasks, write small-batch data tasks, etc.
  • the read large-batch data path corresponds to data transmission and read large-batch data tasks
  • the write large-batch data path corresponds to the data transmission and write large-batch data tasks.
  • the read small-batch data path corresponds to the transmission of data for the task of reading small-batch data
  • the write small-batch data path corresponds to the transmission of data for the task of writing small-batch data.
  • the direct memory access unit controller 110 includes a task management module 111 connected to at least one data path and a reduced instruction set processor 200 located outside the direct memory access unit 100, wherein the task management module 111 is from the reduced instruction set processor 200 Acquire at least one task description parameter information corresponding to data of multiple direct memory access tasks to determine at least one direct memory access task currently to be executed according to the at least one task description parameter information, thereby realizing multiple direct memory access tasks Compared with using a single thread or a queue to manage the execution of multiple direct memory access tasks of different types, the parallel execution of the direct memory access tasks improves the execution efficiency of the direct memory access tasks.
  • At least one task description parameter information corresponding to the data of the direct memory access task is defined in advance.
  • the task description parameter information includes but not limited to priority (pri), interrupt parameter value (irq_mask), order preserving parameter value (order_preserve), transmission The value of the direction parameter (direction), etc.
  • the task description parameter information corresponding to one-dimensional linear data, task management is related to priority pri, interrupt parameter value irq_mask, order preserving parameter value order_preserve, and transmission direction parameter value direction.
  • the task description parameter information corresponding to the immediate data is related to the interrupt parameter value irq_mask, the order preserving parameter value order_preserve, and the transmission direction parameter value direction.
  • the task description parameter information corresponding to the data of the direct memory access task includes the order preserving parameter value order_preserve.
  • the order preserving parameter value order_preserve indicates whether the direct memory access task is executed strictly in order.
  • the order preserving parameter is defined A value of order_preserve of 0 means non-strict order-preserving execution, and a value of order-preserve parameter order_preserve of 1 means strict order-preserving execution.
  • the task management module 111 determines the order-preserving execution direct memory access task among the multiple direct memory access tasks according to the order preservation parameter value order_preserve corresponding to the multiple direct memory access tasks. Specifically, among the multiple direct memory access tasks, if any of them is a direct memory access task, for ease of description, it is hereinafter referred to as the first direct memory access task, if the order preservation parameter corresponding to the first direct memory access task If the value order_preserve is 0, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; if the order preservation parameter value order_preserve corresponding to the first direct memory access task is 1, then the first direct memory access task is determined Take the task as the order-preserving execution of the direct memory access task.
  • the order preserving parameter value order_preserve corresponding to the first direct memory access task is 1, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; if the first direct memory access task If the corresponding order preserving parameter value order_preserve is 0, it is determined that the first direct memory access task is the order preserving execution direct memory access task.
  • the task management module 111 sorts the order-preserving execution direct memory access tasks according to the task loading order, and determines the order-preserving execution direct memory access task with the highest ranking as the current direct memory access task to be executed.
  • the execution order of the direct memory access task can be controlled. For data-dependent application scenarios, it can efficiently realize the existence of multiple direct memory access tasks. Order scheduling.
  • the direct memory access unit 100 further includes at least one task queue 120, and a corresponding relationship between the task queue 120 and the data path is preset.
  • one task queue 120 corresponds to one data path.
  • the at least one task queue includes a task queue for reading large batches of data, a task queue for writing large batches of data, a task queue for reading small batches of data, and a task queue for writing small batches of data.
  • Paths include read large-batch data path, write large-batch data path, read small-batch data path, and write small-batch data path; read large-batch data task queue corresponds to read large-batch data path, write large-batch data task queue corresponds to write large-batch data Path, the task queue for reading small-batch data corresponds to the path for reading small-batch data, and the task queue for writing small-batch data corresponds to the path for writing small-batch data.
  • the task management module 111 includes a task processing module, which is used to distribute direct memory access tasks to corresponding task queues. There are 4 task queues in total, and 4 queues are used to maintain 4 parallel direct memory access tasks to complete direct memory storage. Take the task scheduling work, and finally allocate the direct memory access task to the data path to complete the data interaction between the DDR and the internal buffer BLK_MEM of the DSP.
  • the current direct memory access task to be executed is the task of reading a large batch of data
  • the first data corresponding to the task of reading the large batch of data is read from the DDR outside the digital signal processor, and the first data is based on the reading
  • the mass data path is transmitted to the DSP internal buffer BLK_MEM of the digital signal processor DSP, and the first data is written into the DSP internal buffer BLK_MEM.
  • the current direct memory access task to be executed is a task of reading small batch data
  • read the second data corresponding to the task of reading small batch data from the DDR and transmit the second data to the digital signal processing based on the read small batch data path And write the second data into the data buffer.
  • the third data corresponding to the write bulk data task is read from the DSP internal buffer BLK_MEM, and the third data is transmitted to the DDR based on the write bulk data path. And write the third data into DDR.
  • the fourth data corresponding to the task of writing small batch data is read from the data buffer, and the fourth data is transmitted to the DDR based on the writing small batch data path, and Write the fourth data into the DDR.
  • the task management module 111 determines the task queue corresponding to the at least one direct memory access task currently to be executed according to at least one task description parameter information corresponding to the at least one direct memory access task currently to be executed, and according to the correspondence between the task queue and the data path Relationship, execute at least one direct memory access task currently to be executed. Specifically, at least one direct memory access task to be executed currently is scheduled to the corresponding task queue, and the direct memory access task scheduled to each task queue is allocated to the corresponding task queue according to the corresponding relationship between the task queue and the data path. In the data path of, to execute at least one direct memory access task currently to be executed. Since each task queue corresponds to the corresponding data path and is managed separately, the management granularity is finer, and the direct memory access task management is more efficient.
  • task A and task B are order-preserving execution direct memory access tasks
  • task C and task D are not order-preserving tasks.
  • Execute direct memory access tasks the task pressing order is A->B->C->D
  • the task priority is the same
  • the execution order of the tasks is inconsistent with the task pressing order
  • the tasks A and D are executed in parallel first, and then in parallel Perform task B and task C. That is to say, when a preserving task needs to wait for other preserving tasks in other channels before the preserving task to be executed first, due to the use of preserving parameter values, non-sequence preserving tasks in the same channel can be executed before The task of preserving order is executed.
  • the task management module 111 determines the order preserving of the multiple direct memory access tasks according to the order_preserve parameter value order_preserve corresponding to the multiple direct memory access tasks, and then uses the first direct memory access task to execute the direct memory access task.
  • the first direct memory access task is the order-preserving execution direct memory access task
  • the first direct memory access task is pressed into the virtual queue according to the task loading order, that is, the order-preserving execution is directly executed.
  • the memory access task is pressed into the virtual queue.
  • the virtual queue is executed in strict first-in, first-out order. Only the tasks at the head of the virtual queue are valid candidate tasks, and the tasks at the non-head of the queue are invalid candidate tasks.
  • task B, task C, task D, and task I are pressed into the virtual queue.
  • Task B is at the head of the virtual queue. Only task B is a valid candidate task.
  • Task C, task D, Task I is an invalid candidate task.
  • the size of the virtual queue can be flexibly set according to the actual situation. For example, if it is set to 64bit, there is no specific restriction here.
  • the task management module 111 presses the sequenced execution direct memory access tasks among the multiple direct memory access tasks into the virtual queue according to the task loading sequence, when the execution of the current direct memory access tasks to be executed is completed , That is, when the execution of the direct memory access task at the head of the virtual queue is completed, the head pointer queue_head of the virtual queue is increased by 1; in addition, when a new order-preserving execution of the direct memory access task is pressed into the virtual queue, the The tail pointer queue_rear of the virtual queue is incremented by 1.
  • the task management module 111 stores task description parameter information corresponding to each direct memory access task in a preset priority queue.
  • the priority queue can buffer a preset number of task description parameter information. For example, as shown in FIG. 8, the priority queue buffers 8 task description parameter information dscrp_data0 to dscrp_data7.
  • the task description parameter information corresponding to the data of the direct memory access task is correspondingly configured with status tag information.
  • the task management module 111 assigns the status tag information corresponding to the task description parameter information of each direct memory access task Stored in the status register pri_status.
  • the status register pri_status includes 4 regions, and the 4 regions respectively store status flag information such as task valid parameter value valid, task activation parameter value active, priority parameter value dscrp_pri, and time stamp time_stamp.
  • the task valid parameter value valid indicates whether there is a task at the current position
  • the task activation parameter value active indicates whether the active task is cached at the current position, for non-sequential execution direct memory access tasks, all belong to The activated task, for the order-preserving direct memory access task at the head of the virtual queue, belongs to the activated task
  • the priority parameter value dscrp_pri 3bit, is directly obtained from the task description parameter information header
  • the timestamp time_stamp 3bit , The larger the value, the longer the pressing time.
  • the task management module 111 determines the direct memory access task with the highest execution level according to the status tag information corresponding to the task description parameter information of the multiple direct memory access tasks, and determines the direct memory access task with the highest execution level as the current to be executed Direct memory access tasks.
  • the status flag information corresponding to each task description parameter information includes a task valid parameter value valid, a task activation parameter value active, and a priority parameter value dscrp_pri.
  • the task management module 111 first determines the effective direct memory access task among the multiple direct memory access tasks according to the value of the task effective parameter value valid corresponding to the multiple direct memory access tasks.
  • the valid parameter value of the task corresponding to the direct memory access task is 0, the direct memory access task is determined to be an invalid direct memory access task; if the valid parameter value of the task corresponding to the direct memory access task is 1 , The direct memory access task is determined to be an effective direct memory access task.
  • the direct memory access task is determined to be invalid.
  • the direct memory access task is determined to be invalid; if the valid parameter value of the task corresponding to the direct memory access task is 0 , The direct memory access task is determined to be an effective direct memory access task.
  • the active direct memory access task in the effective direct memory access task is determined.
  • the task activation parameter value active corresponding to the direct memory access task is 0, it is determined that the direct memory access task is an inactive direct memory access task; if the task activation parameter value active corresponding to the direct memory access task is 1.
  • the direct memory access task is determined to be the active direct memory access task.
  • the task activation parameter value active corresponding to the direct memory access task is 1, it is determined that the direct memory access task is an inactive direct memory access task; if the task activation parameter value active corresponding to the direct memory access task is 0, the direct memory access task is determined to be the active direct memory access task.
  • the activated direct memory access task with the highest priority is determined, and the activated direct memory access task with the highest priority is determined as the direct memory access task with the highest execution level.
  • the status tag information corresponding to the task description parameter information of the direct memory access task includes the time stamp time_stamp, and the task management module 111 determines the activated direct memory with the highest priority according to the status tag information corresponding to the multiple direct memory access tasks.
  • Access task if the active direct memory access task with the highest priority is one, the active direct memory access task with the highest priority is determined as the direct memory access task with the highest execution level; if the active direct memory access task with the highest priority is activated There are multiple direct memory access tasks. According to the timestamp time_stamp corresponding to the multiple highest priority active direct memory access tasks, the highest priority active direct memory access task with the largest time stamp value is determined as the execution level The highest direct memory access task.
  • the task valid parameter value valid has the highest priority, and the selected one is always a valid direct memory access task; the task activation parameter value active has the second highest priority, and the active direct memory access task takes precedence over the non-active task.
  • Active direct memory access tasks; the priority parameter value dscrp_pri has the third priority. For two active and active direct memory access tasks, the direct memory access tasks with the higher priority parameter value dscrp_pri are loaded first Task; the timestamp time_stamp has the lowest priority. For two direct memory access tasks that are valid and active, if the priority parameter value dscrp_pri is also the same, the direct memory access task with the larger time stamp time_stamp is also selected.
  • the task description parameter information corresponding to the direct memory access task includes an interrupt parameter value irq_mask, and the interrupt parameter value irq_mask indicates whether an interrupt notification is sent after the direct memory access task is completed.
  • the interrupt parameter value irq_mask of 0 means that an interrupt notification is sent
  • the interrupt parameter value of irq_mask of 1 means that the interrupt notification is not sent.
  • the task management module 111 determines whether to report an interrupt notification to the reduced instruction set processor according to the value of the interrupt parameter value irq_mask corresponding to the direct memory access task. Optionally, if the interrupt parameter value irq_mask corresponding to the direct memory access task is 1, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value irq_mask corresponding to the direct memory access task is 0, it is determined to report Interrupt notification to the reduced instruction set processor.
  • interrupt parameter value irq_mask corresponding to the direct memory access task is 0, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value irq_mask corresponding to the direct memory access task is 1, it is determined to report Interrupt notification to the reduced instruction set processor.
  • the interrupt parameter value irq_mask can also be set to 1 to correspond to the reporting interrupt notification, and the interrupt parameter value irq_mask to 0 corresponds to the reporting interrupt notification.
  • FIG. 10 is a schematic flowchart of a method for processing multiple direct memory access tasks according to an embodiment of the present application. This method can be used in any of the direct memory access units provided in the above embodiments to improve the execution efficiency of the direct memory access task.
  • the method for processing multiple direct memory access tasks specifically includes step S101 to step S102.
  • the reduced instruction set processor predefines at least one task description parameter information corresponding to the data of each direct memory access task, where the task description parameter information includes but is not limited to priority (pri), interrupt parameter value ( irq_mask), order preservation parameter value (order_preserve), transmission direction parameter value (direction), etc.
  • the task description parameter information corresponding to one-dimensional linear data is related to pri, irq_mask, order_preserve, and direction for task management.
  • the task description parameter information corresponding to the immediate data is related to irq_mask, order_preserve, and direction for task management.
  • the direct memory access unit is connected to the external reduced instruction set processor.
  • the direct memory access unit obtains multiple direct memory access tasks from the reduced instruction set processor At least one task description parameter information corresponding to the data.
  • At least one direct memory access task to be executed currently is determined according to the at least one task description parameter information, so as to execute the at least one current task.
  • the direct memory access task to be executed is determined according to the at least one task description parameter information, so as to execute the at least one current task.
  • the task description parameter information includes an order_preserve parameter value (order_preserve), and the determining at least one direct memory access task currently to be executed according to the at least one task description parameter information includes: according to the The order-preserving parameter values corresponding to the multiple direct memory access tasks determine the order-preserving execution direct memory access task among the multiple direct memory access tasks; the order-preserving execution direct memory access task is performed according to the task loading order Perform sorting, and determine the order-preserving execution direct memory access task at the top of the sort as the current direct memory access task to be executed.
  • order_preserve order_preserve parameter value
  • the order preservation parameter value order_preserve indicates whether the direct memory access task is executed strictly in order.
  • the order preservation parameter value order_preserve is defined as 0 to indicate non-strict order preservation execution, and the order preservation parameter value order_preserve is 1 to indicate strict order preservation.
  • the order preserving parameter value order_preserve is 1 to indicate non-strict order preserving execution, and to define the order preserving parameter value order_preserve to 0 to indicate strict order preserving execution.
  • the first direct memory access task if any of them is a direct memory access task, for ease of description, it is hereinafter referred to as the first direct memory access task. If the first direct memory access task corresponds to order preservation If the parameter value order_preserve is 0, it is determined that the first direct memory access task is a non-order-executing direct memory access task; if the order preservation parameter value order_preserve corresponding to the first direct memory access task is 1, the first direct memory is determined The access task is to execute the direct memory access task in order.
  • the order preserving parameter value order_preserve corresponding to the first direct memory access task is 1, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; if the first direct memory access task If the corresponding order preserving parameter value order_preserve is 0, it is determined that the first direct memory access task is the order preserving execution direct memory access task.
  • the direct memory access unit sorts the order-preserving execution direct memory access tasks according to the task loading order, and determines the order-preserving execution direct memory access task with the highest sort as the current direct memory access task to be executed.
  • the execution order of the direct memory access task can be controlled. For data-dependent application scenarios, it can efficiently realize the existence of multiple direct memory access tasks. Order scheduling.
  • the direct memory access unit determines the order preserving of the multiple direct memory access tasks according to the order_preserve parameter value order_preserve corresponding to the multiple direct memory access tasks. Take a direct memory access task as an example. If the first direct memory access task is the order-preserving execution of the direct memory access task, the first direct memory access task is pressed into the virtual queue according to the task loading order, that is, The order-preserving execution direct memory access task is pushed into the virtual queue. The virtual queue is executed in strict first-in, first-out order. Only the tasks at the head of the virtual queue are valid candidate tasks, and the tasks at the non-head of the queue are invalid candidate tasks.
  • task B, task C, task D, and task I are pressed into the virtual queue.
  • Task B is at the head of the virtual queue. Only task B is a valid candidate task.
  • Task C, task D, Task I is an invalid candidate task.
  • the size of the virtual queue can be flexibly set according to the actual situation. For example, if it is set to 64bit, there is no specific restriction here.
  • the head pointer queue_head of the virtual queue is increased by 1; in addition, when a new order-preserving direct memory access task is executed in the virtual queue, the tail of the virtual queue is added The pointer queue_rear is incremented by 1.
  • the direct memory access unit stores task description parameter information corresponding to each direct memory access task in a preset priority queue.
  • the priority queue can buffer a preset number of task description parameter information.
  • the task description parameter information corresponding to the data of the direct memory access task is correspondingly configured with status flag information, and the at least one direct memory access to be executed currently is determined according to the at least one task description parameter information.
  • the task includes: determining the direct memory access task with the highest execution level according to the status tag information corresponding to the task description parameter information of the multiple direct memory access tasks; determining the direct memory access task with the highest execution level as the current waiting task Direct memory access tasks performed.
  • the status flag information corresponding to each task description parameter information includes a task valid parameter value valid, a task activation parameter value active, and a priority parameter value dscrp_pri.
  • the valid parameter value of the task corresponding to the direct memory access task is 0, the direct memory access task is determined to be an invalid direct memory access task; if the valid parameter value of the task corresponding to the direct memory access task is 1 , The direct memory access task is determined to be an effective direct memory access task.
  • the direct memory access task is determined to be invalid.
  • the direct memory access task is determined to be invalid; if the valid parameter value of the task corresponding to the direct memory access task is 0 , The direct memory access task is determined to be an effective direct memory access task.
  • the active direct memory access task in the effective direct memory access task is determined.
  • the task activation parameter value active corresponding to the direct memory access task is 0, it is determined that the direct memory access task is an inactive direct memory access task; if the task activation parameter value active corresponding to the direct memory access task is 1.
  • the direct memory access task is determined to be the active direct memory access task.
  • the task activation parameter value active corresponding to the direct memory access task is 1, it is determined that the direct memory access task is an inactive direct memory access task; if the task activation parameter value active corresponding to the direct memory access task is 0, the direct memory access task is determined to be the active direct memory access task.
  • the activated direct memory access task with the highest priority is determined, and the activated direct memory access task with the highest priority is determined as the direct memory access task with the highest execution level.
  • the status tag information corresponding to the task description parameter information of the direct memory access task includes a time stamp time_stamp
  • the activated direct memory access task with the highest priority is determined according to the status tag information corresponding to multiple direct memory access tasks, If there is one active direct memory access task with the highest priority, the active direct memory access task with the highest priority is determined as the direct memory access task with the highest execution level; if the direct memory access task with the highest priority is activated If there are multiple tasks, according to the timestamp time_stamp corresponding to the multiple highest priority active direct memory access tasks, the highest priority active direct memory access task with the largest timestamp value is determined as the direct memory with the highest execution level Access tasks.
  • the task valid parameter value valid has the highest priority, and the selected one is always a valid direct memory access task; the task activation parameter value active has the second highest priority, and the active direct memory access task takes precedence over the non-active task.
  • Active direct memory access tasks; the priority parameter value dscrp_pri has the third priority. For two active and active direct memory access tasks, the direct memory access tasks with the higher priority parameter value dscrp_pri are loaded first Task; the timestamp time_stamp has the lowest priority. For two direct memory access tasks that are valid and active, if the priority parameter value dscrp_pri is also the same, the direct memory access task with the larger time stamp time_stamp is also selected.
  • the status flag information corresponding to the task description parameter information of each direct memory access task is stored in the status register pri_status.
  • the status register pri_status includes 4 regions, and the 4 regions respectively store status flag information such as task valid parameter value valid, task activation parameter value active, priority parameter value dscrp_pri, and time stamp time_stamp.
  • the task valid parameter value valid indicates whether there is a task at the current position
  • the task activation parameter value active indicates whether the active task is cached at the current position, for non-sequential execution direct memory access tasks, all belong to The activated task, for the order-preserving direct memory access task at the head of the virtual queue, belongs to the activated task
  • the priority parameter value dscrp_pri 3bit, is directly obtained from the task description parameter information header
  • the timestamp time_stamp 3bit , The larger the value, the longer the pressing time.
  • the task description parameter information corresponding to the direct memory access task includes the interrupt parameter value irq_mask
  • the multiple direct memory access task processing methods further include: after the direct memory access task is executed, according to The value of the interrupt parameter value corresponding to the direct memory access task determines whether to report an interrupt notification to the reduced instruction set processor.
  • irq_mask indicates whether to send an interrupt notification after the direct memory access task is completed.
  • the interrupt parameter value irq_mask of 0 means that an interrupt notification is sent
  • the interrupt parameter value of irq_mask of 1 means that the interrupt notification is not sent.
  • the direct memory access task After the direct memory access task is executed, it is determined whether to report an interrupt notification to the reduced instruction set processor according to the value of the interrupt parameter value irq_mask corresponding to the direct memory access task.
  • the interrupt parameter value irq_mask corresponding to the direct memory access task is 1, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value irq_mask corresponding to the direct memory access task is 0, it is determined to report Interrupt notification to the reduced instruction set processor.
  • interrupt parameter value irq_mask corresponding to the direct memory access task is 0, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value irq_mask corresponding to the direct memory access task is 1, it is determined to report Interrupt notification to the reduced instruction set processor.
  • the direct memory access unit includes at least one task queue, and the corresponding relationship between the task queue and the data path is preset.
  • one task queue corresponds to one data path.
  • At least one task queue includes a task queue for reading large batches of data, a task queue for writing large batches of data, a task queue for reading small batches of data, and a task queue for writing small batches of data.
  • Read small-batch data path write small-batch data path; read large-batch data task queue corresponds to read large-batch data path, write large-batch data task queue corresponds to write large-batch data path, read small-batch data task queue corresponds to read small-batch data path , Write small batch data task queue corresponds to write small batch data path.
  • the method further includes: according to at least one task description parameter corresponding to the at least one direct memory access task currently to be executed Information to determine the task queue corresponding to the at least one direct memory access task currently to be executed; execute the at least one direct memory access task currently to be executed according to the corresponding relationship between the task queue and the data path.
  • At least one direct memory access task currently to be executed is scheduled to the corresponding task queue, and the direct memory access task scheduled to each task queue is allocated to the corresponding task queue according to the corresponding relationship between the task queue and the data path In the corresponding data path, at least one direct memory access task currently to be executed is executed.
  • the current direct memory access task to be executed is the task of reading a large batch of data
  • the first data corresponding to the task of reading the large batch of data is read from the DDR outside the digital signal processor, and the first data is based on the reading
  • the mass data path is transmitted to the DSP internal buffer BLK_MEM of the digital signal processor DSP, and the first data is written into the DSP internal buffer BLK_MEM.
  • the current direct memory access task to be executed is a task of reading small batch data
  • read the second data corresponding to the task of reading small batch data from the DDR and transmit the second data to the digital signal processing based on the read small batch data path And write the second data into the data buffer.
  • the third data corresponding to the write bulk data task is read from the DSP internal buffer BLK_MEM, and the third data is transmitted to the DDR based on the write bulk data path. And write the third data into DDR.
  • the fourth data corresponding to the task of writing small batch data is read from the data buffer, and the fourth data is transmitted to the DDR based on the writing small batch data path, and Write the fourth data into the DDR.
  • each task queue corresponds to the corresponding data path and is managed separately, the management granularity is finer, and the direct memory access task management is more efficient.
  • FIG. 11 is a schematic block diagram of a direct memory access unit provided by an embodiment of the present application.
  • the direct memory access unit 100 includes a processor 101 and a memory 102.
  • the processor 101 and the memory 102 are connected by a bus, such as an I2C (Inter-integrated Circuit) bus.
  • I2C Inter-integrated Circuit
  • the processor 101 may be a micro-controller unit (MCU), a central processing unit (Central Processing Unit, CPU), a digital signal processor (Digital Signal Processor, DSP), or the like.
  • MCU micro-controller unit
  • CPU Central Processing Unit
  • DSP Digital Signal Processor
  • the memory 102 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) disk, an optical disk, a U disk, or a mobile hard disk.
  • the processor is used to run a computer program stored in a memory, and implement the following steps when executing the computer program:
  • At least one direct memory access task currently to be executed is determined.
  • the task description parameter information includes an order-preserving parameter value
  • the processor determines at least one direct memory access task currently to be executed according to the at least one task description parameter information.
  • the order-preserving execution direct memory access tasks are sorted according to the task loading order, and the order-preserving execution direct memory access task with the highest ranking is determined as the current direct memory access task to be executed.
  • the processor is implementing the sequence-preserving parameter value corresponding to the multiple direct memory access tasks to determine the sequence-preserving execution direct memory access among the multiple direct memory access tasks.
  • the order-preserving parameter value corresponding to the first direct memory access task among the plurality of direct memory access tasks is 0, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; And if the order-preserving parameter value corresponding to the first direct memory access task among the plurality of direct memory access tasks is 1, determining that the first direct memory access task is an order-preserving execution direct memory access task;
  • the order-preserving parameter value corresponding to the first direct memory access task among the multiple direct memory access tasks is 1, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; And if the order-preserving parameter value corresponding to the first direct memory access task among the multiple direct memory access tasks is 0, it is determined that the first direct memory access task is an order-preserving execution direct memory access task.
  • the processor is implementing the sequence-preserving parameter value corresponding to the multiple direct memory access tasks to determine the sequence-preserving execution direct memory access among the multiple direct memory access tasks.
  • the first direct memory access task among the multiple direct memory access tasks is an order-preserving execution direct memory access task, then the first direct memory access task is pressed into the virtual queue according to the task loading order .
  • the processor when the processor executes the computer program, it also implements:
  • the tail pointer of the virtual queue is incremented by one.
  • the processor is configured with status flag information corresponding to the task description parameter information, and when determining at least one direct memory access task currently to be executed according to the at least one task description parameter information ,Implementation:
  • the direct memory access task with the highest execution level is determined as the direct memory access task currently to be executed.
  • the status flag information includes task effective parameter values, task activation parameter values, and priority parameter values
  • the processor is implementing the task description parameter information according to the multiple direct memory access tasks.
  • Corresponding status flag information when determining the direct memory access task with the highest execution level, the specific implementation is as follows:
  • the active direct memory access task with the highest priority is determined as the direct memory access task with the highest execution level.
  • the status tag information includes a timestamp
  • the processor determines the status tag information corresponding to the task description parameter information of the multiple direct memory access tasks to determine the highest execution level of the direct
  • the activated direct memory access task with the highest priority includes multiple, then according to the multiple timestamps corresponding to the activated direct memory access tasks with the highest priority, the activated direct memory access task with the highest time stamp value is the highest priority. Take the task and determine it as the direct memory access task with the highest execution level.
  • the processor determines the effective direct memory storage of the multiple direct memory access tasks according to the values of the effective parameter values of the tasks corresponding to the multiple direct memory access tasks.
  • the specific realization is as follows:
  • the direct memory access task is determined to be an invalid direct memory access task; if the task valid parameter value corresponding to the direct memory access task is 1, then the direct memory access task is determined Take the task as an effective direct memory access task;
  • the direct memory access task is determined to be an invalid direct memory access task; if the task effective parameter value corresponding to the direct memory access task is 0, the direct memory access task is determined to be 0. Take the task as an effective direct memory access task.
  • the processor determines the active direct memory access task in the effective direct memory access task according to the value of the task activation parameter value corresponding to the effective direct memory access task
  • the direct memory access task is determined to be an inactive direct memory access task; if the task activation parameter value corresponding to the direct memory access task is 1, then the direct memory is determined The access task is to activate the direct memory access task;
  • the direct memory access task is determined to be an inactive direct memory access task; if the task activation parameter value corresponding to the direct memory access task is 0, the direct memory is determined The access task is to activate the direct memory access task.
  • the processor when the processor executes the computer program, it also implements:
  • the status tag information corresponding to the task description parameter information of each direct memory access task is stored in the status register.
  • the status register includes 4 areas, and the 4 areas respectively store task effective parameter values, task activation parameter values, priority parameter values, and time stamps.
  • the processor when the processor executes the computer program, it also implements:
  • the task description parameter information corresponding to each direct memory access task is stored in the preset priority queue.
  • the task description parameter information includes interrupt parameter values, and when the processor executes the computer program, it also implements:
  • the processor when the processor realizes the determination of whether to report an interrupt notification to the reduced instruction set processor according to the value of the interrupt parameter value corresponding to the direct memory access task, it specifically implements:
  • interrupt parameter value corresponding to the direct memory access task is 1, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value corresponding to the direct memory access task is 0, then Determine to report the interrupt notification to the reduced instruction set processor;
  • interrupt parameter value corresponding to the direct memory access task is 0, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value corresponding to the direct memory access task is 1, then It is determined to report the interrupt notification to the reduced instruction set processor.
  • the direct memory access unit further includes at least one task queue, preset with a corresponding relationship between the task queue and the data path, and the processor is implementing the parameter information according to the at least one task description, After determining at least one direct memory access task currently to be executed, it also implements:
  • the correspondence between the task queue and the data path includes: one task queue corresponds to one data path.
  • the processor when the processor implements the at least one direct memory access task currently to be executed according to the corresponding relationship between the task queue and the data path, it specifically implements:
  • the at least one currently to be executed direct memory access task is scheduled to the corresponding task queue, and the direct memory access task scheduled to each task queue is allocated to the corresponding task queue according to the corresponding relationship between the task queue and the data path In the data path, the at least one direct memory access task currently to be executed is executed.
  • the at least one data path includes a read bulk data path, a write bulk data path, a read small bulk data path, and a write low bulk data path
  • the at least one task queue includes a read bulk data task queue , Write large-batch data task queue, read small-batch data task queue, write small-batch data task queue; the read large-batch data task queue corresponds to the read large-batch data path, and the write large-batch data task queue corresponds to the Write a large-batch data path, the read small-batch data task queue corresponds to the read small-batch data path, and the write small-batch data task queue corresponds to the write small-batch data path.
  • the direct memory access unit is provided in a digital signal processor.
  • the processor when the processor implements the at least one direct memory access task currently to be executed, it specifically implements:
  • the first data corresponding to the task of reading bulk data is read from the external double-rate synchronous dynamic random access memory, and the first data is based on Read the bulk data path and transmit it to the internal buffer of the digital signal processor, and write the first data into the internal buffer;
  • the target direct memory access task is a task of reading small-batch data
  • the second data corresponding to the task of reading small-batch data is read from the external double-rate synchronous dynamic random access memory, and the second data is Based on the read small batch data path, the data is transmitted to the data buffer of the digital signal processor, and the second data is written into the data buffer;
  • the target direct memory access task is a task of writing bulk data
  • the third data corresponding to the task of writing bulk data is read from the internal cache, and the third data is transmitted based on the write bulk data path To the external double-rate synchronous dynamic random access memory, and write the third data into the double-rate synchronous dynamic random access memory;
  • the target direct memory access task is a small batch data writing task
  • the fourth data corresponding to the small batch data writing task is read from the data buffer, and the fourth data is based on the writing small batch data path It is transmitted to the double-rate synchronous dynamic random access memory, and the fourth data is written into the double-rate synchronous dynamic random access memory.
  • An embodiment of the present application also provides a direct memory access task processing device.
  • the direct memory access task processing device includes the digital signal processor 1000 in the foregoing embodiment.
  • the direct memory access task processing device obtains at least one task description parameter information corresponding to the data of multiple direct memory access tasks from the reduced instruction set processor, and determines at least one task description parameter information currently to be executed according to the at least one task description parameter information
  • the specific operation can refer to the steps of the multiple direct memory access task processing methods provided in the embodiments of the present application, which will not be repeated here.
  • An embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, the computer program includes program instructions, and a processor executes the program instructions to implement the embodiments of the present application. Provides the steps of multiple direct memory access task processing methods.
  • the computer-readable storage medium may be the direct memory access unit or the digital signal processor or the internal storage unit of the direct memory access task processing device described in the foregoing embodiment, for example, the direct memory access unit or the digital signal processor. Signal processor or direct memory access to the hard disk or memory of task processing equipment.
  • the computer-readable storage medium may also be an external storage device of the direct memory access unit or a digital signal processor or a direct memory access task processing device, such as the direct memory access unit or a digital signal processor or an external storage device.
  • a direct memory access unit includes at least one data path and a direct memory access unit controller, wherein at least one data path is used to transmit data of the direct memory access task, and the direct memory access unit controller includes at least one data path and
  • the task management module connected to the reduced instruction set processor located outside the direct memory access unit, the task management module obtains at least one task description parameter information corresponding to the data of the multiple direct memory access tasks from the reduced instruction set processor, so as to At least one task description parameter information, to determine at least one direct memory access task currently to be executed, so as to realize the parallel execution of multiple direct memory access tasks, compared to using a single thread or a queue to manage different types
  • the execution of multiple direct memory access tasks improves the execution efficiency of direct memory access tasks.

Abstract

A direct memory access unit, a digital signal processor, a direct memory access task processing device, a direct memory access task processing method, and a storage medium. The direct memory access unit comprises at least one data path and a direct memory access unit controller, wherein the direct memory access unit controller comprises a task management module that is connected to the at least one data path and a reduced instruction set processor located outside the direct memory access unit; and the task management module acquires, from the reduced instruction set processor, at least one piece of task description parameter information corresponding to data of a plurality of direct memory access tasks, so as to determine, according to the at least one piece of task description parameter information, at least one direct memory access task to be executed currently, thereby improving the execution efficiency of the direct memory access task.

Description

直接内存存取单元、处理器、设备、处理方法及存储介质Direct memory access unit, processor, device, processing method and storage medium 技术领域Technical field
本申请涉及通信技术领域,尤其涉及一种直接内存存取单元、处理器、设备、处理方法及存储介质。This application relates to the field of communication technology, and in particular to a direct memory access unit, a processor, a device, a processing method, and a storage medium.
背景技术Background technique
数字信号处理器(Digital Signal Processing,以下简称为DSP)由于具有较高的计算能力、良好的可编程特性,在图像处理、人工智能等领域都有广泛的应用。其中,直接存储器访问(Direct Memory Access,DMA)是DSP的重要组成部分,DMA用于实现DSP外部的双倍速率同步动态随机存储器(Double Data Rate,以下简称为DDR)和DSP内部缓存之间的直接内存存取任务的数据搬移。在较为复杂的应用中,需要执行的直接内存存取任务很多,并且直接内存存取任务类型也包括多种,如读取大批量数据任务,写大批量数据任务等等,目前,DSP是采用单线程的方式或者采用一个队列的方式来管理这些不同类型的多个直接内存存取任务的执行,效率低下。Digital Signal Processing (Digital Signal Processing, hereinafter referred to as DSP) has a wide range of applications in image processing, artificial intelligence and other fields due to its high computing power and good programmable characteristics. Among them, direct memory access (Direct Memory Access, DMA) is an important part of DSP. DMA is used to realize the connection between the double-rate synchronous dynamic random access memory (Double Data Rate, hereinafter referred to as DDR) outside the DSP and the internal cache of the DSP. Data movement for direct memory access tasks. In more complex applications, there are many direct memory access tasks that need to be performed, and there are also many types of direct memory access tasks, such as reading large-volume data tasks, writing large-volume data tasks, and so on. Currently, DSP uses A single-threaded approach or a queue approach to manage the execution of these different types of multiple direct memory access tasks is inefficient.
发明内容Summary of the invention
基于此,本申请提供了一种直接内存存取单元、处理器、设备、处理方法及存储介质,以提高直接内存存取任务的执行效率。Based on this, the present application provides a direct memory access unit, a processor, a device, a processing method, and a storage medium to improve the execution efficiency of the direct memory access task.
第一方面,本申请提供了一种直接内存存取单元,包括至少一数据通路和直接内存存取单元控制器;In the first aspect, this application provides a direct memory access unit, including at least one data path and a direct memory access unit controller;
其中,in,
所述至少一数据通路,用于传输直接内存存取任务的数据,其中,所述至少一数据通路对应传输不同类型的直接内存存取任务的数据;The at least one data path is used to transmit data of direct memory access tasks, wherein the at least one data path correspondingly transmits data of different types of direct memory access tasks;
所述直接内存存取控制单元控制器包括与所述至少一数据通路和位于所述直接内存存取单元外部的精简指令集处理器连接的任务管理模块;其中,The direct memory access control unit controller includes a task management module connected to the at least one data path and a reduced instruction set processor located outside the direct memory access unit; wherein,
所述任务管理模块从所述精简指令集处理器获取与多个直接内存存取任务 的数据对应的至少一任务描述参数信息,以根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务。The task management module obtains at least one task description parameter information corresponding to data of a plurality of direct memory access tasks from the reduced instruction set processor to determine at least one task description parameter information currently to be executed according to the at least one task description parameter information Direct memory access tasks.
第二方面,本申请还提供了一种数字信号处理器,所述数字信号处理器包括精简指令集处理器和如上述的直接内存存取单元,所述。In the second aspect, the present application also provides a digital signal processor, the digital signal processor including a reduced instruction set processor and the direct memory access unit as described above.
第三方面,本申请还提供了一种直接内存存取任务处理设备,所述直接内存存取任务处理设备包括如上述的数字信号处理器。In a third aspect, this application also provides a direct memory access task processing device, the direct memory access task processing device including the above-mentioned digital signal processor.
第四方面,本申请还提供了一种多个直接内存存取任务处理方法,应用于如上述的直接内存存取单元,包括:In a fourth aspect, this application also provides a method for processing multiple direct memory access tasks, which is applied to the above-mentioned direct memory access unit, including:
从精简指令集处理器获取与多个直接内存存取任务的数据对应的至少一任务描述参数信息;Acquiring at least one task description parameter information corresponding to the data of multiple direct memory access tasks from the reduced instruction set processor;
根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务。According to the at least one task description parameter information, at least one direct memory access task currently to be executed is determined.
第五方面,本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如上述的多个直接内存存取任务处理方法。In a fifth aspect, the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor realizes the multiple direct commands described above. Memory access task processing method.
本申请公开的直接内存存取单元、数字信号处理器、直接内存存取任务处理设备、多个直接内存存取任务处理方法及计算机可读存储介质,提高了直接内存存取任务的执行效率。The direct memory access unit, digital signal processor, direct memory access task processing equipment, multiple direct memory access task processing methods, and computer-readable storage medium disclosed in the present application improve the execution efficiency of direct memory access tasks.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the application.
附图说明Description of the drawings
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present application. Ordinary technicians can obtain other drawings based on these drawings without creative work.
图1是数字信号处理器的数据交互过程示意图;Figure 1 is a schematic diagram of the data interaction process of the digital signal processor;
图2是直接存储器访问中数据搬移通道的示意图;Figure 2 is a schematic diagram of a data transfer channel in direct memory access;
图3是本申请的实施例提供的一种数字信号处理器的示意性框图;Fig. 3 is a schematic block diagram of a digital signal processor according to an embodiment of the present application;
图4a、4b是本申请的实施例提供的一种任务描述参数信息的示意图;4a and 4b are schematic diagrams of task description parameter information provided by an embodiment of the present application;
图5是本申请的实施例提供的一种直接内存存取单元交互的示意性框图;5 is a schematic block diagram of a direct memory access unit interaction provided by an embodiment of the present application;
图6a、6b、6c是本申请的实施例提供的直接内存存取任务执行的示意图;6a, 6b, and 6c are schematic diagrams of execution of direct memory access tasks provided by an embodiment of the present application;
图7是本申请的实施例提供的一种虚拟队列的示意图;FIG. 7 is a schematic diagram of a virtual queue provided by an embodiment of the present application;
图8是本申请的实施例提供的一种虚拟队列的示意图;FIG. 8 is a schematic diagram of a virtual queue provided by an embodiment of the present application;
图9是本申请的实施例提供的一种状态标记信息的示意图;FIG. 9 is a schematic diagram of state marking information provided by an embodiment of the present application;
图10是本申请的实施例提供的一种多个直接内存存取任务处理方法的步骤示意流程图;10 is a schematic flowchart of steps of a method for processing multiple direct memory access tasks provided by an embodiment of the present application;
图11是本申请的实施例提供的一种直接内存存取单元的示意性框图。FIG. 11 is a schematic block diagram of a direct memory access unit provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flowchart shown in the drawings is only an example, and does not necessarily include all contents and operations/steps, nor does it have to be executed in the described order. For example, some operations/steps can also be decomposed, combined or partially combined, so the actual execution order may be changed according to actual conditions.
应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should be understood that the terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in the specification of this application and the appended claims, unless the context clearly indicates other circumstances, the singular forms "a", "an" and "the" are intended to include plural forms.
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should also be understood that the term "and/or" used in the specification and appended claims of this application refers to any combination of one or more of the associated listed items and all possible combinations, and includes these combinations.
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。Hereinafter, some embodiments of the present application will be described in detail with reference to the accompanying drawings. In the case of no conflict, the following embodiments and features in the embodiments can be combined with each other.
现有技术中,直接存储器访问(Direct Memory Access,DMA)是数字信号处理器(Digital Signal Processing,DSP)的重要组成部分,DMA用于实现DSP 外部的双倍速率同步动态随机存储器(Double Data Rate,DDR)和DSP内部缓存(以下简称为BLK_MEM)之间的直接内存存取任务的数据搬移。例如,如图1所示,为DSP的数据交互过程,直接内存存取任务的数据存放在DDR上,通过DMA进行数据的搬移,搬移到DSP内部的DSP内部缓存BLK_MEM上,然后通过加载存储单元(load store unit,以下简称为LSU)完成DSP内部缓存BLK_MEM到矢量处理单元(vector process unit,以下简称为VPU)的数据加载,通过VPU处理数据,完成数据处理后,再通过LSU将结果写入DSP内部缓存BLK_MEM中,最后通过DMA将DSP内部缓存BLK_MEM中的数据写出到DDR中。In the prior art, Direct Memory Access (DMA) is an important part of the Digital Signal Processing (DSP). DMA is used to implement the Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate) external to the DSP. , DDR) and DSP internal cache (hereinafter referred to as BLK_MEM) for data movement of direct memory access tasks. For example, as shown in Figure 1, the data interaction process of the DSP, the data of the direct memory access task is stored on the DDR, and the data is moved through DMA, moved to the DSP internal buffer BLK_MEM inside the DSP, and then loaded through the storage unit (load store unit, hereinafter referred to as LSU) completes the loading of data from the DSP internal cache BLK_MEM to the vector process unit (hereinafter referred to as VPU), processes the data through the VPU, and after the data processing is completed, writes the result through the LSU In the DSP internal buffer BLK_MEM, the data in the DSP internal buffer BLK_MEM is finally written out to the DDR through DMA.
如图2所示,DMA中一般有4个数据搬移通道:读大量数据read nd、写大量数据write nd、读小量数据read imm、写小量数据write imm,其中:As shown in Figure 2, there are generally 4 data transfer channels in DMA: read large amounts of data read nd, write large amounts of data write nd, read small amounts of data read imm, and write small amounts of data write imm. Among them:
read/write nd:这两通道执行数据量较大的数据(大批量数据)的搬移,nd可以分为1d/2d/3d,1d对应一维线性数据,2d对应二维平面数据,3d对应三维块数据,一般是从DSP外部DDR中将数据搬移至BLK MEM中。read/write nd: These two channels perform the transfer of data with a large amount of data (mass data), nd can be divided into 1d/2d/3d, 1d corresponds to one-dimensional linear data, 2d corresponds to two-dimensional planar data, and 3d corresponds to three-dimensional Block data is generally moved from the DDR external to the DSP to the BLK MEM.
read/write imm,这两通道用于执行数据量较小的数据(例如,立即数)的搬移,立即数一般存放在DSP内部的数据缓冲器(data buffer)中,精简指令集处理器(Reduced Instruction Set Computer,RISC)可直接快速访问数据缓存器。read/write imm, these two channels are used to perform the movement of data with a small amount of data (for example, immediate data). The immediate data is generally stored in the data buffer inside the DSP, and the reduced instruction set processor (Reduced Instruction Set Computer (RISC) can directly and quickly access the data buffer.
在较为复杂的应用中,需要执行的直接内存存取任务很多,并且直接内存存取任务类型也包括多种,如读取大批量数据任务,写大批量数据任务等等,目前,DSP是采用单线程的方式或者采用一个队列的方式来管理这些不同类型的多个直接内存存取任务的执行,效率低下。In more complex applications, there are many direct memory access tasks that need to be performed, and there are also many types of direct memory access tasks, such as reading large-volume data tasks, writing large-volume data tasks, and so on. Currently, DSP uses A single-threaded approach or a queue approach to manage the execution of these different types of multiple direct memory access tasks is inefficient.
为了解决上述问题,本申请的实施例提供了一种直接内存存取单元、数字信号处理器、直接内存存取任务处理设备、多个直接内存存取任务处理方法及计算机可读存储介质,用于提高直接内存存取任务的执行效率。In order to solve the above-mentioned problems, the embodiments of the present application provide a direct memory access unit, a digital signal processor, a direct memory access task processing device, multiple direct memory access task processing methods, and a computer-readable storage medium. To improve the execution efficiency of direct memory access tasks.
请参阅图3,图3为本申请实施例提供的一种数字信号处理器的示意性框图。如图3所示,数字信号处理器1000可以包括直接内存存取单元100和精简指令集处理器200,精简指令集处理器200和直接内存存取单元100通信连接。Please refer to FIG. 3, which is a schematic block diagram of a digital signal processor according to an embodiment of the application. As shown in FIG. 3, the digital signal processor 1000 may include a direct memory access unit 100 and a reduced instruction set processor 200, and the reduced instruction set processor 200 and the direct memory access unit 100 are in communication connection.
示例性的,直接内存存取单元100包括至少一数据通路(图中未示出)和 直接内存存取单元控制器110,其中,至少一数据通,用于传输直接内存存取任务的数据,至少一数据通路对应传输不同类型的直接内存存取任务的数据。至少一数据通路包括但不限于读大批量数据通路、写大批量数据通路、读小批量数据通路、写小批量数据通路等,不同类型的直接内存存取任务包括但不限于读大批量数据任务、写大批量数据任务、读小批量数据任务、写小批量数据任务等,读大批量数据通路对应传输读大批量数据任务的数据,写大批量数据通路对应传输写大批量数据任务的数据,读小批量数据通路对应传输读小批量数据任务的数据,写小批量数据通路对应传输写小批量数据任务的数据。Exemplarily, the direct memory access unit 100 includes at least one data path (not shown in the figure) and a direct memory access unit controller 110, wherein at least one data path is used to transmit data of the direct memory access task, At least one data path corresponds to transmitting data of different types of direct memory access tasks. At least one data path includes, but is not limited to, read large-batch data path, write large-batch data path, read small-batch data path, write small-batch data path, etc. Different types of direct memory access tasks include but are not limited to read large-batch data tasks , Write large-batch data tasks, read small-batch data tasks, write small-batch data tasks, etc. The read large-batch data path corresponds to data transmission and read large-batch data tasks, and the write large-batch data path corresponds to the data transmission and write large-batch data tasks. The read small-batch data path corresponds to the transmission of data for the task of reading small-batch data, and the write small-batch data path corresponds to the transmission of data for the task of writing small-batch data.
直接内存存取单元控制器110包括与至少一数据通路和位于直接内存存取单元100外部的精简指令集处理器200连接的任务管理模块111,其中,任务管理模块111从精简指令集处理器200获取与多个直接内存存取任务的数据对应的至少一任务描述参数信息,以根据至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务,从而实现多直接内存存取任务的并行执行,相比于采用单线程的方式或者采用一个队列的方式来管理不同类型的多个直接内存存取任务的执行,提高了直接内存存取任务的执行效率。The direct memory access unit controller 110 includes a task management module 111 connected to at least one data path and a reduced instruction set processor 200 located outside the direct memory access unit 100, wherein the task management module 111 is from the reduced instruction set processor 200 Acquire at least one task description parameter information corresponding to data of multiple direct memory access tasks to determine at least one direct memory access task currently to be executed according to the at least one task description parameter information, thereby realizing multiple direct memory access tasks Compared with using a single thread or a queue to manage the execution of multiple direct memory access tasks of different types, the parallel execution of the direct memory access tasks improves the execution efficiency of the direct memory access tasks.
预先定义直接内存存取任务的数据对应的至少一任务描述参数信息,其中,任务描述参数信息包括但不限于优先级(pri)、中断参数值(irq_mask)、保序参数值(order_preserve)、传输方向参数值(direction)等。例如,如图4a所示,一维线性数据对应的任务描述参数信息,任务管理相关的是优先级pri、中断参数值irq_mask、保序参数值order_preserve和传输方向参数值direction。如图4b所示,立即数对应的任务描述参数信息,任务管理相关的是中断参数值irq_mask、保序参数值order_preserve和传输方向参数值direction。At least one task description parameter information corresponding to the data of the direct memory access task is defined in advance. The task description parameter information includes but not limited to priority (pri), interrupt parameter value (irq_mask), order preserving parameter value (order_preserve), transmission The value of the direction parameter (direction), etc. For example, as shown in Figure 4a, the task description parameter information corresponding to one-dimensional linear data, task management is related to priority pri, interrupt parameter value irq_mask, order preserving parameter value order_preserve, and transmission direction parameter value direction. As shown in Figure 4b, the task description parameter information corresponding to the immediate data is related to the interrupt parameter value irq_mask, the order preserving parameter value order_preserve, and the transmission direction parameter value direction.
示例性的,直接内存存取任务的数据对应的任务描述参数信息中包含保序参数值order_preserve,保序参数值order_preserve表示直接内存存取任务是否严格保序执行,可选地,定义保序参数值order_preserve为0表示非严格保序执行,保序参数值order_preserve为1表示严格保序执行。或者,定义保序参数值order_preserve为1表示非严格保序执行,保序参数值order_preserve为0表示严格保序执行。Exemplarily, the task description parameter information corresponding to the data of the direct memory access task includes the order preserving parameter value order_preserve. The order preserving parameter value order_preserve indicates whether the direct memory access task is executed strictly in order. Optionally, the order preserving parameter is defined A value of order_preserve of 0 means non-strict order-preserving execution, and a value of order-preserve parameter order_preserve of 1 means strict order-preserving execution. Or, define the order preserving parameter value order_preserve to be 1 to indicate non-strict order preserving execution, and to define the order preserving parameter value order_preserve to 0 to indicate strict order preserving execution.
任务管理模块111根据多个直接内存存取任务对应的保序参数值 order_preserve,确定多个直接内存存取任务中的保序执行直接内存存取任务。具体地,在多个直接内存存取任务中,若其中任何直接内存存取任务,为了便于描述,下文称为第一直接内存存取任务,若第一直接内存存取任务对应的保序参数值order_preserve为0,则确定第一直接内存存取任务为非保序执行直接内存存取任务;若第一直接内存存取任务对应的保序参数值order_preserve为1,则确定第一直接内存存取任务为保序执行直接内存存取任务。The task management module 111 determines the order-preserving execution direct memory access task among the multiple direct memory access tasks according to the order preservation parameter value order_preserve corresponding to the multiple direct memory access tasks. Specifically, among the multiple direct memory access tasks, if any of them is a direct memory access task, for ease of description, it is hereinafter referred to as the first direct memory access task, if the order preservation parameter corresponding to the first direct memory access task If the value order_preserve is 0, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; if the order preservation parameter value order_preserve corresponding to the first direct memory access task is 1, then the first direct memory access task is determined Take the task as the order-preserving execution of the direct memory access task.
或者,相反,若第一直接内存存取任务对应的保序参数值order_preserve为1,则确定第一直接内存存取任务为非保序执行直接内存存取任务;若第一直接内存存取任务对应的保序参数值order_preserve为0,则确定第一直接内存存取任务为保序执行直接内存存取任务。Or, on the contrary, if the order preserving parameter value order_preserve corresponding to the first direct memory access task is 1, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; if the first direct memory access task If the corresponding order preserving parameter value order_preserve is 0, it is determined that the first direct memory access task is the order preserving execution direct memory access task.
之后,任务管理模块111将保序执行直接内存存取任务按照任务加载顺序进行排序,并将排序最前的保序执行直接内存存取任务确定为当前待执行的直接内存存取任务。通过设置直接内存存取任务对应的保序参数值order_preserve的取值,实现控制直接内存存取任务的执行顺序,对于存在数据依赖的应用场景,可高效实现多个直接内存存取任务间的有序调度。After that, the task management module 111 sorts the order-preserving execution direct memory access tasks according to the task loading order, and determines the order-preserving execution direct memory access task with the highest ranking as the current direct memory access task to be executed. By setting the value of the order preserving parameter value order_preserve corresponding to the direct memory access task, the execution order of the direct memory access task can be controlled. For data-dependent application scenarios, it can efficiently realize the existence of multiple direct memory access tasks. Order scheduling.
示例性的,直接内存存取单元100还包括至少一任务队列120,预设有任务队列120与数据通路的对应关系,可选地,一个任务队列120对应一个数据通路。在一实施方式中,例如,如图5所示,至少一任务队列包括读大批量数据任务队列、写大批量数据任务队列、读小批量数据任务队列、写小批量数据任务队列,至少一数据通路包括读大批量数据通路、写大批量数据通路、读小批量数据通路、写小批量数据通路;读大批量数据任务队列对应读大批量数据通路,写大批量数据任务队列对应写大批量数据通路,读小批量数据任务队列对应读小批量数据通路,写小批量数据任务队列对应写小批量数据通路。Exemplarily, the direct memory access unit 100 further includes at least one task queue 120, and a corresponding relationship between the task queue 120 and the data path is preset. Optionally, one task queue 120 corresponds to one data path. In one embodiment, for example, as shown in FIG. 5, the at least one task queue includes a task queue for reading large batches of data, a task queue for writing large batches of data, a task queue for reading small batches of data, and a task queue for writing small batches of data. Paths include read large-batch data path, write large-batch data path, read small-batch data path, and write small-batch data path; read large-batch data task queue corresponds to read large-batch data path, write large-batch data task queue corresponds to write large-batch data Path, the task queue for reading small-batch data corresponds to the path for reading small-batch data, and the task queue for writing small-batch data corresponds to the path for writing small-batch data.
任务管理模块111包括任务处理模块,用于分发直接内存存取任务到相应的任务队列,任务队列一共有4个,4个队列用于维护4路并行的直接内存存取任务,完成直接内存存取任务的调度工作,最终将直接内存存取任务分配到数据通路(data path)中,完成DDR和DSP内部缓存BLK_MEM之间的数据交互。The task management module 111 includes a task processing module, which is used to distribute direct memory access tasks to corresponding task queues. There are 4 task queues in total, and 4 queues are used to maintain 4 parallel direct memory access tasks to complete direct memory storage. Take the task scheduling work, and finally allocate the direct memory access task to the data path to complete the data interaction between the DDR and the internal buffer BLK_MEM of the DSP.
具体地,若当前待执行的直接内存存取任务为读大批量数据任务,则从数 字信号处理器外部的DDR中读取该读大批量数据任务对应的第一数据,将第一数据基于读大批量数据通路传输至数字信号处理器DSP的DSP内部缓存BLK_MEM,并将第一数据写入DSP内部缓存BLK_MEM。若当前待执行的直接内存存取任务为读小批量数据任务,则从DDR中读取该读小批量数据任务对应的第二数据,将第二数据基于读小批量数据通路传输至数字信号处理器的数据缓存器,并将第二数据写入数据缓存器。若当前待执行的直接内存存取任务为写大批量数据任务,则从DSP内部缓存BLK_MEM读取写大批量数据任务对应的第三数据,将第三数据基于写大批量数据通路传输至DDR,并将第三数据写入DDR。若当前待执行的直接内存存取任务为写小批量数据任务,则从数据缓存器读取写小批量数据任务对应的第四数据,将第四数据基于写小批量数据通路传输至DDR,并将第四数据写入DDR。Specifically, if the current direct memory access task to be executed is the task of reading a large batch of data, the first data corresponding to the task of reading the large batch of data is read from the DDR outside the digital signal processor, and the first data is based on the reading The mass data path is transmitted to the DSP internal buffer BLK_MEM of the digital signal processor DSP, and the first data is written into the DSP internal buffer BLK_MEM. If the current direct memory access task to be executed is a task of reading small batch data, read the second data corresponding to the task of reading small batch data from the DDR, and transmit the second data to the digital signal processing based on the read small batch data path And write the second data into the data buffer. If the current direct memory access task to be executed is a bulk data write task, the third data corresponding to the write bulk data task is read from the DSP internal buffer BLK_MEM, and the third data is transmitted to the DDR based on the write bulk data path. And write the third data into DDR. If the current direct memory access task to be executed is the task of writing small batch data, the fourth data corresponding to the task of writing small batch data is read from the data buffer, and the fourth data is transmitted to the DDR based on the writing small batch data path, and Write the fourth data into the DDR.
任务管理模块111根据至少一当前待执行的直接内存存取任务对应的至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务对应的任务队列,根据任务队列与数据通路的对应关系,执行至少一当前待执行的直接内存存取任务。具体地,将至少一当前待执行的直接内存存取任务调度至对应的任务队列中,以及根据任务队列与数据通路的对应关系,将调度至每一任务队列的直接内存存取任务分配至对应的数据通路中,以执行至少一当前待执行的直接内存存取任务。由于每个任务队列,分别对应相应的数据通路,单独管理,管理的粒度更细,实现直接内存存取任务管理更加高效。The task management module 111 determines the task queue corresponding to the at least one direct memory access task currently to be executed according to at least one task description parameter information corresponding to the at least one direct memory access task currently to be executed, and according to the correspondence between the task queue and the data path Relationship, execute at least one direct memory access task currently to be executed. Specifically, at least one direct memory access task to be executed currently is scheduled to the corresponding task queue, and the direct memory access task scheduled to each task queue is allocated to the corresponding task queue according to the corresponding relationship between the task queue and the data path. In the data path of, to execute at least one direct memory access task currently to be executed. Since each task queue corresponds to the corresponding data path and is managed separately, the management granularity is finer, and the direct memory access task management is more efficient.
例如,如图6a所示,先后压入3个任务:任务A、任务B、任务C,且都是保序执行直接内存存取任务,任务压入顺序为A->B->C,任务优先级相同,任务的执行顺序与任务压入顺序一致,为A->B->C,也即,先执行任务A,再执行任务B,最后执行任务C。For example, as shown in Figure 6a, three tasks are pressed successively: task A, task B, and task C, all of which are executed in order to perform direct memory access tasks. The order of task pressing is A->B->C, and task The priority is the same, and the execution order of tasks is the same as the order of task pressing, which is A->B->C, that is, task A is executed first, then task B is executed, and task C is executed last.
如图6b所示,先后压入3个任务:任务A、任务B、任务C,且都不是保序执行直接内存存取任务,任务压入顺序为A->B->C,任务优先级相同,任务的执行顺序与任务压入顺序不一致,先并行执行任务A和任务B,再执行任务C。As shown in Figure 6b, three tasks are pressed successively: task A, task B, and task C, and none of them are executed in order-preserving direct memory access tasks. The order of task pressing is A->B->C, and the task priority is Similarly, the execution order of the tasks is inconsistent with the order in which the tasks are pressed, and task A and task B are executed in parallel, and then task C is executed.
如图6c所示,先后压入4个任务:任务A、任务B、任务C、任务D,其中,任务A、任务B是保序执行直接内存存取任务,任务C、任务D不是保序 执行直接内存存取任务,任务压入顺序为A->B->C->D,任务优先级相同,任务的执行顺序与任务压入顺序不一致,先并行执行任务A和任务D,再并行执行任务B和任务C。也就是说,当一个保序任何需要等待在该保序任务之前的其他通道中的其他保序任务先被执行,由于保序参数值的使用,使得同一通道中的非保序任务可以先于保序任务而被执行。As shown in Figure 6c, four tasks are pressed successively: task A, task B, task C, and task D. Among them, task A and task B are order-preserving execution direct memory access tasks, and task C and task D are not order-preserving tasks. Execute direct memory access tasks, the task pressing order is A->B->C->D, the task priority is the same, the execution order of the tasks is inconsistent with the task pressing order, the tasks A and D are executed in parallel first, and then in parallel Perform task B and task C. That is to say, when a preserving task needs to wait for other preserving tasks in other channels before the preserving task to be executed first, due to the use of preserving parameter values, non-sequence preserving tasks in the same channel can be executed before The task of preserving order is executed.
示例性的,任务管理模块111根据多个直接内存存取任务对应的保序参数值order_preserve,确定多个直接内存存取任务中的保序执行直接内存存取任务之后,以第一直接内存存取任务为例,若第一直接内存存取任务为保序执行直接内存存取任务,则将第一直接内存存取任务按照任务加载顺序压入虚拟队列中,也即,将保序执行直接内存存取任务压入虚拟队列中。该虚拟队列严格按照先入先出的顺序执行,只有处于虚拟队列头部的任务,才是有效的候选任务,处于队列非头部的任务,为无效候选任务。例如,如图7所示,虚拟队列中压入任务B、任务C、任务D、任务I,其中,任务B处于虚拟队列头部,只有任务B是有效的候选任务,任务C、任务D、任务I为无效候选任务。需要说明的是,虚拟队列的大小可根据实际情况进行灵活设置,如设置为64bit,在此不作具体限制。Exemplarily, the task management module 111 determines the order preserving of the multiple direct memory access tasks according to the order_preserve parameter value order_preserve corresponding to the multiple direct memory access tasks, and then uses the first direct memory access task to execute the direct memory access task. Take the task as an example. If the first direct memory access task is the order-preserving execution direct memory access task, the first direct memory access task is pressed into the virtual queue according to the task loading order, that is, the order-preserving execution is directly executed. The memory access task is pressed into the virtual queue. The virtual queue is executed in strict first-in, first-out order. Only the tasks at the head of the virtual queue are valid candidate tasks, and the tasks at the non-head of the queue are invalid candidate tasks. For example, as shown in Figure 7, task B, task C, task D, and task I are pressed into the virtual queue. Task B is at the head of the virtual queue. Only task B is a valid candidate task. Task C, task D, Task I is an invalid candidate task. It should be noted that the size of the virtual queue can be flexibly set according to the actual situation. For example, if it is set to 64bit, there is no specific restriction here.
示例性的,任务管理模块111将多个直接内存存取任务中的保序执行直接内存存取任务按照任务加载顺序压入虚拟队列中后,在当前待执行的直接内存存取任务执行完成时,也即处于虚拟队列头部的直接内存存取任务执行完成时,将虚拟队列的头部指针queue_head加1;另外,当虚拟队列中压入新的保序执行直接内存存取任务时,将虚拟队列的尾部指针queue_rear加1。Exemplarily, after the task management module 111 presses the sequenced execution direct memory access tasks among the multiple direct memory access tasks into the virtual queue according to the task loading sequence, when the execution of the current direct memory access tasks to be executed is completed , That is, when the execution of the direct memory access task at the head of the virtual queue is completed, the head pointer queue_head of the virtual queue is increased by 1; in addition, when a new order-preserving execution of the direct memory access task is pressed into the virtual queue, the The tail pointer queue_rear of the virtual queue is incremented by 1.
示例性的,任务管理模块111将每个直接内存存取任务对应的任务描述参数信息存储于预设优先队列中。可选地,优先队列可以缓存预设数量的任务描述参数信息,例如,如图8所示,优先队列缓存8个任务描述参数信息dscrp_data0至dscrp_data7。Exemplarily, the task management module 111 stores task description parameter information corresponding to each direct memory access task in a preset priority queue. Optionally, the priority queue can buffer a preset number of task description parameter information. For example, as shown in FIG. 8, the priority queue buffers 8 task description parameter information dscrp_data0 to dscrp_data7.
示例性的,直接内存存取任务的数据对应的任务描述参数信息对应配置有状态标记信息,可选地,任务管理模块111将每个直接内存存取任务的任务描述参数信息对应的状态标记信息存储于状态寄存器pri_status中。可选地,如图8所示,状态寄存器pri_status包括4个区域,4个区域分别存储任务有效参数 值valid、任务激活参数值active、优先级参数值dscrp_pri以及时间戳time_stamp等状态标记信息。Exemplarily, the task description parameter information corresponding to the data of the direct memory access task is correspondingly configured with status tag information. Optionally, the task management module 111 assigns the status tag information corresponding to the task description parameter information of each direct memory access task Stored in the status register pri_status. Optionally, as shown in FIG. 8, the status register pri_status includes 4 regions, and the 4 regions respectively store status flag information such as task valid parameter value valid, task activation parameter value active, priority parameter value dscrp_pri, and time stamp time_stamp.
其中,任务有效参数值valid,1bit,表示当前位置上是否有任务;任务激活参数值active,1bit,表示当前位置上是否缓存被激活的任务,对于非保序执行直接内存存取任务,都属于被激活的任务,对于处于虚拟队列头部的保序执行直接内存存取任务,属于被激活的任务;优先级参数值dscrp_pri,3bit,直接从任务描述参数信息头部获取;时间戳time_stamp,3bit,数值越大,则表示压入的时间越久。Among them, the task valid parameter value valid, 1bit, indicates whether there is a task at the current position; the task activation parameter value active, 1bit, indicates whether the active task is cached at the current position, for non-sequential execution direct memory access tasks, all belong to The activated task, for the order-preserving direct memory access task at the head of the virtual queue, belongs to the activated task; the priority parameter value dscrp_pri, 3bit, is directly obtained from the task description parameter information header; the timestamp time_stamp, 3bit , The larger the value, the longer the pressing time.
任务管理模块111根据多个直接内存存取任务的任务描述参数信息对应的状态标记信息,确定执行等级最高的直接内存存取任务,并将执行等级最高的直接内存存取任务确定为当前待执行的直接内存存取任务。The task management module 111 determines the direct memory access task with the highest execution level according to the status tag information corresponding to the task description parameter information of the multiple direct memory access tasks, and determines the direct memory access task with the highest execution level as the current to be executed Direct memory access tasks.
可选地,例如,如图8所示,每个任务描述参数信息对应的状态标记信息包括任务有效参数值valid、任务激活参数值active和优先级参数值dscrp_pri。任务管理模块111首先根据多个直接内存存取任务对应的任务有效参数值valid的取值,确定多个直接内存存取任务中的有效直接内存存取任务。可选地,若直接内存存取任务对应的任务有效参数值valid为0,则确定直接内存存取任务为无效直接内存存取任务;若直接内存存取任务对应的任务有效参数值valid为1,则确定直接内存存取任务为有效直接内存存取任务。或者,相反,若直接内存存取任务对应的任务有效参数值valid为1,则确定直接内存存取任务为无效直接内存存取任务;若直接内存存取任务对应的任务有效参数值valid为0,则确定直接内存存取任务为有效直接内存存取任务。Optionally, for example, as shown in FIG. 8, the status flag information corresponding to each task description parameter information includes a task valid parameter value valid, a task activation parameter value active, and a priority parameter value dscrp_pri. The task management module 111 first determines the effective direct memory access task among the multiple direct memory access tasks according to the value of the task effective parameter value valid corresponding to the multiple direct memory access tasks. Optionally, if the valid parameter value of the task corresponding to the direct memory access task is 0, the direct memory access task is determined to be an invalid direct memory access task; if the valid parameter value of the task corresponding to the direct memory access task is 1 , The direct memory access task is determined to be an effective direct memory access task. Or, on the contrary, if the valid parameter value of the task corresponding to the direct memory access task is 1, then the direct memory access task is determined to be invalid. The direct memory access task is determined to be invalid; if the valid parameter value of the task corresponding to the direct memory access task is 0 , The direct memory access task is determined to be an effective direct memory access task.
然后,根据确定的有效直接内存存取任务对应的任务激活参数值active的取值,确定有效直接内存存取任务中的激活直接内存存取任务。示例性的,若直接内存存取任务对应的任务激活参数值active为0,则确定直接内存存取任务为非激活直接内存存取任务;若直接内存存取任务对应的任务激活参数值active为1,则确定直接内存存取任务为激活直接内存存取任务。或者,相反,若直接内存存取任务对应的任务激活参数值active为1,则确定直接内存存取任务为非激活直接内存存取任务;若直接内存存取任务对应的任务激活参数值active为0,则确定直接内存存取任务为激活直接内存存取任务。Then, according to the value of the task activation parameter value active corresponding to the determined effective direct memory access task, the active direct memory access task in the effective direct memory access task is determined. Exemplarily, if the task activation parameter value active corresponding to the direct memory access task is 0, it is determined that the direct memory access task is an inactive direct memory access task; if the task activation parameter value active corresponding to the direct memory access task is 1. The direct memory access task is determined to be the active direct memory access task. Or, on the contrary, if the task activation parameter value active corresponding to the direct memory access task is 1, it is determined that the direct memory access task is an inactive direct memory access task; if the task activation parameter value active corresponding to the direct memory access task is 0, the direct memory access task is determined to be the active direct memory access task.
之后,根据激活直接内存存取任务对应的优先级参数值dscrp_pri的取值,确定优先级最高的激活直接内存存取任务,将优先级最高的激活直接内存存取任务确定为执行等级最高的直接内存存取任务。Then, according to the value of the priority parameter value dscrp_pri corresponding to the activated direct memory access task, the activated direct memory access task with the highest priority is determined, and the activated direct memory access task with the highest priority is determined as the direct memory access task with the highest execution level. Memory access tasks.
示例性的,直接内存存取任务的任务描述参数信息对应的状态标记信息包括时间戳time_stamp,任务管理模块111根据多个直接内存存取任务对应的状态标记信息,确定优先级最高的激活直接内存存取任务,若优先级最高的激活直接内存存取任务为1个,则将该优先级最高的激活直接内存存取任务确定为执行等级最高的直接内存存取任务;若优先级最高的激活直接内存存取任务包括多个,则根据多个优先级最高的激活直接内存存取任务对应的时间戳time_stamp,将时间戳数值最大的优先级最高的激活直接内存存取任务,确定为执行等级最高的直接内存存取任务。Exemplarily, the status tag information corresponding to the task description parameter information of the direct memory access task includes the time stamp time_stamp, and the task management module 111 determines the activated direct memory with the highest priority according to the status tag information corresponding to the multiple direct memory access tasks. Access task, if the active direct memory access task with the highest priority is one, the active direct memory access task with the highest priority is determined as the direct memory access task with the highest execution level; if the active direct memory access task with the highest priority is activated There are multiple direct memory access tasks. According to the timestamp time_stamp corresponding to the multiple highest priority active direct memory access tasks, the highest priority active direct memory access task with the largest time stamp value is determined as the execution level The highest direct memory access task.
也即,任务有效参数值valid具有最高优先级,被选取的总是一个有效的直接内存存取任务;任务激活参数值active具有次高优先级,处于激活状态的直接内存存取任务优先于非激活状态的的直接内存存取任务;优先级参数值dscrp_pri具有第三优先级,对于两个有效且处于激活态的的直接内存存取任务,优先加载优先级参数值dscrp_pri高的直接内存存取任务;时间戳time_stamp具有最低优先级,对于两个有效且处于激活态的的直接内存存取任务,如果其优先级参数值dscrp_pri也相同,则选取时间戳time_stamp大的直接内存存取任务,也就是压入时间最久的直接内存存取任务。由于直接内存存取任务的压入总有先后顺序,所以不会存在两个直接内存存取任务的4种优先级全部相同。通过4种优先级调度同一队列中的直接内存存取任务,使得直接内存存取任务调度执行更加灵活。That is, the task valid parameter value valid has the highest priority, and the selected one is always a valid direct memory access task; the task activation parameter value active has the second highest priority, and the active direct memory access task takes precedence over the non-active task. Active direct memory access tasks; the priority parameter value dscrp_pri has the third priority. For two active and active direct memory access tasks, the direct memory access tasks with the higher priority parameter value dscrp_pri are loaded first Task; the timestamp time_stamp has the lowest priority. For two direct memory access tasks that are valid and active, if the priority parameter value dscrp_pri is also the same, the direct memory access task with the larger time stamp time_stamp is also selected. It is the direct memory access task with the longest time to press. Since the direct memory access tasks are always pressed in order, there will be no four direct memory access tasks that have the same priority. Scheduling direct memory access tasks in the same queue through 4 priority levels makes the scheduling and execution of direct memory access tasks more flexible.
示例性的,直接内存存取任务对应的任务描述参数信息中包含中断参数值irq_mask,中断参数值irq_mask表示直接内存存取任务完成后,是否发中断通知。可选地,中断参数值irq_mask为0表示发中断通知,中断参数值irq_mask为1表示不发中断通知。Exemplarily, the task description parameter information corresponding to the direct memory access task includes an interrupt parameter value irq_mask, and the interrupt parameter value irq_mask indicates whether an interrupt notification is sent after the direct memory access task is completed. Optionally, the interrupt parameter value irq_mask of 0 means that an interrupt notification is sent, and the interrupt parameter value of irq_mask of 1 means that the interrupt notification is not sent.
在执行完成直接内存存取任务后,任务管理模块111根据直接内存存取任务对应的中断参数值irq_mask的取值,判断是否上报中断通知至所述精简指令集处理器。可选地,若直接内存存取任务对应的中断参数值irq_mask为1,则 判定不上报中断通知至精简指令集处理器;若直接内存存取任务对应的中断参数值irq_mask为0,则判定上报中断通知至所述精简指令集处理器。或者,相反,若直接内存存取任务对应的中断参数值irq_mask为0,则判定不上报中断通知至精简指令集处理器;若直接内存存取任务对应的中断参数值irq_mask为1,则判定上报中断通知至精简指令集处理器。After the execution of the direct memory access task is completed, the task management module 111 determines whether to report an interrupt notification to the reduced instruction set processor according to the value of the interrupt parameter value irq_mask corresponding to the direct memory access task. Optionally, if the interrupt parameter value irq_mask corresponding to the direct memory access task is 1, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value irq_mask corresponding to the direct memory access task is 0, it is determined to report Interrupt notification to the reduced instruction set processor. Or, on the contrary, if the interrupt parameter value irq_mask corresponding to the direct memory access task is 0, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value irq_mask corresponding to the direct memory access task is 1, it is determined to report Interrupt notification to the reduced instruction set processor.
例如,如图9所示,压入有任务A、任务B、任务C,其中,任务A对应的中断参数值irq_mask为1,任务B对应的中断参数值irq_mask为1,任务C对应的中断参数值irq_mask为0。当任务A执行后,由于其对应的中断参数值irq_mask为1,因此,不上报中断通知;接着任务B执行后,同样由于其对应的中断参数值irq_mask为1,因此,不上报中断通知;最后任务C执行后,由于其对应的中断参数值irq_mask为0,因此,上报中断通知至精简指令集处理器。通过设置特定任务完成后才发送中断通知至精简指令集处理器,因此,大大减少精简指令集处理器和直接内存存取单元的交互,提升精简指令集处理器的效率。需要说明的是,在另一实施方式中,也可以设置中断参数值irq_mask为1对应于上报中断通知,中断参数值irq_mask为0对应于上报中断通知。For example, as shown in Figure 9, task A, task B, and task C are pressed, where the interrupt parameter value irq_mask corresponding to task A is 1, the interrupt parameter value irq_mask corresponding to task B is 1, and the interrupt parameter corresponding to task C The value irq_mask is 0. When task A is executed, because its corresponding interrupt parameter value irq_mask is 1, no interrupt notification is reported; then after task B is executed, because its corresponding interrupt parameter value irq_mask is 1, therefore, no interrupt notification is reported; finally After task C is executed, since its corresponding interrupt parameter value irq_mask is 0, the interrupt notification is reported to the reduced instruction set processor. By setting the interrupt notification to the reduced instruction set processor after the completion of a specific task, the interaction between the reduced instruction set processor and the direct memory access unit is greatly reduced, and the efficiency of the reduced instruction set processor is improved. It should be noted that in another embodiment, the interrupt parameter value irq_mask can also be set to 1 to correspond to the reporting interrupt notification, and the interrupt parameter value irq_mask to 0 corresponds to the reporting interrupt notification.
可以理解的,上述对于数字信号处理器各部件的命名仅仅出于标识的目的,并不因此对本申请实施例进行限制。It can be understood that the aforementioned naming of the various components of the digital signal processor is only for identification purposes, and does not therefore limit the embodiments of the present application.
以下将基于数字信号处理器、所述数字信号处理器中的直接内存存取单元和所述数字信号处理器中的精简指令集处理器对本申请的实施例提供的多个直接内存存取任务处理方法进行详细介绍。需知,图3中的数字信号处理器并不构成对该多个直接内存存取任务处理方法的应用场景的限定。The following will be based on the digital signal processor, the direct memory access unit in the digital signal processor, and the reduced instruction set processor in the digital signal processor to process multiple direct memory access tasks provided by the embodiments of the present application. The method is introduced in detail. It should be understood that the digital signal processor in FIG. 3 does not constitute a limitation on the application scenarios of the multiple direct memory access task processing methods.
请参阅图10,图10是本申请的实施例提供的一种多个直接内存存取任务处理方法的示意流程图。该方法可以用于上述实施例提供的任意一种直接内存存取单元中,以提高直接内存存取任务的执行效率。Please refer to FIG. 10, which is a schematic flowchart of a method for processing multiple direct memory access tasks according to an embodiment of the present application. This method can be used in any of the direct memory access units provided in the above embodiments to improve the execution efficiency of the direct memory access task.
如图10所示,该多个直接内存存取任务处理方法具体包括步骤S101至步骤S102。As shown in FIG. 10, the method for processing multiple direct memory access tasks specifically includes step S101 to step S102.
S101、从精简指令集处理器获取与多个直接内存存取任务的数据对应的至少一任务描述参数信息。S101. Obtain at least one task description parameter information corresponding to data of multiple direct memory access tasks from the reduced instruction set processor.
本实施例中,通过精简指令集处理器预先定义各个直接内存存取任务的数 据对应的至少一任务描述参数信息,其中,任务描述参数信息包括但不限于优先级(pri)、中断参数值(irq_mask)、保序参数值(order_preserve)、传输方向参数值(direction)等。例如,如图4a所示,一维线性数据对应的任务描述参数信息,任务管理相关的是pri、irq_mask、order_preserve和direction。如图4b所示,立即数对应的任务描述参数信息,任务管理相关的是irq_mask、order_preserve和direction。In this embodiment, the reduced instruction set processor predefines at least one task description parameter information corresponding to the data of each direct memory access task, where the task description parameter information includes but is not limited to priority (pri), interrupt parameter value ( irq_mask), order preservation parameter value (order_preserve), transmission direction parameter value (direction), etc. For example, as shown in Figure 4a, the task description parameter information corresponding to one-dimensional linear data is related to pri, irq_mask, order_preserve, and direction for task management. As shown in Figure 4b, the task description parameter information corresponding to the immediate data is related to irq_mask, order_preserve, and direction for task management.
直接内存存取单元与外部的精简指令集处理器连接,当要对多个直接内存存取任务的执行进行管理时,直接内存存取单元从精简指令集处理器获取多个直接内存存取任务的数据对应的至少一任务描述参数信息。The direct memory access unit is connected to the external reduced instruction set processor. When the execution of multiple direct memory access tasks is to be managed, the direct memory access unit obtains multiple direct memory access tasks from the reduced instruction set processor At least one task description parameter information corresponding to the data.
S102、根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务。S102. Determine at least one direct memory access task currently to be executed according to the at least one task description parameter information.
在获取到多个直接内存存取任务的数据对应的至少一任务描述参数信息后,根据该至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务,以执行该至少一当前待执行的直接内存存取任务。After obtaining at least one task description parameter information corresponding to the data of multiple direct memory access tasks, at least one direct memory access task to be executed currently is determined according to the at least one task description parameter information, so as to execute the at least one current task. The direct memory access task to be executed.
在一些实施例中,任务描述参数信息中包含保序参数值(order_preserve),所述根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务,包括:根据所述多个直接内存存取任务对应的保序参数值,确定所述多个直接内存存取任务中的保序执行直接内存存取任务;将所述保序执行直接内存存取任务按照任务加载顺序进行排序,并将排序最前的保序执行直接内存存取任务确定为当前待执行的直接内存存取任务。In some embodiments, the task description parameter information includes an order_preserve parameter value (order_preserve), and the determining at least one direct memory access task currently to be executed according to the at least one task description parameter information includes: according to the The order-preserving parameter values corresponding to the multiple direct memory access tasks determine the order-preserving execution direct memory access task among the multiple direct memory access tasks; the order-preserving execution direct memory access task is performed according to the task loading order Perform sorting, and determine the order-preserving execution direct memory access task at the top of the sort as the current direct memory access task to be executed.
其中,保序参数值order_preserve,表示直接内存存取任务是否严格保序执行,可选地,定义保序参数值order_preserve为0表示非严格保序执行,保序参数值order_preserve为1表示严格保序执行。或者,定义保序参数值order_preserve为1表示非严格保序执行,保序参数值order_preserve为0表示严格保序执行。Among them, the order preservation parameter value order_preserve indicates whether the direct memory access task is executed strictly in order. Optionally, the order preservation parameter value order_preserve is defined as 0 to indicate non-strict order preservation execution, and the order preservation parameter value order_preserve is 1 to indicate strict order preservation. implement. Or, define the order preserving parameter value order_preserve to be 1 to indicate non-strict order preserving execution, and to define the order preserving parameter value order_preserve to 0 to indicate strict order preserving execution.
可选地,在多个直接内存存取任务中,若其中任何直接内存存取任务,为了便于描述,下文称为第一直接内存存取任务,若第一直接内存存取任务对应的保序参数值order_preserve为0,则确定第一直接内存存取任务为非保序执行直接内存存取任务;若第一直接内存存取任务对应的保序参数值order_preserve 为1,则确定第一直接内存存取任务为保序执行直接内存存取任务。Optionally, among the multiple direct memory access tasks, if any of them is a direct memory access task, for ease of description, it is hereinafter referred to as the first direct memory access task. If the first direct memory access task corresponds to order preservation If the parameter value order_preserve is 0, it is determined that the first direct memory access task is a non-order-executing direct memory access task; if the order preservation parameter value order_preserve corresponding to the first direct memory access task is 1, the first direct memory is determined The access task is to execute the direct memory access task in order.
或者,相反,若第一直接内存存取任务对应的保序参数值order_preserve为1,则确定第一直接内存存取任务为非保序执行直接内存存取任务;若第一直接内存存取任务对应的保序参数值order_preserve为0,则确定第一直接内存存取任务为保序执行直接内存存取任务。Or, on the contrary, if the order preserving parameter value order_preserve corresponding to the first direct memory access task is 1, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; if the first direct memory access task If the corresponding order preserving parameter value order_preserve is 0, it is determined that the first direct memory access task is the order preserving execution direct memory access task.
之后,直接内存存取单元将保序执行直接内存存取任务按照任务加载顺序进行排序,并将排序最前的保序执行直接内存存取任务确定为当前待执行的直接内存存取任务。通过设置直接内存存取任务对应的保序参数值order_preserve的取值,实现控制直接内存存取任务的执行顺序,对于存在数据依赖的应用场景,可高效实现多个直接内存存取任务间的有序调度。After that, the direct memory access unit sorts the order-preserving execution direct memory access tasks according to the task loading order, and determines the order-preserving execution direct memory access task with the highest sort as the current direct memory access task to be executed. By setting the value of the order preserving parameter value order_preserve corresponding to the direct memory access task, the execution order of the direct memory access task can be controlled. For data-dependent application scenarios, it can efficiently realize the existence of multiple direct memory access tasks. Order scheduling.
在另一些实施例中,直接内存存取单元根据多个直接内存存取任务对应的保序参数值order_preserve,确定多个直接内存存取任务中的保序执行直接内存存取任务之后,以第一直接内存存取任务为例,若第一直接内存存取任务为保序执行直接内存存取任务,则将第一直接内存存取任务按照任务加载顺序压入虚拟队列中,也即,将保序执行直接内存存取任务压入虚拟队列中。该虚拟队列严格按照先入先出的顺序执行,只有处于虚拟队列头部的任务,才是有效的候选任务,处于队列非头部的任务,为无效候选任务。例如,如图7所示,虚拟队列中压入任务B、任务C、任务D、任务I,其中,任务B处于虚拟队列头部,只有任务B是有效的候选任务,任务C、任务D、任务I为无效候选任务。需要说明的是,虚拟队列的大小可根据实际情况进行灵活设置,如设置为64bit,在此不作具体限制。In other embodiments, the direct memory access unit determines the order preserving of the multiple direct memory access tasks according to the order_preserve parameter value order_preserve corresponding to the multiple direct memory access tasks. Take a direct memory access task as an example. If the first direct memory access task is the order-preserving execution of the direct memory access task, the first direct memory access task is pressed into the virtual queue according to the task loading order, that is, The order-preserving execution direct memory access task is pushed into the virtual queue. The virtual queue is executed in strict first-in, first-out order. Only the tasks at the head of the virtual queue are valid candidate tasks, and the tasks at the non-head of the queue are invalid candidate tasks. For example, as shown in Figure 7, task B, task C, task D, and task I are pressed into the virtual queue. Task B is at the head of the virtual queue. Only task B is a valid candidate task. Task C, task D, Task I is an invalid candidate task. It should be noted that the size of the virtual queue can be flexibly set according to the actual situation. For example, if it is set to 64bit, there is no specific restriction here.
可选地,将多个直接内存存取任务中的保序执行直接内存存取任务按照任务加载顺序压入虚拟队列中后,在当前待执行的直接内存存取任务执行完成时,也即处于虚拟队列头部的直接内存存取任务执行完成时,将虚拟队列的头部指针queue_head加1;另外,当虚拟队列中压入新的保序执行直接内存存取任务时,将虚拟队列的尾部指针queue_rear加1。Optionally, after the order-preserving execution direct memory access task among multiple direct memory access tasks is pressed into the virtual queue according to the task loading order, when the execution of the current direct memory access task to be executed is completed, that is, it is in When the direct memory access task at the head of the virtual queue is executed, the head pointer queue_head of the virtual queue is increased by 1; in addition, when a new order-preserving direct memory access task is executed in the virtual queue, the tail of the virtual queue is added The pointer queue_rear is incremented by 1.
在另一些实施例中,直接内存存取单元将每个直接内存存取任务对应的任务描述参数信息存储于预设优先队列中。可选地,优先队列可以缓存预设数量的任务描述参数信息。In other embodiments, the direct memory access unit stores task description parameter information corresponding to each direct memory access task in a preset priority queue. Optionally, the priority queue can buffer a preset number of task description parameter information.
在另一些实施例中,直接内存存取任务的数据对应的任务描述参数信息对应配置有状态标记信息,所述根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务,包括:根据所述多个直接内存存取任务的任务描述参数信息对应的状态标记信息,确定执行等级最高的直接内存存取任务;将执行等级最高的直接内存存取任务确定为当前待执行的直接内存存取任务。In other embodiments, the task description parameter information corresponding to the data of the direct memory access task is correspondingly configured with status flag information, and the at least one direct memory access to be executed currently is determined according to the at least one task description parameter information. The task includes: determining the direct memory access task with the highest execution level according to the status tag information corresponding to the task description parameter information of the multiple direct memory access tasks; determining the direct memory access task with the highest execution level as the current waiting task Direct memory access tasks performed.
可选地,每个任务描述参数信息对应的状态标记信息包括任务有效参数值valid、任务激活参数值active和优先级参数值dscrp_pri。首先根据多个直接内存存取任务对应的任务有效参数值valid的取值,确定多个直接内存存取任务中的有效直接内存存取任务。可选地,若直接内存存取任务对应的任务有效参数值valid为0,则确定直接内存存取任务为无效直接内存存取任务;若直接内存存取任务对应的任务有效参数值valid为1,则确定直接内存存取任务为有效直接内存存取任务。或者,相反,若直接内存存取任务对应的任务有效参数值valid为1,则确定直接内存存取任务为无效直接内存存取任务;若直接内存存取任务对应的任务有效参数值valid为0,则确定直接内存存取任务为有效直接内存存取任务。Optionally, the status flag information corresponding to each task description parameter information includes a task valid parameter value valid, a task activation parameter value active, and a priority parameter value dscrp_pri. First, determine the effective direct memory access task among the multiple direct memory access tasks according to the value of the task effective parameter value valid corresponding to the multiple direct memory access tasks. Optionally, if the valid parameter value of the task corresponding to the direct memory access task is 0, the direct memory access task is determined to be an invalid direct memory access task; if the valid parameter value of the task corresponding to the direct memory access task is 1 , The direct memory access task is determined to be an effective direct memory access task. Or, on the contrary, if the valid parameter value of the task corresponding to the direct memory access task is 1, then the direct memory access task is determined to be invalid. The direct memory access task is determined to be invalid; if the valid parameter value of the task corresponding to the direct memory access task is 0 , The direct memory access task is determined to be an effective direct memory access task.
然后,根据确定的有效直接内存存取任务对应的任务激活参数值active的取值,确定有效直接内存存取任务中的激活直接内存存取任务。示例性的,若直接内存存取任务对应的任务激活参数值active为0,则确定直接内存存取任务为非激活直接内存存取任务;若直接内存存取任务对应的任务激活参数值active为1,则确定直接内存存取任务为激活直接内存存取任务。或者,相反,若直接内存存取任务对应的任务激活参数值active为1,则确定直接内存存取任务为非激活直接内存存取任务;若直接内存存取任务对应的任务激活参数值active为0,则确定直接内存存取任务为激活直接内存存取任务。Then, according to the value of the task activation parameter value active corresponding to the determined effective direct memory access task, the active direct memory access task in the effective direct memory access task is determined. Exemplarily, if the task activation parameter value active corresponding to the direct memory access task is 0, it is determined that the direct memory access task is an inactive direct memory access task; if the task activation parameter value active corresponding to the direct memory access task is 1. The direct memory access task is determined to be the active direct memory access task. Or, on the contrary, if the task activation parameter value active corresponding to the direct memory access task is 1, it is determined that the direct memory access task is an inactive direct memory access task; if the task activation parameter value active corresponding to the direct memory access task is 0, the direct memory access task is determined to be the active direct memory access task.
之后,根据激活直接内存存取任务对应的优先级参数值dscrp_pri的取值,确定优先级最高的激活直接内存存取任务,将优先级最高的激活直接内存存取任务确定为执行等级最高的直接内存存取任务。Then, according to the value of the priority parameter value dscrp_pri corresponding to the activated direct memory access task, the activated direct memory access task with the highest priority is determined, and the activated direct memory access task with the highest priority is determined as the direct memory access task with the highest execution level. Memory access tasks.
可选地,直接内存存取任务的任务描述参数信息对应的状态标记信息包括时间戳time_stamp,根据多个直接内存存取任务对应的状态标记信息,确定优先级最高的激活直接内存存取任务,若优先级最高的激活直接内存存取任务为 1个,则将该优先级最高的激活直接内存存取任务确定为执行等级最高的直接内存存取任务;若优先级最高的激活直接内存存取任务包括多个,则根据多个优先级最高的激活直接内存存取任务对应的时间戳time_stamp,将时间戳数值最大的优先级最高的激活直接内存存取任务,确定为执行等级最高的直接内存存取任务。Optionally, the status tag information corresponding to the task description parameter information of the direct memory access task includes a time stamp time_stamp, and the activated direct memory access task with the highest priority is determined according to the status tag information corresponding to multiple direct memory access tasks, If there is one active direct memory access task with the highest priority, the active direct memory access task with the highest priority is determined as the direct memory access task with the highest execution level; if the direct memory access task with the highest priority is activated If there are multiple tasks, according to the timestamp time_stamp corresponding to the multiple highest priority active direct memory access tasks, the highest priority active direct memory access task with the largest timestamp value is determined as the direct memory with the highest execution level Access tasks.
也即,任务有效参数值valid具有最高优先级,被选取的总是一个有效的直接内存存取任务;任务激活参数值active具有次高优先级,处于激活状态的直接内存存取任务优先于非激活状态的的直接内存存取任务;优先级参数值dscrp_pri具有第三优先级,对于两个有效且处于激活态的的直接内存存取任务,优先加载优先级参数值dscrp_pri高的直接内存存取任务;时间戳time_stamp具有最低优先级,对于两个有效且处于激活态的的直接内存存取任务,如果其优先级参数值dscrp_pri也相同,则选取时间戳time_stamp大的直接内存存取任务,也就是压入时间最久的直接内存存取任务。由于直接内存存取任务的压入总有先后顺序,所以不会存在两个直接内存存取任务的4种优先级全部相同。通过4种优先级调度同一队列中的直接内存存取任务,使得直接内存存取任务调度执行更加灵活。That is, the task valid parameter value valid has the highest priority, and the selected one is always a valid direct memory access task; the task activation parameter value active has the second highest priority, and the active direct memory access task takes precedence over the non-active task. Active direct memory access tasks; the priority parameter value dscrp_pri has the third priority. For two active and active direct memory access tasks, the direct memory access tasks with the higher priority parameter value dscrp_pri are loaded first Task; the timestamp time_stamp has the lowest priority. For two direct memory access tasks that are valid and active, if the priority parameter value dscrp_pri is also the same, the direct memory access task with the larger time stamp time_stamp is also selected. It is the direct memory access task with the longest time to press. Since the direct memory access tasks are always pressed in order, there will be no four direct memory access tasks that have the same priority. Scheduling direct memory access tasks in the same queue through 4 priority levels makes the scheduling and execution of direct memory access tasks more flexible.
可选地,将每个直接内存存取任务的任务描述参数信息对应的状态标记信息存储于状态寄存器pri_status中。示例性的,如图7所示,状态寄存器pri_status包括4个区域,4个区域分别存储任务有效参数值valid、任务激活参数值active、优先级参数值dscrp_pri以及时间戳time_stamp等状态标记信息。Optionally, the status flag information corresponding to the task description parameter information of each direct memory access task is stored in the status register pri_status. Exemplarily, as shown in FIG. 7, the status register pri_status includes 4 regions, and the 4 regions respectively store status flag information such as task valid parameter value valid, task activation parameter value active, priority parameter value dscrp_pri, and time stamp time_stamp.
其中,任务有效参数值valid,1bit,表示当前位置上是否有任务;任务激活参数值active,1bit,表示当前位置上是否缓存被激活的任务,对于非保序执行直接内存存取任务,都属于被激活的任务,对于处于虚拟队列头部的保序执行直接内存存取任务,属于被激活的任务;优先级参数值dscrp_pri,3bit,直接从任务描述参数信息头部获取;时间戳time_stamp,3bit,数值越大,则表示压入的时间越久。Among them, the task valid parameter value valid, 1bit, indicates whether there is a task at the current position; the task activation parameter value active, 1bit, indicates whether the active task is cached at the current position, for non-sequential execution direct memory access tasks, all belong to The activated task, for the order-preserving direct memory access task at the head of the virtual queue, belongs to the activated task; the priority parameter value dscrp_pri, 3bit, is directly obtained from the task description parameter information header; the timestamp time_stamp, 3bit , The larger the value, the longer the pressing time.
在另一些实施例中,直接内存存取任务对应的任务描述参数信息中包含中断参数值irq_mask,所述多个直接内存存取任务处理方法还包括:在执行完成直接内存存取任务后,根据所述直接内存存取任务对应的中断参数值的取值, 判断是否上报中断通知至所述精简指令集处理器。In some other embodiments, the task description parameter information corresponding to the direct memory access task includes the interrupt parameter value irq_mask, and the multiple direct memory access task processing methods further include: after the direct memory access task is executed, according to The value of the interrupt parameter value corresponding to the direct memory access task determines whether to report an interrupt notification to the reduced instruction set processor.
其中,irq_mask表示直接内存存取任务完成后,是否发中断通知。可选地,中断参数值irq_mask为0表示发中断通知,中断参数值irq_mask为1表示不发中断通知。Among them, irq_mask indicates whether to send an interrupt notification after the direct memory access task is completed. Optionally, the interrupt parameter value irq_mask of 0 means that an interrupt notification is sent, and the interrupt parameter value of irq_mask of 1 means that the interrupt notification is not sent.
在执行完成直接内存存取任务后,根据直接内存存取任务对应的中断参数值irq_mask的取值,判断是否上报中断通知至所述精简指令集处理器。可选地,若直接内存存取任务对应的中断参数值irq_mask为1,则判定不上报中断通知至精简指令集处理器;若直接内存存取任务对应的中断参数值irq_mask为0,则判定上报中断通知至所述精简指令集处理器。或者,相反,若直接内存存取任务对应的中断参数值irq_mask为0,则判定不上报中断通知至精简指令集处理器;若直接内存存取任务对应的中断参数值irq_mask为1,则判定上报中断通知至精简指令集处理器。After the direct memory access task is executed, it is determined whether to report an interrupt notification to the reduced instruction set processor according to the value of the interrupt parameter value irq_mask corresponding to the direct memory access task. Optionally, if the interrupt parameter value irq_mask corresponding to the direct memory access task is 1, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value irq_mask corresponding to the direct memory access task is 0, it is determined to report Interrupt notification to the reduced instruction set processor. Or, on the contrary, if the interrupt parameter value irq_mask corresponding to the direct memory access task is 0, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value irq_mask corresponding to the direct memory access task is 1, it is determined to report Interrupt notification to the reduced instruction set processor.
例如,如图9所示,压入有任务A、任务B、任务C,其中,任务A对应的中断参数值irq_mask为1,任务B对应的中断参数值irq_mask为1,任务C对应的中断参数值irq_mask为0。当任务A执行后,由于其对应的中断参数值irq_mask为1,因此,不上报中断通知;接着任务B执行后,同样由于其对应的中断参数值irq_mask为1,因此,不上报中断通知;最后任务C执行后,由于其对应的中断参数值irq_mask为0,因此,上报中断通知至精简指令集处理器。通过设置特定任务完成后才发送中断通知至精简指令集处理器,因此,大大减少精简指令集处理器和直接内存存取单元的交互,提升精简指令集处理器的效率。For example, as shown in Figure 9, task A, task B, and task C are pressed, where the interrupt parameter value irq_mask corresponding to task A is 1, the interrupt parameter value irq_mask corresponding to task B is 1, and the interrupt parameter corresponding to task C The value irq_mask is 0. When task A is executed, because its corresponding interrupt parameter value irq_mask is 1, no interrupt notification is reported; then after task B is executed, because its corresponding interrupt parameter value irq_mask is 1, therefore, no interrupt notification is reported; finally After task C is executed, since its corresponding interrupt parameter value irq_mask is 0, the interrupt notification is reported to the reduced instruction set processor. By setting the interrupt notification to the reduced instruction set processor after the completion of a specific task, the interaction between the reduced instruction set processor and the direct memory access unit is greatly reduced, and the efficiency of the reduced instruction set processor is improved.
在另一些实施例中,直接内存存取单元包括至少一任务队列,预设任务队列与数据通路的对应关系,可选地,一个任务队列对应一个数据通路。至少一任务队列包括读大批量数据任务队列、写大批量数据任务队列、读小批量数据任务队列、写小批量数据任务队列,至少一数据通路包括读大批量数据通路、写大批量数据通路、读小批量数据通路、写小批量数据通路;读大批量数据任务队列对应读大批量数据通路,写大批量数据任务队列对应写大批量数据通路,读小批量数据任务队列对应读小批量数据通路,写小批量数据任务队列对应写小批量数据通路。In other embodiments, the direct memory access unit includes at least one task queue, and the corresponding relationship between the task queue and the data path is preset. Optionally, one task queue corresponds to one data path. At least one task queue includes a task queue for reading large batches of data, a task queue for writing large batches of data, a task queue for reading small batches of data, and a task queue for writing small batches of data. Read small-batch data path, write small-batch data path; read large-batch data task queue corresponds to read large-batch data path, write large-batch data task queue corresponds to write large-batch data path, read small-batch data task queue corresponds to read small-batch data path , Write small batch data task queue corresponds to write small batch data path.
所述根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务之后,还包括:根据所述至少一当前待执行的直接内存存取任务对应的至少一任务描述参数信息,确定所述至少一当前待执行的直接内存存取任务对应的任务队列;根据任务队列与数据通路的对应关系,执行所述至少一当前待执行的直接内存存取任务。After determining at least one direct memory access task currently to be executed according to the at least one task description parameter information, the method further includes: according to at least one task description parameter corresponding to the at least one direct memory access task currently to be executed Information to determine the task queue corresponding to the at least one direct memory access task currently to be executed; execute the at least one direct memory access task currently to be executed according to the corresponding relationship between the task queue and the data path.
可选地,将至少一当前待执行的直接内存存取任务调度至对应的任务队列中,以及根据任务队列与数据通路的对应关系,将调度至每一任务队列的直接内存存取任务分配至对应的数据通路中,以执行至少一当前待执行的直接内存存取任务。Optionally, at least one direct memory access task currently to be executed is scheduled to the corresponding task queue, and the direct memory access task scheduled to each task queue is allocated to the corresponding task queue according to the corresponding relationship between the task queue and the data path In the corresponding data path, at least one direct memory access task currently to be executed is executed.
具体地,若当前待执行的直接内存存取任务为读大批量数据任务,则从数字信号处理器外部的DDR中读取该读大批量数据任务对应的第一数据,将第一数据基于读大批量数据通路传输至数字信号处理器DSP的DSP内部缓存BLK_MEM,并将第一数据写入DSP内部缓存BLK_MEM。若当前待执行的直接内存存取任务为读小批量数据任务,则从DDR中读取该读小批量数据任务对应的第二数据,将第二数据基于读小批量数据通路传输至数字信号处理器的数据缓存器,并将第二数据写入数据缓存器。若当前待执行的直接内存存取任务为写大批量数据任务,则从DSP内部缓存BLK_MEM读取写大批量数据任务对应的第三数据,将第三数据基于写大批量数据通路传输至DDR,并将第三数据写入DDR。若当前待执行的直接内存存取任务为写小批量数据任务,则从数据缓存器读取写小批量数据任务对应的第四数据,将第四数据基于写小批量数据通路传输至DDR,并将第四数据写入DDR。Specifically, if the current direct memory access task to be executed is the task of reading a large batch of data, the first data corresponding to the task of reading the large batch of data is read from the DDR outside the digital signal processor, and the first data is based on the reading The mass data path is transmitted to the DSP internal buffer BLK_MEM of the digital signal processor DSP, and the first data is written into the DSP internal buffer BLK_MEM. If the current direct memory access task to be executed is a task of reading small batch data, read the second data corresponding to the task of reading small batch data from the DDR, and transmit the second data to the digital signal processing based on the read small batch data path And write the second data into the data buffer. If the current direct memory access task to be executed is a bulk data write task, the third data corresponding to the write bulk data task is read from the DSP internal buffer BLK_MEM, and the third data is transmitted to the DDR based on the write bulk data path. And write the third data into DDR. If the current direct memory access task to be executed is the task of writing small batch data, the fourth data corresponding to the task of writing small batch data is read from the data buffer, and the fourth data is transmitted to the DDR based on the writing small batch data path, and Write the fourth data into the DDR.
由于每个任务队列,分别对应相应的数据通路,单独管理,管理的粒度更细,实现直接内存存取任务管理更加高效。Since each task queue corresponds to the corresponding data path and is managed separately, the management granularity is finer, and the direct memory access task management is more efficient.
请参阅图11,图11是本申请实施例提供的一种直接内存存取单元的示意性框图。如图11所示,该直接内存存取单元100包括处理器101和存储器102,处理器101和存储器102通过总线连接,该总线比如为I2C(Inter-integrated Circuit)总线。Please refer to FIG. 11. FIG. 11 is a schematic block diagram of a direct memory access unit provided by an embodiment of the present application. As shown in FIG. 11, the direct memory access unit 100 includes a processor 101 and a memory 102. The processor 101 and the memory 102 are connected by a bus, such as an I2C (Inter-integrated Circuit) bus.
具体地,处理器101可以是微控制单元(Micro-controller Unit,MCU)、中央处理单元(Central Processing Unit,CPU)或数字信号处理器(Digital Signal  Processor,DSP)等。Specifically, the processor 101 may be a micro-controller unit (MCU), a central processing unit (Central Processing Unit, CPU), a digital signal processor (Digital Signal Processor, DSP), or the like.
具体地,存储器102可以是Flash芯片、只读存储器(ROM,Read-Only Memory)磁盘、光盘、U盘或移动硬盘等。Specifically, the memory 102 may be a Flash chip, a read-only memory (ROM, Read-Only Memory) disk, an optical disk, a U disk, or a mobile hard disk.
其中,所述处理器用于运行存储在存储器中的计算机程序,并在执行所述计算机程序时实现如下步骤:Wherein, the processor is used to run a computer program stored in a memory, and implement the following steps when executing the computer program:
从精简指令集处理器获取与多个直接内存存取任务的数据对应的至少一任务描述参数信息;Acquiring at least one task description parameter information corresponding to the data of multiple direct memory access tasks from the reduced instruction set processor;
根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务。According to the at least one task description parameter information, at least one direct memory access task currently to be executed is determined.
在一些实施例中,所述任务描述参数信息中包含保序参数值,所述处理器在实现所述根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务时,具体实现:In some embodiments, the task description parameter information includes an order-preserving parameter value, and the processor determines at least one direct memory access task currently to be executed according to the at least one task description parameter information. ,Implementation:
根据所述多个直接内存存取任务对应的保序参数值,确定所述多个直接内存存取任务中的保序执行直接内存存取任务;Determining the order-preserving execution direct memory access task among the multiple direct memory access tasks according to the order-preserving parameter values corresponding to the multiple direct memory access tasks;
将所述保序执行直接内存存取任务按照任务加载顺序进行排序,并将排序最前的保序执行直接内存存取任务确定为当前待执行的直接内存存取任务。The order-preserving execution direct memory access tasks are sorted according to the task loading order, and the order-preserving execution direct memory access task with the highest ranking is determined as the current direct memory access task to be executed.
在一些实施例中,所述处理器在实现所述根据所述多个直接内存存取任务对应的保序参数值,确定所述多个直接内存存取任务中的保序执行直接内存存取任务时,具体实现:In some embodiments, the processor is implementing the sequence-preserving parameter value corresponding to the multiple direct memory access tasks to determine the sequence-preserving execution direct memory access among the multiple direct memory access tasks. During the task, the specific realization:
若所述多个直接内存存取任务中的第一直接内存存取任务对应的保序参数值为0,则确定所述第一直接内存存取任务为非保序执行直接内存存取任务;以及若所述多个直接内存存取任务中的第一直接内存存取任务对应的保序参数值为1,则确定所述第一直接内存存取任务为保序执行直接内存存取任务;If the order-preserving parameter value corresponding to the first direct memory access task among the plurality of direct memory access tasks is 0, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; And if the order-preserving parameter value corresponding to the first direct memory access task among the plurality of direct memory access tasks is 1, determining that the first direct memory access task is an order-preserving execution direct memory access task;
或者or
若所述多个直接内存存取任务中的第一直接内存存取任务对应的保序参数值为1,则确定所述第一直接内存存取任务为非保序执行直接内存存取任务;以及若所述多个直接内存存取任务中的第一直接内存存取任务对应的保序参数值为0,则确定所述第一直接内存存取任务为保序执行直接内存存取任务。If the order-preserving parameter value corresponding to the first direct memory access task among the multiple direct memory access tasks is 1, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; And if the order-preserving parameter value corresponding to the first direct memory access task among the multiple direct memory access tasks is 0, it is determined that the first direct memory access task is an order-preserving execution direct memory access task.
在一些实施例中,所述处理器在实现所述根据所述多个直接内存存取任务 对应的保序参数值,确定所述多个直接内存存取任务中的保序执行直接内存存取任务之后,具体实现:In some embodiments, the processor is implementing the sequence-preserving parameter value corresponding to the multiple direct memory access tasks to determine the sequence-preserving execution direct memory access among the multiple direct memory access tasks. After the task, concrete realization:
若确定所述多个直接内存存取任务中的第一直接内存存取任务为保序执行直接内存存取任务,则将所述第一直接内存存取任务按照任务加载顺序压入虚拟队列中。If it is determined that the first direct memory access task among the multiple direct memory access tasks is an order-preserving execution direct memory access task, then the first direct memory access task is pressed into the virtual queue according to the task loading order .
在一些实施例中,所述处理器在执行所述计算机程序时,还实现:In some embodiments, when the processor executes the computer program, it also implements:
当所述当前待执行的直接内存存取任务执行完成时,将所述虚拟队列的头部指针加1;When the execution of the direct memory access task currently to be executed is completed, add 1 to the head pointer of the virtual queue;
当所述虚拟队列中压入新的保序执行直接内存存取任务时,将所述虚拟队列的尾部指针加1。When a new order-preserving execution direct memory access task is pressed into the virtual queue, the tail pointer of the virtual queue is incremented by one.
在一些实施例中,所述处理器在实现所述任务描述参数信息对应配置有状态标记信息,所述根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务时,具体实现:In some embodiments, the processor is configured with status flag information corresponding to the task description parameter information, and when determining at least one direct memory access task currently to be executed according to the at least one task description parameter information ,Implementation:
根据所述多个直接内存存取任务的任务描述参数信息对应的状态标记信息,确定执行等级最高的直接内存存取任务;Determine the direct memory access task with the highest execution level according to the status tag information corresponding to the task description parameter information of the multiple direct memory access tasks;
将执行等级最高的直接内存存取任务确定为当前待执行的直接内存存取任务。The direct memory access task with the highest execution level is determined as the direct memory access task currently to be executed.
在一些实施例中,所述状态标记信息包括任务有效参数值、任务激活参数值和优先级参数值,所述处理器在实现所述根据所述多个直接内存存取任务的任务描述参数信息对应的状态标记信息,确定执行等级最高的直接内存存取任务时,具体实现:In some embodiments, the status flag information includes task effective parameter values, task activation parameter values, and priority parameter values, and the processor is implementing the task description parameter information according to the multiple direct memory access tasks. Corresponding status flag information, when determining the direct memory access task with the highest execution level, the specific implementation is as follows:
根据所述多个直接内存存取任务对应的任务有效参数值的取值,确定所述多个直接内存存取任务中的有效直接内存存取任务;Determine the effective direct memory access task among the multiple direct memory access tasks according to the values of the task effective parameter values corresponding to the multiple direct memory access tasks;
根据所述有效直接内存存取任务对应的任务激活参数值的取值,确定所述有效直接内存存取任务中的激活直接内存存取任务;Determine the active direct memory access task in the effective direct memory access task according to the value of the task activation parameter value corresponding to the effective direct memory access task;
根据所述激活直接内存存取任务对应的优先级参数值的取值,确定优先级最高的激活直接内存存取任务;Determine the activated direct memory access task with the highest priority according to the value of the priority parameter value corresponding to the activated direct memory access task;
将优先级最高的激活直接内存存取任务确定为所述执行等级最高的直接内存存取任务。The active direct memory access task with the highest priority is determined as the direct memory access task with the highest execution level.
在一些实施例中,所述状态标记信息包括时间戳,所述处理器在实现所述根据所述多个直接内存存取任务的任务描述参数信息对应的状态标记信息,确定执行等级最高的直接内存存取任务时,具体实现:In some embodiments, the status tag information includes a timestamp, and the processor determines the status tag information corresponding to the task description parameter information of the multiple direct memory access tasks to determine the highest execution level of the direct When the memory access task, the specific realization:
根据所述多个直接内存存取任务对应的状态标记信息,确定优先级最高的激活直接内存存取任务;Determine the activated direct memory access task with the highest priority according to the status flag information corresponding to the multiple direct memory access tasks;
若优先级最高的激活直接内存存取任务包括多个,则根据多个所述优先级最高的激活直接内存存取任务对应的时间戳,将时间戳数值最大的优先级最高的激活直接内存存取任务,确定为所述执行等级最高的直接内存存取任务。If the activated direct memory access task with the highest priority includes multiple, then according to the multiple timestamps corresponding to the activated direct memory access tasks with the highest priority, the activated direct memory access task with the highest time stamp value is the highest priority. Take the task and determine it as the direct memory access task with the highest execution level.
在一些实施例中,所述处理器在实现所述根据所述多个直接内存存取任务对应的任务有效参数值的取值,确定所述多个直接内存存取任务中的有效直接内存存取任务时,具体实现:In some embodiments, the processor determines the effective direct memory storage of the multiple direct memory access tasks according to the values of the effective parameter values of the tasks corresponding to the multiple direct memory access tasks. When taking a task, the specific realization is as follows:
若直接内存存取任务对应的任务有效参数值为0,则确定直接内存存取任务为无效直接内存存取任务;若直接内存存取任务对应的任务有效参数值为1,则确定直接内存存取任务为有效直接内存存取任务;If the task valid parameter value corresponding to the direct memory access task is 0, the direct memory access task is determined to be an invalid direct memory access task; if the task valid parameter value corresponding to the direct memory access task is 1, then the direct memory access task is determined Take the task as an effective direct memory access task;
或者or
若直接内存存取任务对应的任务有效参数值为1,则确定直接内存存取任务为无效直接内存存取任务;若直接内存存取任务对应的任务有效参数值为0,则确定直接内存存取任务为有效直接内存存取任务。If the effective parameter value of the task corresponding to the direct memory access task is 1, the direct memory access task is determined to be an invalid direct memory access task; if the task effective parameter value corresponding to the direct memory access task is 0, the direct memory access task is determined to be 0. Take the task as an effective direct memory access task.
在一些实施例中,所述处理器在实现所述根据所述有效直接内存存取任务对应的任务激活参数值的取值,确定所述有效直接内存存取任务中的激活直接内存存取任务时,具体实现:In some embodiments, the processor determines the active direct memory access task in the effective direct memory access task according to the value of the task activation parameter value corresponding to the effective direct memory access task When, the specific realization:
若直接内存存取任务对应的任务激活参数值为0,则确定直接内存存取任务为非激活直接内存存取任务;若直接内存存取任务对应的任务激活参数值为1,则确定直接内存存取任务为激活直接内存存取任务;If the task activation parameter value corresponding to the direct memory access task is 0, the direct memory access task is determined to be an inactive direct memory access task; if the task activation parameter value corresponding to the direct memory access task is 1, then the direct memory is determined The access task is to activate the direct memory access task;
或者or
若直接内存存取任务对应的任务激活参数值为1,则确定直接内存存取任务为非激活直接内存存取任务;若直接内存存取任务对应的任务激活参数值为0,则确定直接内存存取任务为激活直接内存存取任务。If the task activation parameter value corresponding to the direct memory access task is 1, the direct memory access task is determined to be an inactive direct memory access task; if the task activation parameter value corresponding to the direct memory access task is 0, the direct memory is determined The access task is to activate the direct memory access task.
在一些实施例中,所述处理器在执行所述计算机程序时,还实现:In some embodiments, when the processor executes the computer program, it also implements:
将每个直接内存存取任务的任务描述参数信息对应的状态标记信息存储于状态寄存器中。The status tag information corresponding to the task description parameter information of each direct memory access task is stored in the status register.
在一些实施例中,所述状态寄存器包括4个区域,所述4个区域分别存储任务有效参数值、任务激活参数值、优先级参数值以及时间戳。In some embodiments, the status register includes 4 areas, and the 4 areas respectively store task effective parameter values, task activation parameter values, priority parameter values, and time stamps.
在一些实施例中,所述处理器在执行所述计算机程序时,还实现:In some embodiments, when the processor executes the computer program, it also implements:
将每个直接内存存取任务对应的任务描述参数信息存储于预设优先队列中。The task description parameter information corresponding to each direct memory access task is stored in the preset priority queue.
在一些实施例中,所述任务描述参数信息中包含中断参数值,所述处理器在执行所述计算机程序时,还实现:In some embodiments, the task description parameter information includes interrupt parameter values, and when the processor executes the computer program, it also implements:
在执行完成直接内存存取任务后,根据所述直接内存存取任务对应的中断参数值的取值,判断是否上报中断通知至所述精简指令集处理器。After the execution of the direct memory access task is completed, it is determined whether to report an interrupt notification to the reduced instruction set processor according to the value of the interrupt parameter value corresponding to the direct memory access task.
在一些实施例中,所述处理器在实现所述根据所述直接内存存取任务对应的中断参数值的取值,判断是否上报中断通知至所述精简指令集处理器时,具体实现:In some embodiments, when the processor realizes the determination of whether to report an interrupt notification to the reduced instruction set processor according to the value of the interrupt parameter value corresponding to the direct memory access task, it specifically implements:
若所述直接内存存取任务对应的中断参数值为1,则判定不上报所述中断通知至所述精简指令集处理器;若所述直接内存存取任务对应的中断参数值为0,则判定上报所述中断通知至所述精简指令集处理器;If the interrupt parameter value corresponding to the direct memory access task is 1, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value corresponding to the direct memory access task is 0, then Determine to report the interrupt notification to the reduced instruction set processor;
或者or
若所述直接内存存取任务对应的中断参数值为0,则判定不上报所述中断通知至所述精简指令集处理器;若所述直接内存存取任务对应的中断参数值为1,则判定上报所述中断通知至所述精简指令集处理器。If the interrupt parameter value corresponding to the direct memory access task is 0, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value corresponding to the direct memory access task is 1, then It is determined to report the interrupt notification to the reduced instruction set processor.
在一些实施例中,所述直接内存存取单元还包括至少一任务队列,预设有任务队列与数据通路的对应关系,所述处理器在实现所述根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务之后,还实现:In some embodiments, the direct memory access unit further includes at least one task queue, preset with a corresponding relationship between the task queue and the data path, and the processor is implementing the parameter information according to the at least one task description, After determining at least one direct memory access task currently to be executed, it also implements:
根据所述至少一当前待执行的直接内存存取任务对应的至少一任务描述参数信息,确定所述至少一当前待执行的直接内存存取任务对应的任务队列;Determine the task queue corresponding to the at least one direct memory access task currently to be executed according to at least one task description parameter information corresponding to the at least one direct memory access task currently to be executed;
根据任务队列与数据通路的对应关系,执行所述至少一当前待执行的直接内存存取任务。According to the corresponding relationship between the task queue and the data path, execute the at least one direct memory access task currently to be executed.
在一些实施例中,所述任务队列与数据通路的对应关系包括:一个任务队列对应一个数据通路。In some embodiments, the correspondence between the task queue and the data path includes: one task queue corresponds to one data path.
在一些实施例中,所述处理器在实现所述根据任务队列与数据通路的对应关系,执行所述至少一当前待执行的直接内存存取任务时,具体实现:In some embodiments, when the processor implements the at least one direct memory access task currently to be executed according to the corresponding relationship between the task queue and the data path, it specifically implements:
将所述至少一当前待执行的直接内存存取任务调度至对应的任务队列中,以及根据任务队列与数据通路的对应关系,将调度至每一任务队列的直接内存存取任务分配至对应的数据通路中,以执行所述至少一当前待执行的直接内存存取任务。The at least one currently to be executed direct memory access task is scheduled to the corresponding task queue, and the direct memory access task scheduled to each task queue is allocated to the corresponding task queue according to the corresponding relationship between the task queue and the data path In the data path, the at least one direct memory access task currently to be executed is executed.
在一些实施例中,所述至少一数据通路包括读大批量数据通路、写大批量数据通路、读小批量数据通路、写小批量数据通路,所述至少一任务队列包括读大批量数据任务队列、写大批量数据任务队列、读小批量数据任务队列、写小批量数据任务队列;所述读大批量数据任务队列对应所述读大批量数据通路,所述写大批量数据任务队列对应所述写大批量数据通路,所述读小批量数据任务队列对应所述读小批量数据通路,所述写小批量数据任务队列对应所述写小批量数据通路。In some embodiments, the at least one data path includes a read bulk data path, a write bulk data path, a read small bulk data path, and a write low bulk data path, and the at least one task queue includes a read bulk data task queue , Write large-batch data task queue, read small-batch data task queue, write small-batch data task queue; the read large-batch data task queue corresponds to the read large-batch data path, and the write large-batch data task queue corresponds to the Write a large-batch data path, the read small-batch data task queue corresponds to the read small-batch data path, and the write small-batch data task queue corresponds to the write small-batch data path.
在一些实施例中,所述直接内存存取单元设置于数字信号处理器中。In some embodiments, the direct memory access unit is provided in a digital signal processor.
在一些实施例中,所述处理器在实现所述执行所述至少一当前待执行的直接内存存取任务时,具体实现:In some embodiments, when the processor implements the at least one direct memory access task currently to be executed, it specifically implements:
若当前待执行的直接内存存取任务为读大批量数据任务,则从外部双倍速率同步动态随机存储器中读取所述读大批量数据任务对应的第一数据,将所述第一数据基于读大批量数据通路传输至所述数字信号处理器的内部缓存,并将所述第一数据写入所述内部缓存;If the current direct memory access task to be executed is the task of reading bulk data, the first data corresponding to the task of reading bulk data is read from the external double-rate synchronous dynamic random access memory, and the first data is based on Read the bulk data path and transmit it to the internal buffer of the digital signal processor, and write the first data into the internal buffer;
若所述目标直接内存存取任务为读小批量数据任务,则从所述外部双倍速率同步动态随机存储器中读取所述读小批量数据任务对应的第二数据,将所述第二数据基于读小批量数据通路传输至所述数字信号处理器的数据缓冲器,并将所述第二数据写入所述数据缓冲器;If the target direct memory access task is a task of reading small-batch data, the second data corresponding to the task of reading small-batch data is read from the external double-rate synchronous dynamic random access memory, and the second data is Based on the read small batch data path, the data is transmitted to the data buffer of the digital signal processor, and the second data is written into the data buffer;
若所述目标直接内存存取任务为写大批量数据任务,则从所述内部缓存读取所述写大批量数据任务对应的第三数据,将所述第三数据基于写大批量数据通路传输至所述外部双倍速率同步动态随机存储器,并将所述第三数据写入所述双倍速率同步动态随机存储器;If the target direct memory access task is a task of writing bulk data, the third data corresponding to the task of writing bulk data is read from the internal cache, and the third data is transmitted based on the write bulk data path To the external double-rate synchronous dynamic random access memory, and write the third data into the double-rate synchronous dynamic random access memory;
若所述目标直接内存存取任务为写小批量数据任务,则从所述数据缓冲器 读取所述写小批量数据任务对应的第四数据,将所述第四数据基于写小批量数据通路传输至所述双倍速率同步动态随机存储器,并将所述第四数据写入所述双倍速率同步动态随机存储器。If the target direct memory access task is a small batch data writing task, the fourth data corresponding to the small batch data writing task is read from the data buffer, and the fourth data is based on the writing small batch data path It is transmitted to the double-rate synchronous dynamic random access memory, and the fourth data is written into the double-rate synchronous dynamic random access memory.
本申请的实施例中还提供一种直接内存存取任务处理设备,该直接内存存取任务处理设备包括上述实施例中的数字信号处理器1000。直接内存存取任务处理设备通过从精简指令集处理器获取与多个直接内存存取任务的数据对应的至少一任务描述参数信息,并根据至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务,具体操作可参考本申请实施例提供的多个直接内存存取任务处理方法的步骤,在此不再赘述。An embodiment of the present application also provides a direct memory access task processing device. The direct memory access task processing device includes the digital signal processor 1000 in the foregoing embodiment. The direct memory access task processing device obtains at least one task description parameter information corresponding to the data of multiple direct memory access tasks from the reduced instruction set processor, and determines at least one task description parameter information currently to be executed according to the at least one task description parameter information For the direct memory access task, the specific operation can refer to the steps of the multiple direct memory access task processing methods provided in the embodiments of the present application, which will not be repeated here.
本申请的实施例中还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序中包括程序指令,处理器执行所述程序指令,实现本申请实施例提供的多个直接内存存取任务处理方法的步骤。An embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, the computer program includes program instructions, and a processor executes the program instructions to implement the embodiments of the present application. Provides the steps of multiple direct memory access task processing methods.
其中,所述计算机可读存储介质可以是前述实施例所述的直接内存存取单元或数字信号处理器或直接内存存取任务处理设备的内部存储单元,例如所述直接内存存取单元或数字信号处理器或直接内存存取任务处理设备的硬盘或内存。所述计算机可读存储介质也可以是所述直接内存存取单元或数字信号处理器或直接内存存取任务处理设备的外部存储设备,例如所述直接内存存取单元或数字信号处理器或直接内存存取任务处理设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。Wherein, the computer-readable storage medium may be the direct memory access unit or the digital signal processor or the internal storage unit of the direct memory access task processing device described in the foregoing embodiment, for example, the direct memory access unit or the digital signal processor. Signal processor or direct memory access to the hard disk or memory of task processing equipment. The computer-readable storage medium may also be an external storage device of the direct memory access unit or a digital signal processor or a direct memory access task processing device, such as the direct memory access unit or a digital signal processor or an external storage device. The plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. equipped on the memory access task processing equipment.
根据本发明实施方式,提出了直接内存存取单元、数字信号处理器、直接内存存取任务处理设备、多个直接内存存取任务处理方法及计算机可读存储介质。直接内存存取单元包括至少一数据通路和直接内存存取单元控制器,其中,至少一数据通路用于传输直接内存存取任务的数据,直接内存存取单元控制器包括与至少一数据通路和位于直接内存存取单元外部的精简指令集处理器连接的任务管理模块,任务管理模块从精简指令集处理器获取与多个直接内存存取任务的数据对应的至少一任务描述参数信息,以根据至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务,从而实现多直接内存存取任务的并行执行,相比于采用单线程的方式或者采用一个队列的方式来管理不同类型 的多个直接内存存取任务的执行,提高了直接内存存取任务的执行效率。According to the embodiments of the present invention, a direct memory access unit, a digital signal processor, a direct memory access task processing device, multiple direct memory access task processing methods, and a computer-readable storage medium are proposed. The direct memory access unit includes at least one data path and a direct memory access unit controller, wherein at least one data path is used to transmit data of the direct memory access task, and the direct memory access unit controller includes at least one data path and The task management module connected to the reduced instruction set processor located outside the direct memory access unit, the task management module obtains at least one task description parameter information corresponding to the data of the multiple direct memory access tasks from the reduced instruction set processor, so as to At least one task description parameter information, to determine at least one direct memory access task currently to be executed, so as to realize the parallel execution of multiple direct memory access tasks, compared to using a single thread or a queue to manage different types The execution of multiple direct memory access tasks improves the execution efficiency of direct memory access tasks.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Any person skilled in the art can easily think of various equivalents within the technical scope disclosed in this application. Modifications or replacements, these modifications or replacements shall be covered within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims (45)

  1. 一种直接内存存取单元,其特征在于,A direct memory access unit, characterized in that:
    所述直接内存存取单元包括至少一数据通路和直接内存存取单元控制器;The direct memory access unit includes at least one data path and a direct memory access unit controller;
    其中,in,
    所述至少一数据通路,用于传输直接内存存取任务的数据,其中,所述至少一数据通路对应传输不同类型的直接内存存取任务的数据;The at least one data path is used to transmit data of direct memory access tasks, wherein the at least one data path correspondingly transmits data of different types of direct memory access tasks;
    所述直接内存存取单元控制器包括与所述至少一数据通路和位于所述直接内存存取单元外部的精简指令集处理器连接的任务管理模块;其中,The direct memory access unit controller includes a task management module connected to the at least one data path and a reduced instruction set processor located outside the direct memory access unit; wherein,
    所述任务管理模块从所述精简指令集处理器获取与多个直接内存存取任务的数据对应的至少一任务描述参数信息,以根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务。The task management module obtains at least one task description parameter information corresponding to data of a plurality of direct memory access tasks from the reduced instruction set processor, so as to determine at least one task description parameter information currently to be executed according to the at least one task description parameter information Direct memory access tasks.
  2. 根据权利要求1所述的直接内存存取单元,其特征在于,所述任务描述参数信息中包含保序参数值,所述根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务,包括:The direct memory access unit according to claim 1, wherein the task description parameter information includes an order preserving parameter value, and the at least one task description parameter information is used to determine at least one direct current to be executed Memory access tasks, including:
    根据所述多个直接内存存取任务对应的保序参数值,确定所述多个直接内存存取任务中的保序执行直接内存存取任务;Determining the order-preserving execution direct memory access task among the multiple direct memory access tasks according to the order-preserving parameter values corresponding to the multiple direct memory access tasks;
    将所述保序执行直接内存存取任务按照任务加载顺序进行排序,并将排序最前的保序执行直接内存存取任务确定为当前待执行的直接内存存取任务。The order-preserving execution direct memory access tasks are sorted according to the task loading order, and the order-preserving execution direct memory access task with the highest ranking is determined as the current direct memory access task to be executed.
  3. 根据权利要求2所述的直接内存存取单元,其特征在于,所述任务管理模块具体用于:The direct memory access unit according to claim 2, wherein the task management module is specifically configured to:
    若所述多个直接内存存取任务中的第一直接内存存取任务对应的保序参数值为0,则确定所述第一直接内存存取任务为非保序执行直接内存存取任务;以及若所述多个直接内存存取任务中的第一直接内存存取任务对应的保序参数值为1,则确定所述第一直接内存存取任务为保序执行直接内存存取任务;If the order-preserving parameter value corresponding to the first direct memory access task among the plurality of direct memory access tasks is 0, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; And if the order-preserving parameter value corresponding to the first direct memory access task among the plurality of direct memory access tasks is 1, determining that the first direct memory access task is an order-preserving execution direct memory access task;
    或者or
    若所述多个直接内存存取任务中的第一直接内存存取任务对应的保序参数值为1,则确定所述第一直接内存存取任务为非保序执行直接内存存取任务; 以及若所述多个直接内存存取任务中的第一直接内存存取任务对应的保序参数值为0,则确定所述第一直接内存存取任务为保序执行直接内存存取任务。If the order-preserving parameter value corresponding to the first direct memory access task among the multiple direct memory access tasks is 1, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; And if the order-preserving parameter value corresponding to the first direct memory access task among the multiple direct memory access tasks is 0, it is determined that the first direct memory access task is an order-preserving execution direct memory access task.
  4. 根据权利要求2所述的直接内存存取单元,其特征在于,所述根据所述多个直接内存存取任务对应的保序参数值,确定所述多个直接内存存取任务中的保序执行直接内存存取任务之后,还包括:The direct memory access unit according to claim 2, wherein the order preserving among the multiple direct memory access tasks is determined according to the order preserving parameter values corresponding to the multiple direct memory access tasks After performing the direct memory access task, it also includes:
    若确定所述多个直接内存存取任务中的第一直接内存存取任务为保序执行直接内存存取任务,则将所述第一直接内存存取任务按照任务加载顺序压入虚拟队列中。If it is determined that the first direct memory access task among the multiple direct memory access tasks is an order-preserving execution direct memory access task, then the first direct memory access task is pressed into the virtual queue according to the task loading order .
  5. 根据权利要求4所述的直接内存存取单元,其特征在于,所述任务管理模块还用于:The direct memory access unit according to claim 4, wherein the task management module is further configured to:
    当所述当前待执行的直接内存存取任务执行完成时,将所述虚拟队列的头部指针加1;When the execution of the direct memory access task currently to be executed is completed, add 1 to the head pointer of the virtual queue;
    当所述虚拟队列中压入新的保序执行直接内存存取任务时,将所述虚拟队列的尾部指针加1。When a new order-preserving execution direct memory access task is pressed into the virtual queue, the tail pointer of the virtual queue is incremented by one.
  6. 根据权利要求1所述的直接内存存取单元,其特征在于,所述任务描述参数信息对应配置有状态标记信息,所述根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务,包括:The direct memory access unit according to claim 1, wherein the task description parameter information is correspondingly configured with state flag information, and the at least one task description parameter information is used to determine at least one direct current to be executed Memory access tasks, including:
    根据所述多个直接内存存取任务的任务描述参数信息对应的状态标记信息,确定执行等级最高的直接内存存取任务;Determine the direct memory access task with the highest execution level according to the status tag information corresponding to the task description parameter information of the multiple direct memory access tasks;
    将执行等级最高的直接内存存取任务确定为当前待执行的直接内存存取任务。The direct memory access task with the highest execution level is determined as the direct memory access task currently to be executed.
  7. 根据权利要求6所述的直接内存存取单元,其特征在于,所述状态标记信息包括任务有效参数值、任务激活参数值和优先级参数值,所述根据所述多个直接内存存取任务的任务描述参数信息对应的状态标记信息,确定执行等级最高的直接内存存取任务,包括:The direct memory access unit according to claim 6, wherein the status flag information includes a task effective parameter value, a task activation parameter value, and a priority parameter value, and the task is based on the plurality of direct memory access tasks The status tag information corresponding to the task description parameter information determines the direct memory access task with the highest execution level, including:
    根据所述多个直接内存存取任务对应的任务有效参数值的取值,确定所述多个直接内存存取任务中的有效直接内存存取任务;Determine the effective direct memory access task among the multiple direct memory access tasks according to the values of the task effective parameter values corresponding to the multiple direct memory access tasks;
    根据所述有效直接内存存取任务对应的任务激活参数值的取值,确定所述有效直接内存存取任务中的激活直接内存存取任务;Determine the active direct memory access task in the effective direct memory access task according to the value of the task activation parameter value corresponding to the effective direct memory access task;
    根据所述激活直接内存存取任务对应的优先级参数值的取值,确定优先级最高的激活直接内存存取任务;Determine the activated direct memory access task with the highest priority according to the value of the priority parameter value corresponding to the activated direct memory access task;
    将优先级最高的激活直接内存存取任务确定为所述执行等级最高的直接内存存取任务。The active direct memory access task with the highest priority is determined as the direct memory access task with the highest execution level.
  8. 根据权利要求6所述的直接内存存取单元,其特征在于,所述状态标记信息包括时间戳,所述任务管理模块还用于:The direct memory access unit according to claim 6, wherein the status mark information includes a time stamp, and the task management module is further configured to:
    根据所述多个直接内存存取任务对应的状态标记信息,确定优先级最高的激活直接内存存取任务;Determine the activated direct memory access task with the highest priority according to the status flag information corresponding to the multiple direct memory access tasks;
    若优先级最高的激活直接内存存取任务包括多个,则根据多个所述优先级最高的激活直接内存存取任务对应的时间戳,将时间戳数值最大的优先级最高的激活直接内存存取任务,确定为所述执行等级最高的直接内存存取任务。If the activated direct memory access task with the highest priority includes multiple, then according to the multiple timestamps corresponding to the activated direct memory access tasks with the highest priority, the activated direct memory access task with the highest time stamp value is the highest priority. Take the task and determine it as the direct memory access task with the highest execution level.
  9. 根据权利要求7所述的直接内存存取单元,其特征在于,所述任务管理模块具体用于:The direct memory access unit according to claim 7, wherein the task management module is specifically configured to:
    若直接内存存取任务对应的任务有效参数值为0,则确定直接内存存取任务为无效直接内存存取任务;若直接内存存取任务对应的任务有效参数值为1,则确定直接内存存取任务为有效直接内存存取任务;If the task valid parameter value corresponding to the direct memory access task is 0, the direct memory access task is determined to be an invalid direct memory access task; if the task valid parameter value corresponding to the direct memory access task is 1, then the direct memory access task is determined Take the task as an effective direct memory access task;
    或者or
    若直接内存存取任务对应的任务有效参数值为1,则确定直接内存存取任务为无效直接内存存取任务;若直接内存存取任务对应的任务有效参数值为0,则确定直接内存存取任务为有效直接内存存取任务。If the effective parameter value of the task corresponding to the direct memory access task is 1, the direct memory access task is determined to be an invalid direct memory access task; if the task effective parameter value corresponding to the direct memory access task is 0, the direct memory access task is determined to be 0. Take the task as an effective direct memory access task.
  10. 根据权利要求7所述的直接内存存取单元,其特征在于,所述任务管理模块具体用于:The direct memory access unit according to claim 7, wherein the task management module is specifically configured to:
    若直接内存存取任务对应的任务激活参数值为0,则确定直接内存存取任务为非激活直接内存存取任务;若直接内存存取任务对应的任务激活参数值为1,则确定直接内存存取任务为激活直接内存存取任务;If the task activation parameter value corresponding to the direct memory access task is 0, the direct memory access task is determined to be an inactive direct memory access task; if the task activation parameter value corresponding to the direct memory access task is 1, then the direct memory is determined The access task is to activate the direct memory access task;
    或者or
    若直接内存存取任务对应的任务激活参数值为1,则确定直接内存存取任务为非激活直接内存存取任务;若直接内存存取任务对应的任务激活参数值为0,则确定直接内存存取任务为激活直接内存存取任务。If the task activation parameter value corresponding to the direct memory access task is 1, the direct memory access task is determined to be an inactive direct memory access task; if the task activation parameter value corresponding to the direct memory access task is 0, the direct memory is determined The access task is to activate the direct memory access task.
  11. 根据权利要求6至10任一项所述的直接内存存取单元,其特征在于,所述任务管理模块还用于:The direct memory access unit according to any one of claims 6 to 10, wherein the task management module is further configured to:
    将每个直接内存存取任务的任务描述参数信息对应的状态标记信息存储于状态寄存器中。The status tag information corresponding to the task description parameter information of each direct memory access task is stored in the status register.
  12. 根据权利要求11所述的直接内存存取单元,其特征在于,所述状态寄存器包括4个区域,所述4个区域分别存储任务有效参数值、任务激活参数值、优先级参数值以及时间戳。The direct memory access unit according to claim 11, wherein the status register includes 4 areas, and the 4 areas respectively store task effective parameter values, task activation parameter values, priority parameter values, and time stamps. .
  13. 根据权利要求6至12任一项所述的直接内存存取单元,其特征在于,所述任务管理模块还用于:The direct memory access unit according to any one of claims 6 to 12, wherein the task management module is further configured to:
    将每个直接内存存取任务对应的任务描述参数信息存储于预设优先队列中。The task description parameter information corresponding to each direct memory access task is stored in the preset priority queue.
  14. 根据权利要求1所述的直接内存存取单元,其特征在于,所述任务描述参数信息中包含中断参数值,所述任务管理模块还用于:The direct memory access unit according to claim 1, wherein the task description parameter information includes interrupt parameter values, and the task management module is further configured to:
    在执行完成直接内存存取任务后,根据所述直接内存存取任务对应的中断参数值的取值,判断是否上报中断通知至所述精简指令集处理器。After the execution of the direct memory access task is completed, it is determined whether to report an interrupt notification to the reduced instruction set processor according to the value of the interrupt parameter value corresponding to the direct memory access task.
  15. 根据权利要求14所述的直接内存存取单元,其特征在于,所述根据所述直接内存存取任务对应的中断参数值的取值,判断是否上报中断通知至所述精简指令集处理器,包括:The direct memory access unit according to claim 14, wherein the determining whether to report an interrupt notification to the reduced instruction set processor according to the value of the interrupt parameter value corresponding to the direct memory access task, include:
    若所述直接内存存取任务对应的中断参数值为1,则判定不上报所述中断通知至所述精简指令集处理器;若所述直接内存存取任务对应的中断参数值为0,则判定上报所述中断通知至所述精简指令集处理器;If the interrupt parameter value corresponding to the direct memory access task is 1, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value corresponding to the direct memory access task is 0, then Determine to report the interrupt notification to the reduced instruction set processor;
    或者or
    若所述直接内存存取任务对应的中断参数值为0,则判定不上报所述中断通知至所述精简指令集处理器;若所述直接内存存取任务对应的中断参数值为1,则判定上报所述中断通知至所述精简指令集处理器。If the interrupt parameter value corresponding to the direct memory access task is 0, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value corresponding to the direct memory access task is 1, then It is determined to report the interrupt notification to the reduced instruction set processor.
  16. 根据权利要求1至15任一项所述的直接内存存取单元,其特征在于,所述直接内存存取单元还包括至少一任务队列,预设有任务队列与数据通路的对应关系,所述任务管理模块还用于:The direct memory access unit according to any one of claims 1 to 15, wherein the direct memory access unit further comprises at least one task queue, and the corresponding relationship between the task queue and the data path is preset, and the The task management module is also used to:
    根据所述至少一当前待执行的直接内存存取任务对应的至少一任务描述参数信息,确定所述至少一当前待执行的直接内存存取任务对应的任务队列;Determine the task queue corresponding to the at least one direct memory access task currently to be executed according to at least one task description parameter information corresponding to the at least one direct memory access task currently to be executed;
    根据任务队列与数据通路的对应关系,执行所述至少一当前待执行的直接内存存取任务。According to the corresponding relationship between the task queue and the data path, execute the at least one direct memory access task currently to be executed.
  17. 根据权利要求16所述的直接内存存取单元,其特征在于,所述任务队列与数据通路的对应关系包括:一个任务队列对应一个数据通路。The direct memory access unit according to claim 16, wherein the correspondence between the task queue and the data path comprises: one task queue corresponds to one data path.
  18. 根据权利要求16或17所述的直接内存存取单元,其特征在于,所述根据任务队列与数据通路的对应关系,执行所述至少一当前待执行的直接内存存取任务,包括:The direct memory access unit according to claim 16 or 17, wherein the executing the at least one direct memory access task currently to be executed according to the corresponding relationship between the task queue and the data path comprises:
    将所述至少一当前待执行的直接内存存取任务调度至对应的任务队列中,以及根据任务队列与数据通路的对应关系,将调度至每一任务队列的直接内存存取任务分配至对应的数据通路中,以执行所述至少一当前待执行的直接内存存取任务。The at least one direct memory access task currently to be executed is scheduled to the corresponding task queue, and the direct memory access task scheduled to each task queue is allocated to the corresponding task queue according to the corresponding relationship between the task queue and the data path In the data path, the at least one direct memory access task currently to be executed is executed.
  19. 根据权利要求16至18任一项所述的直接内存存取单元,其特征在于,所述至少一数据通路包括读大批量数据通路、写大批量数据通路、读小批量数据通路、写小批量数据通路,所述至少一任务队列包括读大批量数据任务队列、写大批量数据任务队列、读小批量数据任务队列、写小批量数据任务队列;所述读大批量数据任务队列对应所述读大批量数据通路,所述写大批量数据任务队列对应所述写大批量数据通路,所述读小批量数据任务队列对应所述读小批量数据通路,所述写小批量数据任务队列对应所述写小批量数据通路。The direct memory access unit according to any one of claims 16 to 18, wherein the at least one data path includes a read large-batch data path, a write large-batch data path, a read small-batch data path, and a write small-batch data path. In the data path, the at least one task queue includes a task queue for reading large batches of data, a task queue for writing large batches of data, a task queue for reading small batches of data, and a task queue for writing small batches of data; the task queue for reading large batches of data corresponds to the reading A large-batch data path, the write large-batch data task queue corresponds to the write large-batch data path, the read small-batch data task queue corresponds to the read small-batch data path, and the small-batch data write task queue corresponds to the Write small batch data path.
  20. 根据权利要求19所述的直接内存存取单元,其特征在于,所述直接内存存取单元设置于数字信号处理器中。18. The direct memory access unit of claim 19, wherein the direct memory access unit is disposed in a digital signal processor.
  21. 根据权利要求20所述的直接内存存取单元,其特征在于,所述执行所述至少一当前待执行的直接内存存取任务,包括:22. The direct memory access unit of claim 20, wherein the executing the at least one direct memory access task currently to be executed comprises:
    若当前待执行的直接内存存取任务为读大批量数据任务,则从外部的双倍速率同步动态随机存储器中读取所述读大批量数据任务对应的第一数据,将所述第一数据基于读大批量数据通路传输至所述数字信号处理器的内部缓存,并将所述第一数据写入所述内部缓存;If the current direct memory access task to be executed is the task of reading bulk data, the first data corresponding to the task of reading bulk data is read from the external double-rate synchronous dynamic random access memory, and the first data Based on the read bulk data path, the data is transmitted to the internal buffer of the digital signal processor, and the first data is written into the internal buffer;
    若当前待执行的直接内存存取任务为读小批量数据任务,则从所述双倍速率同步动态随机存储器中读取所述读小批量数据任务对应的第二数据,将所述第二数据基于读小批量数据通路传输至所述数字信号处理器的数据缓冲器,并 将所述第二数据写入所述数据缓冲器;If the current direct memory access task to be executed is the task of reading small batch data, the second data corresponding to the task of reading small batch data is read from the double-rate synchronous dynamic random access memory, and the second data Based on the read small batch data path, the data is transmitted to the data buffer of the digital signal processor, and the second data is written into the data buffer;
    若当前待执行的直接内存存取任务为写大批量数据任务,则从所述内部缓存读取所述写大批量数据任务对应的第三数据,将所述第三数据基于写大批量数据通路传输至所述双倍速率同步动态随机存储器,并将所述第三数据写入所述双倍速率同步动态随机存储器;If the current direct memory access task to be executed is a task of writing large batch data, the third data corresponding to the task of writing large batch data is read from the internal cache, and the third data is based on the writing large batch data path Transmitting to the double-rate synchronous dynamic random access memory, and writing the third data into the double-rate synchronous dynamic random access memory;
    若当前待执行的直接内存存取任务为写小批量数据任务,则从所述数据缓冲器读取所述写小批量数据任务对应的第四数据,将所述第四数据基于写小批量数据通路传输至所述双倍速率同步动态随机存储器,并将所述第四数据写入所述双倍速率同步动态随机存储器。If the current direct memory access task to be executed is a task of writing small batch data, the fourth data corresponding to the task of writing small batch data is read from the data buffer, and the fourth data is based on writing small batch data The channel is transmitted to the double-rate synchronous dynamic random access memory, and the fourth data is written into the double-rate synchronous dynamic random access memory.
  22. 一种数字信号处理器,其特征在于,所述数字信号处理器包括精简指令集处理器和如权利要求1至21中任一项所述的直接内存存取单元,所述精简指令集处理器通信连接所述直接内存存取单元。A digital signal processor, wherein the digital signal processor comprises a reduced instruction set processor and the direct memory access unit according to any one of claims 1 to 21, and the reduced instruction set processor The direct memory access unit is communicatively connected.
  23. 一种直接内存存取任务处理设备,其特征在于,所述直接内存存取任务处理设备包括如权利要求22所述的数字信号处理器。A direct memory access task processing device, wherein the direct memory access task processing device comprises the digital signal processor according to claim 22.
  24. 一种多个直接内存存取任务处理方法,应用于如权利要求1至21中任一项所述的直接内存存取单元,其特征在于,包括:A method for processing multiple direct memory access tasks, applied to the direct memory access unit according to any one of claims 1 to 21, characterized in that it comprises:
    从精简指令集处理器获取与多个直接内存存取任务的数据对应的至少一任务描述参数信息;Acquiring at least one task description parameter information corresponding to the data of multiple direct memory access tasks from the reduced instruction set processor;
    根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务。According to the at least one task description parameter information, at least one direct memory access task currently to be executed is determined.
  25. 根据权利要求24所述的方法,其特征在于,所述任务描述参数信息中包含保序参数值,所述根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务,包括:The method according to claim 24, wherein the task description parameter information includes a sequence preservation parameter value, and the at least one direct memory access task currently to be executed is determined according to the at least one task description parameter information ,include:
    根据所述多个直接内存存取任务对应的保序参数值,确定所述多个直接内存存取任务中的保序执行直接内存存取任务;Determining the order-preserving execution direct memory access task among the multiple direct memory access tasks according to the order-preserving parameter values corresponding to the multiple direct memory access tasks;
    将所述保序执行直接内存存取任务按照任务加载顺序进行排序,并将排序最前的保序执行直接内存存取任务确定为当前待执行的直接内存存取任务。The order-preserving execution direct memory access tasks are sorted according to the task loading order, and the order-preserving execution direct memory access task with the highest ranking is determined as the current direct memory access task to be executed.
  26. 根据权利要求25所述的方法,其特征在于,所述根据所述多个直接内存存取任务对应的保序参数值,确定所述多个直接内存存取任务中的保序执行 直接内存存取任务,包括:25. The method according to claim 25, wherein the order-preserving execution direct memory storage of the multiple direct memory access tasks is determined according to the order-preserving parameter values corresponding to the multiple direct memory access tasks. Take tasks, including:
    若所述多个直接内存存取任务中的第一直接内存存取任务对应的保序参数值为0,则确定所述第一直接内存存取任务为非保序执行直接内存存取任务;以及若所述多个直接内存存取任务中的第一直接内存存取任务对应的保序参数值为1,则确定所述第一直接内存存取任务为保序执行直接内存存取任务;If the order-preserving parameter value corresponding to the first direct memory access task among the plurality of direct memory access tasks is 0, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; And if the order-preserving parameter value corresponding to the first direct memory access task among the plurality of direct memory access tasks is 1, determining that the first direct memory access task is an order-preserving execution direct memory access task;
    或者or
    若所述多个直接内存存取任务中的第一直接内存存取任务对应的保序参数值为1,则确定所述第一直接内存存取任务为非保序执行直接内存存取任务;以及若所述多个直接内存存取任务中的第一直接内存存取任务对应的保序参数值为0,则确定所述第一直接内存存取任务为保序执行直接内存存取任务。If the order-preserving parameter value corresponding to the first direct memory access task among the multiple direct memory access tasks is 1, it is determined that the first direct memory access task is a non-order-preserving execution direct memory access task; And if the order-preserving parameter value corresponding to the first direct memory access task among the multiple direct memory access tasks is 0, it is determined that the first direct memory access task is an order-preserving execution direct memory access task.
  27. 根据权利要求25所述的方法,其特征在于,所述根据所述多个直接内存存取任务对应的保序参数值,确定所述多个直接内存存取任务中的保序执行直接内存存取任务之后,还包括:25. The method according to claim 25, wherein the order-preserving execution direct memory storage of the multiple direct memory access tasks is determined according to the order-preserving parameter values corresponding to the multiple direct memory access tasks. After taking the task, it also includes:
    若确定所述多个直接内存存取任务中的第一直接内存存取任务为保序执行直接内存存取任务,则将所述第一直接内存存取任务按照任务加载顺序压入虚拟队列中。If it is determined that the first direct memory access task among the multiple direct memory access tasks is an order-preserving execution direct memory access task, then the first direct memory access task is pressed into the virtual queue according to the task loading order .
  28. 根据权利要求27所述的方法,其特征在于,所述方法还包括:The method according to claim 27, wherein the method further comprises:
    当所述当前待执行的直接内存存取任务执行完成时,将所述虚拟队列的头部指针加1;When the execution of the direct memory access task currently to be executed is completed, add 1 to the head pointer of the virtual queue;
    当所述虚拟队列中压入新的保序执行直接内存存取任务时,将所述虚拟队列的尾部指针加1。When a new order-preserving execution direct memory access task is pressed into the virtual queue, the tail pointer of the virtual queue is incremented by one.
  29. 根据权利要求24所述的方法,其特征在于,所述任务描述参数信息对应配置有状态标记信息,所述根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务,包括:The method according to claim 24, wherein the task description parameter information is correspondingly configured with status flag information, and the at least one direct memory access task currently to be executed is determined according to the at least one task description parameter information ,include:
    根据所述多个直接内存存取任务的任务描述参数信息对应的状态标记信息,确定执行等级最高的直接内存存取任务;Determine the direct memory access task with the highest execution level according to the status tag information corresponding to the task description parameter information of the multiple direct memory access tasks;
    将执行等级最高的直接内存存取任务确定为当前待执行的直接内存存取任务。The direct memory access task with the highest execution level is determined as the direct memory access task currently to be executed.
  30. 根据权利要求29所述的方法,其特征在于,所述状态标记信息包括任 务有效参数值、任务激活参数值和优先级参数值,所述根据所述多个直接内存存取任务的任务描述参数信息对应的状态标记信息,确定执行等级最高的直接内存存取任务,包括:The method according to claim 29, wherein the status flag information includes task effective parameter values, task activation parameter values, and priority parameter values, and the task description parameters of the multiple direct memory access tasks are The status tag information corresponding to the information determines the direct memory access task with the highest execution level, including:
    根据所述多个直接内存存取任务对应的任务有效参数值的取值,确定所述多个直接内存存取任务中的有效直接内存存取任务;Determine the effective direct memory access task among the multiple direct memory access tasks according to the values of the task effective parameter values corresponding to the multiple direct memory access tasks;
    根据所述有效直接内存存取任务对应的任务激活参数值的取值,确定所述有效直接内存存取任务中的激活直接内存存取任务;Determine the active direct memory access task in the effective direct memory access task according to the value of the task activation parameter value corresponding to the effective direct memory access task;
    根据所述激活直接内存存取任务对应的优先级参数值的取值,确定优先级最高的激活直接内存存取任务;Determine the activated direct memory access task with the highest priority according to the value of the priority parameter value corresponding to the activated direct memory access task;
    将优先级最高的激活直接内存存取任务确定为所述执行等级最高的直接内存存取任务。The active direct memory access task with the highest priority is determined as the direct memory access task with the highest execution level.
  31. 根据权利要求29所述的方法,其特征在于,所述状态标记信息包括时间戳,所述根据所述多个直接内存存取任务的任务描述参数信息对应的状态标记信息,确定执行等级最高的直接内存存取任务,包括:The method according to claim 29, wherein the status tag information includes a time stamp, and the status tag information corresponding to the task description parameter information of the multiple direct memory access tasks is determined to determine the highest execution level Direct memory access tasks, including:
    根据所述多个直接内存存取任务对应的状态标记信息,确定优先级最高的激活直接内存存取任务;Determine the activated direct memory access task with the highest priority according to the status flag information corresponding to the multiple direct memory access tasks;
    若优先级最高的激活直接内存存取任务包括多个,则根据多个所述优先级最高的激活直接内存存取任务对应的时间戳,将时间戳数值最大的优先级最高的激活直接内存存取任务,确定为所述执行等级最高的直接内存存取任务。If the activated direct memory access task with the highest priority includes multiple, then according to the multiple timestamps corresponding to the activated direct memory access tasks with the highest priority, the activated direct memory access task with the highest time stamp value is the highest priority. Take the task and determine it as the direct memory access task with the highest execution level.
  32. 根据权利要求30所述的方法,其特征在于,所述根据所述多个直接内存存取任务对应的任务有效参数值的取值,确定所述多个直接内存存取任务中的有效直接内存存取任务,包括:The method according to claim 30, wherein the effective direct memory of the multiple direct memory access tasks is determined according to the values of the effective parameter values of the tasks corresponding to the multiple direct memory access tasks Access tasks, including:
    若直接内存存取任务对应的任务有效参数值为0,则确定直接内存存取任务为无效直接内存存取任务;若直接内存存取任务对应的任务有效参数值为1,则确定直接内存存取任务为有效直接内存存取任务;If the task valid parameter value corresponding to the direct memory access task is 0, the direct memory access task is determined to be an invalid direct memory access task; if the task valid parameter value corresponding to the direct memory access task is 1, then the direct memory access task is determined Take the task as an effective direct memory access task;
    或者or
    若直接内存存取任务对应的任务有效参数值为1,则确定直接内存存取任务为无效直接内存存取任务;若直接内存存取任务对应的任务有效参数值为0,则确定直接内存存取任务为有效直接内存存取任务。If the effective parameter value of the task corresponding to the direct memory access task is 1, the direct memory access task is determined to be an invalid direct memory access task; if the task effective parameter value corresponding to the direct memory access task is 0, the direct memory access task is determined to be 0. Take the task as an effective direct memory access task.
  33. 根据权利要求30所述的方法,其特征在于,所述根据所述有效直接内存存取任务对应的任务激活参数值的取值,确定所述有效直接内存存取任务中的激活直接内存存取任务,包括:The method according to claim 30, wherein the active direct memory access in the effective direct memory access task is determined according to the value of the task activation parameter value corresponding to the effective direct memory access task Tasks include:
    若直接内存存取任务对应的任务激活参数值为0,则确定直接内存存取任务为非激活直接内存存取任务;若直接内存存取任务对应的任务激活参数值为1,则确定直接内存存取任务为激活直接内存存取任务;If the task activation parameter value corresponding to the direct memory access task is 0, the direct memory access task is determined to be an inactive direct memory access task; if the task activation parameter value corresponding to the direct memory access task is 1, then the direct memory is determined The access task is to activate the direct memory access task;
    或者or
    若直接内存存取任务对应的任务激活参数值为1,则确定直接内存存取任务为非激活直接内存存取任务;若直接内存存取任务对应的任务激活参数值为0,则确定直接内存存取任务为激活直接内存存取任务。If the task activation parameter value corresponding to the direct memory access task is 1, the direct memory access task is determined to be an inactive direct memory access task; if the task activation parameter value corresponding to the direct memory access task is 0, the direct memory is determined The access task is to activate the direct memory access task.
  34. 根据权利要求29至33任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 29 to 33, wherein the method further comprises:
    将每个直接内存存取任务的任务描述参数信息对应的状态标记信息存储于状态寄存器中。The status tag information corresponding to the task description parameter information of each direct memory access task is stored in the status register.
  35. 根据权利要求34所述的方法,其特征在于,所述状态寄存器包括4个区域,所述4个区域分别存储任务有效参数值、任务激活参数值、优先级参数值以及时间戳。The method according to claim 34, wherein the status register comprises 4 areas, and the 4 areas respectively store task effective parameter values, task activation parameter values, priority parameter values, and time stamps.
  36. 根据权利要求29至35任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 29 to 35, wherein the method further comprises:
    将每个直接内存存取任务对应的任务描述参数信息存储于预设优先队列中。The task description parameter information corresponding to each direct memory access task is stored in the preset priority queue.
  37. 根据权利要求24所述的方法,其特征在于,所述任务描述参数信息中包含中断参数值,所述方法还包括:The method according to claim 24, wherein the task description parameter information includes interrupt parameter values, and the method further comprises:
    在执行完成直接内存存取任务后,根据所述直接内存存取任务对应的中断参数值的取值,判断是否上报中断通知至所述精简指令集处理器。After the execution of the direct memory access task is completed, it is determined whether to report an interrupt notification to the reduced instruction set processor according to the value of the interrupt parameter value corresponding to the direct memory access task.
  38. 根据权利要求37所述的方法,其特征在于,所述根据所述直接内存存取任务对应的中断参数值的取值,判断是否上报中断通知至所述精简指令集处理器,包括:37. The method of claim 37, wherein the judging whether to report an interrupt notification to the reduced instruction set processor according to the value of the interrupt parameter value corresponding to the direct memory access task comprises:
    若所述直接内存存取任务对应的中断参数值为1,则判定不上报所述中断通知至所述精简指令集处理器;若所述直接内存存取任务对应的中断参数值为 0,则判定上报所述中断通知至所述精简指令集处理器;If the interrupt parameter value corresponding to the direct memory access task is 1, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value corresponding to the direct memory access task is 0, then Determine to report the interrupt notification to the reduced instruction set processor;
    或者or
    若所述直接内存存取任务对应的中断参数值为0,则判定不上报所述中断通知至所述精简指令集处理器;若所述直接内存存取任务对应的中断参数值为1,则判定上报所述中断通知至所述精简指令集处理器。If the interrupt parameter value corresponding to the direct memory access task is 0, it is determined not to report the interrupt notification to the reduced instruction set processor; if the interrupt parameter value corresponding to the direct memory access task is 1, then It is determined to report the interrupt notification to the reduced instruction set processor.
  39. 根据权利要求24至38任一项所述的方法,其特征在于,所述直接内存存取单元还包括至少一任务队列,预设有任务队列与数据通路的对应关系,所述根据所述至少一任务描述参数信息,确定至少一当前待执行的直接内存存取任务之后,还包括:The method according to any one of claims 24 to 38, wherein the direct memory access unit further comprises at least one task queue, and the correspondence relationship between the task queue and the data path is preset, and the at least one task queue is preset according to the at least one task queue. A task description parameter information, after determining at least one direct memory access task currently to be executed, further includes:
    根据所述至少一当前待执行的直接内存存取任务对应的至少一任务描述参数信息,确定所述至少一当前待执行的直接内存存取任务对应的任务队列;Determine the task queue corresponding to the at least one direct memory access task currently to be executed according to at least one task description parameter information corresponding to the at least one direct memory access task currently to be executed;
    根据任务队列与数据通路的对应关系,执行所述至少一当前待执行的直接内存存取任务。According to the corresponding relationship between the task queue and the data path, execute the at least one direct memory access task currently to be executed.
  40. 根据权利要求39所述的方法,其特征在于,所述任务队列与数据通路的对应关系包括:一个任务队列对应一个数据通路。The method according to claim 39, wherein the correspondence between the task queue and the data path comprises: one task queue corresponds to one data path.
  41. 根据权利要求39或40所述的方法,其特征在于,所述根据任务队列与数据通路的对应关系,执行所述至少一当前待执行的直接内存存取任务,包括:The method according to claim 39 or 40, wherein the executing the at least one direct memory access task currently to be executed according to the corresponding relationship between the task queue and the data path comprises:
    将所述至少一当前待执行的直接内存存取任务调度至对应的任务队列中,以及根据任务队列与数据通路的对应关系,将调度至每一任务队列的直接内存存取任务分配至对应的数据通路中,以执行所述至少一当前待执行的直接内存存取任务。The at least one direct memory access task currently to be executed is scheduled to the corresponding task queue, and the direct memory access task scheduled to each task queue is allocated to the corresponding task queue according to the corresponding relationship between the task queue and the data path In the data path, the at least one direct memory access task currently to be executed is executed.
  42. 根据权利要求39至41任一项所述的方法,其特征在于,所述至少一数据通路包括读大批量数据通路、写大批量数据通路、读小批量数据通路、写小批量数据通路,所述至少一任务队列包括读大批量数据任务队列、写大批量数据任务队列、读小批量数据任务队列、写小批量数据任务队列;所述读大批量数据任务队列对应所述读大批量数据通路,所述写大批量数据任务队列对应所述写大批量数据通路,所述读小批量数据任务队列对应所述读小批量数据通路,所述写小批量数据任务队列对应所述写小批量数据通路。The method according to any one of claims 39 to 41, wherein the at least one data path includes reading a large-batch data path, writing a large-batch data path, reading a small-batch data path, and writing a small-batch data path, so The at least one task queue includes a task queue for reading large batches of data, a task queue for writing large batches of data, a task queue for reading small batches of data, and a task queue for writing small batches of data; the task queue for reading large batches of data corresponds to the channel for reading large batches of data , The task queue for writing large-batch data corresponds to the large-batch writing data path, the task queue for reading small-batch data corresponds to the small-batch reading data path, and the task queue for writing small-batch data corresponds to the writing small-batch data path.
  43. 根据权利要求42所述的方法,其特征在于,所述直接内存存取单元设置于数字信号处理器中。42. The method of claim 42, wherein the direct memory access unit is provided in a digital signal processor.
  44. 根据权利要求43所述的方法,其特征在于,所述执行所述至少一当前待执行的直接内存存取任务,包括:The method of claim 43, wherein the executing the at least one direct memory access task currently to be executed comprises:
    若当前待执行的直接内存存取任务为读大批量数据任务,则从外部的双倍速率同步动态随机存储器中读取所述读大批量数据任务对应的第一数据,将所述第一数据基于读大批量数据通路传输至所述数字信号处理器的内部缓存,并将所述第一数据写入所述内部缓存;If the current direct memory access task to be executed is the task of reading bulk data, the first data corresponding to the task of reading bulk data is read from the external double-rate synchronous dynamic random access memory, and the first data Based on the read bulk data path, the data is transmitted to the internal buffer of the digital signal processor, and the first data is written into the internal buffer;
    若当前待执行的直接内存存取任务为读小批量数据任务,则从所述双倍速率同步动态随机存储器中读取所述读小批量数据任务对应的第二数据,将所述第二数据基于读小批量数据通路传输至所述数字信号处理器的数据缓冲器,并将所述第二数据写入所述数据缓冲器;If the current direct memory access task to be executed is a task of reading small batch data, the second data corresponding to the task of reading small batch data is read from the double-rate synchronous dynamic random access memory, and the second data Based on the read mini-batch data path, the data is transmitted to the data buffer of the digital signal processor, and the second data is written into the data buffer;
    若当前待执行的直接内存存取任务为写大批量数据任务,则从所述内部缓存读取所述写大批量数据任务对应的第三数据,将所述第三数据基于写大批量数据通路传输至所述双倍速率同步动态随机存储器,并将所述第三数据写入所述双倍速率同步动态随机存储器;If the current direct memory access task to be executed is a task of writing large batch data, the third data corresponding to the task of writing large batch data is read from the internal cache, and the third data is based on the writing large batch data path Transmitting to the double-rate synchronous dynamic random access memory, and writing the third data into the double-rate synchronous dynamic random access memory;
    若当前待执行的直接内存存取任务为写小批量数据任务,则从所述数据缓冲器读取所述写小批量数据任务对应的第四数据,将所述第四数据基于写小批量数据通路传输至所述双倍速率同步动态随机存储器,并将所述第四数据写入所述双倍速率同步动态随机存储器。If the current direct memory access task to be executed is a task of writing small batch data, the fourth data corresponding to the task of writing small batch data is read from the data buffer, and the fourth data is based on writing small batch data The channel is transmitted to the double-rate synchronous dynamic random access memory, and the fourth data is written into the double-rate synchronous dynamic random access memory.
  45. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时使所述处理器实现如权利要求24至44中任一项所述的多个直接内存存取任务处理方法。A computer-readable storage medium, characterized in that, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor realizes the method described in any one of claims 24 to 44. The multiple direct memory access task processing methods described above.
PCT/CN2020/078852 2020-03-11 2020-03-11 Direct memory access unit, processor, device, processing method, and storage medium WO2021179218A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2020/078852 WO2021179218A1 (en) 2020-03-11 2020-03-11 Direct memory access unit, processor, device, processing method, and storage medium
CN202080005135.0A CN112823343A (en) 2020-03-11 2020-03-11 Direct memory access unit, processor, device, processing method, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/078852 WO2021179218A1 (en) 2020-03-11 2020-03-11 Direct memory access unit, processor, device, processing method, and storage medium

Publications (1)

Publication Number Publication Date
WO2021179218A1 true WO2021179218A1 (en) 2021-09-16

Family

ID=75858153

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/078852 WO2021179218A1 (en) 2020-03-11 2020-03-11 Direct memory access unit, processor, device, processing method, and storage medium

Country Status (2)

Country Link
CN (1) CN112823343A (en)
WO (1) WO2021179218A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007249635A (en) * 2006-03-16 2007-09-27 Nec Corp Data transfer unit and data transfer method
US20090150575A1 (en) * 2007-12-06 2009-06-11 Joaquin Madruga Dynamic logical data channel assignment using time-grouped allocations
CN102567256A (en) * 2011-12-16 2012-07-11 龙芯中科技术有限公司 Processor system, as well as multi-channel memory copying DMA accelerator and method thereof
CN103353851A (en) * 2013-07-01 2013-10-16 华为技术有限公司 Method and equipment for managing tasks
CN108701102A (en) * 2017-10-31 2018-10-23 深圳市大疆创新科技有限公司 Direct memory access controller, method for reading data and method for writing data
CN110083461A (en) * 2019-03-29 2019-08-02 郑州信大捷安信息技术股份有限公司 A kind of multitasking system and method based on FPGA

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017070900A1 (en) * 2015-10-29 2017-05-04 华为技术有限公司 Method and apparatus for processing task in a multi-core digital signal processing system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007249635A (en) * 2006-03-16 2007-09-27 Nec Corp Data transfer unit and data transfer method
US20090150575A1 (en) * 2007-12-06 2009-06-11 Joaquin Madruga Dynamic logical data channel assignment using time-grouped allocations
CN102567256A (en) * 2011-12-16 2012-07-11 龙芯中科技术有限公司 Processor system, as well as multi-channel memory copying DMA accelerator and method thereof
CN103353851A (en) * 2013-07-01 2013-10-16 华为技术有限公司 Method and equipment for managing tasks
CN108701102A (en) * 2017-10-31 2018-10-23 深圳市大疆创新科技有限公司 Direct memory access controller, method for reading data and method for writing data
CN110083461A (en) * 2019-03-29 2019-08-02 郑州信大捷安信息技术股份有限公司 A kind of multitasking system and method based on FPGA

Also Published As

Publication number Publication date
CN112823343A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
US10331595B2 (en) Collaborative hardware interaction by multiple entities using a shared queue
US8874810B2 (en) System and method for read data buffering wherein analyzing policy determines whether to decrement or increment the count of internal or external buffers
US8478926B1 (en) Co-processing acceleration method, apparatus, and system
US7433977B2 (en) DMAC to handle transfers of unknown lengths
WO2019183861A1 (en) Method, device, and machine readable storage medium for task processing
US9430411B2 (en) Method and system for communicating with non-volatile memory
CN114780458A (en) Data processing method and storage system
US20090119460A1 (en) Storing Portions of a Data Transfer Descriptor in Cached and Uncached Address Space
US9703603B1 (en) System and method for executing accelerator call
US9390033B2 (en) Method and system for communicating with non-volatile memory via multiple data paths
TWI712951B (en) Task management method, host and storage device for electronic storage device
CN103324599A (en) Inter-processor communication method and system on chip
CN111181874B (en) Message processing method, device and storage medium
US9377968B2 (en) Method and system for using templates to communicate with non-volatile memory
US8972693B2 (en) Hardware managed allocation and deallocation evaluation circuit
US20030061414A1 (en) Controlling data flow between processor systems
WO2021179218A1 (en) Direct memory access unit, processor, device, processing method, and storage medium
CN115904671B (en) Task scheduling method, device, equipment and medium in edge computing environment
US20230393782A1 (en) Io request pipeline processing device, method and system, and storage medium
US20220156006A1 (en) System and method for exchanging messages
US10958597B2 (en) General purpose ring buffer handling in a network controller
US9110856B2 (en) Interface control apparatus, data storage apparatus and method for interface control
CN113268356A (en) LINUX system-based multi-GPU board card bounding system, method and medium
US11941722B2 (en) Kernel optimization and delayed execution
WO2022088074A1 (en) Instruction processing method based on multiple instruction engines, and processor

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20924775

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20924775

Country of ref document: EP

Kind code of ref document: A1