Data processing method, device and system under DMA linked list mode

By recording the mapping relationship between the transmission configuration information and number of the linked list in DMA, the problem of low transmission efficiency in the prior art is solved, and more efficient data transmission processing is achieved.

CN116204466BActive Publication Date: 2025-08-26MOLCHIP TECH (SHANGHAI) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310137923.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-20
Publication Date
2025-08-26
Estimated Expiration
2043-02-20

AI Technical Summary

Technical Problem

In the existing DMA linked list mode, after each linked list is transferred, it is necessary to revisit the memory and obtain the configuration information of the next linked list, resulting in wasted time and memory resources, reducing the efficiency of data transmission processing.

Method used

The transmission configuration information of the linked list is recorded as a mapping of the number of linked lists and stored in the DMA. The configuration information is directly obtained from the DMA to reduce the number of accesses to external memory. The compressed linked list transmission mode and the conventional linked list transmission mode are used to transfer data according to the linked list number and mapping relationship.

Benefits of technology

It improves the access efficiency of DMA, improves the data transmission processing efficiency, and reduces the dependence on external memory during linked list transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116204466B_ABST
    Figure CN116204466B_ABST
Patent Text Reader

Abstract

The present invention discloses a data processing method, device, and system under a DMA linked list mode, and relates to the field of DMA data processing technology. The method comprises the following steps: for a data transfer task, obtaining DMA linked list information and DMA transmission configuration information set in a memory; configuring linked list numbers for multiple linked lists corresponding to the aforementioned data transfer task, recording the mapping relationship between the linked list number and transmission configuration information of each linked list, and storing the mapping relationship within the DMA; when performing DMA linked list transmission, recording the number of linked list transmissions, and reading the transmission configuration information corresponding to the linked list with linked list number N from the DMA according to the number of linked list transmissions N to which the current data to be transferred belongs, and initiating the linked list transmission according to the aforementioned transmission configuration information. The present invention effectively reduces the number of times the memory outside the DMA is accessed during the linked list transmission process, improves the access efficiency of the DMA, and improves the data transmission processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of DMA data processing. Background Art

[0002] DMA (Direct Memory Access) transfer is a technology that replaces the processor in completing data transfers between memory and peripheral devices. DMA allows data from peripheral devices, for example, to be transferred to memory without the intervention of the processor (such as the CPU), allowing the processor to perform other tasks in parallel. Using DMA to transfer data effectively improves processor efficiency.

[0003] DMA transfers can generally be divided into block DMA transfers and chained DMA transfers. Block DMA transfers transfer multiple data packets at once, reducing interrupt processing. Chained DMA transfers record the transfer addresses of different data packets in a linked list. DMA reads the linked list information for transmission and reports an interrupt when all linked list entries have been processed. To implement chained DMA transfers, after the DMA linked list is generated, the information for each linked list must be written to the memory. This information typically includes a pointer to the address of the next linked list information, information to determine whether the linked list has ended, and DMA transfer configuration information. This DMA transfer configuration information can include configuration information such as the source address, destination address, and amount of data to be transferred for this DMA transfer. The process of chained DMA transmission is summarized as follows: first, the DMA is configured for the first time through the host computer and the address information of the first linked list is assigned to the DMA. After configuration, the DMA enters the linked list mode; then, the DMA reads the data at the corresponding address of the memory according to the address information of the assigned first linked list, and after obtaining the table entry information of the first linked list, it starts the transmission; after the first linked list transmission is completed, the DMA reads the information of the next linked list from the memory, and so on, until the end signal in a certain linked list information is read, and the transmission is determined to be the last transmission. After the transmission is completed, the linked list mode ends.

[0004] In DMA's linked list mode (LLI), the host computer only needs to configure the DMA once to continuously read and automatically access the linked list information in the memory. The advantage of this mode is that after entering linked list mode, the host computer does not need to configure the DMA to continuously transfer non-contiguous addresses, and information such as the data length, destination address, and source address of each transfer does not need to be uniformly configured to the DMA in advance. This allows the DMA to operate independently of the host computer without significantly increasing the resources used by the DMA, reducing the DMA's resource usage.

[0005] However, in the existing DMA linked list mode, after each linked list transfer is completed, the DMA still needs to re-access the memory to obtain the configuration information of the next linked list (the multiple data packets to be transmitted are divided into multiple linked lists, and the configuration information corresponding to each linked list is stored in the memory). On the one hand, this causes a waste of time and memory resources; on the other hand, if the data packets are discontinuous, too many linked list entries will increase the waiting time for the linked list to complete, reducing the data transmission processing efficiency.

[0006] Based on the above defects, the prior art also provides some improved DMA transmission schemes. For example, Chinese patent application CN202010076391.0 discloses a ring-linked list DMA transmission method, which uses a ring-linked list with a transfer status flag, so that the DMA controller can autonomously and cyclically remove configuration information from the ring-linked list and inform the CPU of the completion of the transmission through the transfer status flag; after processing the transmission data, the CPU reads the next list status flag and configures a new table entry according to the flag status; thereby avoiding the DMA controller reporting an interrupt every time a transmission is completed, so that the CPU will not be frequently disturbed by DMA interrupts, reducing CPU resource usage. However, the above scheme requires the CPU to set up a ring-linked list with table item link addresses connected end to end in the memory and configure a transfer status flag for each table item in the ring-linked list. During data transmission, the DMA controller needs to cyclically read the status of the transfer status flag of each table item to determine whether to report a DMA interrupt to the CPU or perform DMA transmission, and change the status of the transfer status flag to interact with the CPU. The setting, reading and changing of the transfer status flag takes up time and memory resources, which to a certain extent affects the data transmission efficiency. Summary of the Invention

[0007] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a data processing method, device, and system under a DMA linked list mode. The data processing method, device, and system under the DMA linked list mode provided by the present invention record the transmission configuration information of the linked list as a mapping of linked list numbers based on the DMA linked list information and DMA transmission configuration information of the data transfer task, and store the mapping relationship within the DMA. When performing the DMA linked list transmission of the aforementioned data transfer task, the transmission configuration information of the transmission linked list is directly obtained from the DMA, without the need to repeatedly read the transmission configuration information of the linked list from the memory. This effectively reduces the number of times the memory outside the DMA is accessed during the linked list transmission process, improves the access efficiency of the DMA, and improves the data transmission processing efficiency.

[0008] To achieve the above objectives, the present invention provides the following technical solutions:

[0009] A data processing method in DMA linked list mode includes the following steps:

[0010] For a data transfer task, obtaining DMA linked list information and DMA transfer configuration information set in the memory, wherein the DMA linked list is configured to connect multiple continuous or non-continuous data to be transferred, and the DMA transfer configuration information is used to control data transfer, and the DMA transfer configuration information includes transferred data length information, source address information, destination address information, and a next linked list descriptor;

[0011] Configure linked list numbers for multiple linked lists corresponding to the aforementioned data transfer tasks, where the linked list numbers are used to indicate which linked list transfer the corresponding linked list is in the data transfer task, record the mapping relationship between the linked list numbers and the transmission configuration information of each linked list, and store the mapping relationship inside the DMA; when performing DMA linked list transfer, record the number of linked list transfers, and read the transmission configuration information corresponding to the linked list with linked list number N from the DMA according to the number N of linked list transfers to which the current data to be transferred belongs, and initiate the linked list transfer according to the aforementioned transmission configuration information; N is an integer greater than or equal to 1.

[0012] Furthermore, the total number M of linked lists corresponding to the aforementioned data handling tasks is obtained. When the number N of linked list transmissions is equal to the total number M of the aforementioned linked lists, the linked list transmission is stopped, where M is an integer greater than 1.

[0013] Furthermore, before configuring the linked lists to be numbered, the method further includes the following steps:

[0014] Get the total number of linked lists corresponding to the aforementioned data handling tasks;

[0015] Determine whether the total number of the aforementioned linked lists exceeds a preset threshold;

[0016] When it is determined that the total number of linked lists exceeds a preset threshold, the compressed linked list transmission mode is triggered; in the compressed linked list transmission mode, the DMA module can configure linked list numbers for multiple linked lists corresponding to the aforementioned data handling tasks, and record the mapping relationship between the linked list numbers and transmission configuration information of each linked list and store it inside the DMA, and then perform the aforementioned DMA linked list transmission.

[0017] Further, when it is determined that the total number of linked lists does not exceed a preset threshold, a regular linked list transmission mode is triggered;

[0018] In the conventional linked list transmission mode, when the data transmission of a linked list is completed, the DMA module reads the transmission configuration information of the next linked list from the memory according to the transmission configuration information of the linked list.

[0019] Furthermore, the preset threshold is set by the system or the user.

[0020] Furthermore, the method further includes the steps of: analyzing the transmission configuration information of the plurality of linked lists of the aforementioned data handling tasks to determine whether they contain the same information or conform to a preset rule;

[0021] For multiple linked lists containing the same information or conforming to a preset rule, determining that the multiple linked lists are related;

[0022] A plurality of related linked lists are configured into a group to form a linked list group, and a compressed linked list transmission mode is adopted for the linked list group; under the compressed linked list transmission mode, a linked list number is configured for each linked list in a linked list group, and the linked list number is used to indicate the number of linked list transmissions of the corresponding linked list in the aforementioned linked list group, and a mapping relationship between the linked list number and transmission configuration information of each linked list is recorded, and the mapping relationship is stored inside the DMA; and, when performing DMA linked list transmission of the aforementioned linked list group, the number of linked list transmissions is recorded, and the transmission configuration information corresponding to the linked list with the linked list number N1 is read from the DMA according to the number N1 of linked list transmissions to which the data to be currently transferred belongs, and the linked list transmission is initiated according to the aforementioned transmission configuration information; the N1 is an integer greater than or equal to 1.

[0023] Furthermore, for linked lists that are not related, a conventional linked list transmission mode is adopted; in the conventional linked list transmission mode, when the data transmission of a linked list is completed, the DMA module reads the transmission configuration information of the next linked list from the memory according to the transmission configuration information of the linked list.

[0024] Furthermore, when a data handling task includes multiple consecutive linked list groups, the compressed linked list transmission mode is adopted within the linked list group; the conventional linked list transmission mode is adopted between each linked list group. At this time, when the data transmission of the last linked list in a linked list group is completed, the DMA module reads the transmission configuration information of the first linked list in the next linked list group from the memory according to the transmission configuration information of the linked list.

[0025] The present invention also provides a data processing device in DMA linked list mode, comprising the following structure:

[0026] a linked list information acquisition module, configured to obtain, for a data transfer task, DMA linked list information and DMA transfer configuration information set in the memory, wherein the DMA linked list is configured to connect multiple continuous or non-continuous data to be transferred, and the DMA transfer configuration information is used to control data transfer, and the DMA transfer configuration information includes transferred data length information, source address information, destination address information, and a next linked list descriptor;

[0027] a linked list information compression module, configured to assign linked list numbers to the plurality of linked lists corresponding to the aforementioned data transfer task, wherein the linked list numbers are used to indicate the number of linked list transfers of the corresponding linked list in the data transfer task, record a mapping relationship between the linked list numbers and the transfer configuration information of each linked list, and store the mapping relationship within the DMA;

[0028] The linked list transfer control module is used to record the number of linked list transfers when performing DMA linked list transfers, and read the transmission configuration information corresponding to the linked list numbered N from the DMA according to the number of linked list transfers N to which the current data to be transferred belongs, and initiate the linked list transfer according to the aforementioned transmission configuration information; the N is an integer greater than or equal to 1.

[0029] The present invention also provides a DMA transmission system, comprising a central processing unit (CPU) and a DMA controller;

[0030] The CPU is used to set a DMA linked list and DMA transfer configuration information for the data handling task in the memory;

[0031] The DMA controller is used to control the DMA to execute a data transfer process based on a linked list according to the aforementioned data processing method.

[0032] Due to the adoption of the above technical solution, the present invention has the following advantages and positive effects compared with the existing technology, as an example: the data processing method, device and system under the DMA linked list mode, based on the DMA linked list information and DMA transmission configuration information of the data handling task, the transmission configuration information of the linked list is recorded as a mapping of the linked list number, and the mapping relationship is stored inside the DMA. When performing the DMA linked list transmission of the aforementioned data handling task, the transmission configuration information of the transmission linked list is directly obtained from the DMA, and there is no need to repeatedly read the transmission configuration information of the linked list from the memory, which effectively reduces the number of times the memory outside the DMA is accessed during the linked list transmission process, improves the access efficiency of the DMA, and improves the data transmission processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 Schematic diagram of the linked list connection of the DMA linked list mode in the prior art.

[0034] Figure 2 This is a flow chart of a data processing method in DMA linked list mode provided by an embodiment of the present invention.

[0035] Figure 3 A schematic diagram of the structure of a DMA transmission system provided by an embodiment of the present invention. Implementation Method

[0036] The data processing method, device, and system under the DMA linked list mode disclosed in the present invention are further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the technologies (including methods and devices) known to those skilled in the art may not be discussed in detail, but where appropriate, the above-mentioned known technologies are considered part of the specification. At the same time, other examples of the exemplary embodiments may have different values. The structures, proportions, sizes, etc. depicted in the drawings of this specification are only used to match the contents disclosed in the specification for people familiar with this technology to understand and read, and are not intended to limit the conditions under which the invention can be implemented. Example

[0037] The essence of DMA transfer is to move data from one address space to another. DMA transfer configuration information is used to control data transfer. The transfer configuration information usually includes the length of the data being transferred (or the amount of data transferred), the source address, and the destination address. In DMA linked list mode (LLI for short), the transfer configuration information for a linked list also includes the next linked list descriptor. The configuration information corresponding to each linked list is stored in memory. When the data transfer of a linked list is completed, it will jump to the starting address of the next linked list and continue to transfer data until the next address of the linked list is 0. In this way, the data of multiple linked lists can be connected in series for execution. For a linked list connection diagram, see Figure 1 The DMA linked list supports both address-connected and address-discontinuous transfers. If the DMA is enabled for completion interrupts, a completion interrupt is triggered when DMA transmission or reception is completed.

[0038] Under the linked list transmission scheme of the above DMA linked list mode, after each linked list transmission is completed, it is necessary to re-access the memory to obtain the transmission configuration information of the next linked list, which affects the DMA access efficiency. Therefore, the present invention proposes an improvement to the data transfer scheme under the DMA linked list mode. For details, see Figure 2 As shown, a data processing method in DMA linked list mode provided by the present invention includes the following steps.

[0039] S100 , for a data transfer task, obtaining DMA linked list information and DMA transfer configuration information set in a memory.

[0040] The DMA linked list is configured to connect multiple continuous or non-continuous data to be transferred.

[0041] The DMA transfer configuration information is used to control data transfer and may generally include an address field, a data transfer size field, or a flag. The address field includes source address information and target address information. The source address information is used to indicate the source address of the DMA transfer data in the physical memory or the first address of the subsequent linked list, and the target address information is used to indicate the destination address of the data transfer in the physical memory. The data transfer size field includes data transfer length information, which is used to define the length of the data block transferred by the linked list. The flag may include an interrupt flag, an end flag, etc. The interrupt flag is used to indicate whether the DMA controller reports an interrupt to the CPU after completing the data transfer defined by the linked list; the end flag is used to indicate that the current linked list is the last linked list, and the entire DMA transfer task is terminated after execution is completed. In this embodiment, the DMA transfer configuration information includes at least the transferred data length information, source address information, target address information, and the next linked list descriptor.

[0042] For a data transfer task, there may be multiple transmission linked lists. The transmission configuration information corresponding to each linked list is stored in the memory. After each linked list transmission is completed, the transmission configuration information of the next linked list is read from the memory according to the next linked list address configured in the linked list.

[0043] S200, configure link list numbers for multiple linked lists corresponding to the aforementioned data transfer tasks, record the mapping relationship between the link list numbers and transmission configuration information of each linked list, and store the mapping relationship inside the DMA; when performing DMA linked list transmission, record the number of linked list transmissions, and read the transmission configuration information corresponding to the linked list with link list number N from the DMA according to the number N of linked list transmissions to which the current data to be transferred belongs, and initiate linked list transmission according to the aforementioned transmission configuration information.

[0044] The linked list number is used to indicate the number of linked list transfers in the data transfer task. N is an integer greater than or equal to 1.

[0045] In this embodiment, the total number M of linked lists corresponding to the aforementioned data transfer task is obtained. When the number N of linked list transmissions is equal to the total number M of linked lists, the linked list transmission is stopped, and M is an integer greater than 1.

[0046] As an example, not a limitation, consider a data transfer task that requires linked list transmission. Each linked list has a data length of X bytes, and a total of M linked list transmissions are required (i.e., the total number of linked lists is M, where M is an integer greater than 1). The source addresses (SRC addresses) of the linked list transmissions are configured as src_addr0, src_addr1, src_addr2, ..., src_addrn, with an address offset of offset_src, where n is a positive integer and src_addrn represents the nth source address. The destination addresses (DST addresses) are configured as dst_addr0, dst_addr1, dst_addr2, ..., dst_addrn, with an address offset of offset_dst, where n is a positive integer and dst_addrn represents the nth destination address. The source and destination addresses satisfy the following relationship:

[0047] src_addrn-src_addr(n-1)=offset_src;

[0048] dst_addrn-dst_addr(n-1)=offset_dst.

[0049] Using the above solution provided by the present invention, after mapping the linked list transmission configuration information with the linked list number, the mapping relationship is stored in the DMA. Specifically, for the Nth linked list transmission, N = 1, 2, ..., M, the recorded mapping relationship is as follows:

[0050] src_addrn=offset_src*N+src_addr0

[0051] dst_addrn=offset_dst*N+dst_addr0

[0052] if N=M

[0053] link_listen=0

[0054] Among them, link_listen represents the next address value of the linked list. When link_listen is equal to 0, DMA stops linked list transmission.

[0055] Update the configuration file:

[0056] cfgn=cfg(n-1)

[0057] In this command, cfgn indicates the nth configuration file, and cfg(n-1) indicates the n-1th configuration file.

[0058] After the above mapping information is stored inside the DMA, when performing linked list transmission, the DMA directly obtains the transmission configuration information of the corresponding linked list through the current number of transmission items N, and initiates the linked list transmission based on the obtained transmission configuration information. In this way, there is no need to access the memory outside the DMA (the aforementioned memory) to obtain the configuration information of the transmission linked list, thereby improving the access efficiency of the DMA.

[0059] In another implementation of this embodiment, a compressed linked list transmission mode and a normal linked list transmission mode are also provided.

[0060] At this time, before assigning linked list numbers to the multiple linked lists, the steps may also include: obtaining the total number of linked lists corresponding to the aforementioned data transfer task; determining whether the total number of linked lists exceeds a preset threshold; triggering a compressed linked list transfer mode when it is determined that the total number of linked lists exceeds the preset threshold; in the compressed linked list transfer mode, the DMA module can assign linked list numbers to the multiple linked lists corresponding to the aforementioned data transfer task, record the mapping relationship between the linked list number and the transfer configuration information of each linked list, and store it within the DMA, and then perform the aforementioned DMA linked list transfer. If it is determined that the total number of linked lists does not exceed the preset threshold, the regular linked list transfer mode is triggered.

[0061] In the conventional linked list transmission mode, when the data transmission of a linked list is completed, the DMA module reads the transmission configuration information of the next linked list from the memory according to the transmission configuration information of the linked list. This belongs to the existing technology and will not be described in detail here.

[0062] Specifically, the preset threshold can be set by the system or the user. That is, only when the number of linked lists corresponding to the data transfer task exceeds a certain number, the compressed linked list transmission mode is triggered and the linked list processing step S200 is executed; otherwise, the conventional linked list transmission mode is used for linked list transmission.

[0063] In another implementation of this embodiment, whether to adopt the compressed linked list transmission mode may be determined based on the similarity or regularity of the transmission configuration information of each linked list in the data transfer.

[0064] Specifically, the following steps may be included: analyzing the transmission configuration information of multiple linked lists of the aforementioned data transfer task to determine whether they contain the same information or conform to a preset pattern; for multiple linked lists that contain the same information or conform to the preset pattern, determining that the multiple linked lists are correlated; configuring the multiple correlated linked lists into a group to form a linked list group, and adopting a compressed linked list transmission mode for the linked list group. For example, the inclusion of the same information means that the length of the transferred data is the same; and the conformance to the preset pattern means, for example, that the destination address and the source address have the same pattern.

[0065] In the compressed linked list transmission mode, a linked list number is configured for each linked list in a linked list group, and the linked list number is used to indicate the number of linked list transmissions of the corresponding linked list in the aforementioned linked list group. The mapping relationship between the linked list number and the transmission configuration information of each linked list is recorded, and the mapping relationship is stored inside the DMA; and when performing DMA linked list transmission of the aforementioned linked list group, the number of linked list transmissions is recorded, and the transmission configuration information corresponding to the linked list with the linked list number N1 is read from the DMA according to the number N1 of linked list transmissions to which the current data to be transferred belongs, and the linked list transmission is initiated according to the aforementioned transmission configuration information; the N1 is an integer greater than or equal to 1.

[0066] For linked lists that are not related, a conventional linked list transmission mode is used. In the conventional linked list transmission mode, when the data transmission of a linked list is completed, the DMA module reads the transmission configuration information of the next linked list from the memory according to the transmission configuration information of the linked list.

[0067] Further preferably, when a data transfer task includes multiple consecutive linked list groups, the compressed linked list transfer mode is used within the linked list groups, while the conventional linked list transfer mode is used between the linked list groups. In this case, after the data transfer of the last linked list in a linked list group is completed, the DMA module reads the transmission configuration information of the first linked list in the next linked list group from the memory based on the transmission configuration information of the linked list.

[0068] The above technical solution provided in this embodiment records the mapping relationship between the transmission configuration information of the linked list and the linked list number within the DMA, and obtains the transmission configuration information required for different linked list transmissions through the mapping relationship, so as to configure the DMA and complete the linked list transmission, thereby effectively reducing the number of times the linked list transmission configuration information is read from the external memory, thereby improving access efficiency.

[0069] Another embodiment of the present invention further provides a data processing device in DMA linked list mode.

[0070] The data processing device includes a linked list information acquisition module, a linked list information compression module and a linked list transmission control module.

[0071] The linked list information acquisition module is used to obtain DMA linked list information and DMA transfer configuration information set in the memory for a data transfer task. The DMA linked list is configured to connect multiple continuous or non-continuous data to be transferred. The DMA transfer configuration information is used to control data transfer and includes the transferred data length information, source address information, destination address information, and the next linked list descriptor.

[0072] The linked list information compression module is used to configure linked list numbers for multiple linked lists corresponding to the aforementioned data transfer tasks. The linked list numbers are used to indicate which linked list transmission the corresponding linked list is in the data transfer task, record the mapping relationship between the linked list numbers and transmission configuration information of each linked list, and store the mapping relationship inside the DMA.

[0073] The linked list transfer control module is used to record the number of linked list transfers when performing DMA linked list transfers, and read the transmission configuration information corresponding to the linked list numbered N from the DMA according to the number of linked list transfers N to which the current data to be transferred belongs, and initiate the linked list transfer according to the aforementioned transmission configuration information; N is an integer greater than or equal to 1.

[0074] In this embodiment, the linked list transmission control module is further configured to: obtain the total number M of linked lists corresponding to the aforementioned data transfer task, and stop the linked list transmission when the number N of linked list transmissions is equal to the total number M of linked lists, where M is an integer greater than 1.

[0075] Preferably, a linked list transmission mode selection module may also be included.

[0076] The linked list transmission mode selection module is configured to: obtain the number of linked lists corresponding to the aforementioned data handling task; determine whether the number of linked lists exceeds a preset threshold; when it is determined that the number of linked lists exceeds the preset threshold, trigger the compressed linked list transmission instruction of the data handling task, and send the compressed linked list transmission instruction and the corresponding data handling task identification information to the linked list information compression module and the linked list transmission control module; when it is determined that the number of linked lists does not exceed the preset threshold, trigger the conventional linked list transmission instruction, and send the conventional linked list transmission instruction directly to the linked list transmission control module.

[0077] Upon receiving the compressed linked list transmission instruction and the corresponding data transfer task identification information, the linked list information compression module controls the DMA module to assign linked list numbers to the multiple linked lists corresponding to the aforementioned data transfer tasks, and records the mapping relationship between the linked list number and the transmission configuration information for each linked list and stores it within the DMA. The DMA also records the data transfer task identification corresponding to the mapping relationship.

[0078] The linked list transmission control module records the number of linked list transmissions when performing the DMA linked list transmission of the data transmission task based on the received compressed linked list transmission instruction and the corresponding data transmission task identification information, and reads the mapping relationship of the data transmission task from the DMA (through the corresponding data transmission task identification) based on the number N of linked list transmissions to which the current data to be transmitted belongs. After obtaining the transmission configuration information corresponding to the linked list with linked list number N, the linked list transmission is initiated according to the aforementioned transmission configuration information.

[0079] The linked list transfer control module selects a conventional linked list transfer mode upon receiving a conventional linked list transfer instruction. In the conventional linked list transfer mode, when the data transmission of a linked list is completed, the DMA module reads the transmission configuration information of the next linked list from the memory based on the transmission configuration information of the linked list.

[0080] Preferably, the linked list transmission mode selection module is configured to: analyze the transmission configuration information of multiple linked lists of the aforementioned data handling tasks to determine whether they contain the same information or comply with preset rules; for multiple linked lists that contain the same information or comply with preset rules, determine that the multiple linked lists are correlated; configure multiple linked lists with correlation into a group to form a linked list group, trigger a compressed linked list transmission instruction for the linked list group, and send the compressed linked list transmission instruction, the corresponding data handling task identifier and the linked list group identifier information to the linked list information compression module and the linked list transmission control module; for linked lists that are not correlated, trigger a conventional linked list transmission instruction, and send the conventional linked list transmission instruction directly to the linked list transmission control module.

[0081] The linked list information compression module assigns a linked list number to each linked list in the linked list group, the linked list number being used to indicate the number of linked list transfers in the linked list group, records a mapping relationship between the linked list number and the transfer configuration information for each linked list, and stores the mapping relationship within the DMA. The DMA also records a data transfer task identifier and a linked list group identifier corresponding to the mapping relationship.

[0082] The linked list transfer control module, when performing a DMA linked list transfer of the linked list group, records the number of linked list transfers and, based on the linked list transfer number N1 to which the currently transferred data belongs, reads the mapping relationship of the linked list group from the DMA (using the corresponding data transfer task identifier and linked list group identifier), obtains the transfer configuration information corresponding to the linked list numbered N1, and initiates the linked list transfer based on the transfer configuration information. N1 is an integer greater than or equal to 1.

[0083] Furthermore, when a data handling task includes multiple consecutive linked list groups, the compressed linked list transmission mode is adopted within the linked list group; the conventional linked list transmission mode is adopted between each linked list group. At this time, when the data transmission of the last linked list in a linked list group is completed, the DMA module reads the transmission configuration information of the first linked list in the next linked list group from the memory according to the transmission configuration information of the linked list.

[0084] For other technical features, please refer to the description of the previous embodiment and will not be repeated here.

[0085] See also Figure 3 As shown in FIG, a DMA transmission system provided by the present invention includes a central processing unit (CPU) and a DMA controller.

[0086] The CPU is used to set a DMA linked list and DMA transmission configuration information for a data handling task in the memory.

[0087] The DMA controller is used to control DMA to execute a data transfer process based on a linked list.

[0088] Specifically, the DMA controller may include a data processing device, and the data processing device includes a linked list information acquisition module, a linked list information compression module and a linked list transmission control module.

[0089] The linked list information acquisition module is used to obtain DMA linked list information and DMA transfer configuration information set in the memory for a data transfer task. The DMA linked list is configured to connect multiple continuous or non-continuous data to be transferred. The DMA transfer configuration information is used to control data transfer and includes the transferred data length information, source address information, destination address information, and the next linked list descriptor.

[0090] The linked list information compression module is used to configure linked list numbers for multiple linked lists corresponding to the aforementioned data transfer tasks. The linked list numbers are used to indicate which linked list transmission the corresponding linked list is in the data transfer task, record the mapping relationship between the linked list numbers and transmission configuration information of each linked list, and store the mapping relationship inside the DMA.

[0091] The linked list transfer control module is used to record the number of linked list transfers when performing DMA linked list transfers, and read the transmission configuration information corresponding to the linked list numbered N from the DMA according to the number of linked list transfers N to which the current data to be transferred belongs, and initiate the linked list transfer according to the aforementioned transmission configuration information; N is an integer greater than or equal to 1.

[0092] For other technical features, please refer to the description of the previous embodiment and will not be repeated here.

[0093] In the above description, the disclosure of the present invention is not intended to limit itself to these aspects. Rather, within the scope of the intended protection of the present disclosure, the components can be selectively and operationally combined in any number. In addition, terms such as "including", "encompassing" and "having" should be interpreted as inclusive or open by default, rather than exclusive or closed, unless they are explicitly defined to the contrary. All technical, scientific or other terms have the meaning understood by those skilled in the art unless they are defined to the contrary. Common terms found in dictionaries should not be interpreted too idealistically or too impractically in the context of relevant technical documents, unless the present disclosure explicitly defines them as such. Any changes and modifications made by a person of ordinary skill in the field of the present invention based on the above disclosure are within the scope of protection of the claims.

Claims

1. A data processing method in DMA linked list mode, characterized in that Including steps: For a data transfer task, obtaining DMA linked list information and DMA transfer configuration information set in the memory, wherein the DMA linked list is configured to connect multiple continuous or non-continuous data to be transferred, and the DMA transfer configuration information is used to control data transfer, and the DMA transfer configuration information includes transferred data length information, source address information, destination address information, and a next linked list descriptor; Configure linked list numbers for multiple linked lists corresponding to the aforementioned data transfer tasks, where the linked list numbers are used to indicate which linked list transfer the corresponding linked list is in the data transfer task, record the mapping relationship between the linked list numbers and the transmission configuration information of each linked list, and store the mapping relationship inside the DMA; when performing DMA linked list transfer, record the number of linked list transfers, and read the transmission configuration information corresponding to the linked list with linked list number N from the DMA according to the number N of linked list transfers to which the current data to be transferred belongs, and initiate the linked list transfer according to the aforementioned transmission configuration information; N is an integer greater than or equal to 1.

2. The method according to claim 1, wherein: Obtain the total number M of linked lists corresponding to the aforementioned data handling task. When the number N of linked list transmissions is equal to the total number M of linked lists, stop the linked list transmission, where M is an integer greater than 1.

3. The method according to claim 1, characterized in that Before configuring the linked list numbers for the multiple linked lists, the following steps are also included: Get the total number of linked lists corresponding to the aforementioned data handling tasks; Determine whether the total number of the aforementioned linked lists exceeds a preset threshold; When it is determined that the total number of linked lists exceeds a preset threshold, the compressed linked list transmission mode is triggered; in the compressed linked list transmission mode, the DMA module can configure linked list numbers for multiple linked lists corresponding to the aforementioned data handling tasks, and record the mapping relationship between the linked list numbers and transmission configuration information of each linked list and store it inside the DMA, and then perform the aforementioned DMA linked list transmission.

4. The method according to claim 3, wherein: When it is determined that the total number of linked lists does not exceed the preset threshold, the normal linked list transmission mode is triggered; In the conventional linked list transmission mode, when the data transmission of a linked list is completed, the DMA module reads the transmission configuration information of the next linked list from the memory according to the transmission configuration information of the linked list.

5. The method according to claim 4, characterized in that: The preset threshold is set by the system or the user.

6. The method according to claim 1, characterized in that The method further includes the steps of: analyzing the transmission configuration information of the plurality of linked lists of the aforementioned data handling tasks to determine whether they contain the same information or conform to a preset rule; For multiple linked lists containing the same information or conforming to a preset rule, determining that the multiple linked lists are related; A plurality of related linked lists are configured into a group to form a linked list group, and a compressed linked list transmission mode is adopted for the linked list group; under the compressed linked list transmission mode, a linked list number is configured for each linked list in a linked list group, and the linked list number is used to indicate the number of linked list transmissions of the corresponding linked list in the aforementioned linked list group, and a mapping relationship between the linked list number and transmission configuration information of each linked list is recorded, and the mapping relationship is stored inside the DMA; and, when performing DMA linked list transmission of the aforementioned linked list group, the number of linked list transmissions is recorded, and the transmission configuration information corresponding to the linked list with the linked list number N1 is read from the DMA according to the number N1 of linked list transmissions to which the data to be currently transferred belongs, and the linked list transmission is initiated according to the aforementioned transmission configuration information; the N1 is an integer greater than or equal to 1.

7. The method according to claim 6, characterized in that: For linked lists that are not related, a conventional linked list transmission mode is adopted; in the conventional linked list transmission mode, when the data transmission of a linked list is completed, the DMA module reads the transmission configuration information of the next linked list from the memory according to the transmission configuration information of the linked list.

8. The method according to claim 6, wherein: When a data handling task includes multiple consecutive linked list groups, the compressed linked list transmission mode is adopted within the linked list group; the conventional linked list transmission mode is adopted between each linked list group. At this time, when the data transmission of the last linked list in a linked list group is completed, the DMA module reads the transmission configuration information of the first linked list in the next linked list group from the memory according to the transmission configuration information of the linked list.

9. A data processing device in DMA linked list mode, characterized in that Includes the following structure: a linked list information acquisition module, configured to obtain, for a data transfer task, DMA linked list information and DMA transfer configuration information set in the memory, wherein the DMA linked list is configured to connect multiple continuous or non-continuous data to be transferred, and the DMA transfer configuration information is used to control data transfer, and the DMA transfer configuration information includes transferred data length information, source address information, destination address information, and a next linked list descriptor; a linked list information compression module, configured to assign linked list numbers to the plurality of linked lists corresponding to the aforementioned data transfer task, wherein the linked list numbers are used to indicate the number of linked list transfers of the corresponding linked list in the data transfer task, record a mapping relationship between the linked list numbers and the transfer configuration information of each linked list, and store the mapping relationship within the DMA; The linked list transfer control module is used to record the number of linked list transfers when performing DMA linked list transfers, and read the transmission configuration information corresponding to the linked list numbered N from the DMA according to the number of linked list transfers N to which the current data to be transferred belongs, and initiate the linked list transfer according to the aforementioned transmission configuration information; the N is an integer greater than or equal to 1.

10. A DMA transmission system, comprising a central processing unit (CPU) and a DMA controller, characterized in that: The CPU is used to set a DMA linked list and DMA transfer configuration information for the data handling task in the memory; The DMA controller is used to control the DMA to execute a linked list-based data transfer process according to the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • A transfer method and system for ring-linked list DMA

    CN111258937B

  • DMA controller, SOC system and data handling method based on DMA controller

    CN114328316A

  • DMA controller operation method capable of configuring function mode

    CN114328322A