Processor and write-out method of execution result

CN119045892APending Publication Date: 2024-11-29PHYTIUM TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411042161.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-31
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

When existing hardware accelerators such as password acceleration engines return execution results in a ring queue, they require a large chip area to cache the execution results, resulting in high production costs.

Method used

By introducing a scheduling unit, a read-write control unit and a computing unit into the hardware accelerator, the execution results are directly written to the target position of the receiving queue, reducing storage space usage, and ensuring the consistency of the result writing order through the target identification.

Benefits of technology

It reduces the storage space occupancy and chip area overhead of hardware accelerators, improves application performance and reliability, simplifies software design, and reduces the manufacturing cost of hardware accelerators.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119045892A_ABST
    Figure CN119045892A_ABST
Patent Text Reader

Abstract

The invention provides a processor and an execution result write-out method, the processor comprises a first memory and a hardware accelerator, the first memory comprises a sending queue and a receiving queue, and the sending queue stores a plurality of instructions. The hardware accelerator comprises a scheduling unit, a read-write control unit and a plurality of operation units, the target operation unit is used for executing a target instruction when receiving the target instruction sent by the scheduling unit, and sending an execution result to the read-write control unit, so that the read-write control unit writes the execution result at a target position of a receiving queue, when the position indicated by the current pointer of the receiving queue meets the effective writing condition, the current pointer of the receiving queue is updated, and the target position of the sending queue corresponds to the target position of the receiving queue. The processor can reduce the storage space occupation amount of the hardware accelerator and reduce the chip area overhead of the hardware accelerator.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a processor and a method for writing execution results. Background Art

[0002] In the related art, an application may use a circular queue to send multiple instructions to a hardware accelerator such as a cryptographic acceleration engine and receive execution results of the multiple instructions returned by the cryptographic acceleration engine.

[0003] In order to ensure that the cryptographic acceleration engine normally returns the execution result to the application through the circular queue, the chip area overhead of the cryptographic acceleration engine is relatively large, resulting in a relatively high production cost of the cryptographic acceleration engine. Summary of the invention

[0004] The purpose of the present application is to provide a processor and a method for writing execution results, so that the hardware accelerator can directly write the execution results into a receiving queue, thereby reducing the storage space occupied by the hardware accelerator and reducing the chip area overhead of the hardware accelerator.

[0005] In a first aspect, the present application provides a processor, comprising: a first memory and a hardware accelerator. The first memory comprises a sending queue and a receiving queue, and the sending queue stores a plurality of instructions. The hardware accelerator comprises a scheduling unit, a read-write control unit, and a plurality of computing units, the scheduling unit and the read-write control unit are both communicatively connected to the plurality of computing units, and the scheduling unit and the read-write control unit are both communicatively connected to the first memory;

[0006] The target operation unit is used to: when receiving the target instruction sent by the scheduling unit, execute the target instruction, and send the execution result obtained by executing the target instruction to the read-write control unit, so that the read-write control unit writes the execution result at the target position of the receiving queue when receiving the execution result, and performs a valid write operation when the current pointer indication position of the receiving queue meets the valid write condition, and the valid write operation includes updating the current pointer of the receiving queue;

[0007] The target operation unit of the present application is one of multiple operation units, the target instruction is one of multiple instructions, the target instruction is read by the scheduling unit from the target position of the sending queue, and the target position of the sending queue corresponds to the target position of the receiving queue.

[0008] When adopting the above technical solution, the scheduling unit can read the target instruction from the target position of the sending queue, and then send the target instruction to the target operation unit. After receiving the target instruction, the target operation unit can execute the target instruction, and send the execution result obtained by executing the target instruction to the read-write control unit. The read-write control unit can use the correspondence between the target position of the sending queue and the target position of the receiving queue to directly write the execution result at the target position of the receiving queue, and when the current pointer indication position of the receiving queue meets the valid write condition, update the current pointer of the receiving queue.

[0009] It can be seen that the hardware accelerator of the present application can effectively write the execution result at the target position of the receiving queue without storing the execution result. Since the target position of the receiving queue corresponds to the target position of the sending queue, the order in which the application reads the execution result from the receiving queue matches the order in which the application writes the target instructions in the sending queue. Therefore, the technical solution of the present application can improve the performance and reliability of the application and reduce the complexity of software design.

[0010] In addition, when the hardware accelerator of the present application does not need to store the execution result, the execution result can be effectively written to the target location of the receiving queue, reducing the storage space occupied by the hardware accelerator, so that the hardware accelerator can work normally in a smaller storage space. Therefore, the chip area overhead of the hardware accelerator is relatively small.

[0011] In one possible implementation, the target instructions sent by the scheduling unit and the execution results sent by the target computing unit of the present application both carry a first target identifier, which is used to identify the order in which the scheduling unit reads the target instructions from the sending queue, and the target position of the receiving queue is determined by the first target identifier.

[0012] When the above technical solution is adopted, after the target operation unit receives the target instruction sent by the scheduling unit, the first target identifier carried by the target instruction can be added to the execution result of the target instruction. In this case, the execution results sent by the target operation unit all carry the first target identifier, and the first target identifier is used to identify the order in which the scheduling unit reads the target instructions from the sending queue, and the order in which the scheduling unit reads the target instructions from the sending queue actually corresponds to the target position of the target instruction in the sending queue. Therefore, when the target operation unit sends the target instruction to the read-write control unit, the read-write control unit can accurately determine the target position of the receiving queue based on the first target identifier, so that the target position of the receiving queue corresponds to the target position of the sending queue, ensuring that the order in which the application reads the execution results from the receiving queue matches the order in which the application writes the target instructions in the sending queue.

[0013] In a possible implementation, the valid writing condition of the present application includes: the execution result is stored at the position indicated by the current pointer of the receiving queue.

[0014] When the execution result is stored in the position indicated by the current pointer of the receiving queue, it means that the execution result has been effectively written, so the read-write control unit can update the current pointer of the receiving queue. In this case, as long as the updated indication position of the current pointer of the receiving queue is the stop writing position of the receiving queue, it can be determined that the read-write control unit has written the execution results of all instructions into the receiving queue.

[0015] In a possible implementation, the hardware accelerator of the present application may further include a second memory that is communicatively connected to the read-write control unit.

[0016] When the execution result is written to the target position of the receiving queue, the target position of the second memory stores a second target identifier, which is used to identify the target position of the receiving queue. There is a mapping relationship between the target position of the receiving queue and the target position of the second memory.

[0017] When the above technical solution is adopted, since there is a mapping relationship between the target position of the receiving queue and the target position of the second memory, when the read-write control unit receives the execution result, on the one hand, the execution result can be written to the target position of the receiving queue, and on the other hand, the second target identifier can be stored in the target position of the second memory corresponding to the target position of the receiving queue, so that the second target identifier is used to identify the target position of the receiving queue. In this case, the read-write control unit can indirectly determine whether the execution result is stored in different positions of the receiving queue by checking the storage status of the second target identifier at different positions of the second memory without accessing the first memory, thereby judging whether the position indicated by the current pointer of the receiving queue meets the valid write condition, simplifying the judgment process of whether the position indicated by the current pointer of the receiving queue meets the valid write condition, and reducing the number of times the hardware acceleration engine accesses the first memory.

[0018] Moreover, the target location of the second memory of the present application does not need to store the execution result, but only needs to store the second target identifier, and the second target identifier occupies relatively little storage space. Therefore, although the hardware accelerator of the present application includes a second memory, compared with the related art, the hardware accelerator does not require high storage space for the second memory, which can effectively reduce the chip area overhead of the hardware accelerator and reduce the chip manufacturing cost of the hardware accelerator.

[0019] In one possible implementation, there is a mapping relationship between the current pointer indication position of the second memory of the present application and the current pointer indication position of the receiving queue, and the valid write conditions include: the current pointer indication position of the second memory stores a second target identifier, and the valid write operation also includes updating the current pointer of the second memory.

[0020] In the case of adopting the above technical solution, since the valid writing condition includes that the current pointer indication position of the second memory stores the second target identifier, and there is a mapping relationship between the current pointer indication position of the second memory and the current pointer indication position of the receiving queue, when the current pointer indication position of the second memory stores the second target identifier, the current pointer indication position of the receiving queue writes the execution result. In this case, the present application can indirectly determine whether the current pointer indication position of the receiving queue stores the execution result by detecting whether the current pointer indication position of the second memory stores the second target identifier.

[0021] In a second aspect, the present application further provides a method for writing out an execution result, which is applied to a processor, wherein the processor includes a first memory and a hardware accelerator, wherein the first memory includes a sending queue and a receiving queue, and the sending queue stores multiple instructions; the hardware accelerator includes a scheduling unit, a read-write control unit, and multiple computing units, the scheduling unit and the read-write control unit are both communicatively connected to the multiple computing units, and the scheduling unit and the read-write control unit are both communicatively connected to the first memory; the method of the present application includes:

[0022] When the target computing unit receives the target instruction sent by the scheduling unit, the target computing unit executes the target instruction and sends the execution result obtained by executing the target instruction to the read-write control unit, so that when the read-write control unit receives the execution result, the execution result is written to the target position of the receiving queue, and when the current pointer indication position of the receiving queue meets the valid writing condition, the valid writing operation is performed, and the valid writing operation includes updating the current pointer of the receiving queue;

[0023] The target instruction of the present application is one of multiple instructions, the target operation unit is one of multiple operation units, the target instruction is read by the scheduling unit from the target position of the sending queue, and the target position of the sending queue corresponds to the target position of the receiving queue.

[0024] In one possible implementation, the target instructions sent by the scheduling unit of the present application and the execution results sent by the target computing unit both carry a first target identifier; the first target identifier is used to identify the order in which the scheduling unit reads the target instructions from the sending queue, and the target position of the receiving queue is determined by the first target identifier.

[0025] In a possible implementation, the valid writing condition of the present application includes: the execution result is stored at the position indicated by the current pointer of the receiving queue.

[0026] In one possible implementation, the hardware accelerator of the present application also includes a second memory that is communicatively connected to the read-write control unit; when the execution result is written to the target position of the receiving queue, the target position of the second memory stores a second target identifier, and the second target identifier is used to identify the target position of the receiving queue, and there is a mapping relationship between the target position of the receiving queue and the target position of the second memory.

[0027] In one possible implementation, there is a mapping relationship between the current pointer indication position of the second memory of the present application and the current pointer indication position of the receiving queue; the valid write condition includes: the current pointer indication position of the memory stores a second target identifier, and the valid write operation also includes updating the current pointer of the second memory.

[0028] The beneficial effects brought about by the technical solution of the second aspect of the present application or any possible implementation method of the second aspect are the same as the beneficial effects of the first aspect or any possible implementation method of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Further details, features and advantages of the present application are claimed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:

[0030] Figure 1 A schematic diagram showing the structure of a processor according to an embodiment of the present application is shown;

[0031] Figure 2 A schematic diagram of a queue according to an embodiment of the present application is shown;

[0032] Figure 3 A schematic diagram showing the updating principle of the tail pointer of the receiving queue in an embodiment of the present application is shown;

[0033] Figure 4A A schematic diagram of updating a pointer of a second memory using a multi-bit register as an example in an embodiment of the present application is shown;

[0034] Figure 4B Another pointer update schematic diagram of the second memory using a multi-bit register as an example in an embodiment of the present application is shown;

[0035] Figure 5 A flowchart of a method for writing execution results according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0036] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.

[0037] It should be understood that the various steps described in the method implementation of the present application can be performed in different orders and / or performed in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.

[0038] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this application are only used to distinguish different devices, units or units, and are not used to limit the order or interdependence of the functions performed by these devices, units or units.

[0039] It should be noted that the modifications of "one" and "plurality" mentioned in the present application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0040] The names of the messages or information exchanged between multiple devices in the embodiments of the present application are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0041] Before introducing the embodiments of the present application, the following definitions are given for the relevant terms involved in the embodiments of the present application:

[0042] A queue is a linear table of First In First Out (FIFO). The end that allows insertion is called the tail, and the end that allows deletion is called the head. Inserting a new data element into the queue is called enqueuing, and deleting the head element from the queue is called dequeuing.

[0043] A ring queue is a special queue that adds some restrictions to the queue so that the queue can be used cyclically in a fixed-size storage space.

[0044] A hardware accelerator is a dedicated hardware circuit that can implement various functions so as to achieve higher performance or better energy efficiency than a general-purpose microprocessor when performing a set of operations. Here, the acceleration of various operations by calling an accelerator through software is called hardware acceleration.

[0045] In the related art, an application can use a circular queue to send multiple instructions to a hardware accelerator such as a cryptographic acceleration engine and receive the execution results of multiple instructions returned by the cryptographic acceleration engine. In this process, a circular sending queue and a circular receiving queue are involved, and the circular sending queue and the circular receiving queue are located in a storage space accessible to both the application and the cryptographic acceleration engine.

[0046] The application can write multiple instructions in the circular sending queue, and the cryptographic acceleration engine can read the instructions from the circular sending queue, execute them through the computing unit, and then write the execution results into the circular receiving queue, so that the application can read the execution results from the circular receiving queue. In order to ensure that the cryptographic acceleration engine returns the execution results to the application normally through the circular receiving queue, the cryptographic acceleration engine requires a larger chip area, which makes the production cost of the cryptographic acceleration engine relatively high.

[0047] The inventor discovered that after the cryptographic acceleration engine reads multiple instructions from the circular sending queue in sequence, it executes the corresponding instructions through different computing units, and the time required for each computing unit to execute the instructions is basically different. Therefore, the order in which the cryptographic acceleration engine obtains the execution results of multiple instructions is almost impossible to be the same as the order in which the cryptographic acceleration engine reads multiple instructions from the circular sending queue. Since the order in which the cryptographic acceleration engine writes the execution results of multiple instructions in the circular receiving queue needs to be the same as the order in which the application writes multiple instructions in the circular receiving queue, the cryptographic acceleration engine can cache the execution results of instructions that do not meet the write conditions, and write the instruction execution results to the circular receiving queue when the write conditions are met. However, this also causes the cryptographic acceleration engine to require a larger chip area overhead for caching the execution results, making the production cost of the cryptographic acceleration engine relatively high.

[0048] In view of the above problems, an embodiment of the present application provides a processor, which enables a hardware accelerator to directly write execution results into a receiving queue, thereby reducing the storage space occupied by the hardware accelerator and reducing the chip area overhead of the hardware accelerator.

[0049] Figure 1 FIG. 1 shows a schematic diagram of the structure of a processor in an embodiment of the present application. Figure 1 As shown, the processor 100 of the embodiment of the present application may include: a first memory 101 and a hardware accelerator 102 .

[0050] like Figure 1As shown, the first memory 101 of the embodiment of the present application can be accessed by a certain application and a hardware accelerator 102, or can be accessed by other applications. For example, the first memory 101 can be a cache of a central processing unit (CPU) or a memory particle (Double Data Rate SDRAM, DDR).

[0051] like Figure 1 As shown, the first memory 101 of the embodiment of the present application includes a sending queue and a receiving queue, the sending queue stores multiple instructions, and the receiving queue is used to store the execution results of different instructions. The instructions here can exist in the form of command descriptors (Command Descriptor Block, CDB).

[0052] like Figure 1 As shown, multiple instructions in the embodiment of the present application can be written into the sending queue in sequence by a certain application, or can be written into the sending queue by multiple different applications. For example, when the first application and the second application write five instructions into the sending queue, the first application first writes three instructions into the sending queue in sequence, and the second application then writes the remaining two instructions into the sending queue in sequence. Of course, the first application can also write one instruction into the sending queue first, and the second application then writes three instructions into the sending queue in sequence, and the first application finally writes one instruction into the sending queue.

[0053] It is understandable that when multiple applications in the embodiment of the present application write multiple instructions in the sending queue, the order in which different applications write multiple instructions in the sending queue can be adjusted according to actual conditions, which will not be repeated here.

[0054] like Figure 1 As shown, the hardware accelerator 102 of the embodiment of the present application may include a scheduling unit 1021, a computing unit 1022, and a read-write control unit 1023, where the number of computing units 1022 may be multiple, the scheduling unit 1021 and the read-write control unit 1023 are both communicatively connected to the multiple computing units 1022, and the scheduling unit 1021 and the read-write control unit 1023 are both communicatively connected to the first memory 101. It should be understood that the hardware accelerator 102 of the embodiment of the present application may be a cryptographic accelerator, an artificial intelligence accelerator, etc., but is not limited thereto.

[0055] For example, Figure 1As shown, after the scheduling unit 1021 of the embodiment of the present application reads the target instruction at the target position of the sending queue, it can select a target computing unit that is in an idle state or available from the multiple computing units 1022. If there are multiple candidate computing units that are in an idle state or available among the multiple computing units 1022, a target computing unit can be randomly obtained from the multiple candidate computing units. It can be seen that the target computing unit of the embodiment of the present application can be one of the multiple computing units 1022, and the target instruction is one of the multiple instructions, and the target instruction is read by the scheduling unit 1021 from the target position of the sending queue.

[0056] like Figure 1 As shown, the scheduling unit 1021 of the embodiment of the present application is used to send the target instruction to the target computing unit, and the target computing unit is used to execute the target instruction and obtain the execution result when receiving the target instruction sent by the scheduling unit 1021. When the target instruction fails to execute, the execution result can record the error code of the target instruction execution failure in the form of a state descriptor (State Descriptor), and the error code can be used to determine the failure of the target instruction execution and the error cause of the failure of the target instruction execution, and the identification of the target computing unit of the target instruction can also be executed. When the target instruction is successfully executed, the execution result can describe the success of the target instruction execution in the form of a state descriptor (State Descriptor).

[0057] like Figure 1 As shown, the target operation unit of the embodiment of the present application is also used to send the execution result obtained by executing the target instruction to the read-write control unit 1023, so that when the read-write control unit 1023 receives the execution result, it writes the execution result at the target position of the receiving queue, and when the current pointer indication position of the receiving queue meets the valid write condition, performs a valid write operation, where the valid write operation may include updating the current pointer of the receiving queue.

[0058] In practical applications, the target position of the sending queue of the embodiment of the present application corresponds to the target position of the receiving queue. When the sending queue and the receiving queue can be first-in-first-out queues such as a circular queue and a sequential queue, the sending queue is used to store multiple instructions, and the receiving queue is used to store the execution results of multiple instructions. The correspondence here can be interpreted as: the head of the sending queue is the starting position of the sending queue, the target position of the sending queue is the nth position of the sending queue, the head of the receiving queue is the starting position of the receiving queue, and the target position of the receiving queue can be the nth position of the receiving queue.

[0059] like Figure 1As shown, when the sending queue and the receiving queue belong to first-in-first-out queues, the order in which the scheduling unit 1021 reads each instruction in the sending queue is actually the same as the order in which the application writes each instruction in the sending queue. Since the receiving queue also belongs to a first-in-first-out queue, and the order in which the cryptographic acceleration engine writes the execution results of multiple instructions in the receiving queue needs to be the same as the order in which the application writes multiple instructions in the sending queue, the read-write control unit 1023 of the embodiment of the present application can use the rule that the target position of the sending queue corresponds to the target position of the receiving queue to directly write the execution result in the target position of the receiving queue after receiving the execution result.

[0060] In other words, Figure 1 As shown, after receiving the execution result, the read / write control unit 1023 takes the head of the receiving queue as the starting position, regardless of whether the position between the target position of the receiving queue and the starting position of the receiving queue has written the execution result of other instructions (the order in which the scheduling unit 1021 reads other instructions in the sending queue is earlier than the order in which the scheduling unit 1021 reads the target instruction in the sending queue), the execution result of the target instruction can be written in the target position of the receiving queue. When the current pointer indication position of the receiving queue meets the valid writing condition, the valid writing operation is performed.

[0061] It can be seen that Figure 1 As shown, the hardware accelerator 102 of the embodiment of the present application can effectively write the execution result at the target position of the receiving queue when there is no need to store the execution result. Since the target position of the receiving queue corresponds to the target position of the sending queue, the order in which the application reads the execution result from the receiving queue matches the order in which the application writes the target instructions in the sending queue. Therefore, the embodiment of the present application can improve the performance and reliability of the application and reduce the complexity of software design.

[0062] In addition, if Figure 1 As shown, when the hardware accelerator 102 of the embodiment of the present application does not need to store the execution result, the execution result can be effectively written to the target location of the receiving queue, thereby reducing the storage space occupied by the hardware accelerator 102, so that the hardware accelerator 102 can work normally in a smaller storage space. Therefore, the chip area overhead of the hardware accelerator 102 is relatively small. In addition, since the hardware accelerator 102 does not need to store the execution result, the process of the hardware accelerator 102 effectively writing the execution result to the receiving queue can be simplified.

[0063] It should be noted that if Figure 1As shown, the hardware accelerator 102 of the embodiment of the present application may further include a read-write unit 1024, the scheduling unit 1021 and the read-write control unit 1023 may both be communicatively connected to the read-write unit 1024, and the read-write unit 1024 may be communicatively connected to the first memory 101. In this case, the scheduling unit 1021 may access the first memory 101 through the read-write unit 1024, so that the scheduling unit 1021 may sequentially read the target instructions in the sending queue, and the read-write control unit 1023 may write the execution result in the target position of the receiving queue through the read-write unit 1024.

[0064] In one possible implementation, Figure 1 As shown, the target instructions sent by the scheduling unit 1021 and the execution results sent by the target operation unit of the embodiment of the present application both carry a first target identifier, which is used to identify the order in which the scheduling unit 1021 reads the target instructions from the sending queue, and the target position of the receiving queue can be determined by the first target identifier.

[0065] After receiving the target command, the scheduling unit 1021 can configure a first target identifier for the target instruction based on the order in which the scheduling unit 1021 reads the target instructions from the sending queue, so that the first target identifier can identify the order in which the scheduling unit 1021 reads the target instructions from the sending queue, and then sends the target instruction carrying the first target identifier to the target computing unit. After the target computing unit executes the target instruction, the first target identifier carried by the target instruction can be configured to the execution result of the target instruction.

[0066] After receiving the execution result of the target instruction, the read-write control unit 1023 can determine the write address of the target command in the receiving queue based on the first target identifier carried by the execution result of the target instruction, and determine the target position of the target command in the receiving queue according to the write address of the target command in the receiving queue.

[0067] In practical applications, the scheduling unit of the embodiment of the present application can configure a first identifier for each instruction, so that the first identifier carried by each instruction corresponds to the position of the receiving queue for storing the execution result of the corresponding instruction. When the instruction is a target instruction, the first identifier carried by the instruction and the execution result of the instruction is the first target identifier.

[0068] Figure 2 FIG. 1 shows a schematic diagram of a queue of an embodiment of the present application. Figure 2 As shown, the queue of the embodiment of the present application has 501 positions, and the positions of the queue from the head to the tail are marked as 0 to 500. The following is an example of a circular queue.

[0069] when Figure 2 The queue shown is the send queue, such as Figure 1and Figure 2 As shown, the 0th to 500th bits of the sending queue store the 1st to 501st executions. In the process of the scheduling unit 1021 reading the instructions stored in the 0th to 500th bits in the sending queue in sequence, since the order in which the scheduling unit 1021 reads the target instructions from the sending queue substantially corresponds to the target position of the target instruction in the sending queue, the scheduling unit 1021 can configure the sequence numbers of the instructions read by the scheduling unit 1021 in the sending queue for the 1st to 501st instructions in order from small to large, and configure the sequence numbers of the instructions read by the scheduling unit 1021 in the sending queue for the 1st to 501st instructions as the first identifiers carried by the 1st to 501st instructions, with the minimum sequence number being 1 and the maximum being the maximum number of instructions that the sending queue can accommodate, i.e., 501. Of course, the minimum sequence number can also be 0 and the maximum can be 500.

[0070] like Figure 1 and Figure 2 As shown, the target instruction of the embodiment of the present application can be one of the 1st instruction to the 501st instruction, and the first target instruction carried by the target instruction can be one of the first identifiers carried by the 1st instruction to the 501st instruction. The following takes the 312th instruction as an example to describe the process of writing the execution result of the target instruction at the target position of the receiving queue.

[0071] like Figure 1 and Figure 2 As shown, assuming that the target position of the sending queue is the 311th position of the sending queue, the target instruction is the 312th instruction stored in the 311th position of the sending queue, and the order in which the scheduling unit 1021 reads the 312th instruction from the sending queue is the 312th. Therefore, the scheduling unit 1021 can configure the first identifier for the 312th instruction according to the sequence number of the 312th instruction read from the sending queue by the scheduling unit 1021, that is, 312. Of course, the scheduling unit 1021 can also configure the first identifier for the 312th instruction according to the position identifier of the sending queue, that is, 311.

[0072] like Figure 1 and Figure 2 As shown, the scheduling unit 1021 of the embodiment of the present application sends the 312th instruction carrying the first identifier to the target computing unit. After the target computing unit executes the 312th instruction, it can obtain the execution result of the 312th instruction, and configure the first identifier carried by the 312th instruction to the execution result of the 312th instruction, so that the target computing unit sends the execution result of the 312th instruction carrying the first identifier to the read-write control unit 1023.

[0073] when Figure 2 The queue shown is the receiving queue, such as Figure 1 and Figure 2 As shown, the read-write control unit 1023 can accurately determine that the target position of the receiving queue is the 311th bit of the receiving queue based on the first identifier carried by the execution result of the 312th instruction, and then write the execution result of the 312th instruction at the 311th bit of the receiving queue, so that the target position of the receiving queue corresponds to the target position of the sending queue, ensuring that the order in which the application reads the execution results from the receiving queue matches the order in which the application writes the target instructions into the sending queue.

[0074] It is understandable that if Figure 1 and Figure 2 As shown, regardless of whether the corresponding instructions have been written to the 1st to 311th bits of the receiving queue of the embodiment of the present application, the read-write control unit 1023 can write the execution result of the 312th instruction to the 311th bit of the receiving queue. For example, after the read-write control unit 1023 writes the execution result of the 312th instruction to the 311th bit of the receiving queue, if the read-write control unit 1023 receives the execution result of the 205th instruction, the read-write control unit 1023 can write the execution result of the 205th instruction to the 204th bit of the receiving queue.

[0075] It can be seen that Figure 1 As shown, after receiving the execution result carrying the first target identifier, the read-write control unit 1023 of the embodiment of the present application does not need to consider the order in which the scheduling unit 1021 identified by the first target identifier reads the target instructions from the sending queue, but accurately determines the target position of the receiving queue based on the first target identifier, and directly writes the execution result at the target position of the receiving queue.

[0076] In a possible implementation, the valid write condition of the embodiment of the present application may include: the execution result is stored at the position indicated by the current pointer of the receiving queue.

[0077] When the current pointer of the receiving queue indicates that the execution result is stored at the position, it means that the execution result has been effectively written. Figure 1 As shown, the read / write control unit 1023 can update the current pointer of the receiving queue. In this case, if the updated indication position of the current pointer of the receiving queue is the stop writing position of the receiving queue, it can be determined that the read / write control unit 1023 has written the execution results of all instructions into the receiving queue.

[0078] In actual applications, the current pointer of the receiving queue in the embodiment of the present application may include a tail pointer and a head pointer. When the current pointer of the receiving queue indicates that the execution result is stored at the position, it means that the execution result has been written to the position pointed to by the current tail pointer of the receiving queue, and the current tail pointer of the receiving queue needs to be updated.

[0079] Figure 3 FIG. 2 is a schematic diagram showing the updating principle of the tail pointer of the receiving queue in an embodiment of the present application. Figure 3 As shown, the 0th bit of the receiving queue is written with the execution result a0 of the first instruction. Therefore, the head pointer Front of the receiving queue is 0, and the tail pointer Rear is 1.

[0080] like Figure 1 and Figure 3 As shown, when the read / write control unit 1023 writes the execution result a of the 312th instruction into the 311th bit of the receiving queue, 311 Afterwards, since the execution result is not stored in the position indicated by the tail pointer Rear=1 of the receiving queue, the tail pointer of the receiving queue does not meet the valid writing condition, and there is no need to update the tail pointer Rear of the receiving queue.

[0081] like Figure 1 and Figure 3 As shown, after the read-write control unit 1023 writes the execution result a1 of the second instruction at the first bit of the receiving queue, since the execution result a1 of the second instruction is stored at the indicated position of the tail pointer Rear=1 of the receiving queue, the tail pointer of the receiving queue satisfies the valid write condition and the tail pointer Rear=2 of the receiving queue can be updated.

[0082] By Figure 1 and Figure 3 It can be seen that after the read-write control unit 1023 of the embodiment of the present application writes the execution result to the receiving queue, it can determine whether the execution result is validly written based on whether the execution result is stored at the position indicated by its tail pointer, and then decide whether to update the tail pointer of the receiving queue. Therefore, the read-write control unit 1023 of the embodiment of the present application may not write the execution result of the instruction to the receiving queue in the order in which the scheduling unit 1021 reads the instruction from the sending queue, but will update the tail pointer of the receiving queue in the order in which the scheduling unit 1021 reads the instruction from the sending queue.

[0083] In one embodiment, if Figure 1 As shown, when the read / write control unit 1023 of the embodiment of the present application detects that the position indicated by the tail pointer of the receiving queue is the preset position (the position where writing of the execution result is stopped), it indicates that the execution results of all instructions have been written into the receiving queue. In this case, the read / write control unit 1023 can send a read indication to the application, and the read indication can instruct the application to read the execution result in the receiving queue.

[0084] For example, when the number of instructions is 501, Figure 1 and Figure 3 As shown, when the receiving queue is detected to be full, it means that the read-write control unit 1023 has written the execution results of 501 instructions into Figure 3 In the queue shown, a read indication can be sent to the application.

[0085] In another embodiment, if Figure 1 and Figure 3 As shown, when the read / write control unit 1023 does not write the execution results of all instructions into the receiving queue, as long as there are validly written execution results in the receiving queue, the application can directly read the validly written execution results in the receiving queue.

[0086] In one possible implementation, Figure 1 As shown, the hardware accelerator 102 of the embodiment of the present application may further include a second memory 1025 in communication with the read / write control unit 1023. When the target location of the receiving queue writes the execution result, the target location of the second memory 1025 stores a second target identifier.

[0087] like Figure 1 As shown, the second target identifier of the embodiment of the present application is used to identify the target position of the receiving queue, and there is a mapping relationship between the target position of the receiving queue and the target position of the second memory 1025. That is, when the read-write control unit 1023 receives the execution result, on the one hand, the execution result can be written to the target position of the receiving queue, and on the other hand, the second target identifier can be stored in the target position of the second memory 1025 corresponding to the target position of the receiving queue, so that the second target identifier is used to identify the target position of the receiving queue.

[0088] In some embodiments, Figure 1 As shown, the read / write control unit 1023 of the embodiment of the present application can store the second target identifier at the target position of the second memory 1025 corresponding to the target position of the receiving queue after writing the execution result at the target position of the receiving queue.

[0089] In other embodiments, Figure 1 As shown, the read / write control unit 1023 of the embodiment of the present application may store a second target identifier at a target position of the second memory 1025 corresponding to the target position of the receiving queue before writing the execution result at the target position of the receiving queue.

[0090] In some other embodiments, Figure 1 As shown, the read-write control unit 1023 of the embodiment of the present application can write the execution result at the target position of the receiving queue and store the second target identifier at the target position of the second memory 1025 corresponding to the target position of the receiving queue.

[0091] like Figure 1As shown, the second memory 1025 of the embodiment of the present application can be various storage media with storage functions, such as common dynamic random access memory (DRAM) and multi-bit register units.

[0092] like Figure 1 As shown, when the second memory 1025 is a multi-bit register, the number of bits of the multi-bit register is at least equal to the number of instructions stored in the sending queue. The multi-bit register includes a plurality of registers, each register having a position identifier, which can indicate the position of the register in the multi-bit register, and each register can store a binary code, and the binary code can indicate whether the register stores data. It can be seen that there is a mapping relationship between the position of the multi-bit register in the embodiment of the present application and the position of the receiving queue, and each position of the multi-bit register corresponds to a position identifier of a register.

[0093] Exemplarily, when there is a mapping relationship between the target position of the multi-bit register of an embodiment of the present application and the target position of the receiving queue, if the target position of the receiving queue stores the execution result, the binary code stored in the target register corresponding to the target position of the multi-bit register is 1.

[0094] When there is a mapping relationship between the position of the multi-bit register in the embodiment of the present application and the position of the receiving queue, the position number of the multi-bit register can be the same as the position number corresponding to the receiving queue, or the position number of the multi-bit register and the position number corresponding to the receiving queue can be in a multiple relationship, or the difference between the position number of the multi-bit register and the position number corresponding to the receiving queue can be fixed.

[0095] For example, when the position number of the multi-bit register is the same as the position number corresponding to the receiving queue, the target register corresponding to the target position of the multi-bit register is the 4th register of the multi-bit register, and the target position of the receiving queue is the 4th position of the receiving queue.

[0096] For another example, when the difference between the position number of the multi-bit register and the position number corresponding to the receiving queue is equal to 1, the target register corresponding to the target position of the multi-bit register is the 4th register of the multi-bit register, and the target position of the receiving queue is the 3rd register of the receiving queue.

[0097] It can be seen that Figure 1As shown, the read-write control unit 1023 of the embodiment of the present application can indirectly determine whether different positions of the receiving queue store execution results by checking the storage status of the second target identifier at different positions of the second memory 1025 without accessing the first memory 101, thereby indirectly judging whether the position indicated by the current pointer of the receiving queue meets the valid write condition, simplifying the judgment process of whether the position indicated by the current pointer of the receiving queue meets the valid write condition, and reducing the number of times the hardware acceleration engine accesses the first memory 101.

[0098] Moreover, if Figure 1 As shown, the target location of the second memory 1025 of the embodiment of the present application does not need to store the execution result, but only needs to store the second target identifier. The second target identifier occupies relatively little storage space. Therefore, although the hardware accelerator 102 of the embodiment of the present application includes the second memory 1025, compared with the related art, the hardware accelerator 102 does not require high storage space for the second memory 1025, which can effectively reduce the chip area of ​​the hardware accelerator 102 and reduce the chip manufacturing cost of the hardware accelerator.

[0099] In an alternative approach, Figure 1 As shown, there is a mapping relationship between the current pointer indication position of the second memory 1025 and the current pointer indication position of the receiving queue in the embodiment of the present application. In this case, the valid write condition includes: the current pointer indication position of the second memory 1025 stores the second target identifier, and the valid write operation also includes updating the current pointer of the second memory 1025.

[0100] like Figure 1 As shown, when the hardware accelerator 102 includes the second memory 1025, the valid write condition includes that the current pointer indication position of the second memory 1025 stores the second target identifier, and there is a mapping relationship between the current pointer indication position of the second memory 1025 and the current pointer indication position of the receiving queue, so when the current pointer indication position of the second memory 1025 stores the second target identifier, the current pointer indication position of the receiving queue writes the execution result. In this case, the embodiment of the present application can indirectly determine whether the current pointer indication position of the receiving queue stores the execution result by detecting whether the second target identifier is stored in the current pointer indication position of the second memory 1025.

[0101] When the tail pointer of the receiving queue follows Figure 3 When updating in the manner shown, if the position number of the multi-bit register is the same as the position number corresponding to the receiving queue, Figure 4A A schematic diagram of updating a pointer of a second memory using a multi-bit register as an example in an embodiment of the present application is shown. Figure 3 and Figure 4AAs shown, when the execution result a0 of the first instruction is written to the 0th bit of the receiving queue of the embodiment of the present application, "1" is written to the 0th bit register, indicating that the execution result a0 of the first instruction is written to the 0th bit of the receiving queue. Therefore, the tail pointer Rear of the receiving queue is 1, and the pointer ip of the multi-bit register is 1.

[0102] like Figure 1 , Figure 3 and Figure 4A As shown, when the read / write control unit 1023 writes the execution result a of the 312th instruction into the 311th bit of the receiving queue, 311 When the 311th bit of the register is written with "1", it indicates that the 311th bit of the receiving queue is written with the execution result of the 312th instruction. 311 Since "1" is not written into the first bit register when the pointer ip of the multi-bit register is 1, the tail pointer of the receiving queue is still Rear = 1, and the pointer ip of the multi-bit register is 1.

[0103] like Figure 3 and Figure 4A As shown, when the read / write control unit 1023 writes the execution result a1 of the second instruction into the first bit of the receiving queue, the first bit register is written with "1", indicating that the execution result a1 of the second instruction is written into the first bit of the receiving queue. Since the pointer ip of the multi-bit register is 1, the first bit register is written with "1", therefore, the pointer ip of the multi-bit register can be updated to 2, and the tail pointer Rear of the receiving queue can be updated to 2.

[0104] When the tail pointer of the receiving queue follows Figure 3 When updating in the manner shown, if the difference between the position number of the multi-bit register and the position number corresponding to the receiving queue is equal to 1, Figure 4B Another pointer update schematic diagram of the second memory using a multi-bit register as an example in the embodiment of the present application is shown. Figure 3 and Figure 4B As shown, when the execution result a0 of the first instruction is written to the 0th bit of the receiving queue of the embodiment of the present application, "1" is written to the 1st bit of the register, indicating that the execution result a0 of the first instruction is written to the 0th bit of the receiving queue. Therefore, the pointer ip of the multi-bit register is 2, and the tail pointer Rear of the receiving queue is 1.

[0105] like Figure 1 , Figure 3 and Figure 4B As shown, when the read / write control unit 1023 writes the execution result a of the 312th instruction into the 311th bit of the receiving queue, 311 When the 312th register is written with "1", it indicates that the 311th register of the receiving queue is written with the execution result of the 312th instruction. 311Since "1" is not written into the second bit register when the pointer ip of the multi-bit register is 2, the pointer ip of the multi-bit register is 2, and the tail pointer Rear of the receiving queue is 1.

[0106] like Figure 1 , Figure 3 and Figure 4B As shown, when the read / write control unit 1023 writes the execution result a1 of the second instruction into the first bit of the receiving queue, the second bit register writes "1", indicating that the execution result a1 of the second instruction is written into the first bit of the receiving queue. Since the second bit register writes "1" when the pointer ip of the multi-bit register is 2, the pointer ip of the multi-bit register can be updated to 3, and the tail pointer Rear of the receiving queue can be updated to 2.

[0107] The embodiment of the present application also provides a method for writing out execution results, which is applied to a processor, and the architecture of the processor can be Figure 1 The processor shown. The processor may include a first memory and a hardware accelerator, the first memory includes a sending queue and a receiving queue, the sending queue stores multiple instructions; the hardware accelerator includes a scheduling unit, a read-write control unit, and multiple computing units, the scheduling unit and the read-write control unit are both connected to the multiple computing units in communication, and the scheduling unit and the read-write control unit are both connected to the first memory in communication.

[0108] The following uses the target computing unit and the read-write control unit as the execution subjects and adopts an interactive manner to describe the method of writing the execution results of the embodiment of the present application.

[0109] Figure 5 The flowchart of the method for writing the execution result of the embodiment of the present application is shown. Figure 5 As shown, the method for writing the execution result of the embodiment of the present application may include:

[0110] Step 501: When receiving a target instruction sent by a scheduling unit, the target operation unit executes the target instruction. Here, the target instruction may be one of multiple instructions, the target operation unit may be one of multiple operation units, and the target instruction is read by the scheduling unit from the target position of the sending queue.

[0111] In practical applications, the scheduling unit of the embodiment of the present application can read the target instruction from the target position of the sending queue, and then send the target instruction to the target computing unit. The target instruction can exist in the form of a command descriptor and can carry a first target identifier, which can be configured by the scheduling unit for the target instruction.

[0112] When the target instruction carries the first target identifier, the scheduling unit may configure the first target identifier for the target instruction after reading the target instruction, and then send the target instruction carrying the first target identifier to the target computing unit.

[0113] After the target computing unit executes the target instruction, the execution result of the target instruction can be obtained, which can exist in the form of a state descriptor and can carry a first target identifier. Here, the first target identifier is used to identify the order in which the scheduling unit reads the target instructions from the sending queue.

[0114] Step 502: The target computing unit sends the execution result obtained by executing the target instruction to the read-write control unit. At this time, the read-write control unit can receive the execution result sent by the target computing unit. Moreover, when the read-write control unit receives the execution result sent by the target computing unit, it can also simultaneously or asynchronously receive the execution results sent by other computing units.

[0115] Step 503: upon receiving the execution result, the read / write control unit writes the execution result into the target position of the receiving queue. Here, the execution result sent by the target computing unit may carry a first target identifier, so that the target position of the receiving queue may be determined by the first target identifier.

[0116] In practical applications, after receiving the execution result carrying the first target identifier, the read / write control unit of the embodiment of the present application can determine the order in which the scheduling unit reads the target instructions from the sending queue based on the first target identifier.

[0117] When the target position of the sending queue in the embodiment of the present application corresponds to the target position of the receiving queue, the read-write control unit directly writes the execution result at the target position of the receiving queue, ensuring that the order in which the application reads the execution results from the receiving queue matches the order in which the application writes the target instructions in the sending queue. Therefore, the processor in the embodiment of the present application can improve application performance and reliability and reduce software design complexity.

[0118] In addition, when the hardware accelerator of the embodiment of the present application does not need to store the execution result, the execution result can be effectively written to the target location of the receiving queue, reducing the storage space occupied by the hardware accelerator, so that the hardware accelerator can work normally in a smaller storage space. Therefore, the chip area overhead of the hardware accelerator is relatively small. Moreover, the hardware accelerator does not need to store the execution result, which can simplify the process of the hardware accelerator effectively writing the execution result in the receiving queue.

[0119] Step 504: When the read / write control unit detects whether the position indicated by the current pointer of the receiving queue meets the valid write condition, it performs a valid write operation, and the valid write operation includes updating the current pointer of the receiving queue.

[0120] Exemplarily, the valid write condition of the embodiment of the present application includes: the execution result is stored at the position indicated by the current pointer of the receiving queue. When the execution result is stored at the position indicated by the current pointer of the receiving queue, it means that the operation of the read-write control unit writing the execution result in the receiving queue meets the write condition. In this case, it is sufficient to update the current pointer of the receiving queue, and the specific process can refer to the relevant description above.

[0121] In some embodiments, the hardware accelerator of the embodiment of the present application may further include a second memory in communication with the read-write control unit. In this case, when the target position of the receiving queue writes the execution result, the target position of the second memory stores a second target identifier, and the second target identifier is used to identify the target position of the receiving queue, and there is a mapping relationship between the target position of the receiving queue and the target position of the second memory.

[0122] When there is a mapping relationship between the target position of the receiving queue and the target position of the second memory, the read-write control unit can, based on this mapping relationship, write the execution result to the target position of the receiving queue on the one hand, and write the second target identifier to the target position of the second memory on the other hand, so as to mark the execution result written to the target position of the receiving queue corresponding to the target position of the second memory.

[0123] It can be seen that the read-write control unit of the embodiment of the present application can indirectly determine whether different positions of the receiving queue store execution results by checking the storage status of the second target identifier at different positions of the second memory without accessing the first memory, thereby judging whether the position indicated by the current pointer of the receiving queue meets the valid write condition, simplifying the judgment process of whether the position indicated by the current pointer of the receiving queue meets the valid write condition, and reducing the number of times the hardware acceleration engine accesses the first memory.

[0124] Exemplarily, there is a mapping relationship between the current pointer indication position of the second memory of the present application and the current pointer indication position of the receiving queue, and the valid write conditions include: the current pointer indication position of the second memory stores a second target identifier, and the valid write operation also includes updating the current pointer of the second memory.

[0125] When the read / write control unit of the embodiment of the present application detects that the second target identifier is stored at the current pointer indication position of the second memory, it can determine that the execution result is stored at the current pointer indication position of the receiving queue. In this case, the read / write control unit can not only update the current pointer of the receiving queue, but also update the current pointer of the second memory. Here, it can be considered that the current pointer of the second memory is updated, which triggers the current pointer update of the receiving queue.

[0126] Moreover, the target location of the second memory in the embodiment of the present application does not need to store the execution result, but only needs to store the second target identifier, and the second target identifier occupies relatively little storage space. Therefore, although the hardware accelerator in the embodiment of the present application includes a second memory, compared with the related art, the hardware accelerator does not have high requirements for the storage space of the second memory, which can effectively reduce the chip area overhead of the hardware accelerator and reduce the chip manufacturing cost of the hardware accelerator.

[0127] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A processor, characterized in that: include: A first memory, the first memory comprising a sending queue and a receiving queue, the sending queue storing a plurality of instructions; and a hardware accelerator, the hardware accelerator comprising a scheduling unit, a read-write control unit, and a plurality of computing units, the scheduling unit and the read-write control unit are both communicatively connected to the plurality of computing units, and the scheduling unit and the read-write control unit are both communicatively connected to the first memory; The target operation unit is used to: when receiving the target instruction sent by the scheduling unit, execute the target instruction, and send the execution result obtained by executing the target instruction to the read-write control unit, so that the read-write control unit writes the execution result at the target position of the receiving queue when receiving the execution result, and performs a valid write operation when the current pointer indication position of the receiving queue meets the valid write condition, and the valid write operation includes updating the current pointer of the receiving queue; The target operation unit is one of the multiple operation units, the target instruction is one of the multiple instructions, and the target instruction is read by the scheduling unit from the target position of the sending queue, and the target position of the sending queue corresponds to the target position of the receiving queue.

2. The processor according to claim 1, characterized in that The target instruction sent by the scheduling unit and the execution result sent by the target computing unit both carry a first target identifier; The first target identifier is used to identify the order in which the scheduling unit reads the target instructions from the sending queue, and the target position of the receiving queue is determined by the first target identifier.

3. The processor according to claim 1, wherein: The valid writing condition includes: the execution result is stored at the position indicated by the current pointer of the receiving queue.

4. The processor according to claim 1, characterized in that The hardware accelerator also includes a second memory in communication with the read-write control unit; When the execution result is written into the target position of the receiving queue, a second target identifier is stored in the target position of the second memory; The second target identifier is used to identify a target position of the receiving queue, and there is a mapping relationship between the target position of the receiving queue and the target position of the second memory.

5. The processor according to claim 4, characterized in that There is a mapping relationship between the current pointer indication position of the second memory and the current pointer indication position of the receiving queue; The valid write condition includes: a second target identifier is stored at a position indicated by a current pointer of the memory, and the valid write operation further includes updating a current pointer of the second memory.

6. A method for writing out execution results, characterized in that: The method is applied to a processor, the processor comprising a first memory and a hardware accelerator, wherein the first memory comprises a sending queue and a receiving queue, the sending queue stores a plurality of instructions; the hardware accelerator comprises a scheduling unit, a read-write control unit and a plurality of operation units, the scheduling unit and the read-write control unit are both communicatively connected to the plurality of operation units, and the scheduling unit and the read-write control unit are both communicatively connected to the first memory; the method comprises: When the target operation unit receives the target instruction sent by the scheduling unit, the target operation unit executes the target instruction and sends the execution result obtained by executing the target instruction to the read-write control unit, so that when the read-write control unit receives the execution result, the execution result is written into the target position of the receiving queue, and when the position indicated by the current pointer of the receiving queue meets the valid writing condition, a valid writing operation is performed, and the valid writing operation includes updating the current pointer of the receiving queue; The target instruction is one of the multiple instructions, the target operation unit is one of the multiple operation units, the target instruction is read by the scheduling unit from the target position of the sending queue, and the target position of the sending queue corresponds to the target position of the receiving queue.

7. The method according to claim 6, characterized in that The target instruction sent by the scheduling unit and the execution result sent by the target computing unit both carry a first target identifier; The first target identifier is used to identify the order in which the scheduling unit reads the target instructions from the sending queue, and the target position of the receiving queue is determined by the first target identifier.

8. The method according to claim 6, characterized in that The valid writing condition includes: the execution result is stored at the position indicated by the current pointer of the receiving queue.

9. The method according to claim 6, characterized in that The hardware accelerator also includes a second memory in communication with the read-write control unit; When the execution result is written into the target position of the receiving queue, a second target identifier is stored in the target position of the second memory; The second target identifier is used to identify a target position of the receiving queue, and there is a mapping relationship between the target position of the receiving queue and the target position of the second memory.

10. The method according to claim 9, characterized in that There is a mapping relationship between the current pointer indication position of the second memory and the current pointer indication position of the receiving queue; The valid write condition includes: a second target identifier is stored at a position indicated by a current pointer of the second memory, and the valid write operation further includes updating a current pointer of the second memory.

Citation Information

Cited By

  • Data processing method, system, device and readable storage medium

    CN119782253A