Scalar processor, high-performance processor, and electronic device
By designing the synchronization unit of the scalar processor, the problem of difficulty in synchronizing the scalar processor and vector processor is solved, efficient instruction execution is achieved, and the overall performance of the processor is improved.
Patent Information
- Application Number
- CN202510571424.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-04-30
AI Technical Summary
Existing scalar processors are inefficient in processing instructions, especially when synchronizing with vector processors, which makes it difficult to execute instructions efficiently.
A scalar processor is designed, including a finger fetch unit, a register renaming unit, a computing reserve stack unit, a storage reserve stack unit, a scalar operation unit, a memory access unit, a program control unit, a synchronization unit and a pipeline control unit. Through the synchronization unit, synchronization unit realizes synchronization between the scalar processor and the vector processor, and improves instruction execution efficiency.
Through the synchronization unit, efficient synchronization between the scalar processor and the vector processor is achieved, which improves instruction execution efficiency and improves the overall performance of the processor.
Smart Images

Figure CN120540705A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a scalar processor, a high-performance processor, and an electronic device. Background Art
[0002] A scalar processor is a type of computer processor, as opposed to a vector processor.
[0003] The scalar processor handles all scalar calculations and bit operations, and provides effective support for control and DSP (Digital Signal Processor)-oriented operations. Summary of the Invention
[0004] In order to solve one of the above technical defects, the present application provides a scalar processor, a high-performance processor and an electronic device.
[0005] In a first aspect of the present application, a scalar processor is provided, comprising: an instruction fetch unit, a register renaming unit, an operation reservation stack unit, a storage reservation stack unit, a scalar operation unit, a memory access unit, a program control unit, a synchronization unit, a pipeline control unit, a register file unit, and a special vector register file unit;
[0006] Instruction fetch unit, used to fetch and dispatch instructions;
[0007] Register renaming unit, used to receive instructions dispatched by the instruction fetch unit and rename registers;
[0008] The operation reservation stack unit is the emission queue of the scalar operation unit;
[0009] The storage reservation stack unit is a transmission queue of the memory access unit;
[0010] a scalar operation unit, configured to receive instructions and data sent by the operation reserve stack unit, perform operations on the data based on the instructions, and write the operation results back to the register renaming unit;
[0011] A memory access unit, configured to receive instructions, data, and register information sent by the storage reservation stack unit, and read and write the data based on the instructions and register information;
[0012] a program control unit, configured to receive instructions and data from the register renaming unit, process the data based on the instructions, and output a processing result;
[0013] A synchronization unit for synchronizing the scalar processor and the vector processor;
[0014] The pipeline control unit is used to generate a pipeline pause signal and / or generate a start and stop signal for the scalar processor.
[0015] Optionally, the scalar processor further comprises: an instruction cache and data storage;
[0016] The instruction fetch unit is used to generate an instruction fetch request address, output the instruction fetch request address to the instruction cache for instruction fetch, receive instructions from the instruction cache, and store them in the data storage; each cycle sequentially reads qualified instructions from the data storage, decodes and performs relevant checks on the read instructions, and then dispatches the checked instructions sequentially.
[0017] Optionally, the scalar processor further includes: a special vector register, a status flag register;
[0018] The register renaming unit is used to receive and store instructions dispatched by the instruction fetch unit, rename special vector registers, conditionally decode instructions, and generate pipeline blocking signals; receive data from one or more of the scalar operation unit, memory access unit, program control unit, synchronization unit, special vector registers, condition registers, and flag registers and write them back; send instructions to one or more of the operation retention stack unit, storage retention stack unit, program control unit, and synchronization unit;
[0019] Among them, the condition register is located in the register renaming unit;
[0020] The instructions of the scalar operation unit and memory access unit support the operations of reading and writing condition registers;
[0021] The instructions of the synchronization unit support the operation of reading the condition register;
[0022] The jump and function call instructions of the program control unit support the operation of reading the condition register;
[0023] When an instruction enters the condition register, if there is an unexecuted instruction in the condition register, the pipeline is blocked.
[0024] Optionally, the register renaming unit includes: one or more physical registers and one or more logical registers;
[0025] Wherein, any physical register is one of the following: a scalar physical register, a vector physical register, a condition register, or a flag register;
[0026] Any logical register is one of the following: a scalar logical register, a vector logical register;
[0027] The mapping relationship between logical registers and physical registers is maintained by a register mapping table. Initially, the physical registers mapped to the entries corresponding to all logical register indices in the register mapping table are all 0. When an instruction is executed or an interrupt occurs, the logical register assigned to the relevant physical register is determined, and the mapping of the entry corresponding to the assigned logical register index in the register mapping table is updated to the identifier of the relevant physical register.
[0028] The mapping relationship between vector logical registers and vector physical registers is maintained by a special vector register mapping table; initially, the mapping vector physical registers of the table entries corresponding to all vector logical register indices in the special vector register mapping table are all 0; when the instruction is executed, the vector logical register allocated to the relevant vector physical register is determined, and the mapping of the table entry corresponding to the vector logical register index allocated in the special vector register mapping table is updated to the identifier of the relevant vector physical register.
[0029] Optionally, the operation reservation stack unit is used to receive instructions, dispatch and renaming information from the register renaming unit and push them into the queue; pop ready instructions to the scalar operation unit for execution;
[0030] The operation reserve stack unit is also used to decode input instructions and store instruction type information.
[0031] Optionally, a storage reservation stack unit is used to receive instructions and register renaming information from the register renaming unit and push them into a queue;
[0032] The storage reservation stack unit is also used to send a read request to the register renaming unit when the instruction address register is ready to save the read address operand;
[0033] The register renaming unit is also used to calculate the address, decode the address, and save the decoding information after the instruction obtains the address;
[0034] The register renaming unit is also used to detect when the source register of any instruction is ready and the address decoding is completed, and then send it to the memory access unit for execution.
[0035] Optionally, when performing conditional execution decoding, the scalar processor judges the execution condition of the preset bit of the instruction, and outputs a valid instruction if the condition is met, otherwise outputs a null instruction;
[0036] If there are read-write related operations on the condition register, the pipeline will be blocked and the read operation will be performed after the write operation of the condition register is completed. There is no bypass in the reading and writing of the condition register.
[0037] Optionally, a communication connection is established between the synchronization unit and the pipeline control unit, the register renaming unit, the program control unit, and the vector processor;
[0038] The instructions of the synchronization unit come from the register renaming unit, and the reading and writing of the data of the synchronization unit interact with the register renaming unit;
[0039] a synchronization unit, configured to receive a pause signal sent by the pipeline control unit, and send an execution-level pause signal generated when communicating with the vector processor to the pipeline control unit, so as to generate an execution pause signal for the scalar processor;
[0040] The synchronization unit is used to generate instructions and transmit them to the program control unit.
[0041] In a second aspect of the present application, a high-performance processor is provided, comprising: a scalar processor and a vector processor as described in the first aspect.
[0042] In a third aspect of the present application, an electronic device is provided, comprising: a high-performance processor as described in the second aspect; or comprising one or more processor clusters, wherein each processor cluster includes multiple high-performance processors as described in the second aspect.
[0043] The present application provides a scalar processor, a high-performance processor, and an electronic device. The scalar processor includes: an instruction fetch unit, a register renaming unit, an operation retention stack unit, a storage retention stack unit, a scalar operation unit, a memory access unit, a program control unit, a synchronization unit, a pipeline control unit, a register file unit, and a special vector register file unit; wherein the synchronization unit is used to synchronize the scalar processor with the vector processor. The scalar processor provided by the present application achieves synchronization between the scalar processor and the vector processor through the synchronization unit, thereby efficiently executing instructions. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0045] Figure 1 A schematic diagram of the architecture of a scalar processor provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of a synchronization unit provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of the structure of a high-performance processor provided in an embodiment of the present application;
[0048] Figure 4A schematic diagram of the architecture of a vector processor provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of the structure of a vector operation unit provided in an embodiment of the present application;
[0050] Figure 6 A schematic diagram of the architecture of another vector processor provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the technical solutions and advantages of the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, and are not an exhaustive list of all the embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other unless they conflict.
[0052] In the process of implementing this application, the inventors discovered that a scalar processor is a computer processor, as opposed to a vector processor. A scalar processor can handle all scalar calculations and bit operations, and provides effective support for control and DSP (Digital Signal Processor)-oriented operations.
[0053] To address the above issues, embodiments of the present application provide a scalar processor, a high-performance processor, and an electronic device. The scalar processor includes: an instruction fetch unit, a register renaming unit, an operation retention stack unit, a storage retention stack unit, a scalar operation unit, a memory access unit, a program control unit, a synchronization unit, a pipeline control unit, a register file unit, and a special vector register file unit. The synchronization unit is used to synchronize the scalar processor with the vector processor. The scalar processor provided by the present application achieves synchronization between the scalar processor and the vector processor through the synchronization unit, thereby efficiently executing instructions.
[0054] See also Figure 1 This embodiment provides a scalar processor, which includes: an instruction fetch unit, a register renaming unit, an operation reservation stack unit, a storage reservation stack unit, a scalar operation unit, a memory access unit, a program control unit, a synchronization unit, a pipeline control unit, a register file unit, and a special vector register file unit.
[0055] In addition, the scalar processor may also include one or more other units, such as one or more other functional modules, one or more instruction caches, one or more data storages, one or more special vector registers, one or more status flag registers, etc.
[0056] 1. Instruction fetch unit
[0057] The instruction fetch unit is used to fetch and dispatch instructions.
[0058] Specifically, the instruction fetch unit generates an instruction fetch request address, outputs the fetch request address to the instruction cache for instruction fetching, receives instructions from the instruction cache, and stores them in the data store. Each cycle, it sequentially reads qualified instructions from the data store, decodes and performs relevant checks on the read instructions, and then dispatches the checked instructions sequentially.
[0059] For example, the instruction fetch unit generates an instruction fetch request address and outputs it to the instruction cache for instruction fetch, and receives instructions from the instruction cache and stores them in the data storage. In each cycle, it sequentially selects one or more instructions from the qualified instructions for decoding and related checks, and dispatches the qualified instructions sequentially, dispatching at most one program control unit instruction and one synchronization unit instruction at a time. In addition, one or more scalar operation unit instructions and one or more memory access unit instructions can also be dispatched each time.
[0060] 2. Register renaming unit
[0061] The register renaming unit is used to receive instructions dispatched by the instruction fetch unit and rename registers.
[0062] Specifically, the register renaming unit receives and stores instructions dispatched by the instruction fetch unit, renames special vector registers, conditionally decodes instructions, and generates pipeline stall signals. It also receives and writes data from one or more of the scalar arithmetic unit, memory access unit, program control unit, synchronization unit, special vector registers, condition registers, and flag registers. It also sends instructions to one or more of the arithmetic hold stack unit, memory hold stack unit, program control unit, and synchronization unit.
[0063] For example, the register renaming unit is used in a scalar processor to receive instructions dispatched by the instruction fetch unit and perform register and special vector register renaming, instruction conditional decoding, and generate pipeline congestion signals. At the same time, it receives data from the execution unit (such as the scalar operation unit, memory access unit, program control unit, synchronization unit) to write back registers, special vector registers, condition registers, and status flag registers and writes them back to the corresponding registers.
[0064] The scalar processor write-back supports out-of-order write-back, has high execution efficiency, and distributes instructions to the operation retention stack unit, the storage retention stack unit, the program control unit, or the synchronization unit.
[0065] The register renaming unit bandwidth may be 6 bits, wherein multiple (eg, 4) input instructions may be valid at the same time.
[0066] There can be multiple condition registers, which are located in the register renaming unit.
[0067] The instructions of the scalar operation unit and memory access unit support the operations of reading and writing condition registers.
[0068] The synchronous unit's instructions support the operation of reading the condition register.
[0069] The jump and function call instructions of the program control unit support the operation of reading the condition register.
[0070] When an instruction enters the condition register, if there is an unexecuted instruction in the condition register, the pipeline is blocked.
[0071] That is, the condition register is not renamed, and when a read-write dependency occurs, a dispatch block is triggered to wait. The read and write rules for the condition register are as follows:
[0072] ●Read the rules:
[0073] (1) All instructions of the scalar arithmetic unit, memory access unit, and synchronization unit support conditional execution and require reading the value of the condition register.
[0074] (2) The scalar arithmetic unit also supports read conditional register instruction operations.
[0075] (3) The jump and function call instructions of the program control unit support read condition register operations.
[0076] ●Write rules:
[0077] (1) The scalar arithmetic unit supports write conditional register instructions.
[0078] (2) Scalar operation unit logic instructions and comparison instructions support the option of writing condition registers.
[0079] When the previously issued instruction to write the condition register has not yet been completed, and an instruction to read or write the same condition register enters, the pipeline is blocked and a conditional execution blocking signal is generated, waiting for the previous condition register to be written.
[0080] In addition, the register renaming unit includes: one or more physical registers and one or more logical registers.
[0081] Wherein, any physical register is one of the following: a scalar physical register, a vector physical register, a condition register, and a flag register.
[0082] Any logical register is one of the following: a scalar logical register, a vector logical register.
[0083] For example, the register renaming unit includes one or more physical registers, such as a plurality of 512-bit wide special vector registers, a plurality of condition registers, and a status flag register.
[0084] Among them, special vector registers are renamed, while condition registers and status flag registers are not renamed.
[0085] There are multiple logical registers, such as multiple logical registers including scalar logical registers and multiple vector logical registers.
[0086] In addition, the mapping relationship between logical registers and physical registers is maintained by the register mapping table. The mapping relationship between vector logical registers and vector physical registers is maintained by the special vector register mapping table.
[0087] 1) Register Mapping Table
[0088] Initially, the physical registers mapped to the entries corresponding to all logical register indices in the register mapping table are all 0. When an instruction is executed or an interrupt occurs, the logical registers allocated to the relevant physical registers are determined, and the mappings of the entries corresponding to the allocated logical register indices in the register mapping table are updated to the identifiers of the relevant physical registers.
[0089] For example, the register mapping table is 32 bits deep and 6 bits wide, storing the mapping relationship between all logical registers and all physical registers. Initially, the mapping in the register mapping table is invalid, and all entries mapping physical registers are all zeros. When a physical register is allocated to a logical register, the entry corresponding to the logical register index in the register mapping table is changed to the ID of the physical register.
[0090] It should be noted that the register mapping table will only be updated when the instruction is actually executed. If the conditional execution instruction is not executed, the register mapping table will not be updated. In addition, the register mapping table will not be updated when a jump occurs. However, when an interrupt occurs, the interrupt return address must update the register mapping table to ensure that the interrupt can return normally.
[0091] 2) Special vector register mapping table
[0092] Initially, the mapping vector physical registers of all entries corresponding to the vector logical register indexes in the special vector register mapping table are all 0. When an instruction is executed, the vector logical register allocated to the relevant vector physical register is determined, and the mapping of the entry corresponding to the allocated vector logical register index in the special vector register mapping table is updated to the identifier of the relevant vector physical register.
[0093] For example, the special vector register mapping table has a depth of 4 and a width of 3 bits, storing the mapping relationship between all vector logical registers and all vector physical registers. Initially, the special vector register mapping table is invalid, and all entries for the mapped vector physical registers are all zeros. When a vector physical register is assigned to a vector logical register, the entry corresponding to the vector logical register index in the special vector register mapping table is changed to the ID of the vector physical register.
[0094] It should be noted that the special vector register mapping table is updated only when the instruction is actually executed. If the conditional execution instruction is not executed, the special vector register mapping table will not be updated. In addition, the special vector register mapping table will not be updated when a jump occurs.
[0095] 3. Operation reservation stack unit
[0096] The operation reserve stack unit is the emission queue of the scalar operation unit.
[0097] The operation reserve stack unit receives instructions, dispatch and renaming information from the register renaming unit and pushes them into the queue. It then pops ready instructions to the scalar operation unit for execution.
[0098] The operation reserve stack unit is also used to decode input instructions and store instruction type information.
[0099] In other words, the Arithmetic Hold Stack unit acts as the issue queue for the scalar arithmetic unit. It receives instructions and associated dispatch and renaming information from the register renaming unit, pushes them into the queue, and then pops ready instructions onto the scalar arithmetic unit for execution. The Arithmetic Hold Stack unit decodes the incoming instructions and stores the instruction type information.
[0100] In specific implementation, the depth of the operation reserve stack unit can be flexibly adjusted, for example, the depth of the operation reserve stack unit is 8. Multiple scalar operation units share one operation reserve stack unit.
[0101] The rules for issuing and receiving instructions for the operation reserve stack unit are as follows:
[0102] (1) The output of the register renaming unit enters the operation preservation stack unit.
[0103] (2) When there is any idle scalar operation unit, it will fetch instructions and operands from the operation reservation stack unit for execution.
[0104] (3) The principle of executing instructions from the operation reservation stack unit is to execute the executable instructions that can be sent from the operation reservation stack unit in a forward-to-back order.
[0105] (4) Whether the transmission can be made is determined by whether the values of all source registers or special vector registers or condition registers and status flag registers are ready.
[0106] (5) If there are multiple instructions that can be sent, the oldest instruction will be sent first according to the instruction order.
[0107] (6) If any scalar operation unit is blocked, it can no longer receive new instructions.
[0108] (7) If the instruction previously sent to any scalar operation unit is a division instruction, a new division instruction can only be sent to it after the division result calculation is completed and the calculation completion En signal is returned.
[0109] 4. Storage Retention Stack Unit
[0110] The storage reservation stack unit is the transmit queue of the memory access unit.
[0111] The storage reservation stack unit is used to receive instructions and register renaming information from the register renaming unit and push them into the queue.
[0112] The storage reservation stack unit is also used to send a read request to the register renaming unit when the instruction address register is ready, and save the read address operand.
[0113] The register renaming unit is also used to calculate the address, decode the address, and save the decoding information after the instruction obtains the address.
[0114] The register renaming unit is also used to detect when the source register of any instruction is ready and the address decoding is completed, and then send it to the memory access unit for execution.
[0115] In specific implementation, the depth of the storage reservation stack unit can be flexibly adjusted, such as the depth of the storage reservation stack unit is 16. Multiple memory access units share one storage reservation stack unit. The storage reservation stack unit is the transmission queue of the memory access unit. The storage reservation stack unit receives instructions and register renaming information from the register renaming unit and pushes them into the queue. When the instruction address register in the storage reservation stack unit is ready, a read request is sent to the register renaming unit and the read address operand is saved in the queue. After the instruction in the storage reservation stack unit obtains the address, the address can be calculated and decoded, and the generated decoding information is saved in the queue. When the source register of an instruction (such as a write instruction) in the storage reservation stack unit is ready and the address decoding is completed, it can be transmitted to the memory access unit for execution. Before transmission, it must undergo a series of checks, such as address type check, address comparison check, and address forward check.
[0116] The rules for sending and receiving instructions to the storage reserve stack unit are as follows:
[0117] (1) The output of the register renaming unit enters the storage reservation stack unit.
[0118] (2) When the source operand for calculating the address is ready, the memory access address is calculated and saved in the storage reservation stack unit.
[0119] (3) Instructions with unrelated addresses: They can be sent out of order. The out-of-order rules are: read instructions after read instructions, write instructions after read instructions, and read instructions after write instructions. They can all be sent out of order. Write instructions after write instructions need to maintain order (they cannot be sent to different memory access units at the same time). Even if the addresses are unrelated, write instructions after write instructions still need to maintain order.
[0120] (4) Address-related instructions: read instructions followed by write instructions, write instructions followed by read instructions, write instructions followed by write instructions, and read instructions followed by read instructions all need to be performed in order.
[0121] (5) When the addresses are unrelated but all instructions that have not been sent successfully (i.e., instructions on the way that have not been sent to the destination, including those at the memory access unit level and the memory access unit output level) are located in the same storage space, they can be sent out of order to the same memory access unit, but they cannot be sent to two or more memory access units.
[0122] (6) Only one memory access instruction located in the same storage space but with unrelated addresses can be sent at the same time, and two or more memory access units cannot be sent at the same time.
[0123] (7) Address correlation judgment principle: Whether the addresses are related is irrelevant if they are located in different storage spaces. If they are located in the same storage space, whether the addresses are related is determined based on the data granularity.
[0124] 5. Scalar arithmetic unit
[0125] In a specific implementation, there may be one or more scalar operation units.
[0126] For example, the scalar processor includes two scalar arithmetic units, namely scalar arithmetic unit 0 and scalar arithmetic unit 1.
[0127] The scalar operation unit is used to receive instructions and data sent by the operation reservation stack unit, perform operations on the data based on the instructions, and write the operation results back to the register renaming unit.
[0128] The scalar arithmetic unit is the computing unit of the scalar processor, which can perform various types of fixed-point and floating-point operations, such as addition, subtraction, multiplication, division, logical operations, comparison operations, shifts, etc. It receives instructions and data sent by the operation reserve stack unit, performs operations, and writes the results back to the register file unit of the register renaming unit or the special vector register file unit.
[0129] Several instruction examples are provided below as examples. In specific implementation, they are not limited to the following instructions, nor are they limited to including all instructions.
[0130] Instructions with execution level one include: fixed-point addition and subtraction, logical instructions, shift instructions, fixed-point and floating-point comparison instructions, read and write Flag instructions, fixed-point maximum and minimum instructions, ABS instructions, bit reversal instructions, selection instructions, special vector register distribution instructions, read special vector register instructions, Byte reversal instructions, Merge instructions, immediate value assignment instructions, FirstOne instructions, CRC instructions, floating-point classification instructions, floating-point partial domain extraction, and Rounding instructions.
[0131] Instructions with execution level three include: fixed-point multiplication instructions, fixed-floating-point conversion instructions, bit filtering instructions, Count instructions, and floating-point addition and subtraction instructions.
[0132] Instructions that support Bypass include: selection instructions, fixed-point addition and subtraction instructions, shift instructions, immediate value assignment instructions, ABS instructions, logical instructions, comparison instructions, and maximum and minimum instructions.
[0133] The execution cycle of the division instruction is uncertain and is related to the data of the divisor and the dividend. When the instruction is executed, a DivEn instruction will be generated to indicate that the instruction is executed and the result is output to the register stack. No new division instructions can be input during the execution of the division instruction, but other scalar calculation unit instructions can be input. After the division is executed, the output result is reused with the output port of the first-stage pipeline. When the output port of the first-stage pipeline is not used by other scalar calculation unit instructions, the division outputs its result and outputs the DivEn identifier at the same time. The DivEn identifier is output to the operation retention stack unit, indicating that the Div instruction can continue to be output to the current scalar calculation unit.
[0134] 6. Memory access unit
[0135] In a specific implementation, there may be one or more memory access units.
[0136] For example, a scalar processor includes two memory access units, namely memory access unit 0 and memory access unit 1.
[0137] The memory access unit is used to receive instructions, data and register information sent by the storage reservation stack unit, and read and write the data based on the instructions and register information.
[0138] The memory access unit is a functional module that executes memory access-related instructions for scalar processors. The memory access unit receives instructions and data, as well as register-related information, from the storage retention stack unit. It executes instructions accordingly and interacts with other units to read and write data. Read instructions and atomic write instructions require writing data back to the register renaming unit. These instructions include register-level read and write instructions, including 8-bit, 16-bit, 32-bit, 64-bit, or other bit granularities, as well as vector read and write instructions, including 128-bit, 256-bit, 512-bit, or other bit granularities. Different instructions have different processing cycles.
[0139] In addition, the memory access unit is responsible for providing the relevant instruction quantity information required by FENCE. The memory access unit interacts with the storage reservation stack unit to complete the data storage configuration.
[0140] 7. Program control unit
[0141] In a specific implementation, there is only one program control unit.
[0142] The program control unit is configured to receive instructions and data from the register renaming unit, process the data based on the instructions, and output a processing result.
[0143] The program control unit (PCU) executes instructions related to the scalar processor's program execution sequence. The PCU receives instructions and data from the register renaming unit (RRU), processes the data accordingly, and outputs the results to other modules in the scalar processor. Different instructions are processed in different time periods.
[0144] The program control unit is responsible for controlling the direction of program execution (such as stop, interrupt, jump, function call), involving the execution of related instructions and the reading and writing control of configuration information; the program control unit is responsible for the configuration and prefetch operations of the instruction cache, as well as FENCE operations; the program control unit is responsible for the reading, writing and control of the counter, as well as the reading and writing of some other control information.
[0145] 8. Synchronization unit
[0146] In a specific implementation, there is only one synchronization unit.
[0147] Synchronization unit, used to synchronize the scalar processor and the vector processor.
[0148] like Figure 2 As shown, a communication connection is established between the synchronization unit and the pipeline control unit, the register renaming unit, the program control unit, and the vector processor.
[0149] The instructions of the synchronization unit come from the register renaming unit, and the reading and writing of the data of the synchronization unit interact with the register renaming unit.
[0150] The synchronization unit is used to receive the pause signal sent by the pipeline control unit and send the execution level pause signal generated when communicating with the vector processor to the pipeline control unit so as to generate the execution pause signal of the scalar processor.
[0151] The synchronization unit is used to generate instructions and transmit them to the program control unit.
[0152] That is to say, the synchronization unit is a unit that synchronizes the scalar processor and the vector processor. It receives instructions and data sent by the register renaming unit, reads data from the vector processor and writes it back to the register stack, reads data from the register stack unit or the special vector register stack unit and sends it to the functional module of the vector processor. It is responsible for the startup and status query of the vector processor, such as querying the reading and writing of the read and write FIFO (FirstInput FirstOutput) in the vector program control unit of the vector processor, the configuration of the register file stack, the reading or writing of the scalar register, the register file stack status query, the reading FIFO depth, the reading of the startup vector processor instruction counter, etc., and providing the program control unit with the synchronization unit instruction information.
[0153] The synchronization unit interacts with the pipeline control unit, register renaming unit, and program control unit within the scalar processor, as well as with the external vector processor, scalar processor, and vector processor transfer queue module. Synchronization unit instructions originate from the register renaming unit, and data reading and writing require interaction with the register renaming unit. The synchronization unit receives a block signal from the pipeline control unit and, when communicating with the vector processor, generates its own execute-level block signal and sends it to the pipeline control unit, which generates an execute-level signal that affects the entire scalar processor. The synchronization unit generates the instruction to be executed in the next cycle and transmits it to the program control unit for use by the program control unit's counter instruction. Interactions with the vector processor include, but are not limited to, configuring the register file with special vector registers or registers, reading and writing scalar registers, and querying the write status of the register file. Interactions with the scalar processor and vector processor transfer queue module include, but are not limited to, starting the vector processor, querying vector processor status, reading and writing data in the vector processor's instruction fetch unit FIFO, reading the FIFO depth, and reading the start vector processor instruction counter.
[0154] Therefore, in a specific implementation, the synchronization unit may have the following functions (it should be noted that the following functions are only examples, and other functions may be provided. This embodiment and subsequent embodiments do not limit the specific functions of the synchronization unit):
[0155] The start vector processor function is used to start the vector processor, including immediate start and register start, such as the pipeline waits until the start is successful, or writes the result of the start success or failure back to the destination register.
[0156] Query the vector processor execution status function, support option B.
[0157] Read and write FIFO function, the FIFO is located in the instruction fetch unit of the vector processor, such as the FIFO bit width 32 bits, the read and write FIFO such as the read and write FIFO waits until success, or the read and write FIFO success or failure result is written back to the register.
[0158] Write register file stack functions, including special vector register writes or register writes.
[0159] Read and write scalar register functions, including immediate index or register index read and write.
[0160] Query the register file stack write back status function, such as waiting until all writes to the register file stack are completed, or returning the result of whether the write to the register file stack is completed to the register.
[0161] When the related operations are not completed, the synchronization unit will generate its own blocking signal, blocking and waiting, and the signal will be sent to the pipeline control unit to generate a pipeline blocking signal.
[0162] A FIFO (such as a 32-bit deep FIFO) can also be added between the scalar processor and the vector processor to store the request to start the vector processor, and move the read and write FIFO previously located in the vector processor to the scalar processor and vector processor transmission queue module. The scalar processor and vector processor transmission queue module unit implements the startup of the vector processor, queries the execution status of the vector processor, reads and writes FIFO functions, reads FIFO depth functions, and reads the startup vector processor instruction counter function. The condition for the successful startup of the vector processor is that the startup vector processor FIFO is not full, and the query of the vector processor execution status is passed. The condition for the vector processor status to be stopped is that the vector processor execution is completed and the startup vector processor FIFO is empty.
[0163] 9. Assembly line control unit
[0164] The pipeline control unit is used to generate a pipeline pause signal and / or generate a start and stop signal for the scalar processor.
[0165] The pipeline control unit is the pipeline control unit of the scalar processor, which is connected to each unit inside the scalar processor and is responsible for generating pipeline blocking signals, such as blocking in normal working mode and blocking in debug mode.
[0166] The pipeline control unit also communicates with the communication and synchronization unit to generate signals for starting and stopping the scalar processor.
[0167] Furthermore, in practical applications, scalar processors can also perform conditional execution decoding. For example, when performing conditional execution decoding, a scalar processor determines the execution condition of the instruction's preset bits. If the condition is met, a valid instruction is output; otherwise, a null instruction is output. A null instruction refers to an empty or invalid instruction.
[0168] If there are read or write operations on the condition register, the pipeline is blocked and the read operation can only be performed after the write operation is completed. There is no bypass when reading or writing the condition register.
[0169] Taking two condition registers, namely condition register 0 and condition register 1, and the preset bits being [29:28] as an example, when the scalar processor performs conditional execution decoding, the scalar processor judges the execution condition of the input instruction based on the [29:28] bits of the instruction set encoding. If the condition is met, a valid instruction is output, otherwise an empty instruction is output.
[0170] Among them, [29:28] bits are 00, indicating that condition register 0 is 1 and execution is executed, [29:28] bits are 01, indicating that condition register 1 is 1 and execution is executed, [29:28] bits are 10, indicating that condition register 0 is executed, and [29:28] bits are 11, indicating unconditional execution. If the condition is not met, the instruction is invalid and a null instruction is output.
[0171] If the condition register is read or written, the pipeline is blocked and the read operation is performed after the condition register is written. There is no bypass when reading or writing the condition register.
[0172] This embodiment provides a scalar processor, comprising: an instruction fetch unit, a register renaming unit, an operation reserve stack unit, a storage reserve stack unit, a scalar operation unit, a memory access unit, a program control unit, a synchronization unit, a pipeline control unit, a register file unit, and a special vector register file unit; wherein the synchronization unit is used to synchronize the scalar processor with the vector processor. The scalar processor achieves synchronization with the vector processor through the synchronization unit, thereby efficiently executing instructions.
[0173] Based on the same inventive concept of a scalar processor, this embodiment provides a high-performance processor, which includes a scalar processor and a vector processor.
[0174] The connection relationship between the scalar processor and the vector processor can be shown as follows Figure 3 shown.
[0175] The scalar and vector processors share data storage. The vector processors can only access the data storage and are executed only by the scalar processors.
[0176] A connection is established between the scalar processor and the vector processor. For example, the scalar processor and the vector processor are connected via a dedicated instruction channel.
[0177] In addition, the high-performance processor may also include two registers, one register corresponding to the scalar processor and the other register corresponding to the vector processor. The vector processor can read and write its corresponding register, and the scalar processor can read and write its corresponding register as well as the vector processor's corresponding register.
[0178] The scalar processor can read and write the registers of the vector processor.
[0179] Scalar processors establish connections to global memory.
[0180] (1) Scalar processor
[0181] Scalar processors can be Figure 1 Scalar processor shown.
[0182] That is, the scalar processor includes: an instruction fetch unit, a register renaming unit, an operation reservation stack unit, a storage reservation stack unit, a scalar operation unit, a memory access unit, a program control unit, a synchronization unit, a pipeline control unit, a register file unit, and a special vector register file unit.
[0183] The instruction fetch unit is used to fetch and dispatch instructions.
[0184] The register renaming unit is used to receive instructions dispatched by the instruction fetch unit and rename registers.
[0185] The operation reserve stack unit is the emission queue of the scalar operation unit.
[0186] The storage reservation stack unit is the transmit queue of the memory access unit.
[0187] The scalar operation unit is used to receive instructions and data sent by the operation reservation stack unit, perform operations on the data based on the instructions, and write the operation results back to the register renaming unit.
[0188] The memory access unit is used to receive instructions, data and register information sent by the storage reservation stack unit, and read and write the data based on the instructions and register information.
[0189] The program control unit is configured to receive instructions and data from the register renaming unit, process the data based on the instructions, and output a processing result.
[0190] Synchronization unit, used to synchronize the scalar processor and the vector processor.
[0191] The pipeline control unit is used to generate a pipeline pause signal and / or generate a start and stop signal for the scalar processor.
[0192] Optionally, the scalar processor further includes: instruction cache and data storage.
[0193] The instruction fetch unit generates an instruction fetch request address, outputs the fetch request address to the instruction cache for instruction fetching, receives instructions from the instruction cache, and stores them in the data store. Each cycle, it sequentially reads qualified instructions from the data store, decodes and performs relevant checks on the read instructions, and then dispatches the checked instructions sequentially.
[0194] Optionally, the scalar processor further includes: a special vector register and a status flag register.
[0195] The register rename unit receives and stores instructions dispatched by the instruction fetch unit, renames special vector registers, conditionally decodes instructions, and generates pipeline stall signals. It receives and writes data from one or more of the scalar arithmetic unit, memory access unit, program control unit, synchronization unit, special vector registers, condition registers, and flag registers. It also sends instructions to one or more of the arithmetic hold stack unit, memory hold stack unit, program control unit, and synchronization unit.
[0196] The condition register is located in the register renaming unit.
[0197] The instructions of the scalar operation unit and memory access unit support the operations of reading and writing condition registers.
[0198] The synchronous unit's instructions support the operation of reading the condition register.
[0199] The jump and function call instructions of the program control unit support the operation of reading the condition register.
[0200] When an instruction enters the condition register, if there is an unexecuted instruction in the condition register, the pipeline is blocked.
[0201] Optionally, the register renaming unit includes: one or more physical registers and one or more logical registers.
[0202] Wherein, any physical register is one of the following: a scalar physical register, a vector physical register, a condition register, and a flag register.
[0203] Any logical register is one of the following: a scalar logical register, a vector logical register.
[0204] The mapping relationship between logical registers and physical registers is maintained in a register mapping table. Initially, all entries in the register mapping table corresponding to the logical register index have all mapped physical registers set to 0. When an instruction is executed or an interrupt occurs, the logical register assigned to the relevant physical register is determined, and the mapping of the entry corresponding to the assigned logical register index in the register mapping table is updated to the identifier of the relevant physical register.
[0205] The mapping relationship between vector logical registers and vector physical registers is maintained in a special vector register mapping table. Initially, all entries in the special vector register mapping table corresponding to the vector logical register indexes are mapped to zeros. When an instruction is executed, the vector logical register assigned to the relevant vector physical register is determined, and the mapping of the entry corresponding to the assigned vector logical register index in the special vector register mapping table is updated to the identifier of the relevant vector physical register.
[0206] Optionally, the operation reserve stack unit is used to receive instructions, dispatch and renaming information from the register renaming unit, push them into the queue, and pop ready instructions to the scalar operation unit for execution.
[0207] The operation reserve stack unit is also used to decode input instructions and store instruction type information.
[0208] Optionally, the storage reservation stack unit is used to receive instructions and register renaming information from the register renaming unit and push them into the queue.
[0209] The storage reservation stack unit is also used to send a read request to the register renaming unit when the instruction address register is ready, and save the read address operand.
[0210] The register renaming unit is also used to calculate the address, decode the address, and save the decoding information after the instruction obtains the address.
[0211] The register renaming unit is also used to detect when the source register of any instruction is ready and the address decoding is completed, and then send it to the memory access unit for execution.
[0212] Optionally, when performing conditional execution decoding, the scalar processor judges the execution condition of the preset bit of the instruction, and outputs a valid instruction if the condition is met, otherwise outputs an empty instruction.
[0213] If there are read or write operations on the condition register, the pipeline is blocked and the read operation can only be performed after the write operation is completed. There is no bypass when reading or writing the condition register.
[0214] Optionally, a communication connection is established between the synchronization unit and the pipeline control unit, the register renaming unit, the program control unit, and the vector processor.
[0215] The instructions of the synchronization unit come from the register renaming unit, and the reading and writing of the data of the synchronization unit interact with the register renaming unit.
[0216] The synchronization unit is used to receive the pause signal sent by the pipeline control unit and send the execution level pause signal generated when communicating with the vector processor to the pipeline control unit so as to generate the execution pause signal of the scalar processor.
[0217] The synchronization unit is used to generate instructions and transmit them to the program control unit.
[0218] (2) Vector Processor
[0219] See also Figure 4 ,The vector processor includes : a vector program control unit, multiple ,functional units, a register file and a scalar register.
[0220] In addition, the vector processor also includes: a private vector register of a vector interleaving unit and a private vector register of a vector access unit.
[0221] 1. Vector program control unit
[0222] Vector program control unit, used for instruction fetching and instruction issuance.
[0223] That is, the vector program control unit is used to fetch instructions, determine whether to execute them, and send the instructions to the functional units based on the determination result.
[0224] The vector program control unit is also used to control instruction jumps.
[0225] The vector program control unit has scalar computing capabilities.
[0226] The vector program control unit interacts with the scalar registers.
[0227] In specific implementation, the vector program control unit is an instruction fetch and instruction issuance unit. It takes instructions from the cache according to the PC value, and after determining whether to execute them, it issues the instructions to each functional unit according to the wait value (configured by the wait instruction). At the same time, it controls the jump of instructions and has some scalar computing capabilities.
[0228] In addition, the vector program control unit is further configured to receive a start command from other operation processors to start the vector processor and return an indication signal to the other operation processors indicating whether the vector processor has finished operation.
[0229] Taking the scalar processor as an example, the vector program control unit receives the start command issued by the synchronization unit of the scalar processor, starts the vector processor execution, and also returns an indication signal indicating whether the synchronization unit vector processor execution is completed.
[0230] 2. Functional Unit
[0231] Functional unit, used to perform functional processing according to instructions.
[0232] For example, the functional unit receives an instruction from the vector program control unit, processes data accordingly according to the instruction, and outputs the processing result according to the address specified in the instruction.
[0233] The functional units include: one or more vector operation units, one or more vector interleaving units, and one or more vector access units.
[0234] 1) Vector operation unit
[0235] Any vector arithmetic unit, used to perform vector operations according to instructions.
[0236] like Figure 5 As shown, any vector operation unit includes: a floating-point multiplication-addition operator unit, a floating-point multiplication-accumulation operator unit, a floating-point arithmetic operator unit, a tensor multiplication subunit and an intermediate result register.
[0237] The floating-point multiplication and addition unit and the floating-point arithmetic unit share a single issue slot, so a maximum of eight vector unit instructions can be issued per cycle.
[0238] The floating-point multiply-accumulate operator and the tensor multiplication subunit share one emit slot.
[0239] The floating-point multiply-add operator unit is a functional unit that executes floating-point multiply-add operator unit related instructions. For example, floating-point multiply-add operator unit related instructions include integer and floating-point vector multiplication and accumulation, multiplication, addition, tensor calculation, etc.
[0240] 1 vector operation unit has independent intermediate result registers.
[0241] One floating-point multiplication-addition operator unit, one floating-point multiplication-accumulation operator unit, one tensor multiplication subunit, and one floating-point arithmetic operator unit share intermediate result registers.
[0242] (1) Floating-point multiplication-addition operator unit and floating-point multiplication-accumulation operator unit, which can perform integer and floating-point vector multiplication, multiplication-accumulation and other operations. Supported types include but are not limited to int32, fp32, and fp64.
[0243] (2) The floating-point arithmetic subunit can perform integer and floating-point vector arithmetic operations, such as comparison, addition, subtraction, bitwise operations, etc. Supported types include but are not limited to int8, uint8, int16, uint16, int32, uint32, bool, fp16, bf16, fp32, tf32, and fp64.
[0244] (3) The tensor multiplication subunit can perform tensor multiplication, multiply-accumulate and other operations. Supported types include but are not limited to int8, bf16, fp16, and tf32.
[0245] 2) Vector interleaving unit
[0246] Any vector interleaving unit is used to perform data interleaving and logic processing according to instructions.
[0247] The vector interleaver unit is the control and data processing unit within the vector processor. It is responsible for interleaving data and supports logical and some fixed-point and floating-point calculations. It also supports a wide range of customized instructions, including table lookup, lateral calculations, sparse matrix calculations, precision conversion, and FIFO (First Input First Output). It also executes instructions such as data broadcasting, extraction, and internal interleaving.
[0248] Each vector interleaving unit has a set of private vector registers, so the private vector registers of the vector interleaving units correspond one to one with the vector interleaving units.
[0249] 3) Vector access unit
[0250] Any vector access unit, used to perform multi-mode memory access, address calculation and scalar calculation according to the instruction.
[0251] The vector access unit is a memory access unit within a vector processor, primarily responsible for reading / writing instructions and various scalar calculations.
[0252] The read instruction / write instruction supports multiple memory access modes, such as row mode, column mode / discrete mode / extended mode / accumulated mode.
[0253] It also supports multiple parameter configurations, with a maximum read / write instruction data width of 1024 bits. It can also perform address calculation, load / store and other instructions.
[0254] All vector access units share a set of private vector registers, so the private vector registers of a vector access unit are shared by multiple vector access units.
[0255] 3. Register file stack
[0256] The register file receives read and write requests and returns data. It rearranges the data before returning it. It interacts with the functional units for read and write operations. The vector program control unit's configuration registers are configured using data in the register file.
[0257] The register file is a general-purpose vector register stack and is the main storage unit within the vector processor. It is responsible for receiving read and write requests and returning data. In some functions, it can rearrange the data before returning it to the request module.
[0258] The register file stack performs read and write interactions with the functional units in the vector processor (such as the floating-point multiplication-addition operator unit, the floating-point arithmetic operator unit, the floating-point multiplication-accumulation operator unit, and the tensor multiplication subunit), and supports the use of data in the register file stack to configure the instruction fetch unit configuration register.
[0259] The register file stack is also used to write data to other processors and receive status information from other processors to check whether the data has been written.
[0260] Taking a scalar processor as an example, the synchronization unit of the scalar processor can write data into the register file stack, and the register file stack can also receive status information from the synchronization unit of the scalar processor to inquire whether the data has been written.
[0261] The depth of the register file is configurable.
[0262] Figure 6 A schematic diagram of a vector processor is shown, in which the functional units include four vector operation units, four vector interleaving units, and four vector access units.
[0263] The vector processor provided in this embodiment supports a VLIW (Very Long Instruction Word) instruction set. Each VLIW may be composed of one or more instructions, and each instruction corresponds to a functional unit.
[0264] In addition, a read FIFO unit and a write FIFO unit are provided between the vector processor and other operation processors.
[0265] The vector program control unit and other operation processors both perform a read operation on the read FIFO unit and a write operation on the write FIFO unit.
[0266] Other arithmetic processors perform read operations or write operations on the vector registers.
[0267] Taking a scalar processor as an example, a read FIFO and a write FIFO unit for transmitting data are provided between the scalar processor and the vector processor. The scalar processor and the vector program control unit can perform read operations or write operations on the read and write FIFO.
[0268] At the same time, the synchronization unit of the scalar processor can read or write the scalar registers of the vector processor.
[0269] This embodiment provides a high-performance processor. A scalar processor in the high-performance processor includes: an instruction fetch unit, a register renaming unit, an operation reserve stack unit, a storage reserve stack unit, a scalar operation unit, a memory access unit, a program control unit, a synchronization unit, a pipeline control unit, a register file unit, and a special vector register file unit. The synchronization unit is used to synchronize the scalar processor with the vector processor. The high-performance processor achieves synchronization between the scalar processor and the vector processor through the synchronization unit, thereby efficiently executing instructions.
[0270] Based on the same inventive concept of the scalar processor, this embodiment provides an electronic device, which includes a high-performance processor, or the electronic device includes one or more processor clusters, wherein each processor cluster includes multiple high-performance processors.
[0271] Among them, heterogeneous multi-core processors can be Figure 3 As shown, the implementation details of heterogeneous multi-core processors can also be as follows Figure 3 The embodiments shown in the drawings have been described and will not be described in detail here.
[0272] For example, the high-performance processor includes a scalar processor and a vector processor.
[0273] Scalar processors can be Figure 1 Scalar processor shown.
[0274] That is, the scalar processor includes: an instruction fetch unit, a register renaming unit, an operation reservation stack unit, a storage reservation stack unit, a scalar operation unit, a memory access unit, a program control unit, a synchronization unit, a pipeline control unit, a register file unit, and a special vector register file unit.
[0275] The instruction fetch unit is used to fetch and dispatch instructions.
[0276] The register renaming unit is used to receive instructions dispatched by the instruction fetch unit and rename registers.
[0277] The operation reserve stack unit is the emission queue of the scalar operation unit.
[0278] The storage reservation stack unit is the transmit queue of the memory access unit.
[0279] The scalar operation unit is used to receive instructions and data sent by the operation reservation stack unit, perform operations on the data based on the instructions, and write the operation results back to the register renaming unit.
[0280] The memory access unit is used to receive instructions, data and register information sent by the storage reservation stack unit, and read and write the data based on the instructions and register information.
[0281] The program control unit is configured to receive instructions and data from the register renaming unit, process the data based on the instructions, and output a processing result.
[0282] Synchronization unit, used to synchronize the scalar processor and the vector processor.
[0283] The pipeline control unit is used to generate a pipeline pause signal and / or generate a start and stop signal for the scalar processor.
[0284] Optionally, the scalar processor further includes: instruction cache and data storage.
[0285] The instruction fetch unit generates an instruction fetch request address, outputs the fetch request address to the instruction cache for instruction fetching, receives instructions from the instruction cache, and stores them in the data store. Each cycle, it sequentially reads qualified instructions from the data store, decodes and performs relevant checks on the read instructions, and then dispatches the checked instructions sequentially.
[0286] Optionally, the scalar processor further includes: a special vector register and a status flag register.
[0287] The register rename unit receives and stores instructions dispatched by the instruction fetch unit, renames special vector registers, conditionally decodes instructions, and generates pipeline stall signals. It receives and writes data from one or more of the scalar arithmetic unit, memory access unit, program control unit, synchronization unit, special vector registers, condition registers, and flag registers. It also sends instructions to one or more of the arithmetic hold stack unit, memory hold stack unit, program control unit, and synchronization unit.
[0288] The condition register is located in the register renaming unit.
[0289] The instructions of the scalar operation unit and memory access unit support the operations of reading and writing condition registers.
[0290] The synchronous unit's instructions support the operation of reading the condition register.
[0291] The jump and function call instructions of the program control unit support the operation of reading the condition register.
[0292] When an instruction enters the condition register, if there is an unexecuted instruction in the condition register, the pipeline is blocked.
[0293] Optionally, the register renaming unit includes: one or more physical registers and one or more logical registers.
[0294] Wherein, any physical register is one of the following: a scalar physical register, a vector physical register, a condition register, and a flag register.
[0295] Any logical register is one of the following: a scalar logical register, a vector logical register.
[0296] The mapping relationship between logical registers and physical registers is maintained in a register mapping table. Initially, all entries in the register mapping table corresponding to the logical register index have all mapped physical registers set to 0. When an instruction is executed or an interrupt occurs, the logical register assigned to the relevant physical register is determined, and the mapping of the entry corresponding to the assigned logical register index in the register mapping table is updated to the identifier of the relevant physical register.
[0297] The mapping relationship between vector logical registers and vector physical registers is maintained in a special vector register mapping table. Initially, all entries in the special vector register mapping table corresponding to the vector logical register indexes are mapped to zeros. When an instruction is executed, the vector logical register assigned to the relevant vector physical register is determined, and the mapping of the entry corresponding to the assigned vector logical register index in the special vector register mapping table is updated to the identifier of the relevant vector physical register.
[0298] Optionally, the operation reserve stack unit is used to receive instructions, dispatch and renaming information from the register renaming unit, push them into the queue, and pop ready instructions to the scalar operation unit for execution.
[0299] The operation reserve stack unit is also used to decode input instructions and store instruction type information.
[0300] Optionally, the storage reservation stack unit is used to receive instructions and register renaming information from the register renaming unit and push them into the queue.
[0301] The storage reservation stack unit is also used to send a read request to the register renaming unit when the instruction address register is ready, and save the read address operand.
[0302] The register renaming unit is also used to calculate the address, decode the address, and save the decoding information after the instruction obtains the address.
[0303] The register renaming unit is also used to detect when the source register of any instruction is ready and the address decoding is completed, and then send it to the memory access unit for execution.
[0304] Optionally, when performing conditional execution decoding, the scalar processor judges the execution condition of the preset bit of the instruction, and outputs a valid instruction if the condition is met, otherwise outputs an empty instruction.
[0305] If there are read or write operations on the condition register, the pipeline is blocked and the read operation can only be performed after the write operation is completed. There is no bypass when reading or writing the condition register.
[0306] Optionally, a communication connection is established between the synchronization unit and the pipeline control unit, the register renaming unit, the program control unit, and the vector processor.
[0307] The instructions of the synchronization unit come from the register renaming unit, and the reading and writing of the data of the synchronization unit interact with the register renaming unit.
[0308] The synchronization unit is used to receive the pause signal sent by the pipeline control unit and send the execution level pause signal generated when communicating with the vector processor to the pipeline control unit so as to generate the execution pause signal of the scalar processor.
[0309] The synchronization unit is used to generate instructions and transmit them to the program control unit.
[0310] This embodiment provides an electronic device, wherein a scalar processor in the electronic device includes: an instruction fetch unit, a register renaming unit, an operation reserve stack unit, a storage reserve stack unit, a scalar operation unit, a memory access unit, a program control unit, a synchronization unit, a pipeline control unit, a register file unit, and a special vector register file unit; wherein the synchronization unit is used to synchronize the scalar processor with the vector processor. The electronic device achieves synchronization between the scalar processor and the vector processor through the synchronization unit, thereby efficiently executing instructions.
[0311] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code. The scheme in the embodiment of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal translation scripting language JavaScript, etc.
[0312] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0313] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0314] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0315] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0316] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A scalar processor, characterized in that The scalar processor includes: an instruction fetch unit, a register renaming unit, an operation reservation stack unit, a storage reservation stack unit, a scalar operation unit, a memory access unit, a program control unit, a synchronization unit, a pipeline control unit, a register file unit, and a special vector register file unit; The instruction fetch unit is used to fetch and dispatch instructions; The register renaming unit is used to receive instructions dispatched by the instruction fetch unit and rename registers; The operation reservation stack unit is an emission queue of the scalar operation unit; The storage reservation stack unit is a transmission queue of the memory access unit; The scalar operation unit is configured to receive instructions and data sent by the operation reservation stack unit, perform operations on the data based on the instructions, and write the operation results back to the register renaming unit; The memory access unit is used to receive instructions, data and register information sent by the storage reservation stack unit, and read and write the data based on the instructions and register information; The program control unit is configured to receive instructions and data from the register renaming unit, process the data based on the instructions, and output a processing result; The synchronization unit is used for synchronizing the scalar processor and the vector processor; The pipeline control unit is used to generate a pipeline pause signal and / or generate a start and stop signal for the scalar processor.
2. The scalar processor according to claim 1, wherein The scalar processor further includes: an instruction cache and data storage; The instruction fetch unit is used to generate an instruction fetch request address, output the instruction fetch request address to the instruction cache for instruction fetch, receive instructions from the instruction cache, and store them in the data storage; in each cycle, it sequentially reads qualified instructions from the data storage, decodes and performs relevant checks on the read instructions, and then sequentially dispatches the instructions that have completed the checks.
3. The scalar processor according to claim 1, wherein The scalar processor further includes: a special vector register and a status flag register; The register renaming unit is used to receive and store instructions dispatched by the instruction fetch unit, rename special vector registers, conditionally decode instructions, and generate pipeline blocking signals; receive data from one or more of the scalar operation unit, memory access unit, program control unit, synchronization unit, special vector registers, condition registers, and flag registers and write them back; send instructions to one or more of the operation retention stack unit, storage retention stack unit, program control unit, and synchronization unit; Wherein, the condition register is located in the register renaming unit; The instructions of the scalar operation unit and the memory access unit support operations of reading and writing the condition register; The instruction of the synchronization unit supports the operation of reading the condition register; The jump and function call instructions of the program control unit support the operation of reading the condition register; When an instruction enters a condition register, if there is an unexecuted instruction in the condition register, the pipeline is blocked.
4. The scalar processor according to claim 3, wherein: The register renaming unit includes: one or more physical registers and one or more logical registers; Wherein, any physical register is one of the following: a scalar physical register, a vector physical register, a condition register, or a flag register; Any logical register is one of the following: a scalar logical register, a vector logical register; The mapping relationship between logical registers and physical registers is maintained by a register mapping table. Initially, the physical registers mapped to the entries corresponding to all logical register indices in the register mapping table are all 0. When an instruction is executed or an interrupt occurs, the logical register assigned to the relevant physical register is determined, and the mapping of the entry corresponding to the assigned logical register index in the register mapping table is updated to the identifier of the relevant physical register. The mapping relationship between vector logical registers and vector physical registers is maintained by a special vector register mapping table; initially, the mapping vector physical registers of the table entries corresponding to all vector logical register indices in the special vector register mapping table are all 0; when an instruction is executed, the vector logical register allocated to the relevant vector physical register is determined, and the mapping of the table entry corresponding to the vector logical register index allocated in the special vector register mapping table is updated to the identifier of the relevant vector physical register.
5. The scalar processor according to claim 1, wherein: The operation reservation stack unit is used to receive instructions, dispatch and renaming information from the register renaming unit and push them into a queue; pop out ready instructions to the scalar operation unit for execution; The operation reserve stack unit is also used to decode the input instructions and store instruction type information.
6. The scalar processor according to claim 1, wherein: The storage reservation stack unit is used to receive instructions and register renaming information from the register renaming unit and push them into a queue; The storage reservation stack unit is further configured to send a read request to the register renaming unit when the instruction address register is ready, and save the read address operand; The register renaming unit is further used to calculate the address, decode the address, and save the decoding information after the instruction obtains the address; The register renaming unit is further used to detect when the source register of any instruction is ready and the address decoding is completed, and then transmit it to the memory access unit for execution.
7. The scalar processor according to claim 1, wherein: When the scalar processor performs conditional execution decoding, it judges the execution condition of the preset bit of the instruction, and outputs a valid instruction if the condition is met, otherwise it outputs an empty instruction; If there are read-write related operations on the condition register, the pipeline will be blocked and the read operation will be performed after the write operation of the condition register is completed. There is no bypass in the reading and writing of the condition register.
8. The scalar processor according to claim 1, wherein: The synchronization unit establishes a communication connection with the pipeline control unit, the register renaming unit, the program control unit, and the vector processor; The instructions of the synchronization unit come from the register renaming unit, and the reading and writing of data of the synchronization unit are all interacted with the register renaming unit; The synchronization unit is configured to receive a pause signal sent by the pipeline control unit and send an execution-level pause signal generated when communicating with the vector processor to the pipeline control unit, so as to generate an execution pause signal for the scalar processor; The synchronization unit is used to generate instructions and transmit them to the program control unit.
9. A high-performance processor, characterized in that: include: The scalar processor and vector processor according to any one of claims 1 to 8.
10. An electronic device, characterized in that: include: The high-performance processor according to claim 9; or, comprising one or more processor clusters, wherein each processor cluster comprises a plurality of high-performance processors according to claim 9.
Citation Information
Patent Citations
Vector single instruction multiple data-stream (SIMD) operation structure supporting synergistic working of scalar and vector
CN105373367A
Method and apparatus for asynchronous processor with auxiliary asynchronous vector processor
CN105393240A
Communication processor
CN110096307A
RISC-V vector memory access processing system and processing method
CN114579188A
Vector processor, high performance processor, and electronic device
CN120540709A
Cited By
Vector extension method and vector processor
CN121879955A