Data processing method and device based on execution engine, storage medium and product
By adopting cascading command method in the DMA system, the problem of inflexible scheduling in complex data transmission is solved, efficient, sequential and complete data transmission is achieved, and the burden on the controller and resource competition is reduced.
Patent Information
- Application Number
- CN202510874693.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-06-27
AI Technical Summary
When traditional DMA systems handle complex, multi-task or high-speed data transmission, command scheduling is not flexible enough, which can easily lead to scheduling conflicts, resource competition and delays, affecting system efficiency.
Using a cascading command method based on the execution engine, by obtaining and executing the cascading second command, the controller burden is reduced, task scheduling flexibility is increased, and data transmission order and integrity are ensured.
It improves data transmission efficiency, avoids unnecessary waiting and conflicts, simplifies the program flow, and realizes automatic loading and efficient scheduling of multiple commands.
Smart Images

Figure CN120448074A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, storage medium, and product based on an execution engine. Background Art
[0002] DMA (Direct Memory Access) is a technology that allows peripherals to exchange data directly with memory, which can reduce the burden on the CPU (Central Processing Unit) and improve data transmission efficiency.
[0003] Traditional DMA systems typically rely on fixed transfer modes and pre-set command scheduling mechanisms, which limits their ability to handle complex, multi-tasking, or high-speed data transfer requirements. Especially when multiple DMA requests are concurrent, command scheduling is often inflexible, easily leading to scheduling conflicts, resource contention, and delays, which in turn affect overall system efficiency. Summary of the Invention
[0004] The present application provides a data processing method, device, storage medium and product based on an execution engine, so as to at least solve the problem that DMA in the related art is not flexible enough in command scheduling.
[0005] This application provides a data processing method based on an execution engine, including: Obtaining a first command from the execution engine and executing the first command; If there is a second command cascaded with the first command, the second command is obtained and executed.
[0006] By cascading commands, the present invention enables the execution engine to efficiently handle complex data transmission tasks, reducing the burden on the controller, increasing task scheduling flexibility, and ensuring the order and integrity of data transmission. This also improves data transmission efficiency and avoids unnecessary waiting and conflicts. Furthermore, the use of cascading commands eliminates the need for frequent software intervention, effectively preventing increased latency.
[0007] In an optional implementation, before obtaining the second command, the method further includes: Get the cascade valid flag of the first command; Based on the cascade valid flag of the first command, it is determined whether there is a second command cascaded with the first command.
[0008] In this embodiment, command cascading is achieved through the cascade valid flag, which can minimize software processing, simplify program flow, realize automatic loading of multiple commands, and improve execution efficiency.
[0009] In an optional implementation, there are multiple execution engines; obtaining the first command from the execution engine includes: Determine the first execution engine currently being polled according to a preset engine polling order; A first command is obtained from a first execution engine.
[0010] In this embodiment, a round-robin approach is used to select execution engines and the commands within them. This effectively prevents an execution engine from being idle for extended periods, which can lead to an uneven distribution of commands across the execution engines. Furthermore, in this embodiment, multiple execution engines can operate in parallel, and tasks are scheduled in a round-robin fashion, effectively improving the overall efficiency and processing power of the system.
[0011] In an optional implementation, after obtaining the first command from the execution engine and executing the first command, the method further includes: If there is no second command cascaded with the first command, or if there is a second command cascaded with the first command and after the second command is executed, if the target number corresponding to the first execution engine is greater than 1, continue to obtain commands from the first execution engine as the first command, and execute the first command until the number of commands taken from the first execution engine reaches the target number; The target number is the number of commands acquired and executed from the first execution engine in the current polling, and the target number is determined based on the number of commands currently stored in the first execution engine.
[0012] In this embodiment, a dynamic command scheduling algorithm is used to effectively ensure that the number of commands in the execution engine is balanced and that all commands can be processed quickly, thereby achieving efficient scheduling of commands.
[0013] In an optional embodiment, the target quantity is determined by the following steps: When polling the first execution engine, read the current number of commands in the first execution engine and the current number of commands in other execution engines; Determine the difference between the current number of commands in the first execution engine and the minimum current number of commands in the other execution engines; In a case where the command quantity difference is greater than or equal to the preset command quantity, a target quantity is determined based on the command quantity difference.
[0014] In this embodiment, a dynamic command scheduling algorithm is used to effectively ensure that the number of commands in the execution engine is balanced and that all commands can be processed quickly, thereby achieving efficient scheduling of commands.
[0015] In an optional implementation, obtaining the first command from the first execution engine includes: Reading the command priority of each command in the first execution engine; The first command is selected in descending order of command priority.
[0016] In this embodiment, the commands to be executed are selected according to the command priority, which can effectively cope with task changes and emergency needs and improve the flexibility of command execution.
[0017] In an optional implementation, after reading the command priority of each command in the first execution engine, the method further includes: When there are multiple commands with equal command priorities in the first execution engine, polling arbitration is performed on the multiple commands with equal command priorities, and the first command is selected.
[0018] In this embodiment, the priority of the command can be dynamically adjusted according to the type and urgency of the command to ensure that the high-priority command is executed first, thereby achieving efficient scheduling of the command.
[0019] In an optional implementation, before reading the command priority of each command in the first execution engine, the method further includes: Reading the command execution waiting time of each command in the first execution engine; When the command execution waiting time exceeds a preset threshold, the command priority of the corresponding command is increased.
[0020] In this embodiment, a dynamic priority adjustment mechanism is adopted to effectively avoid task delays, ensure that important commands are processed in a timely manner, better respond to emergencies, and improve overall execution efficiency.
[0021] In an optional embodiment, when a plurality of command queues are included in an execution engine, the method further includes: Read the command execution status bit in the execution engine, the command execution status bit includes a parallel execution status bit and a serial execution status bit; The execution mode of the command queue in the execution engine is determined according to the command execution status bit.
[0022] In this embodiment, users can choose the parallel or serial execution mode of commands in a single engine according to actual needs, which improves the flexibility and adaptability of the system.
[0023] In an optional embodiment, after the command is executed, the method further includes: Store the command execution results and execution status.
[0024] In this embodiment, the execution result and execution status of the command are stored, which can provide detailed information and basis for subsequent troubleshooting, and is conducive to further optimization and adjustment of the execution process.
[0025] In an optional embodiment, before obtaining the first command from the command queue in the execution engine, the method further includes: Read the number of commands that the execution engine can receive; Based on the number of commands that can be received, the command is received and stored in the command queue.
[0026] In this embodiment, reading the number of commands that the execution engine can receive before obtaining the first command can ensure that the system reasonably distributes tasks according to the processing capacity of the engine, avoids resource waste or task backlog, and helps improve command processing efficiency.
[0027] In an optional implementation, after obtaining the first command from the execution engine, the following steps are included: Send bus usage request; After obtaining a response message to the bus use request, the first command is executed.
[0028] In this implementation, obtaining the first command from the execution engine and sending a bus use request can avoid resource conflicts and effectively improve the coordination and execution efficiency of the system.
[0029] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned execution engine-based data processing methods when executing the computer program.
[0030] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned data processing methods based on the execution engine are implemented.
[0031] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned execution engine-based data processing methods when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0033] Figure 1 A schematic diagram of the architecture of a DMA system provided in an embodiment of the present application; Figure 2 A flowchart of a data processing method based on an execution engine provided in an embodiment of the present application; Figure 3 A schematic diagram of the cascade connection provided in the embodiment of the present application; Figure 4 A schematic diagram of the command format provided in an embodiment of the present application; Figure 5 A schematic diagram of the architecture of a DMA system provided in an embodiment of the present application; Figure 6 FIG. 4 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0034] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0035] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0036] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0037] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the data processing method based on the execution engine depends, the specific application environment architecture or specific hardware architecture is described here.
[0038] The present invention is based on a DMA system, which usually has one or more DMA engines. Some simple DMA systems generally only need one DMA engine to support a single data transmission channel. The present invention is preferentially targeted at multi-channel DMA engines, each DMA engine is responsible for an independent data transmission channel, so that parallel transmission can be achieved and overall performance can be improved. The DMA system relied on in the present invention can be referred to Figure 1 As shown, the DMA system includes 16 DMA engines (engine0-engine15), and each DMA engine can have up to 16 command queues (msg0-msg15).
[0039] To facilitate understanding, some definitions involved in the embodiments of the present invention are first explained.
[0040] DMA (Direct memory access): direct memory access; AXI (Advanced eXtensible Interface): a bus protocol; NIC (Network Interconnect): central interconnect; FIFO (First in, First out): First in, first out queue; OPC (Operation Code): Operation code; An embodiment of the present application provides a data processing method based on an execution engine, and the method is described in detail in conjunction with the execution flow of the data processing method based on the execution engine.
[0041] In this embodiment, a data processing method based on an execution engine is provided, which can be executed by devices such as servers, terminals, and mobile terminals. Figure 2 is a flow chart of a data processing method based on an execution engine according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps: Step S101: Obtain a first command from an execution engine and execute the first command.
[0042] Step S102: If there is a second command cascaded with the first command, the second command is obtained and executed.
[0043] The execution engine in this embodiment is a DMA engine. The DMA engine usually maintains a command queue, which contains DMA operation commands to be executed. Each command usually specifies the source address, destination address, number of bytes to be transferred, transfer mode, etc. of the data transmission. Among them, the first command in this embodiment is any command in the command queue. Regarding the DMA engine, for example, when reading data from an external device such as an MCU (Micro Control Unit), a hard disk, etc. to the memory, and then writing the data in the memory to the external device, the DMA engine will start data transmission according to the parameters in the command (such as source address, destination address, etc.). At this time, the CPU can continue to process other tasks because the DMA engine will directly handle the data transmission.
[0044] In related technologies, DMA systems typically use a single command execution method for data transfer, with the DMA engine executing each command independently. After each command completes, the CPU is responsible for initiating the next command. This approach is relatively simple, but when multiple tasks need to be executed sequentially, the CPU may need to intervene frequently, increasing management complexity and system overhead, and reducing task scheduling flexibility and efficiency.
[0045] In this embodiment, the command cascade method is used for scheduling. Figure 3 As shown in the figure, if the first command cmd0 in the command queue is executed successfully and there is a second command cmd1 cascaded with it, the DMA engine will directly obtain the second command cascaded with it from the command queue and execute the second command. At this time, the second command becomes the first command and continues to check whether there is a second command cascaded with it, looping in sequence until there is no more cascaded command.
[0046] In this embodiment, by using cascaded commands, the execution engine can efficiently handle complex data transmission tasks, reducing the burden on the controller, increasing task scheduling flexibility, and ensuring the order and integrity of data transmission. This also improves data transmission efficiency and avoids unnecessary waiting and conflicts. Furthermore, the use of cascaded commands eliminates the need for frequent software intervention, effectively preventing increased latency.
[0047] In some optional implementations, before obtaining the second command, the method further includes: Get the cascade valid flag of the first command.
[0048] Based on the cascade valid flag of the first command, it is determined whether there is a second command cascaded with the first command.
[0049] Specifically, the command format refers to Figure 4 As shown, in the execution engine, command cascading can be implemented by configuring the "chain_valid" flag, which is the cascade valid flag. When "chain_valid" is set to 1 in a command and chain_id is non-zero, the execution engine automatically searches for and executes the subsequent command associated with that cascade ID after completing the current command. This cascading operation links two related commands together, forming a continuous processing flow. The final execution result and completion status are not returned until the cascaded commands are executed.
[0050] Among them, the cascade ID is a unique identifier assigned to each command that needs to be cascaded. When a command is sent, if "chain_valid" = 1 is set, the cascade ID of the command will be recorded in the register, and subsequent commands with the same cascade ID will be stored in the chain_buffer of the corresponding ID. After the execution engine completes the current first command, it will check whether there is a valid cascade ID. If it exists, the corresponding subsequent command will be searched in the register according to the ID and loaded into the execution queue. It should be noted that the cascade search has the highest priority. Even if there is a high-priority command in the command queue, it is necessary to wait for the cascade command to be completed.
[0051] In this embodiment, command cascading is achieved through the cascade valid flag, which can minimize software processing, simplify program flow, realize automatic loading of multiple commands, and improve execution efficiency.
[0052] In some optional embodiments, the method further comprises: Check the hardware error flag of each execution engine and the data in the storage status buffer; Determining whether a corresponding execution engine has a fault based on a hardware error flag and / or data in a storage status buffer; In the event of a fault, determine the type of fault; Based on the failure type, adjust the command queue in the execution engine.
[0053] Specifically, a hardware error flag can be set in each execution engine, and by checking the hardware error flag, it can be detected whether there is a problem with the execution engine. For example, if the command transmission is not completed within the predetermined time, it may indicate that the corresponding execution engine is faulty, and a timeout error flag will be generated. If the data transmitted by the command has a checksum error, it may indicate that there is a problem with the execution engine during the transmission process, and a checksum error flag will be generated.
[0054] In addition, after the command is executed, the execution status and results are stored in the storage status buffer. By regularly reading these status registers, the operation status of the execution engine can be monitored. For example, when a command is completed, a flag bit can be set. Monitoring this flag bit can determine whether the command was successfully executed.
[0055] When an execution engine fails, it can be determined whether command migration is required based on the failure type. If necessary, the commands of the execution engine can be automatically migrated to other healthy execution engines for execution. This can effectively ensure the stable operation of the system and improve the overall performance and reliability of the system.
[0056] In some optional implementations, there are multiple execution engines; obtaining the first command from the execution engine includes: According to the preset engine polling order, the first execution engine currently polled is determined.
[0057] A first command is obtained from a first execution engine.
[0058] Specifically, a polling pointer can be set to indicate the engine currently being checked. Starting at the beginning of the polling queue, the polling pointer points to each execution engine in the polling queue, in sequence, until it reaches the end of the polling queue. When the polling pointer reaches the end of the queue, it returns to the beginning of the polling queue, forming a loop. This polling method sequentially checks the command status of each execution engine's command queue, ensuring that each engine's commands are processed promptly.
[0059] In this embodiment, a round-robin approach is used to select execution engines and the commands within them. This effectively prevents an execution engine from being idle for extended periods, which can lead to an uneven distribution of commands across the execution engines. Furthermore, in this embodiment, multiple execution engines can operate in parallel, and tasks are scheduled in a round-robin fashion, effectively improving the overall efficiency and processing power of the system.
[0060] In some optional implementations, after obtaining the first command from the execution engine and executing the first command, the method further includes: If there is no second command cascaded with the first command, or if there is a second command cascaded with the first command and the second command has been executed, if the target number corresponding to the first execution engine is greater than 1, then commands will continue to be retrieved from the first execution engine as the first command and executed until the number of commands retrieved from the first execution engine reaches the target number. The target number is the number of commands retrieved and executed from the first execution engine in the current polling cycle, and the target number is determined based on the number of commands currently stored in the first execution engine.
[0061] In this embodiment, cascade search has the highest priority. Even if there is a high-priority command in the command queue, the execution engine must wait for the completion of the cascade command. If there is no second command to cascade with the first command, or after the cascade command is completed, the execution engine will continue to extract commands from the execution engine according to normal rules (such as first-in-first-out order or order of priority).
[0062] When there is a second command cascaded with the first command, after the first command is executed, the second command cascaded with the first command is executed first. When there is still a command cascaded with the second command, the command cascaded with the second command is also executed first until there are no more cascaded commands.
[0063] During the polling process, this embodiment will also dynamically adjust the number of commands taken out of the command queue, that is, the target number, based on the number of commands of each execution engine. However, under initial conditions, the target number corresponding to each execution engine is a pre-stored value, that is, it is determined based on the number of commands stored on the first execution engine after polling. In the first polling, the target number will not change due to the reduction in the number of commands being executed, until the next polling, when the target number corresponding to each execution engine is re-determined. For example, when a certain execution engine has a large number of commands, the target number can be increased, and more commands can be taken out when polling the execution engine so that its commands can be processed more quickly.
[0064] The following example illustrates the initial target number set to 1, meaning that only one command is read at a time. After multiple polling cycles, there are two pending commands in Execution Engine A and eight pending commands in Execution Engine B. When Execution Engine A is polled, one command can be read normally. When Execution Engine B is polled, the target number is increased. For example, if the target number is adjusted to 2, two pending commands will be read from Execution Engine B.
[0065] Traditional DMA engines often suffer from inefficiencies in command scheduling. Specifically, in practical applications, some DMA engines may receive a large number of commands, while others may receive a small number. In this case, a simple round-robin algorithm can lead to uneven command execution, impacting overall system performance. In this embodiment, a dynamic command scheduling algorithm is employed to effectively ensure a balanced number of commands across the execution engines, ensuring that all commands are processed quickly, thereby achieving efficient command scheduling.
[0066] In some optional embodiments, the target quantity is determined by the following steps: When the first execution engine is polled, the current number of commands in the first execution engine and the current number of commands in other execution engines are read.
[0067] A command quantity difference between a current command quantity in the first execution engine and a minimum current command quantity in other execution engines is determined.
[0068] In a case where the command quantity difference is greater than or equal to the preset command quantity, a target quantity is determined based on the command quantity difference.
[0069] Specifically, for example, the initial target number is 1 and the preset command number is 5. After multiple polling cycles, there are 2 pending commands in execution engine A, 8 pending commands in execution engine B, and 6 pending commands in execution engine C. If the first execution engine is execution engine B, the command number difference is 6. Further, the target number is determined based on this command number difference, such as using 50% of the command number difference as the target number. If the first execution engine is execution engine C, the command number difference is 4, which is less than the preset command number, and the initial target number is maintained.
[0070] In this embodiment, a dynamic command scheduling algorithm is used to effectively ensure that the number of commands in the execution engine is balanced and that all commands can be processed quickly, thereby achieving efficient scheduling of commands.
[0071] In some optional implementations, obtaining the first command from the first execution engine includes: Reading the command priority of each command in the first execution engine; The first command is selected in descending order of command priority.
[0072] Specifically, a priority register may be configured in advance for each execution engine. The priority register is used to store the priority of the current command of the engine, for example, level 0-level 15. The command priority will exist inside the execution engine and will be issued together with the command.
[0073] During the polling process, when an execution engine detects a command to be executed, the execution engine reads the engine's priority register to determine the priority of the command. After the currently executing command is completed, the highest priority command is issued first.
[0074] In this embodiment, the commands to be executed are selected according to the command priorities, which can effectively cope with task changes and emergency needs and improve the flexibility of command execution.
[0075] In some optional implementations, after reading the command priority of each command in the first execution engine, the method further includes: When there are multiple commands with equal command priorities in the first execution engine, polling arbitration is performed on the multiple commands with equal command priorities, and the first command is selected.
[0076] That is, if there are commands of the same priority in the command queue, round-robin arbitration is performed to ensure that the commands in each command queue are evenly executed.
[0077] In this embodiment, the priority of the command can be dynamically adjusted according to the type and urgency of the command to ensure that high-priority commands are executed first, thereby achieving efficient scheduling of commands.
[0078] In some optional implementations, before reading the command priority of each command in the first execution engine, the method further includes: The command execution waiting time of each command in the first execution engine is read.
[0079] When the command execution waiting time exceeds a preset threshold, the command priority of the corresponding command is increased.
[0080] During command execution, the execution engine can dynamically update the command priority based on actual conditions. When the command execution wait time exceeds a preset threshold, the command priority can be raised by one level to ensure timely completion.
[0081] In this embodiment, a dynamic priority adjustment mechanism is adopted to effectively avoid task delays, ensure that important commands are processed in a timely manner, better respond to emergencies, and improve overall execution efficiency.
[0082] In some optional implementations, when one of the execution engines includes multiple command queues, the method further includes: Read the command execution status bit in the execution engine, which includes a parallel execution status bit and a serial execution status bit.
[0083] The execution mode of the command queue in the execution engine is determined according to the command execution status bit.
[0084] Specifically, users can select parallel or serial execution mode by setting the parallel_mode register, which is the command execution status bit. When parallel_mode = 1, the commands in the engine are executed in parallel; when parallel_mode = 0, the commands in the engine are executed serially.
[0085] For multiple commands in the same queue, the currently executed command may be selected according to the command priority as described in the above embodiment, or may be executed in a serial or parallel manner.
[0086] This embodiment proposes a multi-level parallel-serial hybrid architecture that achieves both engine-level parallelism and channel-level serial and parallel compatibility. Specifically, by parameterizing the number of DMA engines, multiple independent DMA engines can be supported operating in parallel. Each engine can independently process tasks without interfering with each other, thus enabling multi-task parallel processing. This more flexible configuration can meet the needs of both high-performance and low-power scenarios. Within a single engine, a configuration register can be used to determine the number of command execution queues that can exist simultaneously within the execution engine, for example, 16 queues. The command execution order can be managed using the command queue management (FIFO). All written commands are stored in the FIFO in the order of cmd_buffer_id (the ID field in the cmd sent by the user) and retrieved and executed sequentially by the state machine. This approach ensures orderly execution of commands within a single engine and avoids command execution confusion. Furthermore, by configuring registers, the user can determine the parallel execution of commands within a single engine. After a command is written, the corresponding execution engine is started, and all command queues within the execution engine can execute commands simultaneously and in parallel.
[0087] Reference Figure 5 The figure shows a configuration example of this embodiment. A user configures 16 execution engines. Execution Engine 0 contains 16 command queues, enabling parallel execution. Each of the remaining execution engines has only one command queue configured, and written commands are executed sequentially. For Execution Engine 0, after a command is written, the corresponding execution engine starts, and all 16 command queues can execute commands simultaneously and in parallel. At this point, the commands are executed out of order. For the other execution engines, execution is serial, with each command executed as soon as it is stored.
[0088] This embodiment proposes a multi-level parallel-serial hybrid architecture that supports multiple independent engines processing tasks in parallel. Each execution engine manages the instruction sequence through a command queue, enabling serialized command execution. This ensures the orderly execution of commands within a single engine, avoids command execution chaos, and improves system stability and reliability. Furthermore, within a single engine, the parallel or serial execution of commands can be determined based on user-configured registers. This architecture fully leverages the advantages of multi-core parallel processing while ensuring the orderly execution of commands within a single engine.
[0089] In this embodiment, the user can select the parallel or serial execution mode of commands within a single engine according to actual needs, thereby improving the flexibility and adaptability of the system.
[0090] In some optional implementations, after the command is executed, the method further includes: Store the command execution results and execution status.
[0091] Still Figure 5 For example, for execution engine 0, there are 16 command buffers and 16 storage status buffers (fbd_buffer0-fbd_buffer15). After a command is written, the corresponding execution engine starts, and the 16 command buffers can execute commands in parallel, storing the completion status and results in their respective storage status buffers. For other execution engines, there is only one command buffer and one storage status buffer. Commands in the command buffers are executed serially, and the results are stored in the storage status buffer.
[0092] The depth of the command buffer is affected by configuration and is equal to the number of command queues in the execution engine. The total depth of the command buffers is 16, divided evenly among all command queues. The depth of the storage state buffer is not affected by configuration and has only one space. The number of storage state buffers is equal to the number of command queues.
[0093] In this embodiment, the execution result and execution status of the command are stored, which can provide detailed information and basis for subsequent troubleshooting, and is conducive to further optimization and adjustment of the execution process.
[0094] In some optional implementations, before obtaining the first command from the command queue in the execution engine, the method further includes: Read the number of commands the execution engine can receive.
[0095] Based on the number of commands that can be received, the command is received and stored in the command queue.
[0096] Before issuing commands to an execution engine, the user configures registers, specifically the number of execution engines required (number of engines), the number of command queues per execution engine (cmd_queue_num), and the order in which commands are executed (parallel_mode). The user then issues commands. Before issuing commands, the user reads the status register to determine the number of commands each execution engine can currently receive. This allows the user to determine the number of commands that can be received and then issue the appropriate number of commands.
[0097] After the execution engine receives the command, the DMA starts (Q0-Q15). The DMA receives and parses the command, extracting the priority of each command and storing it in the corresponding register. When the DMA engine detects that the command queue contains valid commands, it begins retrieving commands from the command queue. Commands are retrieved in order of priority, starting with the highest and starting with the lowest. For commands with the same priority, commands are retrieved in the order they were received.
[0098] In this embodiment, reading the number of commands that the execution engine can receive before obtaining the first command can ensure that the system reasonably distributes tasks according to the processing capacity of the engine, avoids resource waste or task backlog, and helps improve command processing efficiency.
[0099] In some optional implementations, after obtaining the first command from the execution engine, the following steps are included: Send bus usage request; After obtaining a response message to the bus application request, the first command is executed.
[0100] The DMA parses the received command and begins executing it. Because multiple execution engines share an AXI channel (command completion requires data transmission via the AXI channel), command execution requires queuing to obtain access to the AXI channel. Each execution engine is independent of the others, each sending a request signal for AXI access and waiting for AXI approval. An optimized polling arbiter is used to allocate access to the AXI channel. The DMA completes the task and returns the result. After obtaining access to the AXI, the DMA executes the task specified by the OPC bit in the command. After the task is completed, the result is stored in an internal register and a completion status is returned. Execution between the execution engines is parallel. AXI read and write commands issued by each engine are arbitrated by the NIC_ARB (Network Interconnect Arbiter) module to ensure that access to the NIC is distributed as evenly as possible.
[0101] In this embodiment, obtaining the first command from the execution engine and sending a bus use request can avoid resource conflicts and effectively improve the coordination and execution efficiency of the system.
[0102] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.
[0103] The embodiments of the present application further provide a data processing device based on an execution engine, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and contemplated.
[0104] This embodiment provides a data processing device based on an execution engine, the device comprising: A reading module, configured to obtain a first command from an execution engine and execute the first command; The query module is configured to obtain and execute the second command if a second command cascaded with the first command exists.
[0105] In an optional embodiment, the device further comprises: An acquisition module, configured to acquire a cascade valid flag of the first command; The judgment module is used to determine whether there is a second command cascaded with the first command based on the cascade valid flag of the first command.
[0106] In an optional embodiment, there are multiple execution engines; the reading module includes: A polling unit is configured to determine the first execution engine currently being polled according to a preset engine polling order, and to retrieve a first command from the first execution engine. The polling unit is further configured to, if there is no second command cascaded with the first command, or if there is a second command cascaded with the first command and after the second command has been executed, continue to retrieve commands from the first execution engine as the first command and execute the first command until the target number corresponding to the first execution engine is greater than 1, wherein the target number is the number of commands retrieved and executed from the first execution engine in the current polling, and the target number is determined based on the number of commands currently stored in the first execution engine.
[0107] In an optional embodiment, the device further comprises: An update module is used to read the current number of commands in the first execution engine and the current number of commands in other execution engines when polling the first execution engine; determine the difference in command quantity between the current number of commands in the first execution engine and the minimum current number of commands in other execution engines; and determine the target number based on the difference in command quantity when the difference in command quantity is greater than or equal to the preset number of commands.
[0108] In an optional implementation, the polling unit includes: The priority unit is configured to read the command priority of each command in the first execution engine and select the first command in descending order of command priority. Furthermore, if multiple commands with equal command priority exist in the first execution engine, the unit is configured to perform round-robin arbitration on the multiple commands with equal command priority and select the first command. Furthermore, the unit is configured to read the command execution wait time of each command in the first execution engine and, if the command execution wait time exceeds a preset threshold, increase the command priority of the corresponding command.
[0109] In an optional embodiment, when a plurality of command queues are included in an execution engine, the apparatus further includes: A definition module is used to read the command execution status bit in the execution engine, which includes a parallel execution status bit and a serial execution status bit; and determine the execution mode of the command queue in the execution engine according to the command execution status bit.
[0110] The storage module is used to store the execution results and execution status of the command.
[0111] In an optional embodiment, the device further comprises: The configuration module is used to read the number of commands that can be received by the execution engine; based on the number of commands that can be received, receive the issued commands and store them in the command queue.
[0112] In an optional embodiment, the device further comprises: The sending module is used to send a bus use request; after obtaining a response message to the bus use request, execute a first command.
[0113] For the description of the features in the embodiments corresponding to the data processing device based on the execution engine, please refer to the relevant description of the embodiments corresponding to the data processing method based on the execution engine, and no further details will be given here.
[0114] The embodiment of the present application also provides an electronic device, such as Figure 6 As shown, it includes a memory 10 and a processor 20, wherein the memory 10 stores a computer program, and the processor 20 is configured to run the computer program to execute the steps in any of the above-mentioned data processing method embodiments based on the execution engine.
[0115] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps of any of the above-mentioned embodiments of the data processing method based on the execution engine when running.
[0116] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0117] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned data processing method embodiments based on the execution engine are implemented.
[0118] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of any of the above-mentioned data processing method embodiments based on the execution engine.
[0119] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0120] The above is a detailed introduction to the data processing method, device, storage medium and product based on the execution engine provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A data processing method based on an execution engine, characterized in that: include: Obtaining a first command from an execution engine, and executing the first command; If there is a second command cascaded with the first command, the second command is obtained and executed.
2. The method according to claim 1, characterized in that Before obtaining the second command, the method further includes: Obtaining the cascade valid flag of the first command; Based on the cascade valid flag of the first command, it is determined whether the second command cascaded with the first command exists.
3. The method according to claim 1, characterized in that There are multiple execution engines; The obtaining of the first command from the execution engine includes: Determine the first execution engine currently being polled according to a preset engine polling order; The first command is obtained from the first execution engine.
4. The method according to claim 3, characterized in that After obtaining the first command from the execution engine and executing the first command, the method further includes: If there is no second command cascaded with the first command, or if there is the second command cascaded with the first command and after the second command is executed, if the target number corresponding to the first execution engine is greater than 1, continue to obtain commands from the first execution engine as the first command, and execute the first command until the number of commands retrieved from the first execution engine reaches the target number; The target number is the number of commands acquired and executed from the first execution engine in the current polling, and the target number is determined based on the number of commands currently stored in the first execution engine.
5. The method according to claim 4, characterized in that Determine the target quantity by following these steps: When polling the first execution engine, read the current number of commands in the first execution engine and the current number of commands in the other execution engines; Determine the difference between the current number of commands in the first execution engine and the minimum current number of commands in other execution engines; In a case where the command quantity difference is greater than or equal to a preset command quantity, the target quantity is determined based on the command quantity difference.
6. The method according to claim 3, characterized in that The obtaining the first command from the first execution engine includes: Reading the command priority of each command in the first execution engine; The first command is selected in descending order of the command priorities.
7. The method according to claim 6, characterized in that After reading the command priority of each command in the first execution engine, the method further includes: In the case that there are multiple commands with equal command priorities in the first execution engine, polling arbitration is performed on the multiple commands with equal command priorities, and the first command is selected.
8. The method according to claim 6, characterized in that Before reading the command priority of each command in the first execution engine, the method further includes: Reading the command execution waiting time of each command in the first execution engine; When the command execution waiting time exceeds a preset threshold, the command priority of the corresponding command is increased.
9. The method according to claim 1, characterized in that In the case where one of the execution engines includes multiple command queues, the method further includes: Reading a command execution status bit in the execution engine, wherein the command execution status bit includes a parallel execution status bit and a serial execution status bit; An execution mode of the command queue in the execution engine is determined according to the command execution status bit.
10. The method according to claim 1, characterized in that After the command is executed, the method further includes: Store the command execution results and execution status.
11. The method according to claim 1, wherein Before getting the first command from the command queue in the execution engine, it also includes: Reading the number of commands that can be received by the execution engine; Based on the number of receivable commands, the issued commands are received and stored in a command queue.
12. The method according to claim 1, characterized in that After obtaining the first command from the execution engine, the method includes: Send bus usage request; After obtaining a response message to the bus use request, the first command is executed.
13. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the execution engine-based data processing method according to any one of claims 1 to 12 when executing the computer program.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the data processing method based on the execution engine according to any one of claims 1 to 12 are implemented.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the data processing method based on the execution engine according to any one of claims 1 to 12 are implemented.
Citation Information
Patent Citations
Data reading method and device based on DMA engine and data transmission system
CN112199309A
Quality of service levels for a direct memory access engine in a memory sub-system
CN112835827A
Dynamic code loading for multiple executions on a sequential processor
CN114008589A
Data processing method and related equipment
CN116107954A
Data handling method and device, electronic equipment and medium
CN117909267A