Processor core and instruction execution method

By integrating the controller circuit and functional unit design, and using time-division multiplexing to process multiple fused instructions, the problem of data transmission and computation time consumption in traditional processors is solved, achieving more efficient computing performance.

CN123067930APending Publication Date: 2026-11-10AIROHA TECHNOLOGY CORPORATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610625148.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2025-05-09
Filing Date
2026-05-08
Publication Date
2026-11-10

Smart Images

  • Figure CN123067930A_ABST
    Figure CN123067930A_ABST
Patent Text Reader

Abstract

This invention discloses a processor core comprising a functional unit and a fusion controller circuit. The functional unit performs the operation of each instruction in K batches, wherein an operand of length N is provided for each instruction. The functional unit performs the operation of each batch of each instruction in each clock cycle, and a subset of operands of length M is processed in each batch of each instruction, where K = N / M. The fusion controller circuit receives multiple fused instructions and controls the functional unit to process the multiple fused instructions in a time-division multiplexing manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to processor design, and more particularly to a processor core for processing fused instructions and related instruction execution methods. Background Technology

[0002] Most traditional processors are equipped with an arithmetic unit (ARU) capable of communicating with memory. To perform a given arithmetic operation, each operand must be sequentially passed from memory to the ARU, the operation must be executed, and the result must be returned to memory. Since data transfer between memory and the ARU requires multiple clock cycles, and the execution of the operation itself also requires multiple clock cycles, this process is typically time-consuming. Therefore, an innovative processor design is needed that can effectively reduce the number of times operands are fetched from memory and / or the number of times operation results are returned to memory. Summary of the Invention

[0003] One of the objectives of this invention is to provide a processor core for processing fused instructions and a related instruction execution method.

[0004] In one embodiment of the present invention, a processor core is disclosed. The processor core includes a functional unit and a fusion controller circuit. The functional unit is configured to perform the operation of each instruction in K batches, wherein an operand of each instruction has a length of N. The functional unit performs the operation of each batch of each instruction in each clock cycle, and a portion of operands of length M is processed in each batch of each instruction, where K = N / M. The fusion controller circuit is configured to receive multiple fused instructions and control the functional unit to process the operation of the multiple fused instructions in a time-division multiplexing manner.

[0005] In one embodiment of the present invention, a processor core is disclosed. The processor core includes a fusion controller circuit and an instruction decoder circuit. The fusion controller circuit is configured to receive multiple fused instructions and control the scheduling of the operations of the multiple fused instructions. The instruction decoder circuit is configured to receive a fusion instruction and multiple consecutive instructions following the fusion instruction, wherein the fusion instruction explicitly indicates that the multiple consecutive instructions are instructions to be fused; and is further configured to forward the multiple consecutive instructions to the fusion controller circuit as the multiple fused instructions in response to the fusion instruction.

[0006] In one embodiment of the present invention, an instruction execution method is disclosed. The instruction execution method includes: receiving multiple fused instructions; and controlling a functional unit to process the operations of the multiple fused instructions in a time-division multiplexing manner, wherein the functional unit is used to complete the operation of each instruction in K batches, each instruction having an operand of length N, the functional unit completing the operation of each batch of each instruction in each clock cycle, and a portion of operands of length M being processed in each batch of each instruction, where K = N / M.

[0007] The vector core of this invention supports the operation of multiple fused vector instructions using vector concatenation and / or vector sharing, and can reduce the total operand data bandwidth requirement and / or the total operation result write-back bandwidth requirement. Attached Figure Description

[0008] Figure 1 This is a schematic diagram of a vector processor according to an embodiment of the present invention.

[0009] Figure 2 This is a schematic diagram of the fusion controller circuit and functional units according to an embodiment of the present invention.

[0010] Figure 3 This is a flowchart of the rescheduling operation process of fused instructions according to an embodiment of the present invention.

[0011] Figure 4 This is a schematic diagram of the operation scheduling of fused vector instructions determined by the fusion controller circuit according to an embodiment of the present invention.

[0012] Figure 5 This is a schematic diagram illustrating the operand acquisition sequence of a vector multiplication-addition instruction with a vector concatenation relationship according to an embodiment of the present invention.

[0013] Figure 6 This is a schematic diagram illustrating the writing back of the operation result of a vector multiplication and addition instruction with a vector concatenation relationship to a sequence according to an embodiment of the present invention.

[0014] Figure 7 This is a schematic diagram of the operand acquisition sequence for a vector multiplication instruction with vector sharing relationship according to an embodiment of the present invention.

[0015] Figure 8 This is a schematic diagram illustrating the writing back of the operation result of a vector multiplication instruction with vector sharing relationship according to an embodiment of the present invention.

[0016] [Symbol Explanation]

[0017] 100: Vector Processor

[0018] 102: Scalar Core

[0019] 104: Vector Core

[0020] 111: Instruction fetching circuit

[0021] 112: Instruction Decoder Circuit

[0022] 113, 122: Sequencer

[0023] 114: Arithmetic Logic Unit

[0024] 115: Multiplier

[0025] 116: Scalar Register File

[0026] 117: Load / Storage Unit

[0027] 121: Vector instruction decoder circuit

[0028] 123, 202: Fusion controller circuit

[0029] 124, 204: Functional Units

[0030] 125, 206: Vector register file

[0031] 126: Vector Load / Storage Unit

[0032] 127, 212: Instruction queue

[0033] 128, 214: Fusion and Rescheduling Circuits

[0034] 216, 218: Operand queue

[0035] 220, 222, 224: Internal buffers

[0036] 226, 228: Multiplexers

[0037] 230: Programmable Vector Operation Circuit

[0038] 400: Operation Scheduling

[0039] v0, v1, v2, v3, v4, v5, v6, v7: Registers

[0040] share_a, share_b, chain_a, chain_b, op: control signal

[0041] S302, S304, S306, S308, S310, S312, S314, S316: Steps Detailed Implementation

[0042] Certain terms are used in the specification and claims to refer to specific elements. Those skilled in the art will understand that hardware manufacturers may use different names to refer to the same element. This specification and claims do not distinguish elements based on differences in name, but rather on differences in function. The terms "comprising" and "including" used throughout the specification and claims are open-ended and should be interpreted as "comprising but not limited to." Furthermore, the terms "coupled" or "coupled" herein include any direct and indirect electrical connection means. Therefore, if a first device is described as coupled to a second device, it means that the first device can be directly electrically connected to the second device, or indirectly electrically connected to the second device through other devices and connection means.

[0043] Figure 1 This is a schematic diagram of a vector processor according to an embodiment of the present invention. The vector processor 100 may have multiple processor cores, including a scalar core 102 and a vector core 104. The scalar core 102 is used to set instructions so that the vector core 104 can operate; for example, the scalar core 102 may assign program control, conditional branching, functional calls, etc. The scalar core 102 may include an instruction fetch circuit (labeled "Instruction Fetch") 111, an instruction decoder circuit (labeled "Dec") 112, a sequencer (labeled "SEQ") 113, an arithmetic logic unit (labeled "ALU") 114, a multiplier (labeled "MUL") 115, a scalar register file (which contains multiple registers) 116, and a load / store unit 117. Since the focus of this invention is on the design of the vector core 104, and the scalar core 102 can be implemented using any known design, further description of the scalar core 102 is omitted here for brevity.

[0044] Vector Core 104 supports operations on ordinary vector instructions without vector chaining and vector sharing, and also supports operations on fused vector instructions using vector chaining and / or vector sharing. Vector chaining allows vector operations to begin execution as soon as elements of their source operands become available. Vector sharing allows elements of the same source operand to be shared between different vector operations. Figure 1 As shown, the vector core 104 may include a vector instruction decoder circuit (labeled "VDec") 121, a sequencer (labeled "SEQ") 122, a fusion controller circuit (labeled "fusion control") 123, a function unit (labeled "FU") 124, a vector register file (containing multiple registers) 125, and a vector load / store unit 126. The fusion controller circuit 123 may include an instruction queue 127 and a fusion and re-schedule circuit (labeled "fusion & re-schedule") 128. The instruction queue 127 is used to store vector instructions to be processed by the function unit 124. The maximum number of vector instructions that can be fused depends on the size of the instruction queue 127. The fusion and re-schedule circuit 128 is used to reschedule the computation of the vector instructions stored in the instruction queue 127.

[0045] In this embodiment, since functional unit 124 is used in the vector core 104 of vector processor 100, functional unit 124 is used to complete the operation of each instruction (e.g., vector instruction) in K batches. The operands of each instruction (e.g., a vector composed of values ​​from a linear array) have a length of N. Functional unit 124 completes the operation of each batch of each instruction in each clock cycle. A partial operand of length M (e.g., a partial vector with M elements) is processed in the operation of each batch of each instruction. In this embodiment of the invention, functional unit 124 supports different arithmetic operations (e.g., addition / subtraction, multiplication, division, accumulation, logical operations) and can be shared among different instructions (which are fused instructions). That is, functional unit 124 can be used to process the operation of one instruction in a series of fused instructions, and can be reused to process the operation of another instruction in the series of fused instructions. To achieve the purpose of sharing the same functional unit 124 among fused instructions, fusion controller circuit 123 is used to receive multiple fused instructions and control functional unit 124 to process the operation of the multiple fused instructions in a time-division multiplexing manner. In the following description, the terms "instruction" and "vector instruction" are interchangeable.

[0046] Figure 2 This is a schematic diagram of the fusion controller circuit and functional units according to an embodiment of the present invention. Figure 1 The fusion controller circuit 123 shown can be adopted Figure 2 The fusion controller circuit 202 shown is implemented as follows: Figure 1 The functional unit 124 shown can be adopted Figure 2 The functional unit 204 shown is implemented, and Figure 1 The vector register file 125 shown can be used Figure 2 The vector register file 206 shown is implemented. Vector register file 206 contains multiple registers, such as v0, v1, ..., v7. Instruction queue 212 is used to buffer consecutive instructions (which are considered to be fused instructions). In some embodiments of the invention, the instruction decoder circuit 121 of the vector core 104 is used to receive a fusion instruction (e.g., vsigma) and subsequent consecutive instructions to be fused, wherein the fusion instruction (e.g., vsigma) explicitly indicates that the subsequent consecutive instructions are instructions to be fused; and the instruction decoder circuit 121 further forwards the consecutive instructions to the fusion controller circuit 123 / 202 as fused instructions in response to the fusion instruction (e.g., vsigma).

[0047] Explicit fusion instructions can specify the number of instructions to be fused, or which instructions to fuse. Since the instructions to be fused are defined by the programmer and explicitly indicated by fusion instructions (e.g., vsigma) inserted into the program code, the drawback of online detection of fused instructions by the processor in traditional designs can be avoided. For example, in traditional designs, online detection of fused instructions by the processor takes multiple clock cycles to detect the presence of fused instructions, resulting in instruction execution latency. Compared to traditional vector processor designs, the vector processor design proposed in this invention uses specific fusion instructions (e.g., vsigma) in the program code to explicitly indicate which instructions to fuse. This explicit fusion instruction approach significantly improves the computational efficiency of fused instructions. Furthermore, traditional vector processor designs relying on online detection of fused instructions by the processor may fail to make the optimal choice of which instructions to fuse, leading to a decrease in vector processor performance. Compared to traditional vector processor designs, the vector processor design proposed in this invention uses programmer-defined fusion instructions (e.g., vsigma) in the program code to explicitly indicate which instructions should be fused. In this way, since the programmer has the best understanding of the vector concatenation and / or vector sharing relationships between instructions, they can correctly insert the fusion instructions into the program code, thereby significantly improving the computational efficiency of the fused instructions.

[0048] The merging and rescheduling circuit 214 is used to re-schedule the operation of consecutive instructions to be merged, thereby enabling functional unit 204 to process the operation of the merged instructions in a time-division multiplexing manner. For example, the merging and rescheduling circuit 214 can generate multiple control signals share_a, share_b, chain_a, chain_b, and op to functional unit 204. Figure 2 As shown, functional unit 204 may include multiple operand queues (labeled "Operand Queue A" and "Operand Queue B" respectively) 216 and 218, multiple internal buffers (labeled "Opa_buffer", "Opb_buffer", and "Opc_buffer" respectively) 220, 222, and 224, multiple multiplexers 226 and 228, and a programmable vector operation circuit 230. It should be noted that the number of operand queues, the number of internal buffers, and the number of multiplexers can be adjusted according to actual design considerations.

[0049] For each instruction in the multiple fused instructions, operand A (e.g., a first partial vector A with M elements) is loaded from one of the registers v0 to v7 of the vector register file 206 and stored in operand queue 216, and operand B (e.g., a second partial vector B with M elements) is loaded from another register of the vector register file 206 and stored in operand queue 218. Operands A / B can be used as input data for one instruction in the multiple fused instructions and can be stored in internal buffers 220 / 222 so that they can be loaded later using the vector sharing relationship between the fused instructions as input data for another instruction in the multiple fused instructions. With the help of internal buffers 220 / 222, it is possible to omit loading operands (e.g., partial vectors with M elements) from the vector register file 206 located outside the functional unit 204, and load the required operands (e.g., partial vectors with M elements) from the internal buffers 220 / 222 of the functional unit 204, thereby improving the computational efficiency of fused instructions.

[0050] Furthermore, the result of one instruction from multiple fused instructions can be stored in the internal buffer 224, so that it can be loaded later using the vector concatenation relationship between the fused instructions as input data for another instruction in the fused instructions. With the internal buffer 224, loading operands (e.g., the result of the previous instruction) from the vector register file 206 located outside the functional unit 204 can be omitted, and the required operands (e.g., the result of the previous instruction) can be loaded directly from the internal buffer 224 of the functional unit 204, thus improving the computational efficiency of the fused instructions. Additionally, the computation result generated by the programmable vector operation circuit 230 can be stored in the internal buffer 224, thereby eliminating the need to store the computation result in one of the registers v0 to v7 contained in the vector register file 206.

[0051] Multiplexer 226 can be controlled by control signals share_a / chain_a, where share_a controls the behavior of multiplexer 226 during the computation of fused instructions with vector sharing relationships, and chain_a controls the behavior of multiplexer 226 during the computation of fused instructions with vector concatenation relationships. Multiplexer 228 can be controlled by control signals share_b / chain_b, where share_b controls the behavior of multiplexer 228 during the computation of fused instructions with vector sharing relationships, and chain_b controls the behavior of multiplexer 228 during the computation of fused instructions with vector concatenation relationships. Programmable vector operation circuit 230 can be controlled by control signal op, where op specifies a requested arithmetic operation (e.g., addition / subtraction, multiplication, division, accumulation, or logical operation) during the computation of fused instructions with vector concatenation or vector sharing relationships.

[0052] As described above, the fusion and rescheduling circuit 214 is used to reschedule the operation of consecutive instructions to be fused, so that the functional unit 204 can process the operation of the fused instructions in a time-division multiplexing manner according to the computation schedule. Figure 3 This is a flowchart of the rescheduling operation process for fused instructions according to an embodiment of the present invention. Assuming the number of instructions to be fused is L, functional units 124 / 204 are designed to be divided into K ( A vector instruction is processed in batches, where the length of an operand in the vector instruction is N (i.e., the vector length is N). Functional unit 124 / 204 completes one batch of operations for a vector instruction in each clock cycle, where a partial operand of length M (i.e., a partial vector with M elements) is processed in each batch of the vector instruction. In step S302, two control parameters Cnt and In are initialized, where control parameter Cnt represents the number of elements already processed by functional unit 124 / 204, and control parameter In represents the index of the current vector instruction to be processed by functional unit 124 / 204 (i.e., the nth vector instruction, where...). For example, the initial values ​​of both control parameter Cnt and control parameter In can be set to 0. In step S304, the fused instruction is acquired and stored in the instruction queue 127 / 212 of the fusion controller circuit 123 / 202. In step S306, functional unit 124 / 204 executes a fused vector instruction indexed by control parameter In on M elements. In step S308, control parameter In is updated (e.g., In = In + 1). In step S310, control parameter In is checked to see if L has been reached. If control parameter In has not yet reached L, functional unit 124 / 204 executes the next fused vector instruction indexed by the updated control parameter In on M elements (step 306). If control parameter In reaches L, it indicates that the nth ( If the calculation of the first batch of L fused vector instructions is completed, the process will continue to step S312 to update the control parameter Cnt (e.g., Cnt = Cnt + M). In step S314, the control parameter Cnt is checked to see if it has reached N. If the control parameter Cnt has not yet reached N, it means that the calculation of the last batch (i.e., the (K-1)th batch) of L fused vector instructions has not been completed, and the process will continue to step S316 to reset the control parameter In to its initial value of 0. Then, functional unit 124 / 204 will execute one fused vector instruction indexed by the initialized control parameter In for the next M elements. If the control parameter Cnt reaches N, it means that the calculation of the last batch (i.e., the (K-1)th batch) of L fused vector instructions has been completed, and functional unit 124 / 204 will end the calculation of the L fused vector instructions.

[0053] To better understand the technical features of this invention, several examples of instruction execution are provided below.

[0054] In the first instruction fusion example, there are four consecutive multiply-accumulate (MAC) instructions i0, i1, i2, and i3, and a fusion instruction i-1 that precedes the multiply-accumulate instruction i0 (which is the starting instruction among the consecutive multiply-accumulate instructions i0, i1, i2, and i3). The fusion instruction i-1 explicitly indicates that the subsequent four instructions (i.e., the multiply-accumulate instructions i0, i1, i2, and i3) should be fused.

[0055] i-1 : vsigma 4

[0056] i0: vzwmac.vv v24, v12, v0

[0057] i1: vzwmac.vv v24, v13, v1

[0058] i2: vzwmac.vv v24, v14, v2

[0059] i3: vzwmac.vv v24, v15, v3

[0060] The vector multiplication and addition instructions i0, i1, i2, and i3 are used to execute the following mathematical equations:

[0061] ,

[0062] Where i0 is used to perform loading with operand A and operand B loading of i1 is used to execute the loading of operand A. and operand B loading of i2 is used to execute operations with operand A loaded. and operand B loading of ; and i3 is used to perform loading with operand A. And loading operand B of .

[0063] The vector multiply-add instructions i0, i1, i2, and i3 share the same register v24, which is an accumulator that serves as both an operand and the result. Therefore, there is a concatenation relationship between i0 and i1, i1 and i2, and i2 and i3. In this embodiment, the number of instructions to be fused is 4 (L=4), and the functional units 124 / 204 are designed to be fused in 4 batches. This completes the operation of a vector multiplication and addition instruction. Figure 4 This is a schematic diagram of the operation scheduling of fused vector instructions (e.g., vector multiply-accumulate instructions i0, i1, i2, i3) determined by the fusion controller circuit 123 / 202 according to an embodiment of the present invention. Regarding the operation scheduling 400, in represents the nth instruction, and Tn represents the nth batch of operations of an instruction, where... .like Figure 4 As shown, functional units 124 / 204 will sequentially complete the operations of the nth batch of vector instructions i0, the nth batch of vector instructions i1, the nth batch of vector instructions i2, and the nth batch of vector instructions i3. In other words, functional unit 124 / 204 will not begin executing the (n+1)th batch of operations of vector instruction i0 (the starting instruction in the fused set of instructions) until the nth batch of operations of vector instruction i3 (which is the last instruction in the fused set of instructions) is completed. Specifically, functional unit 124 / 204 will not begin executing the (n+1)th batch of any one of the vector instructions i0, i1, i2, and i3 until the nth batch of operations of all vector instructions i0 to i3 is completed. In this example, the computation flow is rescheduled to take full advantage of the concatenation between the fused vector instructions.

[0064] Figure 5 This is a schematic diagram of the operand fetch sequence for vector multiplication and addition instructions i0, i1, i2, and i3 with vector concatenation relationships according to an embodiment of the present invention. Regarding the operation of the 0th batch T0 of the 0th vector multiplication and addition instruction i0 (which is the starting instruction in a fused set of instructions), operand A (a partial vector containing M elements) is loaded from register v0, operand B (a partial vector containing M elements) is loaded from register v12, operand C is loaded from register v24, and the result of the multiplication and addition operation is stored in internal buffer 224. Regarding the operation of the 0th batch T0 of the 1st vector multiplication and addition instruction i1, operand A (a partial vector containing M elements) is loaded from register v1, operand B (a partial vector containing M elements) is loaded from register v13, and operand C is loaded from internal buffer 224 using vector concatenation. Regarding the operation of the 0th batch T0 of the second vector multiply-add instruction i2, operand A (which is a partial vector containing M elements) is loaded from register v2, operand B (which is a partial vector containing M elements) is loaded from register v14, and operand C is loaded from internal buffer 224 by concatenating vectors. Regarding the operation of the 0th batch T0 of the third vector multiply-add instruction i3 (which is the last instruction in this fused instruction set), operand A (which is a partial vector containing M elements) is loaded from register v3, operand B (which is a partial vector containing M elements) is loaded from register v14, and operand C is loaded from internal buffer 224 by concatenating vectors.

[0065] Since those skilled in the art should be able to easily understand the details of the remaining first, second, and third batches of operations of the vector multiplication and addition instructions i0, i1, i2, and i3 after reading the above paragraphs about the operations of the 0th batch of vector multiplication and addition instructions i0, i1, i2, and i3, similar descriptions will not be repeated here for the sake of brevity.

[0066] Figure 6 This is a schematic diagram of a computation result write-back sequence for vector multiplication and addition instructions i0, i1, i2, and i3 with a vector concatenation relationship, according to an embodiment of the present invention. When the operation of the 0th batch T0 of the 3rd vector multiplication and addition instruction i3 (which is the last instruction in the multi-instruction set) is completed, functional unit 124 / 204 stores the multiplication and addition result of the 0th batch T0 of the 3rd vector multiplication and addition instruction i3 into register v24. When the operation of the 1st batch T1 of the 3rd vector multiplication and addition instruction i3 (which is the last instruction in the multi-instruction set) is completed, functional unit 124 / 204 stores the multiplication and addition result of the 1st batch T1 of the 3rd vector multiplication and addition instruction i3 into register v24. After the second batch T2 of the third vector multiply-accumulate instruction i3 (which is the last instruction in the fused instructions) is completed, functional unit 124 / 204 stores the result of the multiply-accumulate operation of the second batch T2 of the third vector multiply-accumulate instruction i3 into register v24. After the third batch T3 of the third vector multiply-accumulate instruction i3 (which is the last instruction in the fused instructions) is completed, functional unit 124 / 204 stores the result of the multiply-accumulate operation of the third batch T3 of the third vector multiply-accumulate instruction i3 into register v24.

[0067] like Figure 5 As shown, the operand data bandwidth requirement for operand A is... (That is, L=4 and K=4), the operand data bandwidth requirement of operand B is (That is, L=4 and K=4), operand C (which is The accumulated result, whose bit width is twice that of operands A / B, requires a certain amount of operand data bandwidth. (That is, K=4 and bit width=2), where this operand data bandwidth requirement is mainly because operand C only needs to be loaded from register v24 for the initial instruction i0. For subsequent instructions i1, i2, and i3, since operand C is loaded from internal buffer 224 instead of register v24, operand C has no operand data bandwidth overhead. Regarding conventional vector processor designs that do not use the internal buffer proposed in this invention to buffer operation results, the data bandwidth requirement for operand A is... The data bandwidth requirement of operand B is And the data bandwidth requirement of operand C is (That is, L=4, K=4, bit width=2), therefore, the vector processor design that uses the internal buffer proposed in this invention to buffer the operation results can reduce the total operand data bandwidth requirement by 37.5% (that is, (64-40) / 64=37.5%), where 40 = 16+16+8 and 64 = 16+16+32.

[0068] like Figure 6 As shown, the bandwidth requirement for writing the calculation result back is... However, for conventional vector processor designs that do not use the internal buffer proposed in this invention to buffer the computation results, the bandwidth requirement for writing the computation results back is... Therefore, the vector processor design that uses the internal buffer proposed in this invention to buffer the operation results can reduce the bandwidth requirement for writing the total operation results back by 75% (i.e., (32-8) / 32=75%).

[0069] In the second instruction fusion example, there are four consecutive vector multiplication (MUL) instructions i0, i1, i2, and i3, and a fusion instruction i-1 preceding the vector multiplication instruction i0 (which is the starting instruction among the vector multiplication instructions i0, i1, i2, and i3), where the fusion instruction i-1 explicitly indicates that the subsequent four instructions (i.e., the vector multiplication instructions i0, i1, i2, and i3) should be fused.

[0070] i-1 : vsigma 4

[0071] i0: vzwmul.vv v24, v12, v0

[0072] i1: vzwmul.vv v26, v12, v1

[0073] i2: vzwmul.vv v28, v12, v2

[0074] i3: vzwmul.vv v30, v12, v3

[0075] Vector multiplication instructions i0, i1, i2, and i3 share the same register v12, which serves as an operand; therefore, there is a sharing relationship between i0, i1, i2, and i3. In this embodiment, the number of instructions to be fused is 4 (L=4), and functional units 124 / 204 are designed to be divided into 4 batches. This completes the operation of a vector multiplication instruction. Figure 4The same operation schedule shown can be determined by the fusion controller circuit 123 / 202 for the operation of vector multiplication instructions i0, i1, i2, i3. The operation flow is rescheduled to fully utilize the shared relationships between the fused vector instructions.

[0076] Figure 7 This is a schematic diagram illustrating the operand acquisition sequence for the operation of vector multiplication instructions i0, i1, i2, and i3 with vector sharing relationship according to an embodiment of the present invention. Regarding the operation of the 0th batch T0 of the 0th vector multiplication instruction i0 (which is the starting instruction in a fused set of instructions), operand A (which is a partial vector containing M elements) is loaded from register v0, and operand B (which is a partial vector containing M elements) is loaded from register v12 and stored in internal buffer 222 for later use. Regarding the operation of the 0th batch T0 of the 1st vector multiplication instruction i1, operand A (which is a partial vector containing M elements) is loaded from register v1, and vector sharing is used to load operand B (which is a partial vector containing M elements) previously loaded from register v12 and now located in internal buffer 222 from internal buffer 222 as input data. Regarding the operation of the 0th batch T0 of the second vector multiplication instruction i2, operand A (which is a partial vector containing M elements) is loaded from register v2, and vector sharing is used to load operand B (which is a partial vector containing M elements) previously loaded from register v12 and now located in internal buffer 222 as input data. Regarding the operation of the 0th batch T0 of the third vector multiplication instruction i3, operand A (which is a partial vector containing M elements) is loaded from register v3, and vector sharing is used to load operand B (which is a partial vector containing M elements) previously loaded from register v12 and now located in internal buffer 222 as input data.

[0077] Since those skilled in the art should be able to easily understand the details of the remaining first, second, and third batches of operations of vector multiplication instructions i0, i1, i2, and i3 after reading the above paragraphs about the operations of the 0th batch of vector multiplication instructions i0, i1, i2, and i3, similar descriptions will not be repeated here for the sake of brevity.

[0078] Figure 8 This is a schematic diagram illustrating the writing back of the operation results of vector multiplication instructions i0, i1, i2, and i3 with vector sharing relationship according to an embodiment of the present invention. When the operation of the nth batch Tn of the mth vector multiplication instruction is completed ( & Functional unit 124 / 204 stores the result of the nth batch Tn of the mth vector multiplication instruction into the specified registers v24 / v26 / v28 / v30.

[0079] like Figure 7 As shown, the operand data bandwidth requirement for operand A is... And the operand data bandwidth requirement of operand B is .like Figure 8 As shown, the bandwidth requirement for writing back the calculation result is The result of multiplication The bit width is twice that of operands A / B. For conventional vector processor designs that do not use the internal buffer proposed in this invention to buffer shared operands, the operand data bandwidth requirement for operand A is... And the operand data bandwidth requirement of operand B is also... Therefore, the vector processor design using the internal buffer proposed in this invention to buffer shared operands can reduce the total operand data bandwidth requirement by 37.5% (i.e., (32-20) / 32=37.5%). For conventional vector processor designs that do not use the internal buffer proposed in this invention to buffer shared operands, the bandwidth requirement for writing back the computation result is... Vector processor designs that use the internal buffer proposed in this invention to buffer shared operands have the same total operation result write-back bandwidth requirement.

[0080] In the above embodiments, the fusion controller circuit and functional unit proposed in this invention are applied to vector processors (especially the vector core of a vector processor). However, this is only an illustrative example and not a limitation of the invention. In fact, the fusion controller circuit and functional unit proposed in this invention can be adopted by other processors with instruction fusion capabilities. In short, any processor design that adopts one or two of the following characteristics—sharing the same functional unit between different fused instructions and using specific fusion instructions to explicitly specify the consecutive instructions to be fused—is within the scope of this invention.

[0081] The foregoing outlines the features of several embodiments, enabling those skilled in the art to fully understand the various aspects of the invention. Those skilled in the art should recognize that the invention provides a basis for designing or modifying other processes and structures to achieve substantially the same functionality and / or substantially the same results as the embodiments described above. Furthermore, such equivalent configurations do not depart from the spirit and scope of the invention, and various changes, substitutions, and modifications can be made without departing from that spirit and scope.

Claims

1. A processor core, comprising: A functional unit is configured to perform the operation of each instruction in K batches, wherein the operands of each instruction have a length of N. The functional unit performs the operation of each batch of each instruction in each clock cycle, and a portion of operands of length M is processed in each batch of each instruction, where K = N / M; and The fusion controller circuit is used to receive multiple fusion instructions and control the functional unit to process the multiple fusion instructions in a time-division multiplexing manner.

2. The processor core as described in claim 1, further comprising: The instruction decoder circuit is used to receive a fusion instruction and a series of consecutive instructions following the fusion instruction, the fusion instruction explicitly indicating that the series of consecutive instructions are instructions to be fused; and is also used to forward the series of consecutive instructions to the fusion controller circuit in response to the fusion instruction as instructions to be fused.

3. The processor core as described in claim 1, wherein the plurality of fused instructions received by the fusion controller circuit comprises a plurality of consecutive instructions, the plurality of consecutive instructions comprising a first instruction and a second instruction following the first instruction, the fusion controller circuit is further configured to reschedule the operation of the plurality of consecutive instructions, and the functional unit sequentially completes the operation of the nth batch of the first instruction and the operation of the nth batch of the second instruction, wherein... .

4. The processor core of claim 3, wherein the functional unit includes an internal buffer, stores the operation result of the nth batch of the first instruction in the internal buffer, and loads the operation result from the internal buffer as input data for the nth batch of the second instruction.

5. The processor core as described in claim 4, further comprising: A register file, containing multiple registers; The second instruction is the last instruction in the series of consecutive instructions, and the functional unit stores the result of the nth batch of operations of the second instruction into a register in the series of registers.

6. The processor core as described in claim 3, further comprising: A register file, containing multiple registers; The first instruction is the starting instruction in the plurality of consecutive instructions; the functional unit includes an internal buffer, loads the input data of the nth batch of operations of the first instruction from the registers in the plurality of registers, stores the input data in the internal buffer, and loads the input data from the internal buffer as the input data of the nth batch of operations of the second instruction.

7. The processor core of claim 1, wherein the plurality of fused instructions received by the fusion controller circuit comprises a plurality of consecutive instructions, the plurality of consecutive instructions comprising a first instruction and a second instruction following the first instruction, the fusion controller circuit is further configured to reschedule the operation of the plurality of consecutive instructions, and the functional unit will not begin executing the operation of the (n+1)th batch of the first instruction before the operation of the nth batch of the second instruction is completed, wherein... .

8. The processor core of claim 7, wherein the functional unit includes an internal buffer, stores the result of the operation of the nth batch of the first instruction in the internal buffer, and loads the result of the operation from the internal buffer as input data for the operation of the nth batch of the second instruction.

9. The processor core as described in claim 8, further comprising: A register file, containing multiple registers; The second instruction is the last instruction in the series of consecutive instructions, and the functional unit stores the result of the nth batch of operations of the second instruction into a register in the series of registers.

10. The processor core of claim 7, further comprising: A register file, containing multiple registers; The first instruction is the starting instruction in the plurality of consecutive instructions; the functional unit includes an internal buffer, loads the input data of the nth batch of operations of the first instruction from the registers in the plurality of registers, stores the input data in the internal buffer, and loads the input data from the internal buffer as the input data of the nth batch of operations of the second instruction.

11. The processor core of claim 1, wherein the processor core is part of a vector processor, and the operand of each instruction is a vector.

12. A processor core, comprising: A fusion controller circuit is used to receive multiple fusion instructions and control the scheduling of the operation of these multiple fusion instructions; and The instruction decoder circuit is used to receive a fusion instruction and a series of consecutive instructions following the fusion instruction, wherein the fusion instruction explicitly indicates that the series of consecutive instructions are instructions to be fused; and is also used to forward the series of consecutive instructions to the fusion controller circuit in response to the fusion instruction as the series of fusion instructions.

13. The processor core of claim 12, further comprising: A functional unit is used to perform the operation of one of the multiple fused instructions in K batches, wherein the operand of the instruction has a length of N. The functional unit performs the operation of each batch of the instruction in each clock cycle, and a portion of operands with a length of M is processed in each batch of the instruction, where K=N / M.

14. The processor core of claim 13, wherein the processor core is part of a vector processor, and the operand of the instruction is a vector.

15. A method for executing instructions, comprising: Receive multiple fusion commands; and The control function unit processes the operation of the multiple fused instructions in a time-division multiplexing manner. The function unit is used to complete the operation of each instruction in K batches. The operands of each instruction have a length of N. The function unit completes the operation of each batch of each instruction in each clock cycle. A portion of operands with a length of M is processed in each batch of each instruction, where K=N / M.

16. The instruction execution method as described in claim 15, further comprising: The instruction is decoded for the fusion instruction and a series of consecutive instructions following the fusion instruction, and the series of consecutive instructions are forwarded as fused instructions in accordance with the fusion instruction, wherein the fusion instruction explicitly indicates that the series of consecutive instructions are instructions to be fused.

17. The instruction execution method of claim 15, wherein the plurality of fused instructions comprises a plurality of consecutive instructions, the plurality of consecutive instructions comprises a first instruction and a second instruction following the first instruction, and the step of controlling the functional unit to process the operation of the plurality of fused instructions in the time-division multiplexing manner comprises: Reschedule the execution of these multiple consecutive instructions; and The control unit sequentially performs the operations of the nth batch of the first instruction and the nth batch of the second instruction, wherein... .

18. The instruction execution method of claim 15, wherein the plurality of fused instructions received by the fusion controller circuit comprises a plurality of consecutive instructions, the plurality of consecutive instructions comprising a first instruction and a second instruction following the first instruction, and the step of controlling the functional unit to process the operation of the plurality of fused instructions in the time-division multiplexing manner comprises: Reschedule the execution of these multiple consecutive instructions; and The control unit should prevent the execution of the (n+1)th batch of the first instruction from starting before the completion of the nth batch of the second instruction. .

19. The instruction execution method of claim 15, wherein the instruction execution method is executed by a vector processor, and the operand of each instruction is a vector.