DMA scheduler and method, system on chip, electronic component and device
By introducing a DMA scheduler on the SOC chip and optimizing the DMA transmission path and controller allocation, the problem of low data transmission efficiency in the existing technology is solved, and more efficient DMA resource utilization and transmission efficiency improvement are achieved.
Patent Information
- Application Number
- CN202311330695.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-16
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2043-10-16
AI Technical Summary
There is room for optimization in the data transmission efficiency of existing DMA transmission technology, especially in SOC chips. Data transmission between on-chip modules and off-chip devices requires two DMA transmissions, and it is difficult for software to know the status of the DMA controller in real time. , resulting in low transmission efficiency and waste of resources.
Provide a DMA scheduler that pre-configures multiple transmission paths, selects an appropriate target transmission path and allocates a target DMA controller, optimizes the transmission path, priority and idle resources for scheduling according to data transmission performance and load, and realizes data transmission Efficient handling.
It improves data transmission efficiency, reduces DMA resource waste, simplifies the data transmission configuration process, and improves the overall performance of the system.
Smart Images

Figure CN117112465B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data transmission, and in particular to a DMA scheduler, a system on a chip, an electronic component, an electronic device and a DMA scheduling method. Background Art
[0002] To improve data transmission efficiency, data transmission on SOC (System on Chip) chips is often implemented through DMA (Direct Memory Access). To implement DMA transmission, software needs to configure DMA transmission.
[0003] Off-chip devices cannot directly access on-chip modules, and vice versa. Therefore, when the on-chip module of the SOC chip needs to process off-chip data, the off-chip data needs to be temporarily stored in the SOC chip's own external memory, and then moved from the external memory to the on-chip module. This data transfer process requires two DMA transfers, which need to be configured by software separately.
[0004] The current DMA transmission technology still has room for improvement, at least in terms of data transmission efficiency. Summary of the invention
[0005] The purpose of the present disclosure is to provide a DMA scheduler, a system on chip, an electronic component, an electronic device, and a DMA scheduling method to optimize data transmission efficiency.
[0006] According to one aspect of the present disclosure, a DMA scheduler is provided, which is applied to a system on chip, and the DMA scheduler is configured to:
[0007] In response to a data transmission request, selecting at least one target transmission path from a plurality of pre-configured transmission paths, the at least one target transmission path constituting a data transmission path from a source address of data to be transmitted in the system-on-chip to a target address of data to be transmitted in the system-on-chip;
[0008] Allocating a target DMA controller to each target transmission path, wherein the available source address of the target DMA controller includes the source address of the corresponding target transmission path, and the available target address of the target DMA controller includes the target address of the corresponding target transmission path;
[0009] A data transfer instruction is sent to the target DMA controller so that the target DMA controller moves the data to be transferred according to the corresponding target transmission path.
[0010] If there are two or more target transmission paths, data transmission instructions are sent to each target DMA controller respectively. In one implementation, after the upper target transmission path completes the transfer of the data to be transmitted, a data transmission instruction is sent to the DMA controller assigned to the lower target transmission path. In another implementation, after the transfer progress of the above-mentioned data to be transmitted on the upper target transmission path reaches a preset condition, a data transmission instruction is sent to the target DMA controller assigned to the lower target transmission path.
[0011] Based on any of the above embodiments of the DMA scheduler, in order to allocate a target DMA controller to each target transmission path, the DMA scheduler can be configured to: allocate a target DMA controller to each target transmission path at least according to the data transmission performance of the DMA controller, wherein the data transmission performance of the target DMA controller meets the data transmission performance requirement of the corresponding target transmission path.
[0012] The data transmission performance may include but is not limited to data transmission bandwidth.
[0013] Based on any of the above DMA scheduler embodiments, in order to allocate a target DMA controller to each target transmission path, the DMA scheduler can be configured to: allocate a target DMA controller to each target transmission path according to the data transmission performance and load of the DMA controller.
[0014] On this basis, optionally, the target DMA controller is an idle DMA controller.
[0015] Based on any of the above-mentioned DMA scheduler embodiments, the DMA controller assigned to the first target transmission path with a high priority receives the data transmission instruction before the DMA controller assigned to the first target transmission path with a low priority, and the first target transmission path includes a target transmission path with the same target address and an uncompleted transmission task.
[0016] On this basis, optionally, when the corresponding first target transmission paths have the same priority, the DMA controller corresponding to the earlier transmission request receives the data transmission instruction before the DMA controller corresponding to the later transmission request.
[0017] Based on any of the above embodiments of the DMA scheduler, the data transmission instruction may carry data splitting information, where the data splitting information is used to indicate split data of a single transfer, where the split data is a part of the data to be transmitted.
[0018] According to another aspect of the present disclosure, a system on chip is further provided, the system on chip comprising the DMA scheduler described in any one of the above embodiments.
[0019] According to another aspect of the present disclosure, an electronic component is also provided, which includes the system on chip described in any of the above embodiments. In some usage scenarios, the product form of the electronic component is embodied as a graphics card; in other usage scenarios, the product form of the electronic component is embodied as a CPU motherboard.
[0020] According to another aspect of the present disclosure, an electronic device is also provided, which includes the above-mentioned electronic component. In some usage scenarios, the product form of the 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 the electronic device is a personal computer, a game console, etc.
[0021] According to another aspect of the present disclosure, a DMA scheduling method is also provided, which is applied to a DMA scheduler in a system on chip, and the DMA scheduling method at least includes the following operations:
[0022] In response to a data transmission request, selecting at least one target transmission path from a plurality of pre-configured transmission paths, the at least one target transmission path constituting a data transmission path from a source address of data to be transmitted in the system-on-chip to a target address of data to be transmitted in the system-on-chip;
[0023] Allocating a target DMA controller to each target transmission path, wherein the available source address of the target DMA controller includes the source address of the corresponding target transmission path, and the available target address of the target DMA controller includes the target address of the corresponding target transmission path;
[0024] A data transfer instruction is sent to the target DMA controller so that the target DMA controller moves the data to be transferred according to the corresponding target transmission path.
[0025] If there are two or more target transmission paths, data transmission instructions are sent to each target DMA controller respectively. In one implementation, after the upper target transmission path completes the transfer of the data to be transmitted, a data transmission instruction is sent to the DMA controller assigned to the lower target transmission path. In another implementation, after the transfer progress of the above-mentioned data to be transmitted on the upper target transmission path reaches a preset condition, a data transmission instruction is sent to the target DMA controller assigned to the lower target transmission path.
[0026] Based on any of the above method embodiments, a target DMA controller is assigned to each target transmission path, and its implementation method may include: at least according to the data transmission performance of the DMA controller, a target DMA controller is assigned to each target transmission path, and the data transmission performance of the target DMA controller meets the data transmission performance requirements of the corresponding target transmission path.
[0027] The data transmission performance may include but is not limited to data transmission bandwidth.
[0028] Based on any of the above method embodiments, a specific implementation of allocating a target DMA controller to each target transmission path may include: allocating a target DMA controller to each target transmission path according to the data transmission performance and load of the DMA controller.
[0029] On this basis, optionally, the target DMA controller is an idle DMA controller.
[0030] Based on any of the above method embodiments, the DMA controller assigned to the first target transmission path with a high priority receives the data transmission instruction before the DMA controller assigned to the first target transmission path with a low priority, and the first target transmission path includes a target transmission path with the same target address and an uncompleted transmission task.
[0031] On this basis, optionally, when the corresponding first target transmission paths have the same priority, the DMA controller corresponding to the earlier transmission request receives the data transmission instruction before the DMA controller corresponding to the later transmission request.
[0032] Based on any of the above method embodiments, optionally, the data transmission instruction carries data splitting information, and the data splitting information is used to indicate split data of a single transfer, and the split data is a part of the data to be transmitted. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A schematic diagram of a SOC chip structure provided by an embodiment of the present disclosure;
[0034] Figure 2 A schematic diagram of the structure of a graphics processing chip provided by an embodiment of the present disclosure;
[0035] Figure 3 A flowchart of a DMA scheduling method provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0036] Before introducing the embodiments of the present disclosure, it should be noted that:
[0037] Some embodiments of the present disclosure are described as processing flows. Although the various operation steps of the flow may be given sequential step numbers, the operation steps therein may be implemented in parallel, concurrently or simultaneously.
[0038] In the embodiments of the present disclosure, the terms "first", "second", etc. may be used to describe various features, but these features should not be limited by these terms. These terms are used only to distinguish one feature from another.
[0039] The term “and / or” may be used in embodiments of the present disclosure. “And / or” includes any and all combinations of one or more of the associated features listed.
[0040] It should be understood that when describing the connection or communication relationship between two components, unless it is explicitly stated that the two components are directly connected or directly communicating, the connection or communication between the two components can be understood as direct connection or communication, or as indirect connection or communication through an intermediate component.
[0041] In order to make the technical solutions and advantages of the embodiments of the present disclosure more clearly understood, the exemplary embodiments of the present disclosure are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0042] Taking the transmission of data on the SOC chip as an example, data transmission can be divided into data input and data output. Among them, data input refers to the data input from outside the chip (for the convenience of expression, it is called Input) and stored in the SOC chip's own external memory (usually a DDR device). In order to improve system efficiency, the data input from outside the chip is usually first stored in the temporary storage area (DDR-T) of the DDR device. When the data is needed, the data is moved from the temporary storage area to the dedicated area (DDR-S). Among them, data output refers to the data being sent from DDR-S to the outside of the chip via the data sending module (for the convenience of expression, it is called Output).
[0043] In the above data transmission process, data is moved to the DDR device of the SOC chip through two DMA transfers. The corresponding data transmission path is: Input—>DDR-T, DDR-T—>DDR-S; and data is output to the outside of the chip through one DMA transfer. The corresponding data transmission path is: DDR-S—>Output.
[0044] Taking data input as an example, when there is a data input demand (Input—>DDR-S), according to the existing technology, the off-chip software first configures the DMA transfer operation of Input—>DDR-T, specifically including determining the DMA controller, configuring the source address and target address of Input—>DDR-T, and the data length of the data to be transferred, and sending a data transfer request to the determined DMA controller; after the DMA controller completes the data transfer, it returns a transfer completion indication to the off-chip software, and the off-chip software then configures the DMA transfer operation of DDR-T—>DDR-S, and sends a data transfer request to the DMA controller corresponding to the second DMA transfer.
[0045] There are often multiple DMA controllers on the SOC chip, and it is difficult for off-chip software to know the status of these DMA controllers in real time. Therefore, when configuring DMA transfer, you may encounter the following situation: the DMA controller selected for DMA transfer is busy and cannot respond to data transfer requests in time, while other DMA controllers on the SOC chip may be idle. This situation not only affects the data transmission efficiency, but also causes a waste of DMA resources. In addition, if data transmission requires multiple DMA transfers (such as the data input process mentioned above), off-chip software needs to configure DMA transfers separately; because it is difficult for off-chip software to obtain the real-time status of on-chip data transmission, it is necessary to determine the completion of a DMA transfer through the transfer completion indication returned by the DMA controller. Therefore, the off-chip software needs to wait until the upper-level DMA transfer is completed before configuring the lower-level DMA transfer and starting the lower-level DMA transfer, which also affects the data transmission efficiency.
[0046] In view of this, the embodiment of the present disclosure provides a DMA scheduler, which aims to optimize DMA transmission to a certain extent and improve data transmission efficiency. The DMA scheduler provided by the embodiment of the present disclosure is applied to a system on a chip. Figure 1 Taking the SOC chip shown in the figure as an example, the specific working method of the DMA scheduler is explained.
[0047] like Figure 1 As shown, the SOC chip includes an input data receiving module, a DMA-I (a DMA controller built into the input data receiving module) arranged in the input data receiving module, an output data sending module, a DMA-O (a DMA controller built into the output data sending module) arranged in the output data sending module, a functional module A, a DMA-A (a DMA controller built into the functional module A) arranged in the functional module A, a core module, a DMA-C (a DMA controller built into the core module) arranged in the core module, a DMA-BUS (a bus DMA controller), and a DMA scheduler. In addition, the SOC chip's own external memory is a DDR device, including DDR-T and DDR-S. It should be pointed out that Figure 1 The SOC chip shown is an exemplary structure given for the convenience of describing the technical solution. In fact, the SOC chip will also include other modules not shown in the figure, and will also have multiple functional modules, or even multiple core modules. In addition, in addition to the bus structure, a SOC chip based on an on-chip network is also applicable to the present disclosure.
[0048] The DMA scheduler can be an independent module or a module integrated with other functional modules. After the DMA scheduler is powered on, it enters the initialization phase. The software will perform corresponding configurations during the DMA scheduler initialization process. As an example but not a limitation, the following configurations may be included:
[0049] The available source addresses and available target addresses of each DMA controller on the SOC chip. The available source address of a DMA controller may be a continuous or discontinuous address segment. In this article, the available source address of the DMA controller is also referred to as the available source address space. Similarly, the available target address of the DMA can also be referred to as the available target address space. Among them, the available source address (target address) refers to the address that the DMA controller can access;
[0050] The data transmission performance of each DMA controller on the SOC chip; in the embodiment of the present disclosure, the data transmission performance may include but is not limited to the data transmission bandwidth. In addition, the data transmission performance may also include parameters such as data processing delay, which are not limited in the present disclosure; if the data transmission performance includes the data transmission bandwidth; the purpose of configuring the data transmission performance is to schedule the DMA resources, so the configuration information may use either an actual value or a relative value;
[0051] The DMA transfer path available on the SOC chip (for ease of description, referred to as the transfer path) is as follows: Figure 1 Taking the SOC chip shown as an example, the transmission path includes: Input—>DDR-T, DDR-T—>DDR-S, DDR-S—>core module, DDR-S—>Output, core module—>DDR-S, core module—>Output;
[0052] The priority of each transmission path; in actual application, all transmission paths on the SOC chip can be configured as a group to prioritize Figure 1 Taking the SOC chip shown in the figure as an example, the priority of core module->Output can be set to the highest, and the other transmission paths have the same priority, and the priority is lower than that of core module->Output; you can also group by target address and configure the priority for multiple transmission paths with the same destination address, still with Figure 1 Taking the SOC chip shown in the figure as an example, DDR-T—>DDR-S and core module—>DDR-S have the same target address, and the priority of configuring core module—>DDR-S is higher than that of DDR-T—>DDR-S. DDR-S—>Output and core module—>Output have the same target address, and the priority of configuring core module—>Output is higher than that of DDR-S—>Output. In practical applications, the above two priority configuration methods can also be combined, or the priority setting rules can be determined according to actual needs, which is not limited in the present disclosure. It should be pointed out that the priority configuration is an optional configuration.
[0053] The minimum amount of data required to start the lower-level DMA transfer; Figure 1Taking the SOC chip shown as an example, if the core module needs to process the input data stored in the DDR device, then the data amount transmitted from DDR-T—>DDR-S meets the minimum data amount required for the core module to start, the DMA transmission from DDR-S—>core module can be started. Therefore, the minimum data amount requirement for starting the DMA transmission from DDR-S—>core module can be determined according to the minimum data amount required for starting the core module (for example, the minimum data amount required for starting the core module is used as the minimum data amount requirement for starting the DMA transmission from DDR-S—>core module); in actual applications, this configuration is optional;
[0054] The data splitting parameters include data splitting information, which indicates the size of the split data, for example, splitting the data to be transmitted into multiple split data of 1M bytes. Optionally, the parameter may also include splitting validity indication information to indicate whether data splitting is supported. In actual applications, this configuration is an optional configuration. In actual applications, this configuration may also be configured before the corresponding DMA transmission is started.
[0055] The above-mentioned initialization configuration information may be, but is not limited to, stored in relevant registers for query by the DMA scheduler. The present disclosure does not limit the specific data structure of the configuration information.
[0056] Based on the above initialization configuration, the DMA scheduler provided by the embodiment of the present disclosure is configured to: in response to a data transmission request, select at least one target transmission path from a plurality of pre-configured transmission paths, and the at least one target transmission path constitutes a data transmission path from the source address of the data to be transmitted in the on-chip system to the target address of the data to be transmitted in the on-chip system; allocate a target DMA controller to each target transmission path, the available source address of the target DMA controller includes the source address of the corresponding target transmission path, and the available target address of the target DMA controller includes the target address of the corresponding target transmission path; send a data transmission instruction to the target DMA controller so that the target DMA controller moves the data to be transmitted according to the corresponding target transmission path.
[0057] The data transfer request may be initiated by the data demander. For example, but not limited to, the data transfer request is sent by off-chip software. The data transfer request may carry DMA transfer configuration information, which includes the on-chip system (such as Figure 1The configuration information of the DMA transfer may also include the source address and the target address of the SOC chip (shown), and may also include the data length of the data to be transmitted. The configuration information of the above-mentioned DMA transfer may not be sent together with the data transmission request, for example, it may be sent separately. If the source address and the target address of the data in the on-chip system are the same (and the data length may also be the same) for each request for transmission by the same data demander, this part of the configuration information may also be configured only once, and the subsequent execution is in accordance with the configuration information until the part of the configuration information is updated. It can be seen that the embodiment of the present disclosure sets a DMA scheduler on the SOC chip. When performing data transmission, it is only necessary to configure the DMA transfer for the DMA scheduler. The DMA scheduler obtains the configuration information of the DMA transfer of the data to be transmitted, and performs subsequent DMA transfer scheduling according to the configuration information. Even if the data transmission requires multiple DMA transmissions to be implemented, it is only necessary to perform a DMA transmission configuration for the data transmission once and send it to the DMA scheduler, without the need to configure each DMA transmission segment separately, thereby improving the data transmission efficiency to a certain extent.
[0058] The present disclosure does not limit the specific implementation of selecting the target transmission path. In a possible implementation, the pre-configured transmission path is stored in the form of a source address-target address pair (more specifically, it can be stored in the form of a lookup table), and the source address and target address of the data to be transmitted in the system-on-chip are used as the source address-target address pair index, and matched with the pre-configured source address-target address pair. If the match is successful, it means that there is a direct path, and the transmission path that successfully matches is used as the template transmission path; if there is more than one transmission path that successfully matches, one of them can be selected as the template transmission path according to a predetermined strategy. The present disclosure does not limit the selection strategy, and the selection strategy can be formulated according to actual needs / actual conditions; if the match is unsuccessful, it means that there is no direct path, then, two or more transmission paths can be selected as the target transmission path according to a predetermined routing strategy. The present disclosure does not limit the routing strategy, and the routing strategy can be formulated according to actual needs / actual conditions. In the embodiment of the present disclosure, if the data to be transmitted requires two or more target transmission paths between the source address and the target address of the system-on-chip, then, for two adjacent target transmission paths, the previous target transmission path is called the upper target transmission path, and the latter target transmission path is called the lower target transmission path.
[0059] The present disclosure does not limit the specific implementation of assigning a target DMA controller to a target transmission path. In a possible implementation, the source address-target address pair of each target transmission path is used as an index to match the available source address-available target address pair of each DMA controller of the system on chip, and the DMA controller that successfully matches is assigned to the corresponding target transmission path. Once the match is successful, no search is performed; the match can also be performed in a traversal manner. If there are two or more matching results, a DMA controller is selected as the target DMA controller corresponding to the target transmission path according to a predetermined selection strategy. The present disclosure does not limit the specific content of the selection strategy. Preferably, when assigning a target DMA controller, the data transmission performance of the DMA controller can be considered. Accordingly, when formulating the above selection strategy, the data transmission performance of the DMA controller can be used as a selection basis. If the target DMA controller is assigned according to the data transmission performance of the DMA controller, the candidate DMA controller can also be screened according to the data transmission performance first, and then the target DMA controller is matched from the candidate DMA controller by the address index. The purpose of assigning a target DMA controller according to the data transmission performance is to make the data transmission performance of the assigned target DMA controller meet the data transmission performance requirements of the corresponding target transmission path. As for how to match specifically, the present disclosure does not limit this. As an example but not limitation, the target transmission paths are sorted in descending order according to the data transmission performance requirements, and the DMA controllers are sorted in descending order according to the data transmission performance requirements. First, the target transmission path with the highest data transmission performance requirements is assigned a target DMA controller. Specifically, address matching is performed from the DMA controller with the highest data transmission performance until the match is successful. The successfully matched DMA controller is used as the DMA controller of the target transmission path, and then the target transmission path with the second highest data transmission performance requirements is assigned a target DMA controller until all target transmission paths are assigned a target DMA controller. Wherein, the data transmission performance requirements of the target transmission path are determined according to the data transmission performance of the module where the source address of the target transmission path is located and / or the data transmission performance of the module where the target address is located; as an example but not limitation, the optimal data transmission performance is determined as the data transmission performance requirements of the target transmission path. Preferably, when assigning the target DMA controller, the load of the DMA controller can also be considered. Accordingly, when formulating the above selection strategy, the load of the DMA controller can be used as the selection basis. If the target DMA controller is assigned according to the load of the DMA controller, the candidate DMA controller can also be screened according to the load first, and then the target DMA controller is matched from the candidate DMA controller by the address index. The purpose of allocating the target DMA controller according to the load is to fully utilize the DMA resources of the system on chip and improve the data transmission efficiency. As for how to match specifically, this disclosure does not limit this.As an example but not limitation, an idle DMA controller may be allocated as the target DMA controller, or a DMA controller with a load rate less than a set value may be allocated as the target DMA controller.
[0060] In the above embodiment, if there are two or more target transmission paths, there are two or more target DMA controllers, and data transmission instructions need to be sent to each target DMA controller respectively. In one implementation, the upper target transmission path completes the transfer of the data to be transmitted, and sends a data transmission instruction to the DMA controller assigned to the lower target transmission path. In another implementation, after the transfer progress of the above-mentioned data to be transmitted on the upper target transmission path reaches the preset condition, a data transmission instruction is sent to the target DMA controller assigned to the lower target transmission path. Taking the graphics processing chip as an example, in the prior art, it is necessary to wait for the transmission data to be fully transferred from DDR-T to DDR-S before starting the DMA transmission from DDR-S to GPU Core (Graphics Processing Unit Core). In fact, GPUCore does not need to receive all the data to start working, so as long as the data stored in DDR-S meets the working requirements of GPU Core, the DMA transmission from DDR-S to GPU Core can be started. In other words, the DMA transmission on the lower target transmission path does not need to wait for the transmission on the upper target transmission path to be completed before starting, thereby further improving the DMA transmission efficiency. The present disclosure does not limit the specific content and form of the preset conditions for the transport progress, and the conditions can be set according to actual needs.
[0061] In the disclosed embodiment, if there are two or more data transmission tasks for the same target address, it may cause task conflicts. To avoid this situation, a priority can be set for the transmission path. Then, when there is a transmission conflict on the same target address (embodied in that there are at least two target transmission paths (called the first target transmission path) with the same target address and uncompleted transmission tasks), the DMA transmission of the high-priority transmission path is prioritized, that is, the DMA controller assigned to the first target transmission path with a high priority receives the data transmission instruction before the DMA controller assigned to the first target transmission path with a low priority; if the priorities are the same, the order of DMA transmission is determined according to the order of transmission requirements; if the priorities are the same and the transmission requirements are received at the same time, DMA transmission is performed in a polling manner.
[0062] Based on any of the above embodiments of the DMA scheduler, the data transmission instruction may carry data splitting information, where the data splitting information is used to indicate split data of a single transfer, where the split data is a part of the data to be transmitted.
[0063] The DMA scheduler provided in the embodiment of the present disclosure is applicable to various types of system-on-chip chips. The DMA scheduler provided in the embodiment of the present disclosure and its working process are described in detail below using a graphics processing chip as an example.
[0064] Figure 2 The figure shows a single-die (chip) graphics processing chip, including multiple GPU cores, a general-purpose DMA controller, a DMA scheduler, a PCIE controller, an application processor, a memory controller, a display controller, a video encoder, a video decoder, and an on-chip network.
[0065] Among them, the GPU core, PCIE controller, application processor, memory controller, display controller, video encoder and video decoder are respectively equipped with built-in DMA controllers.
[0066] The GPU core is used to process drawing instructions, execute the image rendering pipeline according to the drawing instructions, and can also be used to execute other computing instructions;
[0067] The above-mentioned general DMA controller and the DMA controller inside each module are used to perform data movement between the host end and the graphics processing system memory (such as the graphics card memory), for example, the vertex data of 3D drawing is moved from the host end to the graphics processing system memory through DMA;
[0068] The DMA scheduler is used to perform DMA transmission scheduling according to the method provided by the embodiment of the present disclosure;
[0069] The PCIe controller is an interface for communicating with the host, implementing the PCIe protocol, so that the graphics processing chip is connected to the host through the PCIe interface, and the graphics API and graphics card driver and other programs are running on the host;
[0070] The application processor is used to schedule tasks of various modules on the graphics processing chip. For example, after the GPU core renders a frame of image, it notifies the application processor, and the application processor then starts the display controller to display the image rendered by the GPU core on the screen.
[0071] The memory controller is used to connect to the memory of the graphics processing system so as to save the data on the graphics processing chip to the memory of the graphics processing system;
[0072] The display controller is used to output the frame buffer in the memory of the graphics processing system to the display through the display interface (HDMI, DP, etc.);
[0073] The above video decoder can decode the encoded video on the host hard disk into a displayable picture;
[0074] The above video encoder can encode the original video code stream on the host hard disk into a specified format and return it to the host;
[0075] The above-mentioned on-chip network is used for data exchange between masters and slaves on the graphics processing system. In this embodiment, the on-chip network includes a configuration bus, a data communication network, a communication bus, and the like.
[0076] Figure 2 After the graphics processing chip shown is powered on, each module is initialized. Among them, the host software (or on-chip software) performs the following configuration during the DMA scheduler initialization process:
[0077] Available source addresses and available destination addresses for each DMA controller;
[0078] The data transmission bandwidth of each DMA controller. In this embodiment, this configuration information is the relative value of the data transmission bandwidth. Specifically, general DMA controller: 10, DMA-D: 5, DMA-D: 4, DMA-G: 2, DMA-VD: 1, DMA-VC: 1, DMA-M: 1, DMA-C: 1;
[0079] Available transmission paths. In this embodiment, the available transmission paths include at least: PCIe controller -> DDR-T area in memory (hereinafter referred to as DDR-T), DDR-T -> DDR-S area in memory (hereinafter referred to as DDR-S), DDR-S -> GPU core, DDR-S -> display controller, GPU core -> DDR-S, GPU core -> display controller;
[0080] The priority of each transmission path. In this embodiment, the priority of GPU core -> display controller is set to the highest, and the remaining transmission paths have the same lower priority;
[0081] The minimum data amount required for starting the lower-level DMA transfer. In this embodiment, taking the transmission path with the GPU core as the target address as an example, assuming that the minimum data amount required for starting the GPU core is 1024 bytes, then the minimum data amount required for all lower-level DMA transfers with the GPU core as the target address can be configured as 1024 bytes. It should be noted that, considering the transmission delay, the minimum data amount required for starting the lower-level DMA transfer can also be slightly smaller than the minimum data amount required for starting the corresponding module.
[0082] The data splitting parameters include splitting validity indication information (set to "valid" in this embodiment) and data splitting information (set to 1024 bytes in this embodiment).
[0083] In this embodiment, the above-mentioned initialization configuration information is stored in the configuration register so as to be queried by the DMA scheduler.
[0084] When the graphics API of the host sends a drawing instruction to the graphics processing chip to render an image frame, the drawing instruction includes a data transfer request, which carries the source address and destination address of the data to be transferred on the graphics processing chip, as well as the data length. The data to be transferred, for example, includes the vertex coordinate information of each object in the image frame, which needs to be moved from the host to the graphics processing system memory.
[0085] In the disclosed embodiment, the DMA scheduler responds to the drawing instruction, obtains the source address (PCIe controller) and the target address (DDR-S) of the data to be transmitted, and uses the source address as an index to traverse the source addresses of each transmission path in the configuration register, and each time a matching result is obtained, the target address of the matched transmission path is compared with the DDR-S; in this embodiment, the target address without a matching result is the same as the DDR-S, and then, each target address in the matching result is used as an index to traverse the source address of each transmission path in the configuration register, and each time a matching result is obtained, the target address of the matched transmission path is compared with the DDR-S; so far, it is determined that the target transmission paths are: PCIe controller—>DDR-T, and DDR-T—>DDR-S.
[0086] The DMA scheduler allocates target DMA controllers for the above two target transmission paths respectively. The specific process is as follows:
[0087] First, according to the available source addresses and available target addresses of each DMA controller, first candidate DMA controllers of the two target transmission paths are determined respectively, wherein the available source addresses of the candidate DMA controllers include the source addresses of the target transmission paths, and the available target addresses of the candidate DMA controllers include the target addresses of the target transmission paths;
[0088] If there is only one first candidate DMA controller, assigning the first candidate DMA controller to the corresponding target transmission path;
[0089] If there are two or more first candidate DMA controllers, a DMA controller whose data transmission bandwidth is not less than the data transmission bandwidth requirement of the target transmission path is selected from the first candidate DMA controllers of the target transmission path as the second candidate DMA controller. In this embodiment, the data transmission bandwidth requirement of the target transmission path is the minimum value of the interface bandwidth of the module where the source address and the target address of the target transmission path are located; taking PCIe controller -> DDR-T as an example, the interface bandwidth of the PCIe controller is 10Gbps, and the interface bandwidth of DDR-T is 40Gbps, then the data transmission requirement of the target transmission path is 10Gbps;
[0090] If there is only one second candidate DMA controller, assigning the second candidate DMA controller to the corresponding target transmission path;
[0091] If there are two or more second candidate DMA controllers, the second candidate DMA controllers are determined to be idle in ascending order of data transmission bandwidth. When there is an idle second candidate DMA controller, it is assigned to the corresponding target transmission path. In this embodiment, the target DMA controller assigned to PCIe controller -> DDR-T is DMA-P, and the target DMA controller assigned to DDR-T -> DDR-S is a general DMA controller. If there is no idle second candidate DMA controller, the second candidate DMA controller with the largest data transmission bandwidth or the lightest load is assigned to the corresponding target transmission path.
[0092] The DMA scheduler sends a data transfer instruction to DMA-P, which carries the source address and destination address of PCIe controller -> DDR-T, as well as data splitting information. According to the data transfer instruction, DMA-P splits the data to be transferred into multiple 1024-byte data packets and transfers them from the PCIe controller to DDR-T. Every time DMA-P completes the transfer of a data packet, it sends a signal to the DMA scheduler. The DMA scheduler counts the received signals to determine the amount of data transferred to DDR-T.
[0093] The DMA scheduler detects the amount of data transferred to DDR-T. When the amount of data reaches 1024 bytes, it sends a data transfer instruction to the general DMA controller, which carries the source address and destination address of DDR-T->DDR-S, as well as data splitting information. The general DMA controller splits the data to be transferred into multiple 1024-byte data packets according to the data transfer instruction and transfers them from DDR-T to DDR-S. The general DMA controller sends a signal to the DMA scheduler every time it completes the transfer of a data packet. The DMA scheduler counts the received signals to determine the amount of data transferred to DDR-S. When all the data to be transferred is transferred to DDR-S, the DMA scheduler feedbacks the completion of the DMA transfer to the host.
[0094] Taking the data transfer from PCIe controller -> DDR-T as an example, in the above embodiment, if the data transfer to DDR-T is not completed before the data transfer instruction is sent to DMA-P, then the DMA scheduler compares the priorities of the transmission paths. If the priority of the PCIe controller -> DDR-T that needs to be transferred this time is higher, the data transfer instruction is sent to DMA-P. If the priorities are the same, polling can be used to transfer data. If the priority of the PCIe controller -> DDR-T that needs to be transferred this time is lower, the data transfer instruction is sent to DMA-P after the previous data transfer is completed.
[0095] The disclosed embodiment further provides a system-on-chip chip, comprising the DMA scheduler described in any of the above embodiments.
[0096] The disclosed embodiment also provides an electronic component, which includes the system-on-chip chip described in any of the above embodiments. In some usage scenarios, the product form of the electronic component is a graphics card; in other usage scenarios, the product form of the electronic component is a CPU motherboard.
[0097] The disclosed embodiments also provide an electronic device, which includes the above-mentioned electronic components. In some usage scenarios, the product form of the 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 the electronic device is a personal computer, a game console, a workstation, a server, etc.
[0098] Based on the same inventive concept, the embodiment of the present disclosure also provides another aspect of the present disclosure, and further provides a DMA scheduling method, which is applied to a DMA scheduler in a system on chip, such as Figure 3 As shown, the DMA scheduling method includes at least the following operations:
[0099] Step 301: In response to a data transmission request, at least one target transmission path is selected from a plurality of pre-configured transmission paths, wherein the at least one target transmission path constitutes a data transmission path from a source address of data to be transmitted in the system-on-chip to a target address of data to be transmitted in the system-on-chip;
[0100] Step 302: Allocate a target DMA controller to each target transmission path, wherein the available source address of the target DMA controller includes the source address of the corresponding target transmission path, and the available target address of the target DMA controller includes the target address of the corresponding target transmission path;
[0101] Step 303: Send a data transmission instruction to the target DMA controller so that the target DMA controller moves the data to be transmitted according to the corresponding target transmission path.
[0102] If there are two or more target transmission paths, data transmission instructions are sent to each target DMA controller respectively. In one implementation, after the upper target transmission path completes the transfer of the data to be transmitted, a data transmission instruction is sent to the DMA controller assigned to the lower target transmission path. In another implementation, after the transfer progress of the above-mentioned data to be transmitted on the upper target transmission path reaches a preset condition, a data transmission instruction is sent to the target DMA controller assigned to the lower target transmission path.
[0103] Based on any of the above method embodiments, a target DMA controller is assigned to each target transmission path, and its implementation method may include: at least according to the data transmission performance of the DMA controller, a target DMA controller is assigned to each target transmission path, and the data transmission performance of the target DMA controller meets the data transmission performance requirements of the corresponding target transmission path.
[0104] The data transmission performance may include but is not limited to data transmission bandwidth.
[0105] Based on any of the above method embodiments, a specific implementation of allocating a target DMA controller to each target transmission path may include: allocating a target DMA controller to each target transmission path according to the data transmission performance and load of the DMA controller.
[0106] On this basis, optionally, the target DMA controller is an idle DMA controller.
[0107] Based on any of the above method embodiments, the DMA controller assigned to the first target transmission path with a high priority receives the data transmission instruction before the DMA controller assigned to the first target transmission path with a low priority, and the first target transmission path includes a target transmission path with the same target address and an uncompleted transmission task.
[0108] On this basis, optionally, when the corresponding first target transmission paths have the same priority, the DMA controller corresponding to the earlier transmission request receives the data transmission instruction before the DMA controller corresponding to the later transmission request.
[0109] Based on any of the above method embodiments, optionally, the data transmission instruction carries data splitting information, and the data splitting information is used to indicate split data of a single transfer, and the split data is a part of the data to be transmitted.
[0110] It should be noted that the above-mentioned graphics processing method and the above-mentioned graphics processor are based on the same inventive concept. Therefore, the specific implementation of each step in the method and the explanation of the terms involved can refer to the description of the above-mentioned embodiment, and will not be repeated here.
[0111] Although the preferred embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present disclosure.
[0112] Obviously, those skilled in the art can make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is also intended to include these modifications and variations.
Claims
1. A DMA scheduler, applied to a system on chip, wherein: The DMA scheduler is configured to: In response to a data transmission request, selecting at least one target transmission path from a plurality of pre-configured transmission paths, the at least one target transmission path constituting a data transmission path from a source address of data to be transmitted in the system-on-chip to a target address of the data to be transmitted in the system-on-chip; Allocating a target DMA controller to each target transmission path, wherein the available source address of the target DMA controller includes the source address of the corresponding target transmission path, and the available target address of the target DMA controller includes the target address of the corresponding target transmission path; A data transmission instruction is sent to the target DMA controller so that the target DMA controller moves the data to be transmitted according to the corresponding target transmission path.
2. The DMA scheduler according to claim 1, wherein: In order to allocate a target DMA controller to each target transmission path, the DMA scheduler is configured as follows: A target DMA controller is allocated to each target transmission path at least according to the data transmission performance of the DMA controller, and the data transmission performance of the target DMA controller meets the data transmission performance requirement of the corresponding target transmission path.
3. The DMA scheduler according to claim 2, wherein: Data transmission performance includes data transmission bandwidth.
4. The DMA scheduler according to claim 2, wherein: In order to allocate a target DMA controller to each target transmission path, the DMA scheduler is configured as follows: A target DMA controller is assigned to each target transfer path based on the data transfer performance and load of the DMA controller.
5. The DMA scheduler according to claim 4, wherein: The target DMA controller is an idle DMA controller.
6. The DMA scheduler according to claim 1, wherein: The DMA controller assigned to the first target transmission path with a high priority receives the data transmission instruction before the DMA controller assigned to the first target transmission path with a low priority, wherein the first target transmission path includes the target transmission path with the same target address and uncompleted transmission task.
7. The DMA scheduler according to claim 6, wherein: When the priorities of the corresponding first target transmission paths are the same, the DMA controller corresponding to the previous transmission request receives the data transmission instruction before the DMA controller corresponding to the subsequent transmission request.
8. The DMA scheduler according to claim 1, wherein: In order to send a data transfer instruction to a target DMA controller assigned to a lower-level target transmission path, the DMA scheduler is configured as follows: When the progress of the data to be transmitted on the upper target transmission path reaches a preset condition, a data transmission instruction is sent to the target DMA controller allocated to the lower target transmission path.
9. The DMA scheduler according to claim 1, wherein: The data transmission instruction carries data splitting information, where the data splitting information is used to indicate split data for a single transfer, and the split data is a part of the data to be transmitted.
10. A system on chip, wherein: Includes the DMA scheduler as described in any one of claims 1 to 9.
11. An electronic component, wherein: The system on chip comprising the method according to claim 10.
12. An electronic device, wherein: The electronic component comprising claim 11.
13. A DMA scheduling method, wherein: A DMA scheduler applied to a system on chip, wherein the DMA scheduling method at least comprises: In response to a data transmission request, selecting at least one target transmission path from a plurality of pre-configured transmission paths, the at least one target transmission path constituting a data transmission path from a source address of data to be transmitted in the system-on-chip to a target address of the data to be transmitted in the system-on-chip; Allocating a target DMA controller to each target transmission path, wherein the available source address of the target DMA controller includes the source address of the corresponding target transmission path, and the available target address of the target DMA controller includes the target address of the corresponding target transmission path; A data transmission instruction is sent to the target DMA controller so that the target DMA controller moves the data to be transmitted according to the corresponding target transmission path.
14. The method according to claim 13, wherein: The allocating a target DMA controller to each target transmission path includes: A target DMA controller is allocated to each target transmission path at least according to the data transmission performance of the DMA controller, and the data transmission performance of the target DMA controller meets the data transmission performance requirement of the corresponding target transmission path.
15. The method according to claim 14, wherein: Data transmission performance includes data transmission bandwidth.
16. The method according to claim 14, wherein: The allocating a target DMA controller to each target transmission path includes: A target DMA controller is assigned to each target transfer path based on the data transfer performance and load of the DMA controller.
17. The method according to claim 16, wherein: The target DMA controller is an idle DMA controller.
18. The method according to claim 13, wherein: The DMA controller assigned to the first target transmission path with a high priority receives the data transmission instruction before the DMA controller assigned to the first target transmission path with a low priority, wherein the first target transmission path includes the target transmission path with the same target address and uncompleted transmission task.
19. The method according to claim 18, wherein: When the priorities of the corresponding first target transmission paths are the same, the DMA controller corresponding to the previous transmission request receives the data transmission instruction before the DMA controller corresponding to the subsequent transmission request.
20. The method according to claim 13, wherein: The sending of a data transfer instruction to the target DMA controller further comprises: When the progress of the data to be transmitted on the upper target transmission path reaches a preset condition, a data transmission instruction is sent to the target DMA controller allocated to the lower target transmission path.
21. The method according to claim 13, wherein: The data transmission instruction carries data splitting information, where the data splitting information is used to indicate split data for a single transfer, and the split data is a part of the data to be transmitted.
Citation Information
Patent Citations
Data transmission device and method and readable storage medium
CN110008156A
SDN-based transmission network service path scheduling and protection method and system
CN111683008A
Multiprocessor data memory sharing
CN1117318A
Safety DMA controller and data carrying method
CN112256605A
Control method and device for multi-channel DMA with token bucket structure
CN112559405A
