A DMA task data transmission method, a DMA controller, and an electronic device
By introducing a first-level arbitration module and a virtual channel mechanism into the DMA controller, combining the second-level arbitration module and the second physical channel, the problem of unreasonable processing of DMA tasks on the SOC is solved, and efficient and flexible processing of DMA tasks is achieved, reducing the impact on the CPU.
Patent Information
- Application Number
- CN202311171202.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-12
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2043-09-12
AI Technical Summary
On a system-on-chip (SOC), DMA requests initiated by multiple devices lead to a large number of DMA tasks, and the prior art is difficult to handle these tasks reasonably, affecting the processing capabilities of the CPU.
The first-level arbitration module and virtual channel mechanism in the DMA controller are adopted to arbitrate according to the virtual channel priority and transmission ID, DMA task data is transmitted through the first physical channel, and a secondary arbitration module and a second physical channel are introduced when necessary to improve the flexibility and efficiency of task processing.
It improves the rationality and efficiency of DMA task processing, reduces the burden on the CPU, saves hardware resources, and meets the priority and continuous processing needs of different DMA tasks.
Smart Images

Figure CN117370239B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of DMA, and in particular, to a DMA task data transmission method, a DMA controller, and an electronic device. Background Art
[0002] DMA (Direct Memory Access) refers to the direct memory access technology. Due to its characteristics such as fast transmission speed and liberation of CPU processing power, DMA is currently widely used.
[0003] On a SOC (System-on-a-Chip), multiple devices will initiate DMA requests, forming a large number of DMA tasks. How the DMA controller reasonably processes a large number of DMA tasks is an urgent problem to be solved currently. Summary of the Invention
[0004] According to one aspect of the present disclosure, there is provided a DMA task data transmission method, which is applied to a DMA controller. The DMA controller includes a first-level arbitration module, a plurality of virtual channels, a first physical channel, and a transmission module. Among them, the plurality of virtual channels are configured with different priorities; the first-level arbitration module includes a first-level arbitration register for storing first-level arbitration factors, and the first-level arbitration factors at least include virtual channel priorities. The method includes:
[0005] The first-level arbitration module arbitrates the plurality of virtual channels according to the first-level arbitration factors to determine a target virtual channel; any one of the virtual channels stores DMA task data corresponding to the priority of the virtual channel.
[0006] The transmission module transmits at least part of the data in the target virtual channel through the first physical channel.
[0007] In an implementation manner, the DMA controller further includes an acquisition module, and the method further includes:
[0008] The acquisition module acquires DMA task data corresponding to any DMA task, and the DMA task is pre-configured with a priority.
[0009] Using the priority of the DMA task, match the priorities of each virtual channel, determine the virtual channel corresponding to the DMA task, and store the DMA task data in the determined virtual channel.
[0010] In an implementation manner, the first-level arbitration factors include virtual channel priorities and transmission IDs;
[0011] The first-level arbitration module arbitrates the plurality of virtual channels according to the first-level arbitration factor to determine a target virtual channel, including:
[0012] The first-level arbitration module arbitrates the plurality of virtual channels according to the first-level arbitration factor to determine a plurality of target virtual channels; wherein, any DMA task data corresponds to a transmission ID, and the DMA task data corresponding to the same transmission ID is stored in the plurality of target virtual channels;
[0013] The transmission module transmits at least part of the data in the target virtual channel through the first physical channel, including:
[0014] The transmission module transmits at least part of the data in the plurality of target virtual channels through the first physical channel according to the priorities of the plurality of target virtual channels.
[0015] In one implementation, the DMA task data stored in any virtual channel corresponds to a unique transmission ID;
[0016] The arbitration of the plurality of virtual channels according to the first-level arbitration factor to determine a plurality of target virtual channels includes:
[0017] Determine the priorities and data storage conditions of each virtual channel, and determine the virtual channel with the highest priority storing DMA task data as the target virtual channel;
[0018] Determine the target transmission ID corresponding to the DMA task data in the target virtual channel;
[0019] Determine the other virtual channels storing the DMA task data corresponding to the target transmission ID as other target virtual channels;
[0020] The transmission module transmits at least part of the data in the plurality of target virtual channels through the first physical channel according to the priorities of the plurality of target virtual channels, including:
[0021] Transmit all the DMA task data in all the determined target virtual channels through the first physical channel in sequence according to the priorities of each target virtual channel.
[0022] In one implementation, the DMA task data stored in any virtual channel corresponds to at least one transmission ID;
[0023] The arbitration of the plurality of virtual channels according to the first-level arbitration factor to determine a plurality of target virtual channels includes:
[0024] When determining the priorities of the respective virtual channels and the data storage situation, the virtual channel with the highest priority that stores the DMA task data is determined as the target virtual channel;
[0025] Determine the target transfer ID corresponding to the DMA task data with the longest storage time in the target virtual channel;
[0026] Determine the other virtual channels that store the DMA task data corresponding to the target transfer ID as the other target virtual channels;
[0027] The transmission module transmits at least part of the data in the multiple target virtual channels through the first physical channel according to the priorities of the multiple target virtual channels, including:
[0028] Transmit the DMA task data corresponding to the target transfer ID in all the determined target virtual channels through the first physical channel in sequence according to the priorities of the respective target virtual channels.
[0029] In one embodiment, the DMA controller further includes a second physical channel and a secondary arbitration module. The secondary arbitration module stores a secondary arbitration register for storing secondary arbitration factors and arbitration granularity; the method further includes:
[0030] The secondary arbitration module arbitrates between the second physical channel and the first physical channel according to the secondary arbitration factors and the arbitration granularity to determine the target physical channel; wherein, the secondary arbitration factors at least include the physical channel priority, and the priority of the second physical channel is higher than that of the first physical channel;
[0031] The transmission module transmits the DMA task data in the target physical channel according to the arbitration granularity.
[0032] In one embodiment, the secondary arbitration factors include the physical channel priority, and the arbitration granularity includes the task granularity;
[0033] The secondary arbitration module arbitrates between the second physical channel and the first physical channel according to the secondary arbitration factors and the arbitration granularity to determine the target physical channel, including:
[0034] During the process of the transmission module transmitting each DMA task data, if the second physical channel stores DMA task data, the secondary arbitration module determines the second physical channel as the target physical channel;
[0035] The transmission module transmits the data in the target physical channel according to the arbitration granularity, including:
[0036] After the DMA task data to be currently transmitted is transmitted, the DMA task data in the second physical channel is transmitted.
[0037] In one implementation, the arbitration factor includes the physical channel priority and the transmission ID, and the arbitration granularity includes the task granularity;
[0038] The secondary arbitration module arbitrates between the second physical channel and the first physical channel according to the secondary arbitration factor and the arbitration granularity to determine the target physical channel, including:
[0039] During the process of the transmission module transmitting each DMA task data, if there is DMA task data stored in the second physical channel, the secondary arbitration module determines the second physical channel and the first physical channel as the target physical channels, and feeds back the target transmission ID corresponding to the DMA task data in the second physical channel to the primary arbitration module;
[0040] The primary arbitration module determines the virtual channel storing the DMA task data corresponding to the target transmission ID as the target virtual channel;
[0041] The transmission module transmits the data in the target physical channel according to the arbitration granularity, including:
[0042] After the transmission module transmits the currently to-be-transmitted DMA task data, it transmits the data in the second physical channel;
[0043] The DMA task data corresponding to the target transmission ID in the target virtual channel is sequentially stored into the first physical channel according to the priorities of the target virtual channels, and the DMA task data in the first physical channel is transmitted.
[0044] In one implementation, the arbitration factor includes the physical channel priority, and the arbitration granularity includes the burst transmission length granularity;
[0045] The secondary arbitration module arbitrates between the second physical channel and the first physical channel according to the secondary arbitration factor and the arbitration granularity to determine the target physical channel, including:
[0046] During the process of the transmission module transmitting each burst transmission length, if there is DMA task data stored in the second physical channel, the secondary arbitration module determines the second physical channel as the target physical channel;
[0047] The transmission module transmits the data in the target physical channel according to the arbitration granularity, including:
[0048] After the burst transfer length corresponding to the DMA task data to be currently transmitted is completely transmitted, the DMA task data in the second physical channel is transmitted.
[0049] In one implementation, the arbitration factor includes the physical channel priority and the transfer ID, and the arbitration granularity includes the burst transfer length granularity;
[0050] The secondary arbitration module arbitrates between the second physical channel and the first physical channel according to the secondary arbitration factor and the arbitration granularity to determine the target physical channel, including:
[0051] During the process of the transmission module transmitting each burst transfer length, if there is DMA task data stored in the second physical channel, the secondary arbitration module determines the second physical channel and the first physical channel as the target physical channels; and feeds back the target transfer ID corresponding to the DMA task data in the second physical channel to the primary arbitration module;
[0052] The primary arbitration module determines the virtual channel storing the DMA task data corresponding to the target transfer ID as the target virtual channel;
[0053] The transmission module transmits the data in the target physical channel according to the arbitration granularity, including:
[0054] After the burst transfer length corresponding to the DMA task data to be currently transmitted is completely transmitted, the DMA task data in the second physical channel is transmitted;
[0055] The DMA task data corresponding to the target transfer ID in the target virtual channel is sequentially stored into the first physical channel according to the priorities of the respective target virtual channels, and the DMA task data in the first physical channel is transmitted.
[0056] According to the second aspect of the present disclosure, a DMA controller is provided. The DMA controller includes a primary arbitration module, a plurality of virtual channels, a first physical channel, and a transmission module. Among them, the plurality of virtual channels are configured with different priorities; the primary arbitration module includes a primary arbitration register for storing a primary arbitration factor, and the primary arbitration factor includes at least the virtual channel priority;
[0057] The primary arbitration module is configured to arbitrate among the plurality of virtual channels according to the primary arbitration factor to determine the target virtual channel; wherein, any virtual channel is used to store the DMA task data corresponding to the priority of the virtual channel;
[0058] The transmission module is configured to transmit at least part of the data in the target virtual channel through the first physical channel.
[0059] In one embodiment, the DMA controller further includes an acquisition module;
[0060] The acquisition module is configured to acquire DMA task data corresponding to any DMA task, where the DMA task is pre-configured with a priority; using the priority of the DMA task, match the priorities of each virtual channel, determine the virtual channel corresponding to the DMA task, and store the DMA task data in the determined virtual channel.
[0061] In one embodiment, the first-level arbitration factor includes virtual channel priority and transmission ID;
[0062] The first-level arbitration module is specifically configured to arbitrate the plurality of virtual channels according to the first-level arbitration factor to determine a plurality of target virtual channels; wherein, any DMA task data corresponds to a transmission ID, and the plurality of target virtual channels store DMA task data corresponding to the same transmission ID;
[0063] The transmission module is specifically configured to transmit at least part of the data in the plurality of target virtual channels through the first physical channel according to the priorities of the plurality of target virtual channels.
[0064] In one embodiment, the DMA task data stored in any virtual channel corresponds to a unique transmission ID;
[0065] The first-level arbitration factor is specifically configured to determine the priorities of each virtual channel and the data storage situation, and determine the virtual channel with the highest priority storing DMA task data as the target virtual channel;
[0066] Determine the target transmission ID corresponding to the DMA task data in the target virtual channel;
[0067] Determine other virtual channels storing DMA task data corresponding to the target transmission ID as other target virtual channels;
[0068] The transmission module is specifically configured to transmit all the DMA task data in all the determined target virtual channels through the first physical channel in sequence according to the priorities of each target virtual channel.
[0069] In one embodiment, the DMA task data stored in any virtual channel corresponds to at least one transmission ID;
[0070] The first-level arbitration factor is specifically used to determine the priorities of each virtual channel and the data storage situation, and determine the target virtual channel as the virtual channel with the highest priority that stores the DMA task data; determine the target transfer ID corresponding to the DMA task data with the longest storage time in the target virtual channel; determine other virtual channels that store the DMA task data corresponding to the target transfer ID as other target virtual channels;
[0071] The transmission module is specifically used to transmit the DMA task data corresponding to the target transfer ID in all the determined target virtual channels through the first physical channel in sequence according to the priorities of each target virtual channel.
[0072] In one embodiment, the DMA controller further includes a second physical channel and a second-level arbitration module. The second-level arbitration module stores a second-level arbitration register for storing second-level arbitration factors and arbitration granularity;
[0073] The second-level arbitration module is used to arbitrate between the second physical channel and the first physical channel according to the second-level arbitration factors and the arbitration granularity to determine the target physical channel; wherein, the second-level arbitration factor at least includes the physical channel priority, and the priority of the second physical channel is higher than that of the first physical channel;
[0074] The transmission module is used to transmit the DMA task data in the target physical channel according to the arbitration granularity.
[0075] In one embodiment, the second-level arbitration factor includes the physical channel priority, and the arbitration granularity includes the task granularity;
[0076] The second-level arbitration module is specifically used to, during the process of the transmission module transmitting each DMA task data, if there is DMA task data stored in the second physical channel, determine the second physical channel as the target physical channel;
[0077] The transmission module is specifically used to, after transmitting the currently to-be-transmitted DMA task data, transmit the DMA task data in the second physical channel.
[0078] In one embodiment, the arbitration factor includes the physical channel priority and the transfer ID, and the arbitration granularity includes the task granularity;
[0079] The second-level arbitration module is specifically used to, during the process of the transmission module transmitting each DMA task data, if there is DMA task data stored in the second physical channel, determine the second physical channel and the first physical channel as the target physical channels, and feed back the target transfer ID corresponding to the DMA task data in the second physical channel to the first-level arbitration module;
[0080] The first-level arbitration module is further configured to determine the virtual channel storing the DMA task data corresponding to the target transfer ID as the target virtual channel;
[0081] The transfer module is specifically configured to, after transmitting the currently to-be-transmitted DMA task data, transmit the data in the second physical channel; store the DMA task data corresponding to the target transfer ID in the target virtual channel into the first physical channel in sequence according to the priorities of the target virtual channels, and transmit the DMA task data in the first physical channel.
[0082] In one implementation, the arbitration factor includes the physical channel priority, and the arbitration granularity includes the burst transfer length granularity;
[0083] The second-level arbitration module is specifically configured to, during the process of the transfer module transmitting each burst transfer length, if there is DMA task data stored in the second physical channel, determine the second physical channel as the target physical channel;
[0084] The transfer module is specifically configured to, after transmitting the burst transfer length corresponding to the currently to-be-transmitted DMA task data, transmit the DMA task data in the second physical channel.
[0085] In one implementation, the arbitration factor includes the physical channel priority and the transfer ID, and the arbitration granularity includes the burst transfer length granularity;
[0086] The second-level arbitration module is specifically configured to, during the process of the transfer module transmitting each burst transfer length, if there is DMA task data stored in the second physical channel, determine the second physical channel and the first physical channel as the target physical channels; and feedback the target transfer ID corresponding to the DMA task data in the second physical channel to the first-level arbitration module;
[0087] The first-level arbitration module is further configured to determine the virtual channel storing the DMA task data corresponding to the target transfer ID as the target virtual channel;
[0088] The transfer module is specifically configured to, after transmitting the burst transfer length corresponding to the currently to-be-transmitted DMA task data, transmit the DMA task data in the second physical channel; store the DMA task data corresponding to the target transfer ID in the target virtual channel into the first physical channel in sequence according to the priorities of the target virtual channels, and transmit the DMA task data in the first physical channel.
[0089] According to a third aspect of the present disclosure, a graphics processing system is provided, including the DMA controller in any implementation manner of the second aspect.
[0090] According to a fourth aspect of the present disclosure, an electronic component is provided, including the graphics processing system in any implementation manner of the third aspect.
[0091] According to a fifth aspect of the present disclosure, an electronic device is provided, including the electronic component in any implementation manner of the fourth aspect.
[0092] According to another aspect of the present disclosure, an electronic component is provided, including the graphics processing system described in any of the above embodiments.
[0093] According to another aspect of the present disclosure, an electronic device is provided, including the electronic component described in any of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0094] Figure 1 Schematic diagram of a DMA controller structure provided in an embodiment of the present disclosure;
[0095] Figure 2 Schematic diagram of the process of a DMA task data transmission method provided in an embodiment of the present disclosure;
[0096] Figure 3 Another schematic diagram of a DMA controller structure provided in an embodiment of the present disclosure;
[0097] Figure 4 Schematic diagram of a DMA task transmission provided in an embodiment of the present disclosure;
[0098] Figure 5 Another schematic diagram of a DMA task transmission provided in an embodiment of the present disclosure;
[0099] Figure 6 Schematic diagram of a graphics processing system structure provided in an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0100] Before introducing the embodiments of the present disclosure, it should be noted that:
[0101] Some embodiments of the present disclosure are described as processing flows. Although the various operation steps of the flow may be labeled with sequential step numbers, the operation steps therein can be implemented in parallel, concurrently, or simultaneously.
[0102] In the embodiments of the present disclosure, terms such as "first" and "second" may be used to describe various features, but these features should not be limited by these terms. These terms are only used to distinguish one feature from another.
[0103] In the embodiments of the present disclosure, the term "and / or" may be used, and "and / or" includes any and all combinations of one or more of the listed related features.
[0104] It should be understood that when describing the connection relationship or communication relationship between two components, unless it is clearly specified that the two components are directly connected or directly communicate, otherwise, the connection or communication between the two components can be understood as direct connection or communication, or can be understood as indirect connection or communication through an intermediate component.
[0105] In order to make the technical solutions and advantages in the embodiments of the present disclosure clearer, the following further describes the exemplary embodiments of the present disclosure in conjunction with the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than an exhaustive list of all embodiments. It should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments can be combined with each other.
[0106] On a System-on-Chip (SOC), various devices have data transfer requirements, and at the same time, various applications running on the central processing unit (hereinafter simply referred to as the processor) also have a large number of data transfer requirements. If the processor processes a large amount of data transfer work, it will affect the processor's processing ability for other work. In order to avoid the processor from processing a large amount of data transfer work, various devices will initiate DMA requests to the processor. The processor generates a large number of DMA tasks according to the DMA requests initiated by various devices or the data transfer requirements of various applications, and issues the DMA tasks to the DMA controller. How the DMA controller reasonably processes these DMA tasks is an urgent problem to be solved at present.
[0107] To solve the above problems, the present disclosure proposes a DMA task data transmission method, which is applied to a DMA controller. As Figure 1 shown, the DMA controller includes a first-level arbitration module 120, a plurality of virtual channels 110, a first physical channel 130, a transmission module 150, and an acquisition module 140. Among them, a plurality of virtual channels share the first physical channel, that is, the data in multiple virtual channels needs to be transmitted to the outside of the DMA through the first physical channel.
[0108] It can be understood that although only 4 virtual channels are shown in the figure, this figure is only an exemplary display. In actual applications, the number of virtual channels can be configured according to actual needs. A virtual channel can be understood as a cache space in the DMA controller for caching DMA task data. After receiving a DMA task issued by the processor, the DMA controller can obtain the corresponding DMA task data according to the DMA task. For example, a DMA task usually carries information such as the source address, destination address, and data length of the data to be transferred (referred to as DMA task data in this article). The DMA controller can obtain the DMA task data corresponding to each DMA task according to the source address and data length, and then cache the obtained DMA task data into the virtual channel. In addition, the processor can pre-configure different priorities for the several virtual channels. For example, taking the 4 virtual channels in Figure 1 as an example, it can be configured that the priorities of virtual channel 1 - virtual channel 4 are from the highest to the lowest, that is, the order of priorities is virtual channel 1 > virtual channel 2 > virtual channel 3 > virtual channel 4. It can be understood that the present disclosure does not limit how to configure the priorities, as long as the priorities of each virtual channel are different.
[0109] The above-mentioned first-level arbitration module also includes a first-level arbitration register for storing first-level arbitration factors. The processor can configure the first-level arbitration factors in the first-level arbitration register according to actual needs. The first-level arbitration factors proposed by the present disclosure at least include virtual channel priorities. In addition, the first-level arbitration factors can also be virtual channel priorities and transmission IDs.
[0110] As Figure 2 shown, based on the above DMA controller, the present disclosure proposes a DMA task data transmission method, including:
[0111] S201, the first-level arbitration module arbitrates several virtual channels according to the first-level arbitration factors to determine the target virtual channel;
[0112] Among them, any virtual channel is used to store the DMA task data corresponding to the priority of this virtual channel; the first-level arbitration factors at least include virtual channel priorities;
[0113] S202, the transmission module transmits at least part of the data in the target virtual channel through the first physical channel.
[0114] The transmission module transmits the data through the first physical channel, that is, stores the data in the target virtual channel into the first physical channel first, and then outputs the data to the output port of the DMA controller through the first physical channel, so as to output the data to the destination address corresponding to the DMA task through the output port.
[0115] Adopting the above solution proposed by the present disclosure, after the DMA controller obtains the DMA task data of each DMA task, according to the priorities of the respective DMA tasks, it stores the DMA task data of different priorities into the virtual channels corresponding to the respective priorities, and then calls the first-level arbitration module to arbitrate the data in each virtual channel by using the first-level arbitration factor, which can at least ensure that the DMA task data corresponding to the DMA task with a higher priority can be preferentially transmitted, that is, the DMA task with a higher priority can be processed faster than the DMA task with a lower priority, thereby enhancing the rationality of the DMA controller in processing a large number of DMA tasks. At the same time, by adopting the virtual channel method, the DMA task data of multiple priorities is stored in different virtual channels instead of physical channels, which can save hardware resources, that is, there is no need to develop and deploy multiple physical channels.
[0116] It can be understood that before the first-level arbitration module arbitrates several virtual channels according to the first-level arbitration factor to determine the target virtual channel, it is also necessary to store the DMA task data into each virtual channel. Specifically, the acquisition module in the DMA controller can acquire the DMA task data corresponding to any DMA task. Among them, each DMA task is pre-configured with a priority by the processor. Specifically, when the processor generates a DMA task, in addition to storing information such as the source address, destination address, and data length into the DMA task, it can also store the priority information of the DMA task into the DMA task. In this way, after the DMA controller acquires a DMA task, it can obtain the priority information corresponding to the DMA task through parsing.
[0117] After the acquisition module acquires the DMA task data, it can use the priority of the DMA task to match the priorities of each virtual channel, determine the virtual channel corresponding to the DMA task, and store the DMA task data into the determined virtual channel. For how to acquire the DMA task data, reference can be made to the above content, which will not be elaborated here.
[0118] Still taking Figure 1 as an example, and taking the priority order as virtual channel 1 > virtual channel 2 > virtual channel 3 > virtual channel 4 as an example, as shown in Table 1, it is the priority of each virtual channel.
[0119] Virtual Channel Virtual Channel 1 Virtual Channel 2 Virtual Channel 3 Virtual Channel 4 Priority 4 3 2 1
[0120] Table 1
[0121] After the acquisition module obtains the DMA task data corresponding to a certain DMA task, it can determine the priority of the DMA task. For example, if the DMA task priority level is 4, the DMA task data is stored in virtual channel 1, and so on. Different DMA task data can be stored in the virtual channels corresponding to their priorities. The present disclosure does not limit the capacity size of the virtual channels, as long as it can store at least one DMA task data, that is, the maximum value of various DMA task data can be determined according to engineering experience, and the capacity size of each virtual channel can be set to be not less than this maximum value.
[0122] The process of S201 - S202 above will be described in detail below.
[0123] In one implementation, the first - level arbitration factor in the first - level arbitration register is the virtual channel priority.
[0124] In this implementation, S201 above is: The first - level arbitration module will determine the target virtual channel as the virtual channel with the highest priority that stores DMA task data according to the priorities of each virtual channel and the data storage situation.
[0125] Specifically, the DMA controller can configure a counter for each virtual channel to record the number of DMA task data stored in the virtual channel. For example, after the acquisition module stores a DMA task data in a certain virtual channel, the counter of this virtual channel is incremented by 1, and after transporting out a DMA task data from this virtual channel, the counter of this virtual channel is decremented by 1. Additionally, if the capacity of each virtual channel is only enough to store one DMA task data, there is no need to configure a counter for each virtual channel. The arbitration module can check each virtual channel during each arbitration to determine whether each virtual channel stores DMA task data. In this way, it can be determined whether each virtual channel stores DMA task data by querying the counter or directly checking each virtual channel later. After determining the virtual channels that store DMA task data, sort the virtual channels that store DMA task data according to the priorities of the virtual channels, and determine the virtual channel with the highest priority as the target virtual channel. Still taking the content in Table 1 above as an example, if it is determined that there is no DMA task data in the current virtual channel 1 and virtual channels 2 - 4 store DMA task data, then virtual channel 2 is determined as the target virtual channel.
[0126] Correspondingly, in this implementation, S202 above is specifically: The transmission module transmits all the DMA task data in the target virtual channel through the first physical channel.
[0127] In this embodiment, since each virtual channel stores DMA task data corresponding to the priority of the virtual channel, the first-level arbitration module performs arbitration based on the virtual channel priority, and can arbitrate the tasks with higher priority first for the transmission module to perform transmission processing, thereby improving the rationality of the DMA controller in processing various DMA tasks. It can be understood that in this embodiment, the first-level arbitration module can perform an arbitration operation when the transmission module transmits the DMA task data in a certain virtual channel, so as to ensure that when the transmission module completes the transmission of the DMA task data in a certain virtual channel, it can directly continue to execute the next transmission based on the new arbitration result of the arbitration module.
[0128] As Figure 4 shown, if DMA task data is stored in all four virtual channels, the priority order of the four virtual channels is virtual channel 1 > virtual channel 2 > virtual channel 3 > virtual channel 4. Then as Figure 4 shown in the upper right, the target virtual channel will be determined as virtual channel 1 first, and the DMA task data in virtual channel 1 will be transmitted. After the DMA task data in virtual channel 1 is transmitted, a new round of arbitration will determine the target virtual channel as virtual channel 2, and then the DMA task data in virtual channel 2 will be transmitted, and so on.
[0129] Considering that in various DMA tasks, not only do the data have the need to be transmitted according to the priority, but in some scenarios, the DMA task data in multiple-priority DMA tasks also has the need to be processed continuously. For example, in the scenario of video playback, the video data and audio data of the same frame often need to be transmitted to the playback device together for playback. However, the processor often assigns different priorities to the DMA tasks for audio data and video data. Therefore, when the DMA controller obtains the DMA tasks for video data and audio data, the video data and audio data will be stored in different virtual channels. At this time, the video data and audio data stored in different virtual channels actually need to be transmitted to the playback device simultaneously or continuously.
[0130] For another example, some picture pixels need to be filled with pure white or black, and then some simple color overlays are performed. The two tasks of filling and overlaying are also usually assigned different priorities. Therefore, the data for color overlay may be stored in a certain virtual channel, while the data for color filling may be stored in another virtual channel. At this time, the color filling data and color overlay data stored in different virtual channels actually need to be transmitted to the destination address simultaneously or continuously.
[0131] In view of the above requirements, the present disclosure proposes that the first-level arbitration factor can be the virtual channel priority and the transmission ID. Specifically, the above S201 can be: the first-level arbitration module arbitrates a plurality of virtual channels according to the first-level arbitration factor to determine a plurality of target virtual channels; wherein, any DMA task data corresponds to a transmission ID, and the DMA task data with the same transmission ID is stored in a plurality of target virtual channels;
[0132] Specifically, the above S202 is: the transmission module transmits at least part of the data in the plurality of target virtual channels through the first physical channel according to the priorities of the plurality of target virtual channels.
[0133] In this embodiment, in the case where DMA tasks with multiple priorities have the requirement of being continuously transmitted, the present disclosure proposes that the transmission ID can be used to establish an association between the DMA task data with multiple priorities, so that the DMA task data with multiple different priorities can be continuously transmitted to the destination address, that is, the DMA task data is arbitrated based on two arbitration factors, namely the priority and the transmission ID, which meets the actual requirements in this scenario and makes the DMA task processing more flexible and reasonable.
[0134] Next, the process of the processor generating the transmission ID in this scenario will be described. If the processor can know in advance that multiple DMA tasks need to be continuously processed, it can preferentially configure the same priority for the multiple DMA tasks. In this way, when the subsequent DMA controller processes the multiple DMA tasks, the number of DMA tasks corresponding to the multiple DMA tasks can be stored in a virtual channel, and then the DMA task data corresponding to the multiple DMA tasks can be continuously processed. When the processor determines that there is a need to continuously process the DMA tasks with multiple priorities after generating each DMA task and generating the priority for each DMA task, the same transmission ID can be set for the multiple DMA tasks, and the arbitration factors in the first-level arbitration module can be configured as the virtual channel priority and the transmission ID.
[0135] Still taking the content of Table 1 as an example, as shown in Table 2, it is an example of the transmission ID corresponding to the DMA task data in each virtual channel.
[0136] Virtual Channel Virtual Channel 1 Virtual Channel 2 Virtual Channel 3 Virtual Channel 4 Priority 4 3 2 1 Transport ID 1 0 0 1
[0137] Table 2
[0138] Taking the content shown in Table 2 as an example, if the DMA task data corresponding to DMA task A is stored in virtual channel 1, the data corresponding to DMA task B is stored in virtual channel 4, and DMA task A and DMA task B have the requirement to be processed continuously, the processor will assign the same transfer ID to DMA task A and DMA task B, and configure the arbitration factors in the primary arbitration module as virtual channel priority and transfer ID, so that the DMA task data in DMA task A and DMA task B will be processed continuously.
[0139] In addition, generally, low-priority DMA tasks do not have a high requirement to be processed quickly, but in some scenarios, low-priority DMA tasks may also need to be processed as soon as possible. Still taking the example in Table 2, if the data in all four virtual channels stores DMA task data, and at this time the DMA task data in virtual channel 4 needs to be processed as soon as possible for some reason, the processor can configure the transfer ID of the DMA task data stored in virtual channel 1 to be the same as the transfer ID of the DMA task data stored in virtual channel 4, and configure the arbitration factors in the primary arbitration module as virtual channel priority and transfer ID. In this way, after the DMA controller finishes transmitting the DMA task data in virtual channel 1, it can skip virtual channels 2 and 3 and directly transmit the DMA task data in virtual channel 4.
[0140] It can be seen that by adopting the solution of this embodiment, using IDs to mark DMA tasks in virtual channels can enable DMA task data located in different virtual channels but having the requirement to be processed continuously to be transmitted continuously, and at the same time, it can also enable low-priority DMA task data to be processed as soon as possible, further improving the flexibility and rationality of DMA task processing.
[0141] In the above text, when the processor assigns priorities and transfer IDs to each DMA task, it can directly store the priority and transfer ID identifiers in the DMA task information and send them to the DMA controller when generating the DMA task. The DMA controller can obtain the priority and transfer ID identifiers by parsing the DMA task information. In addition, as mentioned above, the transfer ID may be assigned by the processor after the DMA task data is stored in the virtual channel. Then the processor can directly send the mapping relationship between the transfer ID of a certain DMA task and the task to the DMA controller, and the DMA controller determines the transfer ID corresponding to each DMA task based on this mapping relationship.
[0142] In a specific embodiment, the DMA task data stored in any virtual channel corresponds to a unique transmission ID. That is, each virtual channel stores only the DMA task data corresponding to one DMA task at the same time, or the transmission IDs of the DMA task data corresponding to multiple DMA tasks stored in each virtual channel at the same time are the same.
[0143] Still taking the content of Table 2 as an example, the transmission IDs corresponding to the DMA task data in virtual channel 1 and virtual channel 4 are the same, and the transmission IDs corresponding to the DMA task data in virtual channel 2 and virtual channel 3 are the same.
[0144] In this embodiment, the above S201 is specifically as follows: The first-level arbitration module determines the priorities and data storage conditions of each virtual channel, and determines the virtual channel with the highest priority and storing DMA task data as the target virtual channel; determines the target transmission ID corresponding to the DMA task data in the target virtual channel; determines the other virtual channels storing the DMA task data corresponding to the target transmission ID as other target virtual channels;
[0145] Combined with Figure 4 Shown content, if all four virtual channels store DMA task data at this time, and the virtual channel with the highest priority is virtual channel 1, then virtual channel 1 is determined as the target virtual channel. At the same time, it is determined that the transmission ID corresponding to the DMA task data in virtual channel 1 is 1. By traversing, it is found that the transmission ID corresponding to the DMA task data in virtual channel 4 is also 1, then virtual channel 4 is also determined as the target virtual channel.
[0146] Correspondingly, in this embodiment, the above S202 is specifically as follows: The transmission module sequentially transmits all the DMA task data in all the determined target virtual channels through the first physical channel according to the priorities of the target virtual channels.
[0147] Still combined with the above example, that is, after the arbitration module determines that the target virtual channels are virtual channel 1 and virtual channel 4, since the priority of virtual channel 1 is higher than that of virtual channel 4, then as Figure 4 Shown in the lower right, the transmission module first transmits the DMA task data in virtual channel 1 to the output port through the first physical channel, that is, outputs it to the destination address, then transmits the DMA task data in virtual channel 4 through the first physical channel, and then transmits the DMA task data in virtual channel 2 and virtual channel 3.
[0148] In the previous embodiment, each virtual channel stores only one DMA task data at the same time, or the transmission IDs of the multiple DMA task data stored in each virtual channel at the same time are the same. In another embodiment, the DMA task data stored in any virtual channel can correspond to at least one transmission ID.
[0149] As shown in Table 3, multiple tasks in each virtual channel can correspond to one or more transfer IDs. For example, in virtual channel 1, there are two tasks, task A and task B. The transfer ID of task A is 1, and the transfer ID of task B is 2, and so on.
[0150]
[0151] Table 3
[0152] In this embodiment, the present disclosure proposes that two specific methods can be adopted to implement the above S201 - S202.
[0153] The first method is as follows: S201 is specifically: after determining the priorities and data storage conditions of each virtual channel, the virtual channel with the highest priority that stores DMA task data is determined as the target virtual channel; determining the target transfer ID corresponding to the DMA task data with the longest storage time in the target virtual channel; judging whether the transfer ID corresponding to the DMA task data with the longest storage time in any other virtual channel is the target transfer ID, and if so, determining that virtual channel as the target virtual channel.
[0154] S202 can specifically be: the DMA task data with the longest storage time in all the determined target virtual channels is transmitted through the first physical channel in sequence according to the priorities of each target virtual channel.
[0155] Combined with the content in Table 3 above, since each virtual channel stores DMA task data and virtual channel 1 has the highest priority, virtual channel 1 can be determined as one of the target virtual channels. Then, it is determined that the DMA task data with the longest storage time in virtual channel 1 is task A, and the corresponding target transfer ID is 1. Among them, the DMA task data in the virtual channel can be stored in the virtual channel in a consecutive address manner according to the order. Therefore, the DMA task data with the longest storage time can be determined according to the position stored in the virtual channel. In addition, a timer can also be used to time each type of DMA task data in the virtual channel, and the DMA task data with the longest storage time in the virtual channel can be determined according to the value of the timer. Both virtual channel 3 and virtual channel 4 store DMA task data with a corresponding transfer ID of 1. However, the DMA task data corresponding to task E in virtual channel 3 is not the DMA task data with the longest storage time in virtual channel 3 (the DMA task data of task D has the longest storage time), and the DMA task data of task F in virtual channel 4 is the DMA task data with the longest storage time in virtual channel 4. Therefore, virtual channel 4 is determined as the target virtual channel.
[0156] Since the priority of task A is higher than that of task F, the transmission module can sequentially transmit the DMA task data corresponding to task A and task F through the first physical channel.
[0157] The second method is as follows: In order to enable all DMA task data with the same transmission ID to be continuously transmitted, in the above S201, the first-level arbitration module determines the priorities of each virtual channel and the data storage situation, and determines the virtual channel with the highest priority that stores the DMA task data as the target virtual channel. After determining the target transmission ID corresponding to the DMA task data with the longest storage time in the target virtual channel, the first-level arbitration module can directly determine other virtual channels that store the DMA task data corresponding to the target transmission ID as other target virtual channels.
[0158] In the above S202, the transmission module can directly transmit the DMA task data corresponding to the target transmission ID in all the determined target virtual channels through the first physical channel in the order of the priorities of each target virtual channel.
[0159] Combined with the content in Table 3 above, since each virtual channel stores DMA task data and the priority of virtual channel 1 is the highest, virtual channel 1 can be determined as the target virtual channel. Then, the DMA task data with the longest storage time in virtual channel 1 is determined as task A, and the corresponding target transmission ID is 1. Then, virtual channels 3 and 4 can both be determined as target virtual channels.
[0160] Since the priorities of task A, task E, and task F are in descending order, the transmission module can sequentially transmit the DMA task data corresponding to task A, task E, and task F through the first physical channel.
[0161] Under normal circumstances, the data in the virtual channel follows the principle of first in first out. By adopting this implementation solution, the DMA task data stored later in some virtual channels can be transmitted first, greatly increasing the flexibility of DMA data processing and enabling the data that needs to be processed preferentially to be processed quickly.
[0162] To further increase the flexibility, the arbitration factor can also include an ID arbitration range identifier. The processor can set this arbitration range identifier in the first-level arbitration register according to actual needs. The arbitration module determines whether to use the first method or the second method in this implementation solution based on the ID arbitration range identifier, and the transmission module also determines whether to use the first method or the second method for transmission based on the arbitration range identifier. In this embodiment, the specific form of the arbitration range identifier is not limited, as long as it can distinguish the two arbitration ranges.
[0163] During the process of data transmission by the DMA controller, there are often some target DMA tasks that are generated later but have the requirement to be processed first. With the above solution, storing the DMA task data corresponding to the target DMA task in the virtual channel will be blocked by the data that is stored in the same virtual channel first, and will also be blocked by the data that is transmitted to the first physical channel first, resulting in the inability to quickly transmit the data of the target DMA task. Based on this problem, the present disclosure proposes a DMA controller as shown in Figure 3 which adds a second physical channel 160 and a secondary arbitration module 170 on the basis of Figure 1 . The secondary arbitration module stores a secondary arbitration register for storing secondary arbitration factors and arbitration granularity.
[0164] The secondary arbitration module arbitrates between the second physical channel and the first physical channel according to the secondary arbitration factors and arbitration granularity to determine the target physical channel; among them, the secondary arbitration factors at least include the physical channel priority, and the priority of the second physical channel is higher than that of the first physical channel; specifically, the processor can configure the highest priority identifier for some DMA tasks. After the DMA controller parses this DMA task information, it can store the DMA task data corresponding to these DMA tasks in the second physical channel.
[0165] The transmission module transmits the DMA task data in the target physical channel according to the arbitration granularity.
[0166] In this embodiment, storing the DMA task data that needs to be quickly processed in the second physical channel can enable this task to be quickly processed, avoid being blocked by other DMA task data, and can meet the actual requirement that the DMA task data can be quickly processed.
[0167] The following describes the above-mentioned secondary arbitration factors and arbitration granularity. And the specific implementation methods of the secondary arbitration module and the transmission module are described.
[0168] The secondary arbitration factor can be the physical channel priority, or a combination of the physical channel priority and the transmission ID. The arbitration granularity can be the task granularity, or the burst transmission length (burst) granularity.
[0169] Therefore, when the secondary arbitration module arbitrates based on the secondary arbitration factors and arbitration granularity, it can be divided into the following four cases. At the same time, the transmission module will adopt corresponding transmission methods in the four cases.
[0170] Case 1: The secondary arbitration factor is the physical channel priority, and the arbitration granularity is the task granularity. In this case, specifically during the process of the transmission module transmitting each DMA task data, if it is determined that there is DMA task data stored in the second physical channel, the second physical channel is determined as the target physical channel;
[0171] Specifically, after the transmission module finishes transmitting the currently to-be-transmitted DMA task data, it transmits the DMA task data in the second physical channel.
[0172] Such as Figure 3 shown, if the transmission module is currently transmitting a DMA task data in the first physical channel and the secondary arbitration module detects that there is DMA task data stored in the second physical channel at this time, the second physical channel is determined as the target physical channel and the transmission module is informed. After the transmission module finishes transmitting the current DMA task data in the first physical channel, it starts to transmit the DMA task data in the second physical channel.
[0173] When the secondary arbitration module performs arbitration according to the arbitration granularity, it can be understood that the secondary arbitration module determines the arbitration frequency according to the arbitration granularity. In this case, an arbitration is performed each time the transmission module transmits a DMA task data. And when the transmission module performs transmission according to the arbitration granularity, it can be understood that the transmission module determines the amount of data to be transmitted according to the arbitration granularity. For example, in this case, the transmission module obtains and transmits the data amount corresponding to a DMA task data from the physical channel each time, that is, all the data corresponding to transmitting a complete DMA task data at one time.
[0174] Case 2: The arbitration factors are the physical channel priority and the transmission ID, and the arbitration granularity is the task granularity.
[0175] In this case, specifically during the process of the transmission module transmitting each DMA task data, if there is DMA task data stored in the second physical channel, the second physical channel and the first physical channel are determined as the target physical channels, and the target transmission ID corresponding to the DMA task data in the second physical channel is fed back to the primary arbitration module;
[0176] The primary arbitration module determines the virtual channel storing the DMA task data corresponding to the target transmission ID as the target virtual channel;
[0177] Specifically, after the transmission module finishes transmitting the currently to-be-transmitted DMA task data, it transmits the data in the second physical channel; the DMA task data corresponding to the target transmission ID in the target virtual channel is sequentially stored into the first physical channel according to the priorities of the target virtual channels, and the DMA task data in the first physical channel is transmitted.
[0178] As Figure 3 shown, if the transmission module is currently transmitting a DMA task data in the first physical channel and the secondary arbitration module detects that DMA task data is stored in the second physical channel at this time, it is determined that both the second physical channel and the first physical channel are target physical channels. If the target transmission ID corresponding to the DMA task data in the second physical channel is 0, the target transmission ID 0 is fed back to the first-level arbitration module. At this time, the arbitration module needs to change its arbitration strategy and determine the virtual channel storing the DMA task data corresponding to the target transmission ID as the target virtual channel. Combining the content of Table 3 above, it can be determined that virtual channel 2 and virtual channel 4 are the target virtual channels. After the transmission module finishes transmitting the currently to-be-transmitted DMA task data, it transmits the data in the second physical channel, that is, first transmits the data in the second physical channel, and then stores the DMA task data corresponding to the target transmission ID in virtual channel 2 and virtual channel 4 into the first physical channel in the order of the priorities of the target virtual channels, that is, in the order of virtual channel 2 - virtual channel 4, and transmits the DMA task data in the first physical channel. It can be understood that if the processor sets the secondary arbitration factor to the physical channel priority and the transmission ID, it means that there must be DMA task data in the virtual channel with the same transmission ID as the DMA task corresponding to the second physical channel. Therefore, the secondary arbitration module can directly determine both the second physical channel and the first physical channel as the target physical channels. It can be understood that if there is no DMA task data in the second physical channel, the secondary arbitration module can determine the first physical channel as the target physical channel.
[0179] In the above - mentioned manner, the DMA task data associated with the DMA task data in the second physical channel in each virtual channel can be transmitted together. This can meet some actual application requirements. For example, some tasks in the virtual channel need to be processed quickly, such as DMA task C, DMA task D, and DMA task G in Table 3. If the first - level arbitration module uses the arbitration factor of virtual - channel priority to arbitrate the data in each virtual channel, it is necessary to transmit the data in virtual channel 1 first before transmitting the data corresponding to DMA task C in virtual channel 2, and finally transmit the data in DMA task G. At this time, if the backend urgently needs the data of DMA task C, DMA task D, and DMA task G, the processor can send the transmission IDs of DMA task C, DMA task D, and DMA task G to the first - level arbitration module, configure the transmission IDs of these three tasks to 0, at the same time store the newly generated DMA task in the second physical channel, and also configure the transmission ID of this DMA task to 0. At the same time, configure the arbitration factor of the second - level arbitration module as physical - channel priority and transmission ID. In this way, the DMA task data in DMA task C, DMA task D, and DMA task G stored in the virtual channel can be quickly transmitted to the backend, meeting the actual requirements.
[0180] Case 3: The arbitration factor is physical - channel priority, and the arbitration granularity is the burst - transfer - length (burst) granularity. Among them, the burst - transfer - length burst can be understood as the data length carried by DMA in a single transfer. Usually, the data length corresponding to the DMA task data is much larger than the burst - transfer - length, that is, the DMA task data corresponding to one DMA task includes N bursts, where N is an integer greater than 1.
[0181] In this case, specifically, during the process of the transmission module transmitting each burst - transfer - length, if the second - level arbitration module detects that there is DMA task data stored in the second physical channel, it determines the second physical channel as the target physical channel;
[0182] Specifically, after the transmission module finishes transmitting the burst - transfer - length corresponding to the currently to - be - transmitted DMA task data, it transmits the DMA task data in the second physical channel.
[0183] The difference between this case and Case 1 is that the arbitration granularity is configured as the burst - length granularity. In this case, the arbitration frequency of the second - level arbitration module is actually that during the process of the transmission module transmitting each burst length, the second - level arbitration module conducts an arbitration once. At the same time, the transmission module also based on the arbitration result of the second - level arbitration module, each time only obtains and transmits the data corresponding to one burst - transfer - length from the physical channel.
[0184] By adopting the method of this embodiment, the target physical channel can be switched to the second physical channel faster, that is, the data in the second physical channel can be transmitted faster, meeting the requirement that tasks can be processed most quickly.
[0185] As Figure 5 shown, if the data in the current first physical channel includes the result arbitrated by the first-level arbitration module, such as the DMA task data in virtual channel 1, including N bursts, and if the arbitration factor in the second-level arbitration module is the physical channel priority and the arbitration granularity is the task granularity, the transmission result is as Figure 5 shown in the upper right, that is, after all the data in virtual channel 1 is transmitted, the data in the second physical channel is transmitted. And if the arbitration factor in the second-level arbitration module is the physical channel priority and the arbitration granularity is the burst transmission length granularity, and if when the transmission module transmits 1 burst in the first physical channel, the second-level arbitration module detects that there is new DMA task data stored in the second physical channel at this time, then as Figure 5 shown in the lower right, the second-level arbitration module directly determines the second physical channel as the target physical channel and starts to transmit the data in the second physical channel, that is, after transmitting 1 burst of data of the DMA task in virtual channel 1, directly starts to transmit the data in the second physical channel. It can be seen that by adopting this method, the data in the second physical channel can be transmitted faster. When some data needs to be transmitted urgently, the solution of this embodiment can be adopted.
[0186] Case 4: The arbitration factor is the physical channel priority and the transmission ID, and the arbitration granularity is the burst transmission length (burst) granularity.
[0187] In this case, specifically, during the process of the transmission module transmitting each burst transmission length, if there is DMA task data stored in the second physical channel, the second-level arbitration module determines the second physical channel and the first physical channel as the target physical channels; and feeds back the target transmission ID corresponding to the DMA task data in the second physical channel to the first-level arbitration module;
[0188] The first-level arbitration module determines the virtual channel storing the DMA task data corresponding to the target transmission ID as the target virtual channel;
[0189] Specifically, after the transmission module finishes transmitting the burst transmission length corresponding to the current DMA task data to be transmitted, it transmits the DMA task data in the second physical channel;
[0190] The DMA task data corresponding to the target transmission ID in the target virtual channel is sequentially stored into the first physical channel according to the priorities of the target virtual channels, and the DMA task data in the first physical channel is transmitted.
[0191] The difference between this case and Case 2 is that the arbitration granularity is configured as the burst length granularity. By adopting this method, the data in the second physical channel can be transmitted more quickly, and at the same time, the related or also quickly transmitted data in each virtual channel can be transmitted to the backend as soon as possible. For the specific analysis, reference can be made to the analysis content of Case 2 and Case 3 above, which will not be elaborated here. It can be understood that in this case, the processor configures the arbitration factor as the physical channel priority and the transmission ID. Then, before the transmission module finishes transmitting the data in the second physical channel and the first physical channel for the current transmission ID, the processor will not trigger the DMA controller to store new DMA task data in the second physical channel, so as to avoid starting to transmit the data newly stored in the second physical channel before the data corresponding to the current transmission ID is transmitted.
[0192] Based on the same inventive concept, an embodiment of the present disclosure further provides a DMA controller, which includes a first-level arbitration module, a plurality of virtual channels, a first physical channel, and a transmission module. Among them, the plurality of virtual channels are configured with different priorities; the first-level arbitration module includes a first-level arbitration register for storing a first-level arbitration factor, and the first-level arbitration factor at least includes the virtual channel priority;
[0193] The first-level arbitration module is used to arbitrate the plurality of virtual channels according to the first-level arbitration factor to determine a target virtual channel; among them, any virtual channel is used to store the DMA task data corresponding to the priority of the virtual channel;
[0194] The transmission module is used to transmit at least part of the data in the target virtual channel through the first physical channel.
[0195] In an embodiment, the DMA controller further includes an acquisition module;
[0196] The acquisition module is used to acquire the DMA task data corresponding to any DMA task, and the DMA task is pre-configured with a priority; using the priority of the DMA task, match the priorities of each virtual channel, determine the virtual channel corresponding to the DMA task, and store the DMA task data in the determined virtual channel.
[0197] In an embodiment, the first-level arbitration factor includes the virtual channel priority and the transmission ID;
[0198] The first-level arbitration module is specifically configured to arbitrate the plurality of virtual channels according to the first-level arbitration factor to determine a plurality of target virtual channels; wherein, any DMA task data corresponds to a transmission ID, and the DMA task data with the same transmission ID is stored in the plurality of target virtual channels;
[0199] The transmission module is specifically configured to transmit at least part of the data in the plurality of target virtual channels through the first physical channel according to the priorities of the plurality of target virtual channels.
[0200] In one implementation, the DMA task data stored in any virtual channel corresponds to a unique transmission ID;
[0201] The first-level arbitration factor is specifically configured to determine the priorities and data storage conditions of the respective virtual channels, and determine the virtual channel with the highest priority storing the DMA task data as the target virtual channel;
[0202] Determine the target transmission ID corresponding to the DMA task data in the target virtual channel;
[0203] Determine the other virtual channels storing the DMA task data corresponding to the target transmission ID as the other target virtual channels;
[0204] The transmission module is specifically configured to transmit all the DMA task data in all the determined target virtual channels through the first physical channel in sequence according to the priorities of the respective target virtual channels.
[0205] In one implementation, the DMA task data stored in any virtual channel corresponds to at least one transmission ID;
[0206] The first-level arbitration factor is specifically configured to determine the priorities and data storage conditions of the respective virtual channels, and determine the virtual channel with the highest priority storing the DMA task data as the target virtual channel; determine the target transmission ID corresponding to the DMA task data with the longest storage time in the target virtual channel; determine the other virtual channels storing the DMA task data corresponding to the target transmission ID as the other target virtual channels;
[0207] The transmission module is specifically configured to transmit the DMA task data corresponding to the target transmission ID in all the determined target virtual channels through the first physical channel in sequence according to the priorities of the respective target virtual channels.
[0208] In one implementation, the DMA controller further includes a second physical channel and a second-level arbitration module, and a second-level arbitration register is stored in the second-level arbitration module for storing a second-level arbitration factor and an arbitration granularity;
[0209] The secondary arbitration module is used to arbitrate between the second physical channel and the first physical channel according to the secondary arbitration factor and the arbitration granularity to determine the target physical channel; wherein, the secondary arbitration factor at least includes the physical channel priority, and the priority of the second physical channel is higher than that of the first physical channel;
[0210] The transmission module is used to transmit the DMA task data in the target physical channel according to the arbitration granularity.
[0211] In one implementation, the secondary arbitration factor includes the physical channel priority, and the arbitration granularity includes the task granularity;
[0212] The secondary arbitration module is specifically configured to, during the process of the transmission module transmitting each DMA task data, if there is DMA task data stored in the second physical channel, determine the second physical channel as the target physical channel;
[0213] The transmission module is specifically configured to, after transmitting the currently to-be-transmitted DMA task data, transmit the DMA task data in the second physical channel.
[0214] In one implementation, the arbitration factor includes the physical channel priority and the transmission ID, and the arbitration granularity includes the task granularity;
[0215] The secondary arbitration module is specifically configured to, during the process of the transmission module transmitting each DMA task data, if there is DMA task data stored in the second physical channel, determine the second physical channel and the first physical channel as the target physical channels, and feedback the target transmission ID corresponding to the DMA task data in the second physical channel to the primary arbitration module;
[0216] The primary arbitration module is further used to determine the virtual channel storing the DMA task data corresponding to the target transmission ID as the target virtual channel;
[0217] The transmission module is specifically configured to, after transmitting the currently to-be-transmitted DMA task data, transmit the data in the second physical channel; store the DMA task data corresponding to the target transmission ID in the target virtual channel into the first physical channel in sequence according to the priorities of the target virtual channels, and transmit the DMA task data in the first physical channel.
[0218] In one implementation, the arbitration factor includes the physical channel priority, and the arbitration granularity includes the burst transmission length granularity;
[0219] The secondary arbitration module is specifically configured to, during the process of the transmission module transmitting each burst transmission length, if there is DMA task data stored in the second physical channel, determine the second physical channel as the target physical channel;
[0220] The transmission module is specifically configured to, after transmitting the burst transmission length corresponding to the currently to-be-transmitted DMA task data, transmit the DMA task data in the second physical channel.
[0221] In one implementation, the arbitration factor includes the physical channel priority and the transmission ID, and the arbitration granularity includes the burst transmission length granularity;
[0222] The secondary arbitration module is specifically configured to, during the process of the transmission module transmitting each burst transmission length, if there is DMA task data stored in the second physical channel, determine the second physical channel and the first physical channel as the target physical channels; and feedback the target transmission ID corresponding to the DMA task data in the second physical channel to the primary arbitration module;
[0223] The primary arbitration module is further configured to determine the virtual channel storing the DMA task data corresponding to the target transmission ID as the target virtual channel;
[0224] The transmission module is specifically configured to, after transmitting the burst transmission length corresponding to the currently to-be-transmitted DMA task data, transmit the DMA task data in the second physical channel; store the DMA task data corresponding to the target transmission ID in the target virtual channel into the first physical channel in sequence according to the priorities of the target virtual channels, and transmit the DMA task data in the first physical channel.
[0225] As the present disclosure also proposes a graphics processing system, as Figure 6 shown, it at least includes:
[0226] The GPU core is used to process commands, such as commands for drawing pictures. According to the drawing commands, it executes the image rendering pipeline. Among them, the GPU core mainly includes a computing unit, which is used to execute the instructions after shader compilation. It is a programmable module composed of a large number of ALUs; a Cache (memory) is used to cache the data of the GPU core to reduce the access to the memory; a controller (not shown in the figure). In addition, the GPU core also has a variety of functional modules, such as rasterization (a fixed stage of the 3D rendering pipeline), Tilling (slicing a frame in the TBR and TBDR GPU architectures), clipping (a fixed stage of the 3D rendering pipeline, clipping the primitives outside the viewing range or not showing the back side), post-processing (operations such as scaling, clipping, and rotating the drawn picture), etc.
[0227] The general-purpose DMA is used to perform data transfer between the host memory and the GPU graphics card memory. For example, for the vertex data used in 3D drawing, the general-purpose DMA moves the vertex data from the host memory to the GPU graphics card memory; in addition, this DMA also executes the DMA task data transfer method mentioned above;
[0228] The on-chip network is used for data exchange between various masters and slaves on the SOC; among them, the routing node proposed in the present disclosure is applied in the on-chip network;
[0229] The application processor is used for scheduling the tasks of each module on the SOC. For example, after the GPU renders a frame of the picture, it notifies the application processor, and the application processor then starts the display controller to display the picture drawn by the GPU on the screen; this application processor is also used to configure the priority, primary arbitration factor, secondary arbitration factor, and arbitration granularity of the virtual channels in the DMA controller, as well as the priority and transfer ID of each DMA task.
[0230] The PCIe controller is an interface for communicating with the host, implementing the PCIe protocol, so that the GPU graphics card is connected to the host through the PCIe interface. Graphics APIs and driver programs of the graphics card are run on the host;
[0231] The memory controller is used to connect to the memory device and is used to store the data on the SOC;
[0232] The display controller is used to control the output of the frame buffer in the memory to the display through a display interface (HDMI, DP, etc.);
[0233] The video decoder is used to decode the encoded video on the host hard disk into a displayable picture.
[0234] A video encoder for encoding the original video stream on the host hard disk into a specified format and returning it to the host.
[0235] Based on the same inventive concept, embodiments of the present disclosure further provide an electronic component, which includes the graphics processing system described in any of the above embodiments. In some usage scenarios, the product form of this electronic component is embodied as a graphics card; in other usage scenarios, the product form of this electronic component is embodied as a CPU motherboard.
[0236] Embodiments of the present disclosure further provide an electronic device, which includes the above electronic component. In some usage scenarios, the product form of this electronic device is a portable electronic device, such as a smart phone, a tablet computer, a VR device, etc.; in some usage scenarios, the product form of this electronic device is a personal computer, a game console, etc.
[0237] Although the preferred embodiments of the present disclosure have been described above, those skilled in the art can make additional changes and modifications once they learn the basic creative concept. Therefore, the appended claims are intended to be construed to include the preferred embodiments and all changes and modifications that fall within the scope of the present disclosure. Without departing from the spirit and scope of the present disclosure, the changes and modifications made by those skilled in the art should also be regarded as the protection scope of the embodiments of the present disclosure.
Claims
1. A DMA task data transmission method, which is applied to a DMA controller. The DMA controller includes a first-level arbitration module, several virtual channels, a first physical channel, and a transmission module, where, The plurality of virtual channels are configured with different priorities; The first-level arbitration module includes a first-level arbitration register for storing first-level arbitration factors, and the first-level arbitration factors include virtual channel priorities and transmission IDs; The DMA task data stored in any virtual channel corresponds to a unique transmission ID; The method includes: Determine the priorities and data storage conditions of each virtual channel, and determine the virtual channel with the highest priority that stores DMA task data as the target virtual channel; Determine the target transmission ID corresponding to the DMA task data in the target virtual channel; Determine the other virtual channels that store DMA task data corresponding to the target transmission ID as other target virtual channels; wherein, any virtual channel is used to store DMA task data corresponding to the priority of the virtual channel; Transmit all the DMA task data in all the determined target virtual channels through the first physical channel in sequence according to the priorities of the respective target virtual channels.
2. The method according to claim 1, wherein the DMA controller further includes an acquisition module, and the method further includes: The acquisition module acquires DMA task data corresponding to any DMA task, and the DMA task is pre-configured with a priority; Use the priority of the DMA task to match the priorities of each virtual channel, determine the virtual channel corresponding to the DMA task, and store the DMA task data in the determined virtual channel.
3. According to the method described in claim 1, the DMA controller further includes a second physical channel and a secondary arbitration module, and a secondary arbitration register is stored in the secondary arbitration module for storing secondary arbitration factors and arbitration granularity; The method further includes: The second-level arbitration module arbitrates the second physical channel and the first physical channel according to the second-level arbitration factor and the arbitration granularity to determine the target physical channel; wherein, the second-level arbitration factor includes at least a physical channel priority, and the priority of the second physical channel is higher than that of the first physical channel; The transmission module transmits the DMA task data in the target physical channel according to the arbitration granularity.
4. The method according to claim 3, wherein the second-level arbitration factor includes a physical channel priority, and the arbitration granularity includes a task granularity; The second-level arbitration module arbitrates the second physical channel and the first physical channel according to the second-level arbitration factor and the arbitration granularity to determine the target physical channel, including: During the process of transmitting each DMA task data by the transmission module, if there is DMA task data stored in the second physical channel, determine the second physical channel as the target physical channel; The transmission module transmits the data in the target physical channel according to the arbitration granularity, including: After transmitting the currently to-be-transmitted DMA task data, transmit the DMA task data in the second physical channel.
5. The method according to claim 3, wherein the arbitration factor includes a physical channel priority and a transmission ID, and the arbitration granularity includes a task granularity; The second-level arbitration module arbitrates the second physical channel and the first physical channel according to the second-level arbitration factor and the arbitration granularity to determine the target physical channel, including: During the process of the transmission module transmitting each DMA task data, if there is DMA task data stored in the second physical channel, determine the second physical channel and the first physical channel as the target physical channels, and feedback the target transmission ID corresponding to the DMA task data in the second physical channel to the first-level arbitration module; The first-level arbitration module determines the virtual channel storing the DMA task data corresponding to the target transmission ID as the target virtual channel; The transmission module transmits the data in the target physical channel according to the arbitration granularity, including: After the transmission module finishes transmitting the currently to-be-transmitted DMA task data, it transmits the data in the second physical channel; The DMA task data corresponding to the target transmission ID in the target virtual channel is sequentially stored into the first physical channel according to the priorities of the target virtual channels, and the DMA task data in the first physical channel is transmitted.
6. The method according to claim 3, wherein the arbitration factor includes the physical channel priority, and the arbitration granularity includes the burst transmission length granularity; The second-level arbitration module arbitrates between the second physical channel and the first physical channel according to the second-level arbitration factor and the arbitration granularity to determine the target physical channel, including: During the process of the transmission module transmitting each burst transmission length, if there is DMA task data stored in the second physical channel, determine the second physical channel as the target physical channel; The transmission module transmits the data in the target physical channel according to the arbitration granularity, including: After the burst transmission length corresponding to the currently to-be-transmitted DMA task data is transmitted, the DMA task data in the second physical channel is transmitted.
7. The method according to claim 3, wherein the arbitration factor includes the physical channel priority and the transmission ID, and the arbitration granularity includes the burst transmission length granularity; The second-level arbitration module arbitrates between the second physical channel and the first physical channel according to the second-level arbitration factor and the arbitration granularity to determine the target physical channel, including: During the process of the transmission module transmitting each burst transmission length, if there is DMA task data stored in the second physical channel, determine the second physical channel and the first physical channel as the target physical channels; and feedback the target transmission ID corresponding to the DMA task data in the second physical channel to the first-level arbitration module; The first-level arbitration module determines the virtual channel storing the DMA task data corresponding to the target transmission ID as the target virtual channel; The transmission module transmits the data in the target physical channel according to the arbitration granularity, including: After the burst transmission length corresponding to the currently to-be-transmitted DMA task data is transmitted, the DMA task data in the second physical channel is transmitted; The DMA task data corresponding to the target transmission ID in the target virtual channel is sequentially stored into the first physical channel according to the priorities of the target virtual channels, and the DMA task data in the first physical channel is transmitted.
8. A DMA controller, which includes a first-level arbitration module, a plurality of virtual channels, a first physical channel, and a transmission module, wherein, The several virtual channels are configured with different priorities; The first-level arbitration module includes a first-level arbitration register for storing first-level arbitration factors, and the first-level arbitration factors at least include virtual channel priorities and transfer IDs; The DMA task data stored in any virtual channel corresponds to a unique transfer ID; The first-level arbitration module is used to determine the priorities and data storage conditions of each virtual channel, and determine the target virtual channel as the virtual channel with the highest priority that stores DMA task data; Determine the target transfer ID corresponding to the DMA task data in the target virtual channel; determine other virtual channels storing DMA task data corresponding to the target transfer ID as other target virtual channels; wherein, any virtual channel is used to store DMA task data corresponding to the priority of the virtual channel; The transmission module is used to transmit all the DMA task data in all the determined target virtual channels in sequence through the first physical channel according to the priorities of the target virtual channels.
9. The DMA controller according to claim 8, wherein the DMA controller further includes an acquisition module; The acquisition module is used to acquire the DMA task data corresponding to any DMA task, and the DMA task is pre-configured with a priority; use the priority of the DMA task to match the priorities of each virtual channel, determine the virtual channel corresponding to the DMA task, and store the DMA task data into the determined virtual channel.
10. The DMA controller according to claim 8, wherein the DMA controller further includes a second physical channel and a second-level arbitration module, and the second-level arbitration module stores a second-level arbitration register for storing second-level arbitration factors and arbitration granularities; The second-level arbitration module is used to arbitrate the second physical channel and the first physical channel according to the second-level arbitration factors and the arbitration granularities to determine the target physical channel; wherein, The second-level arbitration factors at least include physical channel priorities, and the second physical channel priority is higher than the first physical channel priority; The transmission module is used to transmit the DMA task data in the target physical channel according to the arbitration granularity.
11. The DMA controller according to claim 10, wherein the second-level arbitration factors include physical channel priorities, and the arbitration granularities include task granularities; The second-level arbitration module is specifically used to, during the process of the transmission module transmitting each DMA task data, if there is DMA task data stored in the second physical channel, determine the second physical channel as the target physical channel; The transmission module is specifically used to, after transmitting the currently to-be-transmitted DMA task data, transmit the DMA task data in the second physical channel.
12. The DMA controller according to claim 10, wherein the arbitration factors include physical channel priorities and transfer IDs, and the arbitration granularities include task granularities; The secondary arbitration module is specifically configured to, during the process of the transmission module transmitting each DMA task data, if there is DMA task data stored in the second physical channel, determine the second physical channel and the first physical channel as the target physical channels, and feed back the target transmission ID corresponding to the DMA task data in the second physical channel to the primary arbitration module; The primary arbitration module is further configured to determine the virtual channel storing the DMA task data corresponding to the target transmission ID as the target virtual channel; The transmission module is specifically configured to, after transmitting the currently to-be-transmitted DMA task data, transmit the data in the second physical channel; store the DMA task data corresponding to the target transmission ID in the target virtual channel into the first physical channel in sequence according to the priorities of the target virtual channels, and transmit the DMA task data in the first physical channel.
13. The DMA controller according to claim 10, wherein the arbitration factor includes the physical channel priority, and the arbitration granularity includes the burst transmission length granularity; The secondary arbitration module is specifically configured to, during the process of the transmission module transmitting each burst transmission length, if there is DMA task data stored in the second physical channel, determine the second physical channel as the target physical channel; The transmission module is specifically configured to, after transmitting the burst transmission length corresponding to the currently to-be-transmitted DMA task data, transmit the DMA task data in the second physical channel.
14. The DMA controller according to claim 10, wherein the arbitration factor includes the physical channel priority and the transmission ID, and the arbitration granularity includes the burst transmission length granularity; The secondary arbitration module is specifically configured to, during the process of each transmission of a burst transmission length by the transmission module, determine the second physical channel and the first physical channel as target physical channels if DMA task data is stored in the second physical channel; and feed back the target transmission ID corresponding to the DMA task data in the second physical channel to the primary arbitration module; The primary arbitration module is further configured to determine the virtual channel storing the DMA task data corresponding to the target transmission ID as the target virtual channel; The transmission module is specifically configured to, after transmitting the burst transmission length corresponding to the currently to-be-transmitted DMA task data, transmit the DMA task data in the second physical channel; store the DMA task data corresponding to the target transmission ID in the target virtual channel into the first physical channel in sequence according to the priorities of the target virtual channels, and transmit the DMA task data in the first physical channel.
15. A graphics processing system, comprising the DMA controller according to any one of claims 8-14.
16. An electronic component, comprising the graphics processing system according to claim 15.
17. An electronic device, comprising the electronic component according to claim 16.
Citation Information
Patent Citations
Data transmission system and method based on FPGA
CN108259368A
PCIe virtual channel data processing method and related device
CN112269752A
Data processing apparatus and operation method thereof
CN112491746A
Optimized arbiter using multi-level arbitration
US20110296068A1