Instruction processing method, processor and computing equipment

By employing out-of-order issue and parallel execution instruction processing methods in superscalar architecture, the problem of low instruction processing efficiency in sequential processors is solved, achieving more efficient instruction processing and circuit expansion.

CN119025162APending Publication Date: 2024-11-26ALIBABA DAMO (HANGZHOU) TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410881687.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-11-26

Smart Images

  • Figure CN119025162A_ABST
    Figure CN119025162A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an instruction processing method, a processor and computing equipment, the instruction processing method is applied to a distribution unit in the processor, and the processor comprises the distribution unit and a plurality of execution units; the instruction processing method comprises the steps of obtaining a to-be-executed instruction; according to the current storage identifier of the transmitting queue, the to-be-executed instruction is stored in the transmitting queue, the transmitting queue comprises a plurality of instruction sequences, the instruction sequences comprise a plurality of instructions transmitted in sequence, and the instruction sequences correspond to different execution units; according to a current instruction pointer of a target execution unit, a target execution instruction is read from an instruction sequence corresponding to the target execution unit, and the target execution unit is an idle execution unit in the multiple execution units; and transmitting the target execution instruction to a target execution unit to obtain a target execution result output by the target execution unit. The instructions which can be executed in parallel are mixed and stored in the transmitting queue, so that disordered transmitting of the instructions is realized, and the instruction processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technology, and in particular, to instruction processing methods, processors, and computing devices. Background Art

[0002] In computing architecture, the processor is the core component responsible for converting instruction sequences stored in memory into actual computing operations and data processing tasks.

[0003] At present, the sequential execution processor can be used for instruction processing: the sequential execution processor can write the instructions into the emission queue according to the original order of the program. At this time, the emission queue is equivalent to a first-in-first-out queue. The emission queue only emits the oldest instruction at a time. If the oldest instruction is not emitted, other instructions will also be blocked, resulting in extremely low instruction processing efficiency. Therefore, an efficient instruction processing solution is urgently needed. Summary of the invention

[0004] In view of this, the embodiments of this specification provide an instruction processing method. One or more embodiments of this specification also relate to a processor and a computing device to solve the technical defects existing in the prior art.

[0005] According to a first aspect of an embodiment of this specification, an instruction processing method is provided, which is applied to a distribution unit in a processor, wherein the processor includes a distribution unit and a plurality of execution units; the instruction processing method includes:

[0006] Get the instructions to be executed;

[0007] According to the current storage identifier of the transmission queue, the to-be-executed instruction is stored in the transmission queue, wherein the transmission queue includes a plurality of instruction sequences, the instruction sequence includes a plurality of sequentially transmitted instructions, and the plurality of instruction sequences correspond to different execution units;

[0008] Reading a target execution instruction from an instruction sequence corresponding to the target execution unit according to a current instruction pointer of the target execution unit, wherein the target execution unit is an idle execution unit among the plurality of execution units;

[0009] The target execution instruction is sent to the target execution unit to obtain the target execution result output by the target execution unit.

[0010] According to a second aspect of an embodiment of this specification, an instruction processing method is provided, which is applied to a target execution unit in a processor, the processor comprising a distribution unit and a plurality of execution units, the target execution unit being an idle execution unit among the plurality of execution units; the instruction processing method comprises:

[0011] Receive a target execution instruction transmitted by a distribution unit, wherein the distribution unit includes a transmission queue, the transmission queue includes multiple instruction sequences, the instruction sequence includes multiple sequentially transmitted instructions, the multiple instruction sequences correspond to different execution units, and the target execution instruction is read by the distribution unit from the instruction sequence corresponding to the target execution unit according to the current instruction pointer of the target execution unit;

[0012] Execute the target execution instruction and obtain the target execution result.

[0013] According to a third aspect of an embodiment of this specification, there is provided a processor, including a distribution unit and a plurality of execution units;

[0014] A distribution unit is used to obtain instructions to be executed; store the instructions to be executed in the emission queue according to the current storage identifier of the emission queue, wherein the emission queue includes multiple instruction sequences, the instruction sequence includes multiple instructions to be sequentially emitted, and the multiple instruction sequences correspond to different execution units; read the target execution instruction from the instruction sequence corresponding to the target execution unit according to the current instruction pointer of the target execution unit, and the target execution unit is an idle execution unit among the multiple execution units; and emit the target execution instruction to the target execution unit;

[0015] The target execution unit is used to execute the target execution instruction and obtain the target execution result.

[0016] According to a fourth aspect of an embodiment of this specification, a computing device is provided, comprising the processor provided in the third aspect above.

[0017] An instruction processing method provided by an embodiment of the present specification is applied to a distribution unit in a processor, and the processor includes a distribution unit and multiple execution units; the instruction processing method includes: obtaining instructions to be executed; storing the instructions to be executed in the transmission queue according to the current storage identifier of the transmission queue, wherein the transmission queue includes multiple instruction sequences, the instruction sequence includes multiple sequentially transmitted instructions, and the multiple instruction sequences correspond to different execution units; reading the target execution instruction from the instruction sequence corresponding to the target execution unit according to the current instruction pointer of the target execution unit, wherein the target execution unit is an idle execution unit among the multiple execution units; transmitting the target execution instruction to the target execution unit, and obtaining the target execution result output by the target execution unit. Since multiple instruction sequences correspond to different execution units, the instructions in different instruction sequences can be executed in parallel, and the instructions that can be executed in parallel are mixed and stored in the transmission queue, so that the instructions in the transmission queue are transmitted out of order, the congestion problem during the transmission of first-in-first-out instructions is avoided, and the instruction processing efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flow chart of an instruction processing method provided by an embodiment of this specification;

[0019] Figure 2 is a flow chart of another instruction processing method provided by an embodiment of this specification;

[0020] Figure 3 is a processing flow chart of an instruction processing method provided by an embodiment of this specification;

[0021] Figure 4 is a schematic diagram of a transmission queue in an instruction processing method provided by an embodiment of the present specification;

[0022] Figure 5 is a schematic diagram of the structure of a processor provided by an embodiment of this specification;

[0023] Figure 6 is a schematic diagram of the structure of another processor provided by an embodiment of this specification;

[0024] Figure 7 It is a structural diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION

[0025] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.

[0026] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0027] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0028] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0029] First, the terms involved in one or more embodiments of this specification are explained.

[0030] Superscalar Architecture: A microprocessor design technology that allows the processor to execute multiple instructions in one clock cycle, thereby improving the processor's throughput. In traditional non-superscalar processors, usually only one instruction can be executed per clock cycle. Superscalar processors achieve instruction-level parallel processing by building in multiple execution units (such as arithmetic logic units, floating-point units, etc.) and complex instruction scheduling logic.

[0031] Issue Queue: It is a key component in a superscalar processor. The issue queue is responsible for storing instructions that are ready (i.e. all operands are ready and there is no data risk) but have not yet been sent to the execution unit (FU) for execution. After the instruction is processed by register renaming and other processes from the fetch and decode stages, if the instruction meets the issue condition, it will be transferred to the issue queue and wait for execution. The instructions in the issue queue are usually selected according to a certain strategy (such as priority, shortest execution time first, etc.) and sent to the corresponding execution unit for execution.

[0032] Very Long Instruction Word (VLIW): Instruction multi-issue in VLIW architecture is static and relies on the compiler to arrange parallel instructions. In a VLIW processor, multiple operations can be packed into a very long instruction word, which contains multiple operations, and these operations are issued simultaneously in the processor.

[0033] Issue Clusters: refers to issuing instructions in groups, each group has its own set of functional units.

[0034] Parallel Vector Processors: Vector processors can perform the same operation on multiple data elements in a single instruction. A parallel vector processor has multiple such execution units, so it can perform separate operations on multiple vectors in parallel.

[0035] First In First Out (FI FO): The addition (entry) and removal (deletion) of elements in a queue follow the first-in-first-out principle, that is, new elements are added to the end of the queue, and removal occurs at the front of the queue.

[0036] Multiple-issue: Multiple instructions are issued in a single clock cycle.

[0037] Out-of-order execution: The execution unit can execute instructions out of their original order.

[0038] Sequential write back: Write back in the original order of instructions.

[0039] For general processors, the prepared instructions can be sent to the execution unit for execution. For simple sequential execution processors, instructions are written to the emission queue in the original order of the program. At this time, the emission queue is equivalent to a FIFO, and only the oldest instruction is emitted each time. If the oldest instruction is not emitted, other instructions will also be blocked. For superscalar processors with out-of-order execution superscalar architecture, after the instructions arrive in the emission queue, they will not be sent to the execution unit one by one in the original order of the program. As long as the instructions are ready and meet the emission conditions, they can be emitted to the execution unit. Therefore, there is a situation where the later instructions are emitted first and executed first.

[0040] Currently, out-of-order instruction transmission can be achieved through the following two schemes. The first is the compressed queue transmission method: when an instruction is selected and leaves the transmission queue, a "gap" will appear, and all instructions above this instruction will move down one grid to fill the "gap". However, in the first scheme, after each instruction is issued, the subsequent instructions need to be moved forward, which consumes a lot of power, and when multiple instructions are issued, the forward position of the subsequent instructions needs to be judged. The circuit design is complex and difficult to expand, and the instruction processing efficiency is low. The second is the non-compressed queue two-by-two comparison multiple-choice method: each instruction is numbered in the original order and marked whether it is valid. Each time it is issued, the instructions are compared two by two to find the oldest instruction. However, the second scheme requires multi-level arbitration circuits and a longer path, resulting in low instruction processing efficiency.

[0041] In order to solve the above problems, the embodiment of this specification proposes a superscalar architecture instruction multi-issue scheme. Specifically, obtain the instruction to be executed; store the instruction to be executed in the emission queue according to the current storage identifier of the emission queue, wherein the emission queue includes multiple instruction sequences, the instruction sequence includes multiple sequentially emitted instructions, and the multiple instruction sequences correspond to different execution units; read the target execution instruction from the instruction sequence corresponding to the target execution unit according to the current instruction pointer of the target execution unit, wherein the target execution unit is an idle execution unit among multiple execution units; emit the target execution instruction to the target execution unit, and obtain the target execution result output by the target execution unit. In particular, the scheme proposed in the embodiment of this specification does not require the instruction shift operation after each instruction is emitted, and the power consumption is lower. In addition, when there are multiple parallel execution units, the expansion is more convenient. At the same time, the scheme proposed in the embodiment of this specification does not need to compare instructions in pairs, saves multi-stage series selectors and comparators, and only needs to fetch instructions according to the storage identifier. The circuit design is simple and the expansion is convenient, and the mixed storage, multi-issue and out-of-order execution of multiple parallel instructions are realized, which improves the instruction processing efficiency.

[0042] In this specification, an instruction processing method is provided. This specification also relates to a processor and a computing device, which are described in detail one by one in the following embodiments.

[0043] See also Figure 1 , Figure 1 A flowchart of an instruction processing method provided by an embodiment of the present specification is shown. The instruction processing method is applied to a distribution unit in a processor, and the processor includes a distribution unit and multiple execution units. The method specifically includes the following steps:

[0044] Step 102: Obtain instructions to be executed.

[0045] Specifically, the instructions to be executed refer to instructions used to complete tasks such as calculation, data processing, control flow management, and system interaction. The instructions to be executed include but are not limited to arithmetic and logic operation instructions, data transmission instructions, and control transfer instructions. Among them, arithmetic and logic operation instructions include but are not limited to basic mathematical operations (such as addition, subtraction, multiplication, division, etc.) instructions, logical operations (such as AND, OR, NOT, XOR, etc.) instructions. Data transmission instructions include instructions for loading data from memory to registers, instructions for storing data in registers to memory, data transfer instructions between registers, etc. Control transfer instructions include unconditional jump instructions, conditional jump instructions, loop control instructions, etc.

[0046] It should be noted that the processor includes but is not limited to the core processor (CPU, Central Processing Unit) and the image processor (GPU, Graphics Processing Unit). The processor is the core component of the computer system, responsible for executing instructions in the computer program and performing data processing. It drives the operation of the computer system by performing arithmetic and logical operations, control flow management, memory access and other operations. The processor contains multiple units, such as the distribution unit and various execution units, which work together to complete a series of operations such as instruction fetching, decoding, distribution, execution, memory access and write back of instructions. The distribution unit (Dispatch Unit) is an important component of the processor, located after the decoding unit and before the execution unit. The distribution unit is used to dynamically assign instructions to the corresponding execution unit for processing according to the instruction status in the instruction queue and the availability of the execution unit. The distribution unit optimizes the execution order of instructions by considering the data dependency between instructions, the occupancy of the execution unit and the possible out-of-order execution strategy to improve the overall efficiency and throughput of the processor. The execution unit (Execut ion Unit) is the unit inside the processor responsible for directly executing instructions. The execution unit may include an arithmetic logic unit, a floating point unit, a branch execution unit, a load / store unit, etc. Each execution unit is configured to process a specific type of operation, such as addition, subtraction, multiplication, division, logical operations, floating point operations, data loading and storage, etc. After the dispatch unit assigns the instruction to the execution unit, the execution unit will perform the corresponding calculation or operation according to the requirements of the instruction, and may update the status of the processor, such as modifying the flag register or writing it back to the register file.

[0047] In practical applications, there are many ways to obtain instructions to be executed, which are selected according to actual conditions, and the embodiments of this specification do not limit this. In one possible implementation of this specification, instructions to be executed sent by a decoding unit in a processor can be received. In another possible implementation of this specification, instructions to be executed can be read from an instruction set (such as a Risc-V instruction set), wherein the instruction set includes multiple instructions that can be understood by the processor.

[0048] In an optional embodiment of the present specification, the instructions to be executed may be instructions in different tasks, such as voice tasks, image tasks, etc. Taking the voice task as an example, the above-mentioned acquisition of the instructions to be executed may include the following steps:

[0049] In response to a task processing request for a voice task, an instruction to be executed of the voice task is obtained.

[0050] Specifically, a speech task refers to a task for analyzing, converting, synthesizing, and understanding speech. A speech task may be a task in the fields of natural language processing, artificial intelligence, communication technology, human-computer interaction, etc. Speech tasks include, but are not limited to, speech recognition tasks, speech synthesis tasks, speech noise reduction tasks, and speech enhancement tasks. The instructions to be executed in a speech task include, but are not limited to, filtering instructions and Fourier transform instructions for speech signals.

[0051] By applying the solution of the embodiments of this specification, the to-be-executed instructions of the voice task are obtained, so that the instruction processing method proposed in the embodiments of this specification can be used to realize multiple issuance and out-of-order execution of instructions for the voice task, thereby improving the instruction processing efficiency in the voice task.

[0052] Step 104: store the to-be-executed instruction into the transmit queue according to the current storage identifier of the transmit queue, wherein the transmit queue includes a plurality of instruction sequences, the instruction sequence includes a plurality of sequentially-issued instructions, and the plurality of instruction sequences correspond to different execution units.

[0053] Specifically, the transmission queue includes multiple storage locations, each storage location corresponds to a storage identifier, that is, the transmission queue maintains a storage identifier sequence, the storage identifier sequence can be called a write data sequence, each storage identifier stored in the storage identifier sequence can be called a write data sequence number, and the storage identifier is used to identify the storage location in the transmission queue. When storing the to-be-executed instructions in the transmission queue, the to-be-executed instructions can be sequentially stored in the transmission queue according to the storage identifiers of the transmission queue.

[0054] Exemplarily, it is assumed that the emission queue includes two instruction sequences, which are instruction sequence A and instruction sequence B, respectively. The instructions in instruction sequence A are processed by execution unit A, and the instructions in instruction sequence B are processed by execution unit B. Therefore, instruction sequence A can be regarded as an emission combination, and instruction sequence B can be regarded as an emission combination. Instruction sequence A includes instruction A1, instruction A3 and instruction A4. Instruction sequence B includes instruction B2 and instruction B5. In the emission queue, the instructions in the two instruction sequences are stored in the order of instruction A1, instruction B2, instruction A3, instruction A4, and instruction B5. For instruction sequence A, the instructions are executed in the order of executing instruction A1 first, then executing instruction A3, and finally executing instruction A4. For instruction sequence B, the instructions are executed in the order of executing instruction B2 first and finally executing instruction B5. It is worth noting that instruction sequence A can include instructions that are executed in parallel with instructions in instruction sequence B, for example, instruction A3 can be executed in parallel with instruction B2.

[0055] In an optional embodiment of the present specification, storing the to-be-executed instruction in the transmit queue according to the current storage identifier of the transmit queue may include the following steps:

[0056] According to the current storage identifier of the transmission queue, the storage position of the instruction to be executed in the transmission queue is determined, and the instruction to be executed is stored in the storage position.

[0057] Exemplarily, it is assumed that the current storage identifier of the transmission queue is 0. The transmission queue includes three storage locations, which are storage location 0, storage location 1, and storage location 2. After obtaining the instruction to be executed A1, it can be determined that the storage location of the instruction to be executed A1 is the storage location 0 corresponding to the current storage identifier 0 according to the current storage identifier 0, and the instruction to be executed A1 can be stored in the storage location 0. After the instruction to be executed A1 is stored in the storage location 0, the current storage identifier of the transmission queue can be updated to the storage identifier 1 located after the storage identifier 0. Then, after obtaining the instruction to be executed B2, it can be determined that the storage location of the instruction to be executed B2 is the storage location 1 corresponding to the current storage identifier 1 according to the current storage identifier 1, and the instruction to be executed B2 can be stored in the storage location 1. After the instruction to be executed B2 is stored in the storage location 1, the current storage identifier of the transmission queue can be updated to the storage identifier 2 located after the storage identifier 1.

[0058] By applying the solution of the embodiments of this specification, by storing the to-be-executed instructions according to the current storage identifier of the transmission queue, the instructions are sequentially stored in the transmission queue according to the acquisition time of the to-be-executed instructions. Moreover, since the sequentially stored instructions may belong to different instruction sequences, the storage of different instruction sequences in the transmission queue is achieved.

[0059] Step 106: Read a target execution instruction from an instruction sequence corresponding to the target execution unit according to the current instruction pointer of the target execution unit, wherein the target execution unit is an idle execution unit among the multiple execution units.

[0060] Specifically, each execution unit in the processor corresponds to an instruction pointer. The instruction pointer is used to indicate the storage location of the first instruction and the last instruction in the instruction sequence corresponding to the execution unit. The dispatch unit can determine the storage location of the instruction currently to be executed by the execution unit from the emission queue based on the current instruction pointer of the execution unit. The target execution instruction refers to the instruction currently to be executed by the target execution unit.

[0061] In practical applications, the target execution unit may be one or more. For example, it is assumed that the processor includes three execution units, which are execution unit A, execution unit B, and execution unit C. Among them, execution unit B and execution unit C are idle execution units, and the target execution units are execution unit B and execution unit C. Further, instruction B2 can be read from instruction sequence B corresponding to execution unit B according to the current instruction pointer of execution unit B, and instruction C4 can be read from instruction sequence C corresponding to execution unit C according to the current instruction pointer of execution unit C, and the target execution instructions are instruction B2 and instruction C4. Further, an ultra-long instruction word can be constructed based on instruction B2 and instruction C4 to realize the simultaneous transmission of instruction B2 and instruction C4.

[0062] It should be noted that since the instructions in the same instruction sequence must be executed sequentially, if the execution unit corresponding to the instruction sequence is in a working state, it means that the execution unit has not yet completed executing the instructions. At this time, the distribution unit does not send the instructions in the instruction sequence to the execution unit.

[0063] In an optional embodiment of the present specification, according to the current instruction pointer of the target execution unit, before reading the target execution instruction from the instruction sequence corresponding to the target execution unit, the unit status of multiple execution units can be obtained, and the idle execution unit can be screened out from the multiple execution units according to the unit status of the multiple execution units, and the idle execution unit can be determined as the target execution unit. Among them, the unit status includes a working state and an idle state. If the unit status of the execution unit is a working state, it means that the execution unit is a non-idle execution unit. If the unit status of the execution unit is an idle state, it means that the execution unit is an idle execution unit.

[0064] Step 108: Send the target execution instruction to the target execution unit, and obtain the target execution result output by the target execution unit.

[0065] It should be noted that after the distribution unit reads the target execution instruction from the instruction sequence corresponding to the target execution unit, it can transmit the target execution instruction to the corresponding target execution unit, and the target execution unit executes the target execution instruction to obtain the target execution result.

[0066] Exemplarily, referring to the example of step 106, the distribution unit can simultaneously send instruction B2 to execution unit B and instruction C4 to execution unit C. Execution unit B executes instruction B2 and outputs target execution result B2 corresponding to instruction B2. At the same time, execution unit C executes instruction C4 and outputs target execution result C4 corresponding to instruction C4.

[0067] By applying the solution of the embodiments of this specification, since multiple instruction sequences correspond to different execution units, instructions in different instruction sequences can be executed in parallel, and the instructions that can be executed in parallel are mixed and stored in the transmission queue, thereby realizing out-of-order transmission of instructions in the transmission queue, avoiding congestion problems during first-in-first-out instruction transmission, and improving instruction processing efficiency.

[0068] In an optional embodiment of the present specification, the execution unit carries an instruction pointer, the instruction pointer includes a tail pointer, and the tail pointer is used to identify the storage location of the last instruction in the instruction sequence corresponding to the execution unit; after storing the to-be-executed instruction in the emission queue according to the current storage identifier of the emission queue, the following steps may also be included:

[0069] According to the storage position of the to-be-executed instruction in the issue queue, the tail pointer of the execution unit corresponding to the to-be-executed instruction is updated.

[0070] It should be noted that since the tail pointer is used to identify the storage position of the last instruction in the instruction sequence corresponding to the execution unit, when the distribution unit obtains a new instruction to be executed (an instruction not yet stored in the transmission queue) and stores the new instruction to be executed in the transmission queue, since the instructions in the instruction sequence are arranged in the order of storage, the last instruction in the instruction sequence has changed. At this time, the storage position of the new instruction to be executed in the transmission queue can be used as the updated tail pointer of the execution unit.

[0071] By applying the solution of the embodiments of this specification, the tail pointer of the execution unit corresponding to the to-be-executed instruction is updated according to the storage position of the to-be-executed instruction in the transmission queue, thereby ensuring that the tail pointer can be updated in real time according to the storage of the to-be-executed instruction in the instruction sequence, making the tail pointer more accurate and further making the instructions in the instruction sequence more transparent.

[0072] In an optional embodiment of the present specification, the execution unit carries an instruction pointer, the instruction pointer includes a read pointer, and the read pointer is used to identify the storage location of the first instruction in the instruction sequence corresponding to the execution unit; after transmitting the target execution instruction to the target execution unit and obtaining the target execution result output by the target execution unit, the following steps may also be included:

[0073] A read pointer of a target execution unit is updated according to a storage position of a first instruction in an issue queue, wherein the first instruction and the target execution instruction are located in the same instruction sequence and the first instruction is a next instruction of the target execution instruction.

[0074] It should be noted that since the read pointer is used to identify the storage position of the first instruction in the instruction sequence corresponding to the execution unit, after the distribution unit transmits the target execution instruction to the target execution unit, the instruction sequence will no longer include the target execution instruction. Since the instructions in the instruction sequence are transmitted sequentially, the first instruction in the instruction sequence corresponding to the target execution unit has changed. At this time, the storage position of the first instruction after the target execution instruction in the instruction sequence corresponding to the target execution unit can be used as the updated read pointer of the execution unit, that is, the read pointer of the target execution unit is updated according to the storage position of the first instruction in the transmission queue.

[0075] By applying the solution of the embodiment of this specification, the read pointer of the target execution unit is updated according to the storage position of the first instruction in the transmission queue, so as to ensure that the read pointer can be updated in real time according to the transmission of the target execution instruction, making the read pointer more accurate and further making the instructions in the instruction sequence more transparent.

[0076] In an optional embodiment of the present specification, after storing the to-be-executed instruction in the transmit queue according to the current storage identifier of the transmit queue, the following steps may also be included:

[0077] According to the storage position of the instruction to be executed in the transmission queue, an instruction read identifier of the second instruction is configured, wherein the second instruction and the instruction to be executed are in the same instruction sequence, and the second instruction is the previous instruction of the instruction to be executed, and the instruction read identifier is used to identify the storage position of the next instruction of the second instruction.

[0078] Specifically, the transmission queue includes multiple storage locations, each storage location corresponds to an instruction read identifier. The instruction read identifier is used to identify the storage location of the next instruction of the instruction stored in the corresponding storage location. The instruction read identifiers corresponding to all storage locations in the transmission queue can form an address linked list (also called a read data linked list), and the instructions to be executed in the same execution sequence are connected in series in the form of an address linked list.

[0079] It should be noted that before the distribution unit stores the to-be-executed instruction in the emission queue, the second instruction is the last instruction in the instruction sequence. Since there is no instruction after the second instruction, the instruction read identifier corresponding to the second instruction is empty. After the distribution unit stores the to-be-executed instruction in the emission queue, a new to-be-executed instruction is added after the second instruction. At this time, the instruction read identifier of the second instruction can be configured according to the storage location of the newly added to-be-executed instruction, that is, the storage location of the newly added to-be-executed instruction is used as the instruction read identifier of the second instruction.

[0080] Furthermore, since each instruction stored in the transmission queue corresponds to an instruction read identifier (empty or the storage location of the next instruction), the instruction read identifier is used to identify the storage location of the next instruction. Therefore, after the distribution unit transmits an instruction to the execution unit, it can determine the storage location of the next instruction to be transmitted based on the instruction read identifier of the transmitted instruction.

[0081] By applying the solution of the embodiment of this specification, by configuring an instruction read identifier for each instruction in the transmission queue, the next instruction to be sent can be quickly determined according to the instruction read identifier after the instruction is transmitted, thereby improving the instruction transmission efficiency.

[0082] In an optional embodiment of the present specification, the execution unit carries an instruction pointer, the instruction pointer includes a read pointer, and the read pointer is used to identify the storage location of the first instruction in the instruction sequence corresponding to the execution unit; after transmitting the target execution instruction to the target execution unit and obtaining the target execution result output by the target execution unit, the following steps may also be included:

[0083] The read pointer of the target execution unit is updated according to the instruction read identifier of the target execution instruction.

[0084] It should be noted that each instruction stored in the transmission queue corresponds to an instruction read identifier, and the instruction read identifier corresponding to each instruction is used to identify the storage location of the next instruction of each instruction (if the instruction read identifier is empty, it means that there is no next instruction). After the target execution instruction is transmitted, since the instructions in the instruction sequence are transmitted sequentially, the next instruction of the target execution instruction is the first instruction in the instruction sequence. Therefore, the instruction read identifier of the target execution instruction can identify the storage location of the first instruction in the instruction sequence. At the same time, since the read pointer is used to identify the storage location of the first instruction in the instruction sequence corresponding to the execution unit, the instruction read identifier of the target execution instruction can be used as the read pointer of the target execution unit.

[0085] By applying the solution of the embodiment of this specification, the read pointer of the target execution unit is updated by reading the instruction identifier according to the target execution instruction, ensuring that the read pointer can be updated in real time according to the transmission of the target execution instruction, making the read pointer more accurate and further making the instructions in the instruction sequence more transparent.

[0086] In an optional embodiment of the present specification, after transmitting the target execution instruction to the target execution unit and obtaining the target execution result output by the target execution unit, the following steps may also be included:

[0087] Determine an updated target execution instruction according to an instruction reading identifier of the target execution instruction;

[0088] Return to the step of transmitting the target execution instruction to the target execution unit and obtaining the target execution result output by the target execution unit until the target instruction sequence is empty, and obtain the sequence execution result corresponding to the target instruction sequence, wherein the target instruction sequence is the instruction sequence where the target execution instruction is located.

[0089] Specifically, the updated target execution instruction refers to the instruction stored in the storage location identified by the instruction read identifier of the target execution instruction.

[0090] It should be noted that after the distribution unit transmits the target execution instruction to the target execution unit, and the target execution unit executes the target execution instruction and obtains the target execution result, it means that the target execution unit has completed the instruction processing, and the unit state of the target execution unit at this time is idle, that is, the target execution unit at this time is an idle execution unit, and can continue to process new target execution instructions. Therefore, the distribution unit can determine the updated target execution instruction according to the instruction reading identifier of the target execution instruction, transmit the updated target execution instruction to the target execution unit, and obtain the target execution result of the updated target execution instruction output by the target execution unit. The above steps can be iteratively performed until the instruction sequence to which the target execution instruction belongs (that is, the target execution sequence) is empty, indicating that the target execution sequence does not include instructions that need to be processed by the target execution unit. At this time, the instruction processing of the target execution sequence can be ended, and the execution results of all instructions in the target execution instruction sequence can be obtained.

[0091] By applying the solution of the embodiment of this specification, the instructions in the target instruction sequence are executed according to the instruction read identifier of the target execution instruction, thereby ensuring the sequential execution of the instructions in the target instruction sequence.

[0092] See also Figure 2 , Figure 2 A flowchart of another instruction processing method provided by an embodiment of the present specification is shown. The instruction processing method is applied to a target execution unit in a processor. The processor includes a distribution unit and multiple execution units. The target execution unit is an idle execution unit among the multiple execution units. The method specifically includes the following steps:

[0093] Step 202: Receive a target execution instruction emitted by a distribution unit, wherein the distribution unit includes a transmission queue, the transmission queue includes multiple instruction sequences, the instruction sequence includes multiple sequentially emitted instructions, the multiple instruction sequences correspond to different execution units, and the target execution instruction is read by the distribution unit from the instruction sequence corresponding to the target execution unit according to the current instruction pointer of the target execution unit.

[0094] Step 204: Execute the target execution instruction to obtain the target execution result.

[0095] It should be noted that the implementation of step 202 to step 204 is the same as the implementation of step 102 to step 108 described above, and will not be described in detail in the embodiments of this specification.

[0096] By applying the solution of the embodiments of this specification, since multiple instruction sequences correspond to different execution units, instructions in different instruction sequences can be executed in parallel, and the instructions that can be executed in parallel are mixed and stored in the transmission queue, thereby realizing out-of-order transmission of instructions in the transmission queue, avoiding congestion problems during first-in-first-out instruction transmission, and improving instruction processing efficiency.

[0097] In an optional embodiment of the present specification, the processor further includes a write-back unit (Write-Back Unit), the target execution result carries an instruction sequence identifier, and the instruction sequence identifier is used to guide the write-back unit to sequentially output the target execution result; after executing the target execution instruction and obtaining the target execution result, the following steps may also be included:

[0098] According to the instruction sequence identifier, the target execution result is stored in the write-back unit.

[0099] Specifically, the instruction sequence identifier is used to identify the original sequence of instructions in the program.

[0100] It should be noted that the target execution result refers to the instruction execution result of the target execution instruction. Since the instruction processing method proposed in the embodiment of this specification supports the out-of-order transmission of instructions in the transmission queue, and the address lists of multiple instructions are independent of each other, the instructions first obtained by the distribution unit may be executed later during execution. Since the final execution effect of the program needs to be consistent with the result of the sequential execution of the instructions (the sequential consistency of the results), even if the instructions can be executed out of order inside the processor, from the logic of the program itself, the execution effect of the instructions needs to maintain the same result as if they were executed in sequence. Therefore, after the target execution unit executes the target execution instruction and obtains the target execution result, it is necessary to restore the original order in the write-back unit, that is, according to the instruction sequence identifier, the target execution result of the target execution instruction is stored in the write-back unit.

[0101] By applying the solution of the embodiment of this specification, the target execution result is stored in the write-back unit according to the instruction sequence identifier, and the sequential write-back of the instruction execution result is achieved while the instructions are issued out of order.

[0102] See also Figure 3 , Figure 3 A flowchart of a processing method for processing an instruction provided by an embodiment of the present specification is shown. Figure 3As shown, the write-back unit can write the instruction execution results (such as result 0, result 1,..., result n) sent by multiple execution units (such as execution unit A and execution unit B) into the corresponding positions in the register according to the instruction sequence identifier (such as 0, 1,..., n). When the register outputs the instruction execution result, the output is blocked according to the instruction sequence identifier. For example, if result 1 is written to the register but result 0 is not written, result 1 cannot be output. Only after result 0 is written to the register, result 0 is output first and then result 1 is output.

[0103] See also Figure 4 , Figure 4 A schematic diagram of an emission queue in an instruction processing method provided by an embodiment of the present specification is shown. Taking a dual-emission 8-level cache as an example, the emission queue includes 8 storage locations (storage location 0 to storage location 7), and each storage location corresponds to a storage identifier (storage identifier 0, storage identifier 1, ..., storage identifier 7) and an instruction read identifier. Read pointer A and tail pointer A are instruction pointers of execution unit A, and read pointer B and tail pointer B are instruction pointers of execution unit B. Among them, when the instruction read identifier is 8, it means that the instruction read identifier is empty, and when the read pointer and tail pointer are 8, it means that the read pointer and tail pointer are empty. Figure 4 The storage identifier with a slash is the current storage identifier of the transmit queue, and the storage location with a horizontal line indicates that the instruction stored in the storage location has been transmitted to the corresponding execution unit. Figure 4 , detailed description of different instruction processing situations.

[0104] Initial state: In the initial state, the transmission queue is empty, and the current storage identifier of the transmission queue is storage identifier 0.

[0105] Store instruction A0 to the emission queue: store instruction A0 to storage location 0 according to the current storage identifier 0. Since the execution unit corresponding to instruction A0 is execution unit A, both the read pointer A and the tail pointer A are updated to 0. Update the current storage identifier 0 to the storage identifier 1 corresponding to the next storage location 1 of storage location 0;

[0106] Instruction A0 is sent to execution unit A, and instruction A1 is stored in the emission queue: instruction A1 is stored in storage location 1 according to the current storage identifier 1. Since the execution unit corresponding to instruction A1 is execution unit A, and instruction A0 has been sent out, the instruction sequence A in the emission queue now includes instruction A1, so the read pointer A and the tail pointer A are both updated to 1. The current storage identifier 1 is updated to the storage identifier 2 corresponding to the next storage location 2 of storage location 1;

[0107] Store instruction B2 to the emission queue: store instruction B2 to storage location 2 according to the current storage identifier 2. Since the execution unit corresponding to instruction B2 is execution unit B, both the read pointer B and the tail pointer B are updated to 2. Update the current storage identifier 2 to the storage identifier 3 corresponding to the next storage location 3 of storage location 2;

[0108] Store instruction B3 in the emission queue: store instruction B3 in storage location 3 according to the current storage identifier 3. Since the execution unit corresponding to instruction B3 is execution unit B, the instruction sequence B in the emission queue now includes instructions B2 and B3. Therefore, the read pointer B is still 2, the tail pointer B is updated to 3, and the instruction read identifier of instruction B2 is updated to 3. Update the current storage identifier 3 to the storage identifier 4 corresponding to the next storage location 4 of storage location 3;

[0109] Instruction B2 is sent to execution unit B, and instruction B4 is stored in the emission queue: instruction B4 is stored in storage location 4 according to the current storage identifier 4. Since the execution unit corresponding to instruction B4 is execution unit B, and instruction B2 has been sent out, the instruction sequence B in the emission queue now includes instructions B3 and B4. Therefore, the read pointer B is updated to 3, the tail pointer B is updated to 4, the instruction storage identifier of instruction B2 is updated to 8, the instruction read identifier of instruction B3 is updated to 4, and the storage identifier of storage location 1 is updated to 2. The current storage identifier 4 is updated to the storage identifier 5 corresponding to the next storage location 5 of storage location 4;

[0110] Store instruction B5 in the emission queue: store instruction B5 in storage position 5 according to the current storage identifier 5. Since the execution unit corresponding to instruction B5 is execution unit B, the instruction sequence B in the emission queue now includes instructions B3, B4 and B5. Therefore, the read pointer B is still 3, the tail pointer B is updated to 5, and the instruction read identifier of instruction B4 is updated to 5. Update the current storage identifier 5 to the storage identifier 6 corresponding to the next storage position 6 of storage position 5;

[0111] Store instruction B6 in the emission queue: store instruction B6 in storage position 6 according to the current storage identifier 6. Since the execution unit corresponding to instruction B6 is execution unit B, the instruction sequence B in the emission queue now includes instructions B3, B4, B5 and B6. Therefore, the read pointer B is still 3, the tail pointer B is updated to 6, and the instruction read identifier of instruction B5 is updated to 6. Update the current storage identifier 6 to the storage identifier 7 corresponding to the next storage position 7 of storage position 6;

[0112] Store instruction A7 to the emission queue: store instruction A7 to storage location 7 according to the current storage identifier 7. Since the execution unit corresponding to instruction A7 is execution unit A, the instruction sequence A in the emission queue now includes instruction A1 and instruction A7. Therefore, the read pointer A is still 1, the tail pointer A is updated to 7, and the instruction read identifier of instruction A1 is updated to 7. Update the current storage identifier 7 to the storage identifier 0 corresponding to the next storage location 0 of storage location 7;

[0113] Instruction A1 is emitted to execution unit A, and instruction B3 is emitted to execution unit B: since the execution unit corresponding to instruction A1 is execution unit A, and instruction A1 has been emitted, the instruction sequence A in the emission queue now includes instruction A7, therefore, the read pointer A is updated to 7, the tail pointer A remains 7, the instruction read flag of instruction A1 is updated to 8, and the storage flag of storage location 2 is updated to 1; since the execution unit corresponding to instruction B3 is execution unit B, and instruction B3 has been emitted, the instruction sequence B in the emission queue now includes instruction B4, instruction B5 and instruction B6, therefore, the read pointer B is updated to 4, the tail pointer B remains 6, and the instruction read flag of instruction B3 is updated to 8;

[0114] Store instruction B8 to the emission queue: store instruction B8 to storage location 0 according to the current storage identifier 0. Since the execution unit corresponding to instruction B8 is execution unit B, the instruction sequence B in the emission queue now includes B4, instruction B5, instruction B6 and instruction B8. Therefore, the read pointer B is still 4, the tail pointer B is updated to 0, and the instruction read identifier of instruction B6 is updated to 0. Update the current storage identifier 0 to the storage identifier 2 corresponding to the next storage location 1 of storage location 0;

[0115] Instruction A7 is sent to execution unit A: Since the execution unit corresponding to instruction A7 is execution unit A and instruction A7 has been sent out, the instruction sequence A in the send queue is empty at this time. Therefore, the read pointer A and the tail pointer A are both updated to 8, and the storage flag of storage location 4 is updated to 7.

[0116] Store instruction A9 to the emission queue: store instruction A9 to storage location 2 according to the current storage identifier 2. Since the execution unit corresponding to instruction A9 is execution unit A, the instruction sequence A in the emission queue includes A9 at this time, so the read pointer A is updated to 2, and the tail pointer A is updated to 2. Update the current storage identifier 2 to the storage identifier 1 corresponding to the next storage location 2 of storage location 1;

[0117] Store instruction A10 in the emission queue: store instruction A10 in storage location 1 according to the current storage identifier 1. Since the execution unit corresponding to instruction A10 is execution unit A, the instruction sequence A in the emission queue now includes A9 and instruction A10. Therefore, the read pointer A is still 2, the tail pointer A is updated to 1, and the instruction read identifier of instruction A9 is updated to 1. Update the current storage identifier 1 to the storage identifier 3 corresponding to the next storage location 3 of storage location 2;

[0118] Store instruction A11 in the emission queue: store instruction A11 in storage location 3 according to the current storage identifier 3. Since the execution unit corresponding to instruction A11 is execution unit A, the instruction sequence A in the emission queue now includes A9, instruction A10 and instruction A11. Therefore, the read pointer A is still 2, the tail pointer A is updated to 3, and the instruction read identifier of instruction A10 is updated to 3. Update the current storage identifier 3 to the storage identifier 7 corresponding to the next storage location 4 of storage location 3;

[0119] Store instruction B12 in the emission queue: store instruction B12 in storage location 7 according to the current storage identifier 7. Since the execution unit corresponding to instruction B12 is execution unit B, the instruction sequence B in the emission queue now includes B4, instruction B5, instruction B6, instruction B8 and instruction B12. Therefore, the read pointer B is still 4, the tail pointer B is updated to 7, and the instruction read identifier of instruction B8 is updated to 7. Update the current storage identifier 7 to the storage identifier 5 corresponding to the next storage location 5 of storage location 4. In addition, the emission queue is full at this time and no new instructions can be stored.

[0120] It is worth mentioning that when the distribution unit receives an instruction, it sends it to the transmission queue, and writes the storage location of the oldest instruction in the instruction sequence into the read pointer of the execution unit corresponding to the instruction sequence. When an instruction from the same execution unit arrives again, the instruction is stored in the corresponding storage location according to the storage identifier, and the storage location is stored in the instruction read identifier of the previous instruction. Similarly, the instructions of the same execution unit are connected in series in the form of a data linked list.

[0121] See also Figure 5 , Figure 5 A schematic diagram of the structure of a processor provided by an embodiment of the present specification is shown, and the processor includes a distribution unit 502 and multiple execution units 504;

[0122] The distribution unit 502 is used to obtain instructions to be executed; store the instructions to be executed in the emission queue according to the current storage identifier of the emission queue, wherein the emission queue includes multiple instruction sequences, the instruction sequence includes multiple instructions to be emitted in sequence, and the multiple instruction sequences correspond to different execution units 504; read the target execution instruction from the instruction sequence corresponding to the target execution unit 5042 according to the current instruction pointer of the target execution unit 5042, and the target execution unit 5042 is an idle execution unit among the multiple execution units 504; and emit the target execution instruction to the target execution unit 5042;

[0123] The target execution unit 5042 is used to execute the target execution instruction and obtain the target execution result.

[0124] By applying the solution of the embodiments of this specification, since multiple instruction sequences correspond to different execution units, instructions in different instruction sequences can be executed in parallel, and the instructions that can be executed in parallel are mixed and stored in the emission queue, thereby realizing out-of-order emission of instructions in the emission queue and avoiding congestion problems during first-in-first-out instruction emission. Therefore, by constructing a parallel vector processor with the above functions, instruction processing is made more efficient.

[0125] The above is a schematic solution of a processor of this embodiment. It should be noted that the technical solution of the processor and the technical solution of the above instruction processing method belong to the same concept, and the details of the technical solution of the processor that are not described in detail can all be referred to the description of the technical solution of the above instruction processing method.

[0126] See also Figure 6 , Figure 6 A schematic diagram of the structure of another processor provided by an embodiment of the present specification is shown, and the processor includes an instruction fetch unit (Instruction Fetch Unit), a decoding unit (Decode Unit), a distribution unit, a register, an execution unit and a write-back unit.

[0127] like Figure 6As shown, the instruction fetch unit is used to retrieve the instruction to be executed from the memory. The decoding unit is used to receive the instruction sent by the instruction fetch unit and convert it into a format that the processor can understand and operate. The distribution unit is used to receive the instruction sent by the decoding unit, read and write the corresponding operand from the register, and then transmit the instruction to the execution unit through the instruction processing method proposed in the embodiment of this specification. After the execution unit completes the execution of the instruction, it inputs the instruction execution result into the write-back unit, restores the original order in the write-back unit and performs the write-back operation. It should be noted that the write-back unit has a cache function, and the write-back unit can back-pressure the decoding unit after the cache is full according to the empty / full state of the cache, so that the decoding unit stops working. Similarly, the distribution unit can back-pressure the decoding unit after the cache of the transmission queue is full according to the empty / full state of the transmission queue, so that the decoding unit stops working.

[0128] See also Figure 7 , Figure 7 The schematic diagram of the structure of a computing device provided by an embodiment of the present specification is shown. The components of the computing device include but are not limited to a processor 702.

[0129] It should be understood that Figure 7 The schematic diagram of the computing device structure shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0130] The above is a schematic solution of a computing device of this embodiment. It should be noted that the technical solution of the computing device and the technical solution of the above processor belong to the same concept, and the details of the technical solution of the computing device that are not described in detail can be referred to the description of the technical solution of the above processor.

[0131] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0132] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.

[0133] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0134] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. An instruction processing method, applied to a distribution unit in a processor, wherein the processor comprises the distribution unit and a plurality of execution units; the method comprises: Get the instructions to be executed; According to a current storage identifier of the transmit queue, the to-be-executed instruction is stored in the transmit queue, wherein the transmit queue includes a plurality of instruction sequences, the instruction sequence includes a plurality of sequentially-issued instructions, and the plurality of instruction sequences correspond to different execution units; Reading a target execution instruction from an instruction sequence corresponding to the target execution unit according to a current instruction pointer of the target execution unit, wherein the target execution unit is an idle execution unit among the multiple execution units; The target execution instruction is transmitted to the target execution unit, and a target execution result output by the target execution unit is obtained.

2. According to the method of claim 1, the execution unit carries an instruction pointer, the instruction pointer includes a tail pointer, and the tail pointer is used to identify the storage location of the last instruction in the instruction sequence corresponding to the execution unit; After storing the to-be-executed instruction in the transmit queue according to the current storage identifier of the transmit queue, the method further comprises: According to the storage position of the to-be-executed instruction in the issue queue, a tail pointer of the execution unit corresponding to the to-be-executed instruction is updated.

3. The method according to claim 1, wherein the execution unit carries an instruction pointer, wherein the instruction pointer includes a read pointer, and the read pointer is used to identify the storage location of the first instruction in the instruction sequence corresponding to the execution unit; After transmitting the target execution instruction to the target execution unit and obtaining the target execution result output by the target execution unit, the method further includes: The read pointer of the target execution unit is updated according to the storage position of the first instruction in the issue queue, wherein the first instruction and the target execution instruction are located in the same instruction sequence and the first instruction is the next instruction of the target execution instruction.

4. The method according to claim 1, after storing the to-be-executed instruction in the transmit queue according to the current storage identifier of the transmit queue, further comprises: According to the storage position of the instruction to be executed in the transmission queue, an instruction read identifier of a second instruction is configured, wherein the second instruction and the instruction to be executed are located in the same instruction sequence, and the second instruction is the previous instruction of the instruction to be executed, and the instruction read identifier is used to identify the storage position of the next instruction of the second instruction.

5. The method according to claim 4, wherein the execution unit carries an instruction pointer, wherein the instruction pointer includes a read pointer, and the read pointer is used to identify the storage location of the first instruction in the instruction sequence corresponding to the execution unit; After transmitting the target execution instruction to the target execution unit and obtaining the target execution result output by the target execution unit, the method further includes: The read pointer of the target execution unit is updated according to the instruction read identifier of the target execution instruction.

6. The method according to claim 4, after transmitting the target execution instruction to the target execution unit and obtaining the target execution result output by the target execution unit, further comprises: Determining an updated target execution instruction according to an instruction reading identifier of the target execution instruction; Return to the step of transmitting the target execution instruction to the target execution unit and obtaining the target execution result output by the target execution unit until the target instruction sequence is empty, and obtain the sequence execution result corresponding to the target instruction sequence, wherein the target instruction sequence is the instruction sequence where the target execution instruction is located.

7. The method according to claim 1, wherein storing the to-be-executed instruction into the transmit queue according to the current storage identifier of the transmit queue comprises: The storage position of the to-be-executed instruction in the transmit queue is determined according to the current storage identifier of the transmit queue, and the to-be-executed instruction is stored in the storage position.

8. The method according to claim 1, wherein obtaining the instruction to be executed comprises: In response to a task processing request for a voice task, an instruction to be executed of the voice task is obtained.

9. An instruction processing method, applied to a target execution unit in a processor, the processor comprising a distribution unit and a plurality of execution units, the target execution unit being an idle execution unit among the plurality of execution units; the method comprising: Receive a target execution instruction emitted by the distribution unit, wherein the distribution unit includes an emission queue, the emission queue includes multiple instruction sequences, the instruction sequence includes multiple instructions emitted in sequence, the multiple instruction sequences correspond to different execution units, and the target execution instruction is read by the distribution unit from the instruction sequence corresponding to the target execution unit according to the current instruction pointer of the target execution unit; Execute the target execution instruction to obtain a target execution result.

10. The method according to claim 9, wherein the processor further comprises a write-back unit, the target execution result carries an instruction sequence identifier, and the instruction sequence identifier is used to guide the write-back unit to sequentially output the target execution result; After executing the target execution instruction and obtaining the target execution result, the method further includes: According to the instruction sequence identifier, the target execution result is stored in a write-back unit.

11. A processor comprising a distribution unit and a plurality of execution units; The distribution unit is used to obtain instructions to be executed; store the instructions to be executed in the transmission queue according to the current storage identifier of the transmission queue, wherein: The emission queue includes a plurality of instruction sequences, the instruction sequence includes a plurality of sequentially emitted instructions, and the plurality of instruction sequences correspond to different execution units; according to a current instruction pointer of a target execution unit, a target execution instruction is read from the instruction sequence corresponding to the target execution unit, and the target execution unit is an idle execution unit among the plurality of execution units; and the target execution instruction is emitted to the target execution unit; The target execution unit is used to execute the target execution instruction to obtain a target execution result.

12. A computing device comprising the processor of claim 11.

Citation Information

Cited By

  • Acceleration unit, processor, electronic device and instruction execution method

    CN121255289A