Processors, devices, equipment, and instruction processing methods applied to processors

By introducing decoding units, renaming units, and multiple pipelines into the processor, hardware out-of-order scheduling of parallel execution of different instruction types is achieved, solving the efficiency problem caused by the compiler determining the order of instruction streams, improving the processor's execution efficiency, and saving storage space.

CN123067934APending Publication Date: 2026-11-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510591251.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

In existing technologies, the way compilers determine the packing of multiple instructions and the sequential arrangement of instruction streams is not ideal, which affects the processor's execution efficiency.

Method used

A processor architecture is provided, which includes a decoding unit, a renaming unit, and multiple pipelines. It achieves parallel execution of instructions by out-of-order scheduling of different instruction types through hardware, including out-of-order scheduling of scalar instructions, vector instructions, and memory access instructions.

Benefits of technology

It improves the processor's instruction execution efficiency, reduces compiler intervention, and saves instruction storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123067934A_ABST
    Figure CN123067934A_ABST
Patent Text Reader

Abstract

This application discloses a processor, device, apparatus, and instruction processing method applied to a processor, relating to the field of processors. The processor includes: a decoding unit, a renaming unit, and at least two pipelines. The decoding unit is connected to the renaming unit, and the renaming unit is connected to each of the at least two pipelines. The at least two pipelines are used for out-of-order scheduling of n instructions, where n is greater than or equal to 2. The decoding unit is used to acquire n instructions to be decoded; decode the n instructions to obtain n instructions, the instruction types of the n instructions including at least two instruction types; the renaming unit is used to, based on the instruction types of the n instructions, send a first instruction of a first instruction type from the n instructions to a first pipeline of the at least two pipelines, the first pipeline corresponding to the first instruction type; the first pipeline is used to issue the first instruction and execute the first instruction when the first instruction meets the execution conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of processors, and in particular to a processor, device, apparatus, and instruction processing method applied to a processor. Background Technology

[0002] Very Long Instruction Word (VLIW) architecture is widely used in the processor field. VLIW architecture provides a typical instruction-level parallel approach: multiple instructions are packaged into an instruction pack, and instructions in the same instruction pack can be executed in parallel.

[0003] In related technologies, the compiler packages multiple instructions, handles the dependencies between these instructions, and determines the order of the instruction stream. After receiving the instruction package, the processor simply executes it according to the instruction stream order.

[0004] However, the compiler in related technologies determines how multiple instructions are packaged and how the instruction stream is arranged. If the compiler's compilation quality is poor, it will affect the processor's execution efficiency. Summary of the Invention

[0005] This application provides a processor, a device, an apparatus, and an instruction processing method applied to the processor. The technical solution is as follows:

[0006] On one hand, a processor is provided, comprising a decoding unit, a renaming unit, and at least two pipelines, wherein the decoding unit is connected to the renaming unit, the renaming unit is respectively connected to the at least two pipelines, and the at least two pipelines are used for out-of-order scheduling of n instructions, wherein n is greater than or equal to 2;

[0007] The decoding unit is used to acquire n instructions to be decoded; decode the n instructions to obtain the n instructions, wherein the instruction types of the n instructions include at least two instruction types;

[0008] The renaming unit is used to send the first instruction of the first instruction type among the n instructions to the first pipeline of the at least two pipelines, based on the instruction type of each of the n instructions. The first pipeline corresponds to the first instruction type.

[0009] The first pipeline is configured to issue the first instruction and execute the first instruction when the conditions for execution of the first instruction are met.

[0010] In some embodiments, the first instruction type is a scalar instruction type, the first instruction is a scalar instruction, the first pipeline is a scalar pipeline, the instruction queue in the first pipeline is a scalar queue, the at least two reserved stations are the same at least two scalar reserved stations, the physical register is a scalar physical register, and the at least two execution units are the same at least two scalar execution units;

[0011] The scalar queue is used to receive the scalar instruction;

[0012] One of the at least two scalar reservation stations is used to temporarily store the scalar instruction; and to transmit the scalar instruction when the conditions for execution of the scalar instruction are met.

[0013] The scalar physical register is used to determine the source operand of the scalar instruction;

[0014] One of the at least two scalar execution units is configured to execute the scalar instruction based on the source operand of the scalar instruction.

[0015] In some embodiments, the renaming table corresponding to the scalar instruction is a scalar register renaming table;

[0016] The renaming unit is used to determine the scalar physical register corresponding to the scalar instruction based on the scalar register renaming table corresponding to the scalar instruction; and to send the scalar instruction to the scalar pipeline based on the scalar physical register.

[0017] In some embodiments, the first instruction type is a vector instruction type, the first instruction is a vector instruction, the first pipeline is a vector pipeline, the instruction queue in the first pipeline is a vector queue, the at least two reserved stations are the same at least two vector reserved stations, the physical register is a physical register group, the physical register group includes a vector physical register and a predicate physical register, and the at least two execution units are the same at least two vector execution units;

[0018] The vector queue is used to receive the vector instructions;

[0019] One of the at least two vector holding stations is used to temporarily store the vector instruction; and to transmit the vector instruction when the vector instruction meets the execution conditions.

[0020] The physical register set is used to determine the source operands of the vector instruction;

[0021] One of the at least two vector execution units is used to execute the vector instruction based on the source operand of the vector instruction.

[0022] In some embodiments, the renaming table corresponding to the vector instruction is a vector register renaming table and a predicate register renaming table;

[0023] The renaming unit is used to determine the physical register group corresponding to the vector instruction based on the vector register renaming table and the predicate register renaming table corresponding to the vector instruction; and to send the vector instruction to the vector pipeline based on the physical register group.

[0024] In some embodiments, the first instruction type is a memory access instruction type, the first subtype is a vector load instruction type, the first instruction is a vector load instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the first of the at least two reserved stations is a vector load reserved station, the first memory access queue is a load queue, and the first operation is a load operation.

[0025] The memory access queue is used to receive the vector loading instruction;

[0026] The vector loading reservation station is used to temporarily store the vector loading instruction; and to issue the vector loading instruction when the conditions for execution are met.

[0027] The memory access pipeline is used to determine the source operand of the vector load instruction, and to execute the load operation corresponding to the vector load instruction based on the source operand of the vector load instruction.

[0028] The loading queue is used to maintain the order of the loading instruction stream corresponding to the vector loading instruction.

[0029] In some embodiments, the first instruction type is a memory access instruction type, the second subtype is a scalar load instruction type, the first instruction is a scalar load instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the third of the at least two reserved stations is a load memory reserved station, the first memory access queue is a load queue, and the first operation is a load operation.

[0030] The memory access queue is used to receive the scalar load instruction;

[0031] The loading storage retention station is used to temporarily store the scalar loading instruction; when the scalar loading instruction meets the execution conditions, the scalar loading instruction is emitted.

[0032] The memory access pipeline is used to determine the source operand of the scalar load instruction, and to execute the load operation corresponding to the vector load instruction based on the source operand of the vector load instruction.

[0033] The loading queue is used to maintain the order of the loading instruction stream corresponding to the scalar loading instruction.

[0034] In some embodiments, the first instruction type is a memory access instruction type, the third subtype is a vector memory instruction type, the first instruction is a vector memory instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the second of the at least two reserved stations is a vector memory reserved station, the second memory access queue is a memory queue, and the second operation includes a memory operation;

[0035] The memory access queue is used to receive the vector storage instruction;

[0036] The vector storage reservation station is used to temporarily store the vector storage instructions; and to transmit the vector storage instructions when the conditions for execution are met.

[0037] The memory access pipeline is used to determine the source operand of the vector memory instruction, and to execute the memory operation corresponding to the vector memory instruction based on the source operand of the vector memory instruction.

[0038] The storage queue is used to maintain the order of the storage instruction stream corresponding to the vector storage instruction;

[0039] The storage buffer is used to temporarily store and merge data corresponding to storage instructions in the storage instruction stream; determine the address indicated by the storage instruction in the storage instruction stream; if the address is located in the matrix processing unit, forward the storage instruction to the matrix processing unit; if the address is not located in the matrix processing unit, send the data to the data buffer.

[0040] In some embodiments, the first instruction type is a memory access instruction type, the fourth subtype is a scalar memory instruction type, the first instruction is a scalar memory instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the third of the at least two reserved stations is a load memory reserved station, the second memory access queue is a memory queue, and the second operation includes a memory operation.

[0041] The memory access queue is used to receive the scalar memory instruction;

[0042] The loading storage reservation station is used to temporarily store the scalar storage instruction; when the scalar storage instruction meets the execution conditions, the scalar storage instruction is emitted.

[0043] The memory access pipeline is used to determine the source operand of the scalar memory instruction, and to execute the memory operation corresponding to the scalar memory instruction based on the source operand corresponding to the scalar memory instruction.

[0044] The storage queue is used to maintain the order of the storage instruction stream corresponding to the scalar storage instruction;

[0045] The storage buffer is used to temporarily store and merge data corresponding to storage instructions in the storage instruction stream; determine the address indicated by the storage instruction in the storage instruction stream; if the address is located in the matrix processing unit, forward the storage instruction to the matrix processing unit; if the address is not located in the matrix processing unit, send the data to the data buffer.

[0046] In some embodiments, the renaming unit is further configured to determine the physical register corresponding to the data of each of the vector load instruction, the scalar load instruction, the vector store instruction, and the scalar store instruction, and to send the vector load instruction, the scalar load instruction, the vector store instruction, and the scalar store instruction to the memory access pipeline.

[0047] On the other hand, an electronic component is provided, the electronic component including: the processor as described above.

[0048] On the other hand, a chip is provided, the chip comprising: a processor as described above.

[0049] On the other hand, a board is provided, the board including: the processor as described above.

[0050] On the other hand, a computer device is provided, the computer device comprising: a processor as described above, or the computer device comprising: electronic components as described above, or the computer device comprising: a chip as described above, or the computer device comprising: a board as described above.

[0051] On the other hand, an instruction processing method for a processor is provided, the processor including: a decoding unit, a renaming unit, and at least two pipelines, the decoding unit being connected to the renaming unit, the renaming unit being connected to the at least two pipelines respectively, and the at least two pipelines being used for out-of-order scheduling of n instructions, wherein n is greater than or equal to 2;

[0052] The decoding unit acquires n instructions to be decoded; decodes the n instructions to obtain the n instructions, wherein the instruction types of the n instructions include at least two instruction types;

[0053] The renaming unit, based on the instruction type of each of the n instructions, sends the first instruction of the first instruction type among the n instructions to the first pipeline of the at least two pipelines, where the first pipeline corresponds to the first instruction type;

[0054] When the conditions for execution of the first instruction are met, the first pipeline issues the first instruction and executes the first instruction.

[0055] In some embodiments, the first pipeline includes: an instruction queue, at least two reservation stations, and an instruction execution unit, wherein the instruction queue is connected to the at least two reservation stations, and the at least two reservation stations are connected to the instruction execution unit;

[0056] When the execution conditions for the first instruction are met, the first pipeline issues the first instruction and executes the first instruction, including:

[0057] The instruction queue receives the first instruction;

[0058] One of the at least two reserved stations temporarily stores the first instruction; when the first instruction meets the execution conditions, the first instruction is transmitted;

[0059] The instruction execution unit executes the first instruction.

[0060] In some embodiments, the instruction execution unit includes: a physical register and at least two execution units, wherein the at least two reserved stations are connected to the physical register and the physical register is connected to the at least two execution units;

[0061] The instruction execution unit executes the first instruction, including:

[0062] The physical register determines the source operand of the first instruction;

[0063] One of the at least two execution units executes the first instruction based on the source operand of the first instruction.

[0064] In some embodiments, the at least two reserved stations are of the same type, the at least two execution units are of the same type, and the number of the at least two reserved stations is the same as the number of the at least two execution units.

[0065] In some embodiments, the instruction execution unit includes: a memory access pipeline and at least two memory access queues, wherein the at least two reserved stations are connected to the memory access pipeline and the memory access pipeline is connected to the at least two memory access queues;

[0066] The instruction execution unit executes the first instruction, including:

[0067] The memory access pipeline determines the source operand of the first instruction, and executes the first instruction based on the source operand of the first instruction;

[0068] One of the at least two memory access queues maintains the order of the instruction stream corresponding to the subtype of the first instruction.

[0069] In some embodiments, the subtype of the first instruction is a first subtype or a second subtype, the first subtype and the second subtype correspond to the first instruction stream, the at least two memory access queues include a first memory access queue, and the memory access pipeline is connected to the first memory access queue;

[0070] The memory access pipeline executes the first instruction based on the source operand of the first instruction; one of the at least two memory access queues maintains the order of the instruction stream corresponding to the subtype of the first instruction, including:

[0071] The memory access pipeline executes the first operation corresponding to the first instruction based on the source operand of the first instruction;

[0072] The first memory access queue maintains the order of the first instruction stream.

[0073] In some embodiments, the subtype of the first instruction is a third subtype or a fourth subtype, the third subtype and the fourth subtype correspond to the second instruction stream, the at least two memory access queues include a second memory access queue, and the memory access pipeline is connected to the second memory access queue;

[0074] The memory access pipeline executes the first instruction based on the source operand of the first instruction; one of the at least two memory access queues maintains the order of the instruction stream corresponding to the subtype of the first instruction, including:

[0075] The memory access pipeline executes the second operation corresponding to the first instruction based on the source operand of the first instruction;

[0076] The second memory access queue maintains the order of the second instruction stream.

[0077] In some embodiments, the instruction execution unit further includes: a storage buffer, wherein the second memory access queue is connected to the storage buffer; the method further includes:

[0078] The storage buffer temporarily stores and merges the data corresponding to the instructions in the second instruction stream.

[0079] In some embodiments, the storage buffer further determines the address indicated by the instruction in the second instruction stream; if the address is located in the matrix processing unit, the instruction is forwarded to the matrix processing unit; if the address is not located in the matrix processing unit, the data is sent to the data buffer.

[0080] In some embodiments, the at least two reservation stations include different first reservation stations, second reservation stations, and third reservation stations, the first subtype corresponds to the first reservation station, the third subtype corresponds to the second reservation station, and the second subtype and the fourth subtype correspond to the third reservation station.

[0081] In some embodiments, the renaming unit, based on the instruction type of each of the n instructions, sends a first instruction of a first instruction type among the n instructions to the first pipeline of the at least two pipelines, including:

[0082] The renaming unit determines the physical register corresponding to each of the n instructions based on the renaming table corresponding to the instruction type of each of the n instructions; based on the physical register corresponding to each of the n instructions, the first instruction among the n instructions is sent to the first pipeline of the at least two pipelines;

[0083] The renaming table is used to indicate the mapping relationship from logical registers to physical registers.

[0084] In some embodiments, the decoding unit includes: an instruction fetching unit and a decoder, wherein the instruction fetching unit is connected to the decoder and the decoder is connected to the renaming unit;

[0085] The decoding unit acquires n instructions to be decoded; decodes the n instructions to obtain the n instructions, including:

[0086] The instruction fetching unit performs an instruction fetching operation to obtain the n instructions to be decoded;

[0087] The decoder performs instruction decoding operations on the n instructions to be decoded to obtain the n instructions.

[0088] In some embodiments, the first instruction type is a scalar instruction type, the first instruction is a scalar instruction, the first pipeline is a scalar pipeline, the instruction queue in the first pipeline is a scalar queue, the at least two reserved stations are the same at least two scalar reserved stations, the physical register is a scalar physical register, and the at least two execution units are the same at least two scalar execution units; the method includes:

[0089] The scalar queue receives the scalar instruction;

[0090] One of the at least two scalar reservation stations temporarily stores the scalar instruction; when the scalar instruction meets the execution conditions, the scalar instruction is transmitted.

[0091] The scalar physical register determines the source operand of the scalar instruction;

[0092] One of the at least two scalar execution units executes the scalar instruction based on the source operand of the scalar instruction.

[0093] In some embodiments, the renaming table corresponding to the scalar instruction is a scalar register renaming table; the method includes:

[0094] The renaming unit determines the scalar physical register corresponding to the scalar instruction based on the scalar register renaming table corresponding to the scalar instruction; and sends the scalar instruction to the scalar pipeline based on the scalar physical register.

[0095] In some embodiments, the first instruction type is a vector instruction type, the first instruction is a vector instruction, the first pipeline is a vector pipeline, the instruction queue in the first pipeline is a vector queue, the at least two reserved stations are the same at least two vector reserved stations, the physical register is a physical register group, the physical register group includes a vector physical register and a predicate physical register, and the at least two execution units are the same at least two vector execution units; the method includes:

[0096] The vector queue receives the vector instructions;

[0097] One of the at least two vector holding stations temporarily stores the vector instruction; when the vector instruction meets the execution conditions, the vector instruction is emitted;

[0098] The physical register set determines the source operands of the vector instruction;

[0099] One of the at least two vector execution units executes the vector instruction based on the source operand of the vector instruction.

[0100] In some embodiments, the renaming table corresponding to the vector instruction is a vector register renaming table and a predicate register renaming table; the method further includes:

[0101] The renaming unit determines the physical register group corresponding to the vector instruction based on the vector register renaming table and the predicate register renaming table corresponding to the vector instruction; and sends the vector instruction to the vector pipeline based on the physical register group.

[0102] In some embodiments, the first instruction type is a memory access instruction type, the first subtype is a vector load instruction type, the first instruction is a vector load instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the first of the at least two reserved stations is a vector load reserved station, the first memory access queue is a load queue, and the first operation is a load operation; the method includes:

[0103] The memory access queue receives the vector loading instruction;

[0104] The vector loading reservation station temporarily stores the vector loading instruction; when the vector loading instruction meets the execution conditions, the vector loading instruction is emitted.

[0105] The memory access pipeline determines the source operand of the vector load instruction, and, based on the source operand of the vector load instruction, executes the load operation corresponding to the vector load instruction;

[0106] The loading queue maintains the order of the loading instruction stream corresponding to the vector loading instruction.

[0107] In some embodiments, the first instruction type is a memory access instruction type, the second subtype is a scalar load instruction type, the first instruction is a scalar load instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the third of the at least two reserved stations is a load memory reserved station, the first memory access queue is a load queue, and the first operation is a load operation; the method includes:

[0108] The memory access queue receives the scalar load instruction;

[0109] The loading storage reservation station temporarily stores the scalar loading instruction; when the scalar loading instruction meets the execution conditions, the scalar loading instruction is emitted;

[0110] The memory access pipeline determines the source operand of the scalar load instruction, and, based on the source operand of the vector load instruction, executes the load operation corresponding to the vector load instruction;

[0111] The load queue maintains the order of the load instruction stream corresponding to the scalar load instruction.

[0112] In some embodiments, the first instruction type is a memory access instruction type, the third subtype is a vector memory instruction type, the first instruction is a vector memory instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the second of the at least two reserved stations is a vector memory reserved station, the second memory access queue is a memory queue, and the second operation includes a memory operation; the method includes:

[0113] The memory access queue receives the vector storage instruction;

[0114] The vector storage reservation station temporarily stores the vector storage instruction; when the vector storage instruction meets the execution conditions, the vector storage instruction is emitted.

[0115] The memory access pipeline determines the source operand of the vector memory instruction, and executes the memory operation corresponding to the vector memory instruction based on the source operand of the vector memory instruction.

[0116] The storage queue maintains the order of the storage instruction stream corresponding to the vector storage instruction;

[0117] The storage buffer temporarily stores and merges the data corresponding to the storage instructions in the storage instruction stream; determines the address indicated by the storage instruction in the storage instruction stream; if the address is located in the matrix processing unit, forwards the storage instruction to the matrix processing unit; if the address is not located in the matrix processing unit, sends the data to the data cache.

[0118] In some embodiments, the first instruction type is a memory access instruction type, the fourth subtype is a scalar memory instruction type, the first instruction is a scalar memory instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the third of the at least two reserved stations is a load memory reserved station, the second memory access queue is a memory queue, and the second operation includes a memory operation; the method includes:

[0119] The memory access queue receives the scalar store instruction;

[0120] The loading storage reservation station temporarily stores the scalar storage instruction; when the scalar storage instruction meets the execution conditions, the scalar storage instruction is emitted;

[0121] The memory access pipeline determines the source operand of the scalar memory instruction, and executes the memory operation corresponding to the scalar memory instruction based on the source operand corresponding to the scalar memory instruction.

[0122] The storage queue maintains the order of the storage instruction stream corresponding to the scalar storage instruction;

[0123] The storage buffer temporarily stores and merges the data corresponding to the storage instructions in the storage instruction stream; determines the address indicated by the storage instruction in the storage instruction stream; if the address is located in the matrix processing unit, forwards the storage instruction to the matrix processing unit; if the address is not located in the matrix processing unit, sends the data to the data cache.

[0124] In some embodiments, the method further includes:

[0125] The renaming unit further determines the physical register corresponding to the data of each of the vector load instruction, the scalar load instruction, the vector storage instruction, and the scalar storage instruction, and sends the vector load instruction, the scalar load instruction, the vector storage instruction, or the scalar storage instruction to the storage access pipeline.

[0126] On the other hand, a computer device is provided, the computer device comprising: a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the instruction processing method applied to the processor as described above.

[0127] On the other hand, a computer-readable storage medium is provided that stores a computer program, which is loaded and executed by a processor to implement the instruction processing method applied to the processor as described above.

[0128] On the other hand, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium, wherein a processor retrieves the computer instructions from the computer-readable storage medium, causing the processor to load and execute them to implement the instruction processing method applied to the processor as described above.

[0129] The beneficial effects of the technical solutions provided in this application include at least the following:

[0130] This paper presents a hardware out-of-order scheduling AI processor architecture. The processor's decoding unit receives n instructions, which are of at least two instruction types. The renaming unit sends the instruction of the first instruction type from the n instructions to the first pipeline of at least two pipelines. The first pipeline can wait for the first instruction to become ready before issuing and executing it. On one hand, the processor can implement out-of-order instruction scheduling, meaning that hardware performs out-of-order instruction scheduling without compiler intervention. Moreover, instruction dispatch and issuance can be executed in parallel for instructions of different types, improving the processor's instruction execution efficiency. On the other hand, since no compiler intervention is required, the compiler does not need to insert too many empty instructions into the instruction stream, saving memory space occupied by instructions. Attached Figure Description

[0131] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0132] Figure 1 This is a structural block diagram of a computer system provided in an exemplary embodiment of this application;

[0133] Figure 2 This is a schematic diagram of the related technology provided in an exemplary embodiment of this application;

[0134] Figure 3 This is a schematic block diagram of a processor provided in an exemplary embodiment of this application;

[0135] Figure 4 This is a schematic block diagram of a processor provided in an exemplary embodiment of this application;

[0136] Figure 5 This is a schematic block diagram of a processor provided in an exemplary embodiment of this application;

[0137] Figure 6 This is a schematic block diagram of a processor provided in an exemplary embodiment of this application;

[0138] Figure 7 This is a schematic block diagram of a processor provided in an exemplary embodiment of this application;

[0139] Figure 8 This is a schematic block diagram of a processor provided in an exemplary embodiment of this application;

[0140] Figure 9 This is a schematic block diagram of a processor provided in an exemplary embodiment of this application;

[0141] Figure 10 This is a schematic diagram of the overall architecture provided in an exemplary embodiment of this application;

[0142] Figure 11 This is a schematic diagram illustrating out-of-order execution provided in an exemplary embodiment of this application;

[0143] Figure 12 This is a schematic diagram of instruction flow provided in an exemplary embodiment of this application;

[0144] Figure 13 This is a flowchart of an instruction processing method applied to a processor provided in an exemplary embodiment of this application;

[0145] Figure 14 This is a schematic block diagram of a chip provided in an exemplary embodiment of this application;

[0146] Figure 15 This is a schematic block diagram of a board provided in an exemplary embodiment of this application;

[0147] Figure 16 This is a schematic block diagram of a computer device provided in an exemplary embodiment of this application;

[0148] Figure 17 This is a schematic block diagram of a computer device provided in an exemplary embodiment of this application;

[0149] Figure 18 This is a schematic block diagram of a computer device provided in an exemplary embodiment of this application;

[0150] Figure 19 This is a schematic block diagram of a computer device provided in an exemplary embodiment of this application;

[0151] Figure 20 This is a schematic block diagram of a computer device provided in an exemplary embodiment of this application. Detailed Implementation

[0152] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0153] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0154] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0155] It should be understood that although the terms first, second, etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, a first parameter may also be referred to as a second parameter, and similarly, a second parameter may also be referred to as a first parameter. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0156] It should be noted that this application may display a prompt interface, pop-up window, or output voice prompts before and during the collection of user-related data (e.g., instructions and operations related to processors, computer equipment, electronic components, chips, boards, etc.). These prompt interfaces, pop-ups, or voice prompts are used to inform the user that their relevant data is being collected. This ensures that the application only begins executing the steps related to acquiring user-related data after receiving confirmation from the user regarding the prompt interface or pop-up window; otherwise, if no confirmation is received from the user, the steps to acquire user-related data end, i.e., no user-related data is acquired. In other words, all user data collected in this application is collected with the user's consent and authorization, and the collection, use, and processing of relevant user data must comply with the relevant laws, regulations, and standards of the relevant countries and regions.

[0157] First, let me briefly introduce the terms used in the embodiments of this application:

[0158] Chips: These can include artificial intelligence (AI) chips. Specifically, a chip can include a processor and memory. The processor can include an AI processor, which is used for scheduling, executing instructions, and processing data.

[0159] Pipeline: Used for instruction processing. Instruction processing can be divided into at least some of the following steps: fetch: fetching the instruction; decode: parsing the instruction's opcode and operands; execute: performing the instruction's arithmetic or logical operations; memory access: accessing memory, for example, loading or storing data; write back: writing the result back to a register. Pipelines can divide these instruction execution steps into independent stages, each performed by a dedicated hardware unit.

[0160] In some embodiments, the instruction type includes, but is not limited to, at least one of the following: scalar instruction type, vector instruction type, matrix instruction type, scalar memory access instruction type, and vector memory access instruction type. Specifically, the memory access instruction type includes: load instruction type and store instruction type. Correspondingly, the instruction includes, but is not limited to, at least one of the following: scalar instruction, vector instruction, and memory access instruction. Specifically, the memory access instruction can be at least one of the following: scalar / vector memory access instruction, for example, vector load instruction, vector store instruction, scalar load instruction, and scalar store instruction.

[0161] The pipeline type is set according to the instruction type, and the pipeline type includes, but is not limited to, at least one of the following: scalar type, vector type, and memory access type. Correspondingly, the pipeline includes, but is not limited to, at least one of the following: scalar pipeline (spipe), vector pipeline (vpipe), and memory access pipeline (mpipe). The scalar pipeline is used to process scalar instructions, the vector pipeline is used to process vector instructions, and the memory access pipeline is used to process scalar / vector memory access instructions.

[0162] Registers are used for temporary storage of data and / or instructions. Registers are divided into logical registers and physical registers. Logical registers include, but are not limited to, at least one of the following: scalar register (sr), vector register (vr), and prediction register (pr). Physical registers include, but are not limited to, at least one of the following: scalar physical register (spr), vector physical register (vpr), and prediction physical register (ppr). Scalar registers are used to store single data elements, such as integers, floating-point numbers, and pointers. Vector registers are used to store sets of multiple data elements, such as a group of integers or floating-point numbers. Prediction registers are used to store vector Boolean values. Scalar registers are used by scalar instructions, while vector registers and prediction registers are used by vector instructions.

[0163] Reservation station (rs): Used for dynamic instruction scheduling, it can be understood as a buffer for temporary instruction storage, resolving dependencies between instructions entering the pipeline sequentially. A reservation station can select instructions that meet the execution conditions for issuance. If an instruction in the reservation station does not meet the execution conditions, it must be temporarily stored in the reservation station until it becomes executable before being issued. A reservation station can store one or more instructions, depending on actual technical requirements.

[0164] Figure 1 This is a structural block diagram of a computer system provided in an exemplary embodiment of this application. The computer system 100 can be implemented as a hardware architecture for a processor, or as a system architecture for an instruction processing method applied to a processor. The computer system 100 includes a terminal 120 and a server 140.

[0165] In some embodiments, terminal 120 includes the processor of this embodiment, or terminal 120 includes electronic components including the processor of this embodiment, or terminal 120 includes a chip including the processor of this embodiment. Terminal 120 may be an electronic device such as a mobile phone, tablet computer, vehicle terminal (vehicle system), wearable device, PC (Personal Computer), unmanned reservation terminal, etc., and this application embodiment does not limit it to this.

[0166] In some embodiments, server 140 includes the processor of this embodiment, or server 140 includes a board that includes the processor of this embodiment. Server 140 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. Server 140 can be a backend server for terminal 120, used to provide backend services for the data operation and processing of terminal 120. Optionally, server 140 can also be implemented as a node in a blockchain system. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a chain of data blocks linked using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. Blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.

[0167] The terminal 120 and the server 140 can communicate via a network, such as a wired or wireless network. The instruction processing method applied to a processor provided in this application embodiment can have its steps executed by a processor in a computer device, which includes the terminal 120 and / or the server 140.

[0168] Very Long Instruction Word (VLIW) architecture is widely used in the processor field. VLIW provides a typical approach to instruction-level parallelism: multiple instructions are packaged into a single instruction packet, and instructions within the same packet can be executed in parallel. In related technologies, the compiler handles the packaging of multiple instructions, the processing of dependencies between instructions, and the order of the instruction flow. After receiving the instruction packet, the processor only needs to execute it in the order of the instruction flow.

[0169] Specifically, refer to Figure 2 The instruction fetch unit (ifu) fetches instructions from memory and executes the fetch operation in the form of an instruction package. An instruction package contains multiple instruction slots, and each instruction slot corresponds to one instruction. Figure 2 Taking four instruction slots as an example: slot 0, slot 1, slot 2, and slot 3. Different instruction slots can send instructions to the corresponding execution components based on their type. Instructions within an instruction package can be executed in parallel on different execution components. Figure 2Taking three execution components as an example, they are: scalar process unit (SPU), vector process unit (VPU), and matrix process unit (MPU), which are respectively used to process the following instruction types: scalar instructions, vector instructions, and matrix instructions.

[0170] However, the related technologies have at least the following drawbacks: 1. The compiler determines the packing method of multiple instructions and the sequential arrangement of the instruction stream. The compiler-level design is relatively complex, and the compilation quality of the compiler directly determines the processor's performance. If the compilation quality of the compiler is poor, it will affect the processor's execution efficiency; 2. The instruction pack may not be able to be filled with all valid instructions. If the compiler cannot find instructions that can be executed in parallel, it will place empty instructions in the instruction pack. Empty instructions will also occupy instruction space, making the code compiled by the compiler longer and occupying valuable on-chip storage space.

[0171] To eliminate reliance on compilers, this application provides a hardware out-of-order scheduling AI processor architecture. It introduces out-of-order mechanisms such as register renaming, allowing vector and scalar instructions to be scheduled out of order once they meet the execution conditions, without waiting for preceding unrelated instructions to complete. For matrix instructions, a store instruction can be used to send the matrix instruction to the matrix processing unit, which can be implemented as a matrix operation accelerator. This hardware out-of-order scheduling AI processor, with instruction scheduling entirely controlled by hardware, offers better execution efficiency and higher performance. Furthermore, compared to related technologies, it avoids inserting excessive empty instructions into the instruction stream, as hardware detects dependencies between instructions, saving storage space occupied by instructions.

[0172] Next, the overall architecture of the processor in the embodiments of this application will be introduced:

[0173] Figure 3 This is a schematic block diagram of a processor provided in an exemplary embodiment of this application. The processor 200 includes: a decoding unit 210, a renaming unit 220, and at least two pipelines 230. Each of the at least two pipelines 230 is used to process instructions of a corresponding instruction type. Figure 3 This example uses at least two pipelines 230, including pipelines 231, 232, and 233. It should also be noted that any one of pipelines 231, 232, and 233 in the at least two pipelines 230 can serve as the first pipeline 2300 described below. Pipelines 231, 232, and 233 are used to process instructions of corresponding instruction types.

[0174] Decoding unit 210 is connected to renaming unit 220, and renaming unit 220 is connected to at least two pipelines 230 respectively. Specifically, renaming unit 220 is connected to each pipeline of the at least two pipelines 230. The at least two pipelines 230 are used for out-of-order scheduling of n instructions, where n is greater than or equal to 2. Optionally, the above connections can be physical wiring connections or communication connections, which are not limited here.

[0175] The decoding unit 210 is used to acquire n instructions to be decoded; decode the n instructions to obtain n instructions, wherein the instruction types of the n instructions include at least two instruction types.

[0176] The decoding unit is used to perform instruction fetching and instruction decoding operations.

[0177] An instruction to be decoded refers to an instruction containing machine code. Instruction decoding involves parsing the machine code of the instruction and converting it into a series of control signals that are easily identifiable by subsequent circuits / hardware units. These control signals can drive subsequent circuits / hardware units to perform at least one of the following operations: selection operation, register file read / write operation, memory access operation, etc.

[0178] The n instructions to be decoded can be obtained as an instruction package, or they can be n independent instructions. The n instructions are obtained by the decoding unit performing instruction decoding operations on the n instructions to be decoded. The decoding unit can decode n instructions in each clock cycle, and the instruction types of the n instructions must include at least two types. n is greater than or equal to 2. It should also be noted that the value of n can be set according to actual technical needs; the larger n is, the more resources are consumed, but the higher the performance.

[0179] The decoding unit is also used to determine the instruction type of each of the n instructions, where each instruction is an instruction type. In some embodiments, the instruction type includes, but is not limited to, at least one of the following: scalar instruction type, vector instruction type, matrix instruction type, scalar memory access instruction type, and vector memory access instruction type. Specifically, the memory access instruction type includes: load instruction type and store instruction type. Correspondingly, the instruction includes, but is not limited to, at least one of the following: scalar instruction, vector instruction, and memory access instruction. Specifically, the memory access instruction can be at least one of the following: scalar / vector memory access instruction, for example, vector load instruction, vector store instruction, scalar load instruction, and scalar store instruction.

[0180] The pipeline type is set according to the instruction type, and the pipeline type includes, but is not limited to, at least one of the following: scalar type, vector type, and memory access type. Correspondingly, the pipeline includes, but is not limited to, at least one of the following: scalar pipeline (spipe), vector pipeline (vpipe), and memory access pipeline (mpipe). The scalar pipeline is used to process scalar instructions, the vector pipeline is used to process vector instructions, and the memory access pipeline is used to process scalar / vector memory access instructions.

[0181] For example, the decoding unit is used to acquire n instructions to be decoded; decode the n instructions to obtain n instructions. Furthermore, the decoding unit also outputs the n instructions to the renaming unit.

[0182] The renaming unit 220 is used to send the first instruction of the first instruction type among the n instructions to the first pipeline of at least two pipelines, based on the instruction type of each of the n instructions. The first pipeline corresponds to the first instruction type.

[0183] The renaming unit is used to perform register renaming operations and instruction sending operations.

[0184] Register renaming is used to resolve data hazards between instructions. Registers are divided into logical registers and physical registers. Since there are fewer logical registers and more physical registers, the renaming unit can complete the mapping from logical registers to physical registers through register renaming. Specifically, the renaming unit maintains one or more renaming tables (rt), which indicate the mapping relationship from logical registers to physical registers. The renaming unit can complete register renaming through one or more renaming tables.

[0185] In some embodiments, three types of logical registers are primarily configured: scalar registers, vector registers, and predicate registers. Correspondingly, three renaming tables are configured: scalar register renaming table (sr_rt), vector register renaming table (vr_vt), and predicate register renaming table (pr_rt). Scalar instructions utilize the scalar register renaming table, while vector instructions utilize the vector register renaming table and / or the predicate register renaming table.

[0186] Instruction sending refers to the renaming unit sending each of the n instructions to the pipeline that processes instructions of the corresponding instruction type, based on the instruction type of each of the n instructions. One of the instruction types is called the first instruction type, and the pipeline that processes instructions of the first instruction type is called the first pipeline; that is, the first pipeline corresponds to the first instruction type.

[0187] For example, the renaming unit is used to send the first instruction of the first instruction type among the n instructions to the first pipeline in at least two pipelines, based on the instruction types of the n instructions. The renaming unit can also be called a global renaming unit. It should also be noted that the first instruction of the first instruction type can be one or more of the n instructions, i.e., at least one instruction. When the first instruction is a single instruction, it is sent to the first pipeline; when the first instruction is multiple instructions, each instruction is sent to the first pipeline separately.

[0188] In one specific example, the n instructions include scalar instructions, vector instructions, and scalar / vector memory access instructions. Correspondingly, at least two pipelines are a scalar pipeline, a vector pipeline, and a memory access pipeline. The renaming unit is used to send scalar instructions to the scalar pipeline, vector instructions to the vector pipeline, and scalar / vector memory access instructions to the memory access pipeline.

[0189] The first production line 2300 is used to issue the first instruction and execute the first instruction when the conditions for execution of the first instruction are met.

[0190] At least two pipelines are used to issue and execute n instructions in parallel. Each of the n instructions has its own execution conditions. An instruction can only be issued and executed after its execution conditions are met and it is ready.

[0191] The execution conditions of an instruction are related to at least one of the following factors: the instruction itself, the dependencies between instructions, the program state, external events, and hardware logic. For example, execution conditions include, but are not limited to, at least one of the following: unconditional execution, execution after one or more dependent instructions have been executed, execution when a preset flag is detected, execution when an external device issues an interrupt request, and execution when the execution unit is in an idle state.

[0192] The first pipeline is any one of at least two pipelines, and each of the at least two pipelines can be called the first pipeline. The first pipeline corresponds to the first instruction type, that is, the first pipeline is used to process instructions of the first instruction type.

[0193] In a specific example, if the first instruction is a scalar instruction, then the first pipeline is a scalar pipeline; if the first instruction is a vector instruction, then the first pipeline is a vector pipeline; if the first pipeline is a scalar / vector memory access instruction, then the first pipeline is a memory access pipeline.

[0194] For example, the first pipeline is configured to receive a first instruction sent by the renaming unit, and, if the first instruction meets the execution conditions, to issue the first instruction and execute the first instruction. In some embodiments, the first instruction of the first instruction type can be one or more instructions from n instructions, i.e., at least one instruction. When the first instruction is a single instruction, the first pipeline issues and executes the first instruction if the first instruction meets the execution conditions. When the first instruction is multiple instructions, the first pipeline issues and executes the j-th first instruction if the j-th first instruction meets the execution conditions.

[0195] It should also be noted that since the first pipeline is any one of at least two pipelines, each pipeline of at least two pipelines can issue and execute itself when any one of the at least one first instruction received has the conditions for execution, without waiting for the completion of the preceding irrelevant instructions, which can result in out-of-order execution in the instruction stream.

[0196] It should also be noted that the above embodiment is illustrated by taking n instructions output by the decoding unit in one clock cycle as an example. In practical applications, instructions can be output continuously and enter the corresponding first pipeline for transmission and execution according to the instruction type.

[0197] In summary, the processor provided in this application includes: a decoding unit, a renaming unit, and at least two pipelines. The decoding unit is connected to the renaming unit, and the renaming unit is connected to each of the at least two pipelines. The at least two pipelines are used for out-of-order scheduling of n instructions, where n is greater than or equal to 2. The decoding unit is used to obtain n instructions to be decoded; decode the n instructions to obtain n instructions, where the instruction types of the n instructions include at least two instruction types; the renaming unit is used to send a first instruction of a first instruction type from the n instructions to the first pipeline of the at least two pipelines, based on the instruction types of the n instructions, and the first pipeline corresponds to the first instruction type; the first pipeline is used to issue the first instruction and execute the first instruction when the first instruction is ready. This provides a hardware out-of-order scheduling AI processor architecture. The processor's decoding unit can obtain n instructions, which are instructions of at least two instruction types. The renaming unit can send the instruction of the first instruction type from the n instructions to the first pipeline of the at least two pipelines. The first pipeline can wait for the first instruction to be ready before issuing and executing it. On the one hand, the processor can perform out-of-order scheduling of instructions, that is, the hardware can perform out-of-order scheduling of instructions without the need for compiler intervention. Moreover, for instructions of different instruction types, instruction dispatch and issuance can be executed in parallel, which improves the processor's instruction execution efficiency. On the other hand, since no compiler intervention is required, the compiler does not need to insert too many empty instructions into the instruction stream, which also saves the storage space occupied by instructions.

[0198] In some embodiments, any one of at least two pipelines can serve as the first pipeline. For example, Figure 3 Any one of the pipelines 231, 232 and 233 in at least two pipelines 230 can be used as the first pipeline 2300.

[0199] refer to Figure 4 The first pipeline 2300 includes: an instruction queue 310, at least two reservation stations 320, and an instruction execution unit 330. The instruction queue 310 is connected to the at least two reservation stations 320; specifically, the instruction queue 310 is connected to each of the at least two reservation stations 320. The at least two reservation stations 320 are connected to the instruction execution unit 330; specifically, each of the at least two reservation stations 320 is connected to the instruction execution unit 330. Figure 4 This example uses at least two reserved stations 320, including reserved stations 321, 322 and 323, as an example, but may include more or fewer reserved stations.

[0200] Instruction queue 310 is used to receive the first instruction.

[0201] The instruction queue is used to receive instructions and send instructions to the reserved station.

[0202] For example, the instruction queue is used to receive a first instruction sent by the renaming unit, and the instruction queue is also used to send the first instruction to one of at least two reserved stations.

[0203] In some embodiments, a hold station can be understood as a buffer for temporary instruction storage. The hold station can select instructions that meet the execution conditions for issuance. If an instruction in the hold station does not meet the execution conditions, the instruction needs to be temporarily stored in the hold station until it meets the execution conditions before being issued.

[0204] Each of the at least two reserved stations can be of the same type or different types, depending on actual technical needs. Each reserved station can temporarily store one or more instructions. Optionally, when each of the at least two reserved stations is of different types, each reserved station can also be configured to store specific subtypes of instructions. For example, if there are three reserved stations of different types (at least two), one reserved station can be used to temporarily store vector store instructions, one reserved station can be used to temporarily store vector load instructions, and one reserved station can be used to temporarily store scalar load instructions and scalar store instructions.

[0205] In some embodiments, when each of the at least two reserved stations is of the same type, the instruction queue is used to randomly send a first instruction to one of the at least two reserved stations, specifically, to a reserved station that is not full. When each of the at least two reserved stations is of a different type, the instruction queue is used to send the first instruction to a reserved station corresponding to the specific subtype of the first instruction.

[0206] One of the at least two reserved stations 320 is used to temporarily store the first instruction; when the first instruction is ready to be executed, the first instruction is launched.

[0207] The reserved station is used to select commands that meet the execution conditions for launch.

[0208] For example, at least one of the two holding stations that receives the first instruction is used to temporarily store the first instruction; when the first instruction meets the execution conditions, the first instruction is transmitted. After being transmitted, the first instruction enters the instruction execution unit for execution.

[0209] Instruction execution unit 330 is used to execute the first instruction.

[0210] The instruction execution unit is used to execute the first instruction issued.

[0211] For example, the instruction execution unit is used to execute the first instruction. After the first instruction is issued, the corresponding register file can be read first to obtain the source operands, and then sent to the specific execution unit for execution.

[0212] In this embodiment, the hardware units in the first pipeline are introduced. On the one hand, the first pipeline can wait for the received first instruction to be ready before issuing and executing it, which can realize the out-of-order issuance and execution of the received first instruction. On the other hand, since the first pipeline can be any one of at least two pipelines, at least two pipelines can realize the parallel dispatch and issuance of different types of instructions, thereby improving the instruction execution efficiency of the processor.

[0213] Depending on the instruction type, the instruction execution unit has at least two configuration methods. Configuration method one is suitable for vector and scalar instructions, while configuration method two is suitable for scalar / vector memory access instructions. One or a combination of these methods can be used according to actual technical needs.

[0214] The following describes setting up method one:

[0215] refer to Figure 5 The instruction execution unit 330 includes: a physical register 331, at least two execution units 332, and at least two reserved stations 320 connected to the physical register 331. Specifically, each of the at least two reserved stations 320 is connected to the physical register 331. The physical register 331 is connected to each of the at least two execution units 332. Figure 5 This example uses at least two reserved stations 320, including reserved stations 321, 322 and 323, and at least two execution units 332, including execution unit 3321, 3322 and 3323. It may also include more or fewer reserved stations and execution units.

[0216] Physical register 331 is used to determine the source operand of the first instruction.

[0217] For example, the physical register is used to determine the source operand of the first instruction, specifically by reading the register file corresponding to the first instruction. It is also used to send the first instruction and its source operand to one of at least two execution units for execution.

[0218] In some embodiments, the execution unit is used to execute ready instructions, that is, instructions that meet the conditions for execution. Each of the at least two execution units can be of the same type or different types, depending on actual technical needs. Each execution unit can execute one or more instructions. Optionally, when each of the at least two execution units is of different types, each execution unit can also be configured with a specific subtype of instructions that it can execute.

[0219] In some embodiments, when each of the at least two execution units is of the same type, the physical register is used to randomly send the first instruction to one of the at least two execution units, specifically, to an execution unit that is in an idle state. When each of the at least two execution units is of different types, the physical register is used to send the first instruction to an execution unit corresponding to the specific subtype of the first instruction.

[0220] One of the at least two execution units 332 is used to execute the first instruction based on the source operand of the first instruction.

[0221] The execution unit is used to specifically execute the first instruction that is issued.

[0222] For example, one of the at least two execution units that receives the first instruction and the source operand of the first instruction is used to execute the first instruction based on the source operand of the first instruction.

[0223] This embodiment introduces a hardware unit in the instruction execution unit, which is suitable for processing scalar instructions and vector instructions, thereby improving the processor's instruction execution efficiency.

[0224] In some embodiments, for configuration method one, at least two reserved stations are of the same type, at least two execution units are of the same type, and the number of at least two reserved stations is the same as the number of at least two execution units. For example, refer to Figure 10 The scalar pipeline includes three identical scalar hold stations and three identical scalar execution units, while the vector pipeline includes three identical vector hold stations and three identical vector execution units. In this embodiment, the hold stations can temporarily store a larger number of first instructions, which helps improve the processor's instruction execution efficiency.

[0225] The following describes the second setup method:

[0226] refer to Figure 6The instruction execution unit 330 includes: a memory access pipeline 333, at least two memory access queues 334, and at least two reservation stations 320 connected to the memory access pipeline 333. Specifically, each of the at least two reservation stations 320 is connected to the memory access pipeline 333. The memory access pipeline 333 is connected to each of the at least two memory access queues 334. Figure 6 This example uses at least two reserved stations 320, including reserved stations 321, 322 and 323, and at least two memory access queues 334, including memory access queues 3341 and 3342. It may include more or fewer reserved stations.

[0227] The memory access pipeline 333 is used to determine the source operand of the first instruction and, based on the source operand of the first instruction, execute the first instruction.

[0228] The memory access pipeline is used to execute the first instruction issued. The memory access pipeline is represented as a load-store pipeline. Specifically, the memory access pipeline is a pipeline specifically designed to handle memory access operations, which can be broken down into at least some of the following stages: address generation: calculating the memory address based on the instruction; address translation: converting the virtual address to a physical address; cache access: checking for a cache hit; if a hit, reading or writing data directly from the cache; memory access: if a cache miss, accessing main memory to read or write data; data write-back: writing the read data back to a register, or committing the written data to the data cache or main memory.

[0229] For example, a memory access pipeline is used to determine the source operands of a first instruction, and to execute the first instruction based on the source operands of the first instruction. The execution of the first instruction by the memory access pipeline mainly includes performing a load operation or a store operation.

[0230] At least one of the two memory access queues 334 is used to maintain the order of the instruction stream corresponding to the subtype of the first instruction.

[0231] In some embodiments, at least two memory access queues are different memory access queues, and the memory access queues correspond to a specific subtype of the first instruction. For example, if the subtype of the first instruction is a scalar / vector load instruction, the memory access queue is a load query. If the subtype of the first instruction is a scalar / vector store instruction, the memory access queue is a store query.

[0232] For example, at least one of the two memory access queues is used to maintain the order of the instruction stream corresponding to the subtype of the first instruction. The memory access queue ensures that the memory access pipeline correctly executes memory access operations, such as correctly executing load and store operations, avoiding data hazards and dependency conflicts.

[0233] This embodiment introduces a hardware unit in the instruction execution unit, which is suitable for processing scalar memory access instructions and vector memory access instructions, thereby improving the processor's instruction execution efficiency.

[0234] For configuration method two, the following describes each of the at least two memory access queues:

[0235] In some embodiments, the subtype of the first instruction is either a first subtype or a second subtype, and the first subtype and the second subtype correspond to the first instruction stream. (See reference) Figure 7 At least two memory access queues 334 include a first memory access queue 3343, and the memory access pipeline 333 is connected to the first memory access queue 3343. Figure 7 This example uses at least two reserved stations 320, including a first reserved station 324, a second reserved station 325, and a third reserved station 326, as an example. It may include more or fewer reserved stations.

[0236] The memory access pipeline 333 is used to execute the first operation corresponding to the first instruction based on the source operand of the first instruction.

[0237] For example, the memory access pipeline is used to execute the first operation corresponding to the first instruction based on the source operand of the first instruction. In a specific example, the first subtype and the second subtype are a vector load instruction type and a scalar load instruction type, and the first instruction stream is a load instruction stream. The first operation is the load operation.

[0238] The first memory access queue 3343 is used to maintain the order of the first instruction stream.

[0239] For example, the first memory access queue is used to maintain the order of the first instruction stream. That is, it is used to maintain the order of loading the instruction stream. In a specific example, the first memory access queue is the load query queue.

[0240] This embodiment describes the configuration of the memory access queue when the first instruction is a first subtype or a second subtype. This configuration is applicable to the processing of vector loading instructions and scalar loading instructions, thereby improving the processor's instruction execution efficiency.

[0241] In some embodiments, the subtype of the first instruction is a third subtype or a fourth subtype, and the third and fourth subtypes correspond to the second instruction stream. (See reference) Figure 7 At least two memory access queues 334 include a second memory access queue 3344, and the memory access pipeline 333 is connected to the second memory access queue 3344. The first memory access queue 3343 and the second memory access queue 3344 are connected in parallel.

[0242] The memory access pipeline 333 is used to execute the second operation corresponding to the first instruction based on the source operand of the first instruction.

[0243] For example, a memory access pipeline is used to execute a second operation corresponding to a first instruction based on the source operand of the first instruction. In a specific example, the third and fourth subtypes are vector memory instruction type and scalar memory instruction type, respectively, and the second instruction stream is a memory instruction stream. The second operation is the store operation.

[0244] The second memory access queue 3344 is used to maintain the order of the second instruction stream.

[0245] For example, the second memory access queue is used to maintain the order of the second instruction stream. That is, it is used to maintain the order of the stored instruction stream. In a specific example, the second memory access queue is a store query queue.

[0246] This embodiment describes the memory access queue setting when the first instruction is a third or fourth subtype, which is applicable to the processing of vector storage instructions and scalar storage instructions, and improves the processor's instruction execution efficiency.

[0247] In some embodiments, if a second memory access queue 3344 exists, the reference continues. Figure 7 The instruction execution unit 330 also includes a storage buffer 335, and a second memory access queue 3344 connected to the storage buffer 335.

[0248] Storage buffer 335 is used to temporarily store and merge data corresponding to instructions in the second instruction stream.

[0249] A store buffer is an area where data is temporarily stored for writing.

[0250] For example, the storage buffer is used to temporarily store and merge data corresponding to instructions in the second instruction stream. In one specific example, the second instruction stream is a store instruction stream, and the store operation temporarily writes the data to the storage buffer for merging, thereby reducing the number of times the data cache (dcache) is accessed.

[0251] In this embodiment, when the first instruction is a third or fourth subtype, a storage buffer is also set up. The storage operation can temporarily write the write data to the storage buffer for merging, reducing the number of times the data cache is accessed, thereby improving the processor's performance, saving resources and reducing the load.

[0252] In some embodiments, continue to refer to Figure 7 The storage buffer 335 is also connected to the data cache 410, or the storage buffer 335 is also connected to the matrix processing unit 420.

[0253] The storage buffer 335 is also used to determine the address indicated by the instruction in the second instruction stream; if the address is located in the matrix processing unit, the instruction is forwarded to the matrix processing unit; if the address is not located in the matrix processing unit, the data is sent to the data buffer.

[0254] The matrix processing unit is a unit specifically designed for matrix operations and can be implemented as a matrix operation accelerator.

[0255] The storage buffer is also used to determine the address corresponding to the written data. For example, the storage buffer is also used to determine the address indicated by the instruction in the second instruction stream, that is, to determine whether the written address falls on the matrix processing unit. If the address is located on the matrix processing unit, the instruction is directly forwarded to the matrix processing unit, that is, the matrix instruction is sent to the matrix processing unit through the stored instruction. If the address is not located on the matrix processing unit, the data is directly sent to the data buffer.

[0256] In this embodiment, the storage buffer also determines whether the written address falls on the matrix processing unit. If it does, the instruction is directly forwarded to the matrix processing unit. This is the instruction configuration channel for the matrix processing unit. Since one instruction from the matrix processing unit corresponds to the execution of multiple data entries, and the number of instructions is relatively small, this instruction sending process has no impact on performance. Using the matrix processing unit to execute matrix instructions can improve instruction execution efficiency. If the address does not fall on the matrix processing unit, the data is directly sent to the data cache, which can improve the processor's execution efficiency.

[0257] In some embodiments, for configuration method two, at least two reserved stations include different first reserved stations, second reserved stations, and third reserved stations, with a first subtype corresponding to the first reserved station, a third subtype corresponding to the second reserved station, and second and fourth subtypes corresponding to the third reserved station. In a specific example, refer to... Figure 10The first subtype is a vector load instruction type, and the first reserved station in the memory access pipeline is the vector load reserved station (vld rs). The third subtype is a vector store instruction type, and the second reserved station in the memory access pipeline is the vector store reserved station (vst rs). The second subtype is a scalar load instruction type, and the fourth subtype is a scalar store instruction type. The third reserved station in the memory access pipeline is the load store reserved station (ldst rs). In this embodiment, the reserved stations can temporarily store the first instruction of the corresponding type, which helps improve the processor's instruction execution efficiency.

[0258] In some embodiments, reference Figure 8 The renaming unit 220 is used to maintain one or more renaming tables. These renaming tables indicate the mapping relationship from logical registers to physical registers. The number of renaming tables depends on the number and type of logical and physical registers. Figure 8 This example uses three renaming tables. In one specific example, there are three types of logical registers: scalar registers, vector registers, and predicate registers. The three renaming tables are: scalar register renaming table (sr_rt), vector register renaming table (vr_rt), and predicate register renaming table (pr_rt).

[0259] The renaming unit 220 is used to determine the physical registers corresponding to each of the n instructions based on the renaming table corresponding to the instruction type of each of the n instructions; and to send the first instruction among the n instructions to the first pipeline of at least two pipelines based on the physical registers corresponding to each of the n instructions; wherein, the renaming table is used to indicate the mapping relationship from logical registers to physical registers.

[0260] The renaming unit is used to perform register renaming operations and instruction sending operations.

[0261] For example, the renaming unit 220 is used to determine the physical registers corresponding to each of the n instructions based on the renaming table corresponding to the instruction types of the n instructions; and based on the physical registers corresponding to the n instructions, to send the first instruction among the n instructions to the first pipeline of at least two pipelines. Specifically, the first instruction among the n instructions is sent to the instruction queue in the first pipeline.

[0262] In this embodiment, the renaming unit can perform register renaming operations and map from logical registers to physical registers, thereby eliminating unnecessary data dependencies caused by the reuse of logical registers, avoiding unnecessary sequential execution, and improving the processor's instruction-level parallelism.

[0263] In some embodiments, reference Figure 9The decoding unit 210 includes an instruction fetching unit 211 and a decoder 212. The instruction fetching unit 211 is connected to the decoder 212, and the decoder 212 is connected to the renaming unit 220.

[0264] The instruction fetch unit 211 is used to perform instruction fetching operations to obtain n instructions to be decoded.

[0265] The instruction fetch unit, also known as the instruction acquisition unit, is used to perform instruction fetching operations to obtain n instructions to be decoded.

[0266] Decoder 212 is used to perform instruction decoding operations on n instructions to be decoded, so as to obtain n instructions.

[0267] A decoder, also known as a decoder, is used to perform instruction decoding operations on n instructions to be decoded, resulting in n instructions. The instruction types of the n instructions include at least two types, with each instruction representing one instruction type. The decoder outputs n instructions per clock cycle; the larger n is, the more resources are consumed, but the higher the performance.

[0268] This embodiment describes the hardware unit within the decoding unit. The decoding unit enables instruction acquisition and decoding, generating a series of control signals that are easily identifiable by subsequent circuits, thereby improving the processor's instruction execution efficiency.

[0269] As an example, the processor provided in the embodiments of this application will be described in detail below with reference to the schematic diagram.

[0270] 1. Product Realization

[0271] In the fields of chips, processors, high-performance processors, and high-performance AI processors, and in scenarios involving data parallel computing and high-performance computing, such as image data processing, scientific computing, machine learning, and game data processing, the execution efficiency of instructions directly affects the overall performance of the processor. The hardware out-of-order scheduling AI processor architecture provided in this application allows for hardware-based out-of-order instruction scheduling, saving storage space occupied by instructions, improving instruction execution efficiency, and effectively enhancing product competitiveness.

[0272] 2. Technical Implementation

[0273] Specifically, the first instruction type of the first instruction includes at least one of the following: scalar instruction type, vector instruction type, and memory access instruction type. The specific subtypes of the memory access instruction type include at least one of the following: vector load instruction type, scalar load instruction type, vector store instruction type, and scalar store instruction type.

[0274] Figure 10 This is a schematic diagram of the overall architecture provided by an exemplary embodiment of this application.

[0275] The overall architecture includes: an instruction fetch unit (ifu), a decoder, a global rename unit, a scalar pipeline (spipe), a vector pipeline (vpipe), and a memory pipeline (mpipe). The instruction fetch unit is connected to the decoder, the decoder is connected to the rename unit, and the rename unit is connected to the scalar pipeline, vector pipeline, and memory pipeline, respectively. The scalar pipeline, vector pipeline, and memory pipeline are connected in parallel. The memory pipeline is also connected to the matrix processing unit (mpu) and the data cache (dcache), respectively.

[0276] This embodiment mainly sets up three types of logical registers: scalar register (sr), vector register (vr), and predicate register (pr). The renaming unit is used to maintain three renaming tables: scalar register renaming table (sr_rt), vector register renaming table (vr_rt), and predicate register renaming table (pr_rt).

[0277] The scalar pipeline includes: a scalar queue (sq), three identical scalar reservation stations: scalar reservation station 0 (scalar rs0), scalar reservation station 1 (scalar rs1), and scalar reservation station 2 (scalar rs2), a scalar physical register (spr), and three identical scalar execution units: scalar execution unit 0 (execute0, ex0), scalar execution unit 1 (execute1, ex1), and scalar execution unit 2 (execute2, ex2). The scalar queue is connected to each scalar reservation station, each scalar reservation station is connected to the scalar physical register, and the scalar physical register is connected to each scalar execution unit. It should also be noted that... Figure 10 This example uses three scalar retention stations and three scalar execution units of the same type. It can also include more or fewer scalar retention stations and scalar execution units.

[0278] The vector pipeline includes: a vector queue (vq), three identical vector reservation stations: vector reservation station 0 (vector rs0), vector reservation station 1 (vector rs1), and vector reservation station 2 (vector rs2), a vector physical register (vpr) and a prediction physical register (ppr), and three identical vector execution units: vector execution unit 0 (vector execute0, vex0), vector execution unit 1 (vector execute1, vex1), and vector execution unit 2 (vector execute2, vex2). The vector queue is connected to each vector reservation station, each vector reservation station is connected to the vector physical register and the prediction physical register, and the vector physical register and the prediction physical register are connected to each vector execution unit. It should also be noted that... Figure 10 This example uses three vector retention stations and three vector execution units of the same type. It can also include more or fewer vector retention stations and vector execution units.

[0279] The storage access pipeline includes: a memory queue (MQ), three different types of reservation stations: vector load reservation station (VLD RS), vector store reservation station (VST RS), and load store reservation station (LDST RS), a load-store pipeline, a load queue, a store queue, and a store buffer. The memory queue is connected to the vector load reservation station, vector store reservation station, and load-store reservation station, respectively. The vector load reservation station, vector store reservation station, and load-store reservation station are connected to the storage pipeline, which in turn is connected to the load queue and the store queue. The load queue and store queue are connected in parallel. The store queue is also connected to the store buffer. The store buffer is also connected to the data cache (DCache) and the matrix processing unit (MPU).

[0280] The overall explanation is as follows:

[0281] The instruction fetch unit performs the instruction fetch operation, which is then sent to the decoder for instruction decoding. Instruction decoding involves parsing the machine code and generating a series of control signals that can be easily recognized by subsequent circuits. The decoder outputs n instructions per clock cycle; the larger n is, the more resources are consumed, but the higher the performance.

[0282] The renaming unit performs register renaming operations. Since the number of logical registers is relatively small, while the processor has a large number of physical registers, the renaming unit is used to complete the mapping from logical registers to physical registers. This embodiment mainly has three types of logical registers: scalar registers (used by scalar instructions), vector registers, and predicate registers. The predicate register stores vector Boolean values, and both the vector and predicate registers are used by vector instructions. The renaming unit sets up corresponding renaming tables for these three types of registers, and the mapping from logical registers to physical registers is completed through these renaming tables.

[0283] The renaming unit sends these instructions to three instruction queues based on the instruction type parsed by the decoder:

[0284] (1) Scalar queue, used to store scalar instructions to be executed;

[0285] (2) Vector queue, used to store vector instructions to be executed;

[0286] (3) Storage queue, used to store scalar / vector load / store instructions to be executed. Load / store instructions complete the data transfer between memory and registers;

[0287] The three instruction queues mentioned above reside in the scalar pipeline, vector pipeline, and memory access pipeline, respectively. Within each pipeline, instructions are sent to a holdout based on their specific instruction type. The holdout can be considered a buffer for temporary instruction storage. Due to factors such as data dependencies between instructions and the idle state of execution units, instructions in the holdout may not yet be ready for execution. These instructions need to be held in the holdout until they are ready for execution before being issued.

[0288] For instructions in the reserved station that are ready to be executed, a suitable instruction is selected and issued. After the instruction is issued, the corresponding register file is first read to obtain the source operands, and then the instructions are sent to the appropriate execution unit for execution. Since the reserved station selects ready instructions for execution, this process introduces out-of-order execution, as illustrated in the following example.

[0289] refer to Figure 11Assume there are three instructions in the instruction stream, i0 to i2. Instruction i0 is a vector load instruction, vld, which loads the memory content at address r3 into vr1, represented as i0:vld vrl,[r3]. Instruction i1 is a vector addition instruction, vadd, which performs the addition operation vr1 + vr0 and writes the result into vr2, represented as i1:vadd vr2,vrl,vr0. It can be seen that instruction i1 depends on the data load result of instruction i0. Instruction i2 is a vector subtraction instruction, vsub, which performs the subtraction operation vr3 - vr4 and writes the result into vr5, represented as i2:vsub vr5,vr3,vr4. It can be seen that instruction i2 does not depend on instructions i0 or i1. The execution analysis is as follows:

[0290] Sequential execution: When executing instructions i0, i1, and i2 sequentially, the execution order is as follows: instruction i0 is executed first, followed by instruction i1, and finally instruction i2. When instruction i0 is executed, assuming it encounters a cache miss during data loading, it needs to retrieve data from the lower-level cache, which takes a considerable amount of time. Since one of the source operands of instruction i1 depends on the data loading result of instruction i0, instruction i1 needs to be held in the reserve. Instruction i1 is temporarily unable to execute and needs to wait for a long time.

[0291] Out-of-order execution: In the case of out-of-order execution of instructions i0, i1, and i2, there is a dependency between instructions i0 and i1 because one of the source operands of instruction i1 depends on the data loading result of instruction i0. Instruction i2, however, does not depend on either instruction i0 or i1. Suppose that instruction i0 encounters a cache miss during data loading and needs to retrieve data from the lower-level cache, which takes a considerable amount of time. Therefore, instruction i0 takes a long time to execute. Since instruction i2 does not depend on instructions i0 and i1, and assuming vr3 and vr4 are both ready, instruction i2 can be executed immediately. Instruction i1 must wait until instruction i0 has finished executing before it can be executed. In this case, the execution order of these three instructions is: instruction i2 is executed first, then instruction i0, and instruction i1 is executed only after instruction i0 has finished. This results in out-of-order execution of the instruction stream.

[0292] For the memory access pipeline, both vector load / store instructions and scalar load / store instructions are executed within the pipeline. The load queue maintains the order of the load instruction stream, and the store queue maintains the order of the store instruction stream. During a store operation, the write data is temporarily written to the storage buffer for merging, reducing the number of accesses to the data cache. For the final write data, the storage buffer checks if the address falls within a matrix processing unit (MSU). If the address does, the instruction is forwarded directly to the MSU. This is the MSU's instruction configuration channel. Since one instruction in the MSU corresponds to the execution of multiple data entries, the number of instructions is relatively small, and this instruction sending process has no impact on processor performance. If the address does not fall within an MSU, for write operations to addresses outside the MSU, the write data is directly sent to the data cache.

[0293] An example reference for instruction flow Figure 12 Suppose that at a certain moment, the decoder decodes three instructions: a vector load instruction, a vector addition instruction, and a scalar addition instruction. The vector load instruction is represented as i0:vld, the vector addition instruction as i1:vadd, and the scalar addition instruction as i2:add. After the renaming unit performs register renaming operations on the three instructions, instruction i0 is sent to the memory access pipeline, instruction i1 is sent to the vector pipeline, and instruction i2 is sent to the scalar pipeline. Instructions i0, i1, and i2 enter their respective reserved stations, waiting to be issued to their respective execution units for execution once they are ready. It can be seen that as long as the instructions are of different types, the dispatch and issuance of these different types of instructions can be performed in parallel.

[0294] The following explanation focuses on the specific types of instructions:

[0295] Case 1: The first instruction is a scalar instruction;

[0296] In conjunction with the foregoing embodiments, the first instruction type is a scalar instruction type, the first instruction is a scalar instruction, the first pipeline is a scalar pipeline, the instruction queue in the first pipeline is a scalar queue, at least two reserved stations are the same at least two scalar reserved stations, the physical register is a scalar physical register, and at least two execution units are the same at least two scalar execution units; the renaming table corresponding to the scalar instruction is a scalar register renaming table;

[0297] The renaming unit is used to determine the scalar physical register corresponding to the scalar instruction based on the scalar register renaming table corresponding to the scalar instruction; and to send the scalar instruction to the scalar pipeline based on the scalar physical register.

[0298] Scalar queue, used to receive scalar instructions;

[0299] One of at least two scalar reservation stations is used to temporarily store scalar instructions; when the scalar instructions are ready to be executed, the scalar instructions are emitted.

[0300] Scalar physical registers are used to determine the source operands of scalar instructions;

[0301] One of at least two scalar execution units is used to execute scalar instructions based on the source operands of the scalar instructions.

[0302] Case 2: The first instruction is a vector instruction;

[0303] In conjunction with the foregoing embodiments, the first instruction type is a vector instruction type, the first instruction is a vector instruction, the first pipeline is a vector pipeline, the instruction queue in the first pipeline is a vector queue, the at least two reserved stations are the same at least two vector reserved stations, the physical registers are physical register sets, the physical register sets include vector physical registers and predicate physical registers, the at least two execution units are the same at least two vector execution units, and the renaming tables corresponding to the vector instructions are vector register renaming tables and predicate register renaming tables;

[0304] The renaming unit is used to determine the physical register set corresponding to the vector instruction based on the vector register renaming table and predicate register renaming table corresponding to the vector instruction; and to send the vector instruction to the vector pipeline based on the physical register set.

[0305] Vector queue, used to receive vector instructions;

[0306] One of at least two vector holding stations is used to temporarily store vector instructions; when the vector instructions are ready to be executed, the vector instructions are issued.

[0307] The physical register set is used to determine the source operands of vector instructions;

[0308] One of at least two vector execution units is used to execute vector instructions based on the source operands of the vector instructions.

[0309] Case 3: The first instruction is a memory access instruction;

[0310] Case 3.1: The first instruction is specifically a vector loading instruction;

[0311] In conjunction with the foregoing embodiments, the first instruction type is a memory access instruction type, the first subtype is a vector load instruction type, the first instruction is a vector load instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the first of at least two reserved stations is a vector load reserved station, the first memory access queue is a load queue, and the first operation is a load operation.

[0312] The renaming unit is used to determine the physical register corresponding to the data of the vector load instruction, and to send the vector load instruction to the memory access pipeline;

[0313] The memory access queue is used to receive vector load instructions;

[0314] The vector loading reserve is used to temporarily store vector loading instructions; when the conditions for executing a vector loading instruction are met, the vector loading instruction is issued.

[0315] The memory access pipeline is used to determine the source operands of the vector load instruction, and, based on the source operands of the vector load instruction, to execute the load operation corresponding to the vector load instruction;

[0316] The load queue is used to maintain the order of the load instruction stream corresponding to the vector load instructions.

[0317] Case 3.2: The first instruction is specifically a scalar load instruction;

[0318] In conjunction with the foregoing embodiments, the first instruction type is a memory access instruction type, the second subtype is a scalar load instruction type, the first instruction is a scalar load instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the third reserved station among at least two reserved stations is a load memory reserved station, the first memory access queue is a load queue, and the first operation is a load operation.

[0319] The renaming unit is also used to determine the physical register corresponding to the data of the scalar load instruction, and to send the scalar load instruction to the memory access pipeline;

[0320] The memory access queue is used to receive scalar load instructions;

[0321] Load the storage reservation station to temporarily store scalar load instructions; when the scalar load instructions meet the execution conditions, issue the scalar load instructions;

[0322] The memory access pipeline is used to determine the source operands of scalar load instructions, and, based on the source operands of vector load instructions, to execute the load operation corresponding to the vector load instructions;

[0323] The load queue is used to maintain the order of the load instruction stream corresponding to scalar load instructions.

[0324] Case 3.3: The first instruction is specifically a vector storage instruction;

[0325] The first instruction type is a memory access instruction type, the third subtype is a vector memory access instruction type, the first instruction is a vector memory access instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the second of the at least two reserved stations is a vector memory reserved station, the second memory access queue is a memory queue, and the second operation includes a memory operation.

[0326] The renaming unit is also used to determine the physical register corresponding to the data of the vector storage instruction, and to send the vector storage instruction to the storage access pipeline;

[0327] The memory access queue is used to receive vector storage instructions;

[0328] The vector storage reservation station is used to temporarily store vector storage instructions; when the vector storage instructions are ready to be executed, the vector storage instructions are issued.

[0329] The memory access pipeline is used to determine the source operands of a vector memory instruction, and, based on the source operands of the vector memory instruction, to execute the memory operation corresponding to the vector memory instruction.

[0330] A storage queue is used to maintain the order of the storage instruction stream corresponding to vector storage instructions;

[0331] The storage buffer is used to temporarily store and merge data corresponding to storage instructions in the storage instruction stream; determine the address indicated by the storage instruction in the storage instruction stream; if the address is located in the matrix processing unit, forward the storage instruction to the matrix processing unit; if the address is not located in the matrix processing unit, send the data to the data buffer.

[0332] Case 3.4: The first instruction is specifically a scalar store instruction;

[0333] In conjunction with the foregoing embodiments, the first instruction type is a memory access instruction type, the fourth subtype is a scalar memory instruction type, the first instruction is a scalar memory instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the third reserved station among at least two reserved stations is a load memory reserved station, the second memory access queue is a memory queue, and the second operation includes a memory operation.

[0334] The renaming unit is also used to determine the physical register corresponding to the data of the scalar store instruction, and to send the scalar store instruction to the memory access pipeline;

[0335] The memory access queue is used to receive scalar store instructions;

[0336] Load the storage reservation station to temporarily store scalar store instructions; when the scalar store instructions are ready to be executed, issue the scalar store instructions;

[0337] The memory access pipeline is used to determine the source operand of a scalar memory instruction, and to execute the memory operation corresponding to the scalar memory instruction based on the source operand.

[0338] A storage queue is used to maintain the order of the storage instruction stream corresponding to scalar storage instructions;

[0339] The storage buffer is used to temporarily store and merge data corresponding to storage instructions in the storage instruction stream; determine the address indicated by the storage instruction in the storage instruction stream; if the address is located in the matrix processing unit, forward the storage instruction to the matrix processing unit; if the address is not located in the matrix processing unit, send the data to the data buffer.

[0340] It should be noted that the various units, devices, queues, and connections involved in the overall architecture diagram can all be implemented using corresponding components, connecting lines or connecting circuits, logic circuits, and other types of hardware.

[0341] In summary, the hardware out-of-order scheduling AI processor architecture proposed in this application allows for out-of-order instruction scheduling by hardware without compiler intervention, thus improving instruction execution efficiency. Furthermore, the compiler does not need to insert instruction vacancy bubbles, saving storage space occupied by instructions.

[0342] Figure 13 This is a flowchart illustrating an exemplary embodiment of an instruction processing method applied to a processor. The method is applied to a processor, and will be described using an example of execution by the processor. The processor can be located in an electronic component, chip, circuit board, or computer device. The processor includes: a decoding unit, a renaming unit, and at least two pipelines. The decoding unit is connected to the renaming unit, and the renaming unit is connected to each of the at least two pipelines. The at least two pipelines are used for out-of-order scheduling of n instructions, where n is greater than or equal to 2. The method includes at least some of the steps 1320, 1340, and 1360:

[0343] Step 1320: The decoding unit acquires n instructions to be decoded; decodes the n instructions to be decoded to obtain n instructions, wherein the instruction types of the n instructions include at least two instruction types;

[0344] Step 1340: The renaming unit, based on the instruction type of each of the n instructions, sends the first instruction of the first instruction type among the n instructions to the first pipeline of at least two pipelines, where the first pipeline corresponds to the first instruction type.

[0345] Step 1360: When the first instruction is ready to be executed, the first pipeline issues the first instruction and executes the first instruction.

[0346] In summary, the instruction processing method for a processor provided in this application includes a processor comprising: a decoding unit, a renaming unit, and at least two pipelines. The decoding unit is connected to the renaming unit, and the renaming unit is connected to each of the at least two pipelines. The at least two pipelines are used for out-of-order scheduling of n instructions, where n is greater than or equal to 2. The decoding unit acquires n instructions to be decoded; decodes the n instructions to obtain n instructions, the instruction types of which include at least two instruction types; the renaming unit, based on the instruction types of the n instructions, sends a first instruction of a first instruction type from the n instructions to the first pipeline of the at least two pipelines, the first pipeline corresponding to the first instruction type; the first pipeline, when the first instruction is ready for execution, issues and executes the first instruction. Accordingly, a hardware out-of-order scheduling AI processor architecture is provided. The processor's decoding unit can obtain n instructions, which are instructions of at least two instruction types. The renaming unit can send the instruction of the first instruction type from the n instructions to the first pipeline of the at least two pipelines. The first pipeline can wait for the first instruction to be ready before issuing and executing it. On the one hand, the processor can perform out-of-order scheduling of instructions, that is, the hardware can perform out-of-order scheduling of instructions without the need for compiler intervention. Moreover, for instructions of different instruction types, instruction dispatch and issuance can be executed in parallel, which improves the processor's instruction execution efficiency. On the other hand, since no compiler intervention is required, the compiler does not need to insert too many empty instructions into the instruction stream, which also saves the storage space occupied by instructions.

[0347] In some embodiments, the first pipeline includes: an instruction queue, at least two reservation stations, and an instruction execution unit, wherein the instruction queue is connected to the at least two reservation stations, and the at least two reservation stations are connected to the instruction execution unit; step 1360 is specifically implemented as steps 1361, 1362, and 1363:

[0348] Step 1361: The instruction queue receives the first instruction;

[0349] Step 1362: At least one of the two reserved stations temporarily stores the first instruction; if the first instruction meets the execution conditions, the first instruction is transmitted.

[0350] Step 1363: The instruction execution unit executes the first instruction.

[0351] In some embodiments, the instruction execution unit includes: a physical register, at least two execution units, at least two reserved stations connected to the physical register, and the physical register connected to at least two execution units; step 1363 is implemented as steps 13631 and 13632:

[0352] Step 13631: The physical register determines the source operand of the first instruction;

[0353] Step 13632: One of the at least two execution units executes the first instruction based on the source operand of the first instruction.

[0354] In some embodiments, at least two reserved stations are of the same type, at least two execution units are of the same type, and the number of at least two reserved stations is the same as the number of at least two execution units.

[0355] In some embodiments, the instruction execution unit includes: a memory access pipeline, at least two memory access queues, at least two reservation stations connected to the memory access pipeline, and the memory access pipeline connected to at least two memory access queues; step 1360 is specifically implemented as steps 1364 and 1365:

[0356] Step 1364: The memory access pipeline determines the source operand of the first instruction, and executes the first instruction based on the source operand of the first instruction;

[0357] Step 1365: At least one of the two memory access queues maintains the order of the instruction stream corresponding to the subtype of the first instruction.

[0358] In some embodiments, the subtype of the first instruction is a first subtype or a second subtype, the first subtype and the second subtype correspond to the first instruction stream, at least two memory access queues include a first memory access queue, and the memory access pipeline is connected to the first memory access queue; steps 1364 and 1365 are specifically implemented as steps 13641 and 13651, respectively:

[0359] Step 13641: The memory access pipeline executes the first operation corresponding to the first instruction based on the source operand of the first instruction;

[0360] Step 13651: The first memory access queue maintains the order of the first instruction stream.

[0361] In some embodiments, the subtype of the first instruction is a third subtype or a fourth subtype, the third subtype and the fourth subtype correspond to the second instruction stream, at least two memory access queues include the second memory access queue, and the memory access pipeline is connected to the second memory access queue; steps 1364 and 1365 are specifically implemented as steps 13642 and 13652, respectively:

[0362] Step 13642: The memory access pipeline executes the second operation corresponding to the first instruction based on the source operand of the first instruction;

[0363] Step 13652: The second memory access queue maintains the order of the second instruction stream.

[0364] In some embodiments, the instruction execution unit further includes: a storage buffer, and a second memory access queue is connected to the storage buffer; the method further includes step 1366:

[0365] Step 1366: Temporarily store and merge the data corresponding to the instructions in the storage buffer and the second instruction stream.

[0366] In some embodiments, the method further includes step 1367:

[0367] In step 1367, the storage buffer further determines the address indicated by the instruction in the second instruction stream; if the address is located in the matrix processing unit, the instruction is forwarded to the matrix processing unit; if the address is not located in the matrix processing unit, the data is sent to the data buffer.

[0368] In some embodiments, at least two reservation stations include different first reservation stations, second reservation stations, and third reservation stations, with a first subtype corresponding to the first reservation station, a third subtype corresponding to the second reservation station, and a second subtype and a fourth subtype corresponding to the third reservation station.

[0369] In some embodiments, step 1340 is specifically implemented as step 1341:

[0370] Step 1341: The renaming unit determines the physical registers corresponding to each of the n instructions based on the renaming table corresponding to the instruction type of each of the n instructions; based on the physical registers corresponding to each of the n instructions, the first instruction among the n instructions is sent to the first pipeline of at least two pipelines.

[0371] The renaming table is used to indicate the mapping relationship from logical registers to physical registers.

[0372] In some embodiments, the decoding unit includes: an instruction fetching unit and a decoder, wherein the instruction fetching unit is connected to the decoder and the decoder is connected to the renaming unit; step 1320 is specifically implemented as steps 1321 and 1322:

[0373] Step 1321: The instruction fetch unit performs an instruction fetch operation to obtain n instructions to be decoded;

[0374] Step 1322: The decoder performs instruction decoding operation on the n instructions to be decoded to obtain n instructions.

[0375] The following explanation focuses on the specific types of instructions:

[0376] Case 1: The first instruction is a scalar instruction;

[0377] The first instruction type is a scalar instruction type, the first instruction is a scalar instruction, the first pipeline is a scalar pipeline, the instruction queue in the first pipeline is a scalar queue, at least two reserved stations are the same at least two scalar reserved stations, the physical register is a scalar physical register, and at least two execution units are the same at least two scalar execution units; the method includes:

[0378] Step S11: The scalar queue receives scalar instructions;

[0379] Step S12: At least one of the two scalar reservation stations temporarily stores the scalar instruction; if the scalar instruction meets the execution conditions, the scalar instruction is transmitted.

[0380] Step S13: The scalar physical register determines the source operand of the scalar instruction;

[0381] Step S14: One of the at least two scalar execution units executes the scalar instruction based on the source operand of the scalar instruction.

[0382] In some embodiments, the renaming table corresponding to the scalar instruction is a scalar register renaming table; the method further includes step S10:

[0383] Step S10: The renaming unit determines the scalar physical register corresponding to the scalar instruction based on the scalar register renaming table corresponding to the scalar instruction; based on the scalar physical register, the scalar instruction is sent to the scalar pipeline.

[0384] Case 2: The first instruction is a vector instruction;

[0385] The first instruction type is a vector instruction type, the first instruction is a vector instruction, the first pipeline is a vector pipeline, the instruction queue in the first pipeline is a vector queue, at least two reserved stations are the same at least two vector reserved stations, the physical registers are a physical register set, the physical register set includes vector physical registers and predicate physical registers, and at least two execution units are the same at least two vector execution units; the method includes:

[0386] Step S21: The vector queue receives vector instructions;

[0387] Step S22: At least one of the two vector holding stations temporarily stores the vector instruction; if the vector instruction meets the execution conditions, the vector instruction is issued;

[0388] Step S23: The physical register set determines the source operands of the vector instruction;

[0389] Step S24: One of the at least two vector execution units executes the vector instruction based on the source operand of the vector instruction.

[0390] In some embodiments, the renaming table corresponding to the vector instruction is a vector register renaming table and a predicate register renaming table; the method further includes:

[0391] In step S20, the renaming unit determines the physical register group corresponding to the vector instruction based on the vector register renaming table and the predicate register renaming table corresponding to the vector instruction; based on the physical register group, the vector instruction is sent to the vector pipeline.

[0392] Case 3: The first instruction is a memory access instruction;

[0393] Case 3.1: The first instruction is specifically a vector loading instruction;

[0394] The first instruction type is a memory access instruction type, the first subtype is a vector load instruction type, the first instruction is a vector load instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the first of at least two reserved stations is a vector load reserved station, the first memory access queue is a load queue, and the first operation is a load operation; the method includes:

[0395] Step S311: The memory access queue receives a vector load instruction;

[0396] Step S312: The vector loading reservation station temporarily stores the vector loading instruction; if the vector loading instruction meets the execution conditions, the vector loading instruction is issued;

[0397] Step S313: The memory access pipeline determines the source operand of the vector load instruction, and executes the load operation corresponding to the vector load instruction based on the source operand of the vector load instruction.

[0398] Step S314: The loading queue maintains the order of the loading instruction stream corresponding to the vector loading instruction.

[0399] Case 3.2: The first instruction is specifically a scalar load instruction;

[0400] The first instruction type is a memory access instruction type, the second subtype is a scalar load instruction type, the first instruction is a scalar load instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the third reserved station among at least two reserved stations is a load memory reserved station, the first memory access queue is a load queue, and the first operation is a load operation; the method includes:

[0401] Step S321: The memory access queue receives a scalar load instruction;

[0402] Step S322: Load the scalar loading instruction temporarily stored in the storage reservation station; if the scalar loading instruction meets the execution conditions, issue the scalar loading instruction;

[0403] Step S323: The memory access pipeline determines the source operand of the scalar load instruction, and, based on the source operand of the vector load instruction, executes the load operation corresponding to the vector load instruction.

[0404] Step S324: The load queue maintains the order of the load instruction stream corresponding to the scalar load instruction.

[0405] Case 3.3: The first instruction is specifically a vector storage instruction;

[0406] The first instruction type is a memory access instruction type, the third subtype is a vector memory access instruction type, the first instruction is a vector memory access instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the second of at least two reserved stations is a vector memory reserved station, the second memory access queue is a memory queue, and the second operation includes a memory operation; the method includes:

[0407] Step S331: The memory access queue receives the vector storage instruction;

[0408] Step S332: The vector storage reservation station temporarily stores the vector storage instruction; if the vector storage instruction meets the execution conditions, the vector storage instruction is issued;

[0409] Step S333: The memory access pipeline determines the source operand of the vector storage instruction, and executes the storage operation corresponding to the vector storage instruction based on the source operand of the vector storage instruction.

[0410] Step S334: The storage queue maintains the order of the storage instruction stream corresponding to the vector storage instruction;

[0411] Step S335: The storage buffer temporarily stores and merges the data corresponding to the storage instructions in the storage instruction stream; determines the address indicated by the storage instruction in the storage instruction stream; if the address is located in the matrix processing unit, the storage instruction is forwarded to the matrix processing unit; if the address is not located in the matrix processing unit, the data is sent to the data buffer.

[0412] Case 3.4: The first instruction is specifically a scalar store instruction;

[0413] The first instruction type is a memory access instruction type, the fourth subtype is a scalar memory instruction type, the first instruction is a scalar memory instruction, the first pipeline is a memory access pipeline, the instruction queue in the first pipeline is a memory access queue, the third reserved station among at least two reserved stations is a load memory reserved station, the second memory access queue is a memory queue, and the second operation includes a memory operation; the method includes:

[0414] Step S341: The memory access queue receives a scalar store instruction;

[0415] Step S342: Load the temporary scalar storage instruction in the storage reservation station; if the scalar storage instruction meets the execution conditions, issue the scalar storage instruction;

[0416] Step S343: The memory access pipeline determines the source operand of the scalar memory instruction, and executes the memory operation corresponding to the scalar memory instruction based on the source operand of the scalar memory instruction.

[0417] Step S344: The storage queue maintains the order of the storage instruction stream corresponding to the scalar storage instruction;

[0418] Step S345: The storage buffer temporarily stores and merges the data corresponding to the storage instructions in the storage instruction stream; determines the address indicated by the storage instruction in the storage instruction stream; if the address is located in the matrix processing unit, forwards the storage instruction to the matrix processing unit; if the address is not located in the matrix processing unit, sends the data to the data buffer.

[0419] In some embodiments, step S300 is also included:

[0420] In step S300, the renaming unit further determines the physical register corresponding to the data of each vector load instruction, scalar load instruction, vector store instruction, or scalar store instruction, and sends the vector load instruction, scalar load instruction, vector store instruction, or scalar store instruction to the memory access pipeline.

[0421] It should also be noted that the description of the embodiments of the instruction processing method applied to the processor can be found in the description of the embodiments of the processor provided in the above embodiments, and will not be repeated here.

[0422] This application provides an electronic component, including the processor 200 provided in the above embodiments. Alternatively, the electronic component includes programmable logic circuits and / or computer instructions, which, when running on a computer device, implement the instruction processing method applied to the processor provided in the above method embodiments. The electronic component can be implemented as, but is not limited to, at least one of the following: a chip, a circuit board, an integrated circuit, a semiconductor element, a sensor, or an optoelectronic device.

[0423] This application provides a chip. Figure 14 This is a schematic block diagram of a chip provided in an exemplary embodiment of this application. Chip 500 includes the processor 200 provided in the above embodiment. Alternatively, an embodiment of this application provides a chip including programmable logic circuits and / or computer instructions, which, when running on a computer device, are used to implement the instruction processing method applied to the processor provided in the above method embodiment.

[0424] This application provides a circuit board. Figure 15This is a schematic block diagram of a board provided in an exemplary embodiment of this application. The board 600 includes the processor 200 provided in the above embodiment. Alternatively, an embodiment of this application provides a board that, when running on a computer device, is used to implement the instruction processing method applied to the processor provided in the above method embodiment.

[0425] Specifically, a board, also known as a server board, is a type of printed circuit board (PCB). During manufacturing, it includes a connector that inserts into a slot on a server's motherboard to control hardware operations, such as monitors and data acquisition cards. After installing a driver or computer program on the board, it can perform its corresponding functions. This driver or computer program can be installed on the processor, which controls its execution and, in conjunction with the processor 200, implements the corresponding functions of the board 600.

[0426] This application provides a computer device. Figure 16 This is a schematic block diagram of a computer device provided in an exemplary embodiment of this application. The computer device 700 includes the processor 200 provided in the above embodiment. Alternatively, an embodiment of this application provides a computer device. Figure 17 This is a schematic block diagram of a computer device provided in an exemplary embodiment of this application. The computer device 800 includes the chip 500 provided in the above embodiment, and the computer device 800 may optionally be implemented as a terminal. Alternatively, an embodiment of this application provides a computer device. Figure 18 This is a schematic block diagram of a computer device provided in an exemplary embodiment of this application. The computer device 900 includes the board 600 provided in the above embodiment, and the computer device 900 may be implemented as a server.

[0427] Optionally, embodiments of this application also provide a computer device, the computer device including: a processor and a memory, the memory storing a computer program; the processor being used to execute the computer program in the memory to implement the instruction processing methods applied to the processor provided in the above method embodiments.

[0428] Figure 19 This is a schematic block diagram of a computer device provided in an exemplary embodiment of this application. The computer device is a server 1000. Typically, the server 1000 includes a processor 1001 and a memory 1002.

[0429] Processor 1001 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1001 may be implemented using at least one hardware form selected from Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). Processor 1001 may also include a main processor and a coprocessor. The main processor, also known as a central processing unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1001 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1001 may also include an Artificial Intelligence (AI) processor, which is used to handle computational operations related to machine learning.

[0430] The memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1002 are used to store at least one instruction, which is executed by the processor 1001 to implement the instruction processing method applied to the processor provided in the method embodiments of this application.

[0431] In some embodiments, the server 1000 may optionally include an input interface 1003 and an output interface 1004. The processor 1001, memory 1002, and input interfaces 1003 and 1004 can be connected via a bus or signal lines. Various peripheral devices can be connected to the input interfaces 1003 and 1004 via buses, signal lines, or circuit boards. The input interfaces 1003 and 1004 can be used to connect at least one input / output (I / O) related peripheral device to the processor 1001 and memory 1002. In some embodiments, the processor 1001, memory 1002, and input interfaces 1003 and 1004 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 1001, memory 1002, and input interfaces 1003 and 1004 can be implemented on separate chips or circuit boards, and this application does not limit this aspect.

[0432] Figure 20 This is a schematic block diagram of a computer device provided in an exemplary embodiment of this application. Optionally, the computer device 2000 is a terminal.

[0433] The computer device 2000 can be a portable mobile terminal, also referred to as a mobile terminal in this embodiment. Examples include smartphones, tablets, MP3 players (Moving Picture Experts Group Audio Layer III), and MP4 players (Moving Picture Experts Group Audio Layer IV). The computer device 2000 may also be referred to as user equipment, portable terminal, or other names.

[0434] Typically, a computer device 2000 includes a processor 2001 and a memory 2002.

[0435] Processor 2001 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 2001 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 2001 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 2001 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 2001 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0436] The memory 2002 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 2002 may also include high-speed random access memory devices and non-volatile storage devices, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 2002 are used to store at least one instruction, which is executed by the processor 2001 to implement the instruction processing methods applied to the processor provided in the various method embodiments of this application.

[0437] In some embodiments, the computer device 2000 may optionally include a peripheral device interface 2003 and at least one peripheral device. Specifically, the peripheral device includes at least one of a radio frequency circuit 2004, a touch display screen 2005, a camera assembly 2006, an audio circuit 2007, and a power supply 2008. The computer device 2000 also includes one or more sensors 2009. The one or more sensors 2009 include, but are not limited to, an accelerometer 2010, a gyroscope 2011, a pressure sensor 2012, an optical sensor 2013, and a proximity sensor 2014.

[0438] Those skilled in the art will understand that Figure 14 The structure shown does not constitute a limitation on the chip. Figure 15The structure shown does not constitute a limitation on the board. Figure 16 , Figure 17 , Figure 18 , Figure 19 and Figure 20 The structure shown does not constitute a limitation on the computer device and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0439] This application provides a computer-readable storage medium storing a computer program, which is loaded and executed by a processor to implement the instruction processing methods applied to the processor provided in the above-described method embodiments.

[0440] This application provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium, executes the computer instructions, and causes the processor of the computer device to load and execute the instruction processing method applied to the processor provided in the above-described method embodiments.

[0441] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0442] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented in hardware, or instructed by a program to implement related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0443] Those skilled in the art will recognize that the functions described in the embodiments of this application in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0444] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A processor, characterized in that, The processor includes: a decoding unit, a renaming unit, and at least two pipelines. The decoding unit is connected to the renaming unit, and the renaming unit is connected to each of the at least two pipelines. The at least two pipelines are used for out-of-order scheduling of n instructions, where n is greater than or equal to 2. The decoding unit is used to acquire n instructions to be decoded; decode the n instructions to obtain the n instructions, wherein the instruction types of the n instructions include at least two instruction types; The renaming unit is used to send the first instruction of the first instruction type among the n instructions to the first pipeline of the at least two pipelines, based on the instruction type of each of the n instructions. The first pipeline corresponds to the first instruction type. The first pipeline is configured to issue the first instruction and execute the first instruction when the conditions for execution of the first instruction are met.

2. The processor according to claim 1, characterized in that, The first pipeline includes: an instruction queue, at least two reservation stations, and an instruction execution unit, wherein the instruction queue is connected to the at least two reservation stations, and the at least two reservation stations are connected to the instruction execution unit; The instruction queue is used to receive the first instruction; One of the at least two retention stations is used to temporarily store the first instruction; when the first instruction meets the execution conditions, the first instruction is transmitted. The instruction execution unit is used to execute the first instruction; The execution conditions include at least one of the following: execution after one or more dependent instructions have been executed, execution when a preset flag is detected, execution when an external device issues an interrupt request, or execution when the execution unit is in an idle state.

3. The processor according to claim 2, characterized in that, The instruction execution unit includes: a physical register and at least two execution units, wherein the at least two reserved stations are connected to the physical register, and the physical register is connected to the at least two execution units respectively; The physical register is used to determine the source operand of the first instruction; One of the at least two execution units is configured to execute the first instruction based on the source operand of the first instruction.

4. The processor according to claim 2 or 3, characterized in that, The at least two reserved stations are of the same type, the at least two execution units are of the same type, and the number of the at least two reserved stations is the same as the number of the at least two execution units.

5. The processor according to claim 2, characterized in that, The instruction execution unit includes: a memory access pipeline and at least two memory access queues, wherein the at least two reserved stations are connected to the memory access pipeline and the memory access pipeline is connected to the at least two memory access queues; The memory access pipeline is used to determine the source operand of the first instruction, and to execute the first instruction based on the source operand of the first instruction; One of the at least two memory access queues is used to maintain the order of the instruction stream corresponding to the subtype of the first instruction.

6. The processor according to claim 5, characterized in that, The first instruction has a subtype of either a first subtype or a second subtype, and the first subtype and the second subtype correspond to the first instruction stream. The at least two memory access queues include a first memory access queue, and the memory access pipeline is connected to the first memory access queue. The memory access pipeline is used to execute the first operation corresponding to the first instruction based on the source operand of the first instruction; The first memory access queue is used to maintain the order of the first instruction stream.

7. The processor according to claim 5, characterized in that, The first instruction has a subtype of either a third or a fourth subtype, the third and fourth subtypes correspond to the second instruction stream, the at least two memory access queues include the second memory access queue, and the memory access pipeline is connected to the second memory access queue; The memory access pipeline is used to execute the second operation corresponding to the first instruction based on the source operand of the first instruction; The second memory access queue is used to maintain the order of the second instruction stream.

8. The processor according to claim 7, characterized in that, The instruction execution unit further includes a storage buffer, and the second memory access queue is connected to the storage buffer; The storage buffer is used to temporarily store and merge the data corresponding to the instructions in the second instruction stream.

9. The processor according to claim 8, characterized in that, The storage buffer is also used to determine the address indicated by the instruction in the second instruction stream; if the address is located in the matrix processing unit, the instruction is forwarded to the matrix processing unit; if the address is not located in the matrix processing unit, the data is sent to the data buffer.

10. The processor according to claim 6 or 7, characterized in that, The at least two reserved stations include different first reserved stations, second reserved stations, and third reserved stations, where the first subtype corresponds to the first reserved station, the third subtype corresponds to the second reserved station, and the second subtype and the fourth subtype correspond to the third reserved station.

11. The processor according to any one of claims 1 to 10, characterized in that, The renaming unit is used to determine the physical registers corresponding to each of the n instructions based on the renaming table corresponding to the instruction types of the n instructions; and to send the first instruction among the n instructions to the first pipeline of the at least two pipelines based on the physical registers corresponding to the n instructions. The renaming table is used to indicate the mapping relationship from logical registers to physical registers.

12. The processor according to any one of claims 1 to 11, characterized in that, The decoding unit includes: an instruction fetching unit and a decoder, wherein the instruction fetching unit is connected to the decoder, and the decoder is connected to the renaming unit; The instruction fetching unit is used to perform the instruction fetching operation to obtain the n instructions to be decoded; The decoder is used to perform instruction decoding operations on the n instructions to be decoded, so as to obtain the n instructions.

13. An electronic component, characterized in that, The electronic component includes: a processor as described in any one of claims 1 to 12.

14. A computer device, characterized in that, The computer device includes: a processor as described in any one of claims 1 to 12, or the computer device includes: an electronic component as described in claim 13.

15. An instruction processing method applied to a processor, characterized in that, The processor includes: a decoding unit, a renaming unit, and at least two pipelines. The decoding unit is connected to the renaming unit, and the renaming unit is connected to each of the at least two pipelines. The at least two pipelines are used for out-of-order scheduling of n instructions, where n is greater than or equal to 2. The decoding unit acquires n instructions to be decoded; decodes the n instructions to obtain the n instructions, wherein the instruction types of the n instructions include at least two instruction types; The renaming unit, based on the instruction type of each of the n instructions, sends the first instruction of the first instruction type among the n instructions to the first pipeline of the at least two pipelines, where the first pipeline corresponds to the first instruction type; When the conditions for execution of the first instruction are met, the first pipeline issues the first instruction and executes the first instruction.