An instruction fetch pipeline for a storage-computation fusion processor

By designing six-level streaming finger fetching logic in the storage and computing converged processor and optimizing the pipeline structure, the problem of finger fetching pipeline delay is solved, and the system execution efficiency and performance are improved.

CN114528024BActive Publication Date: 2024-11-19安徽芯纪元科技有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210158362.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-21
Publication Date
2024-11-19
Estimated Expiration
2042-02-21

AI Technical Summary

Technical Problem

The finger fetch pipeline in existing memory and computing converged processors uses large instruction memory and cache, resulting in delay problems, affecting the system execution efficiency.

Method used

A six-level flow-based finger fetching logic is designed, including finger fetching address generation circuit, branch predictor and instruction buffer FIFO. By optimizing the pipeline structure, the critical path time is shortened, the system clock frequency is improved, and the finger fetching performance is enhanced.

Benefits of technology

It effectively improves program execution efficiency, reduces the Cache missing rate, and improves system execution performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114528024B_ABST
    Figure CN114528024B_ABST
Patent Text Reader

Abstract

The present invention discloses an instruction fetch pipeline for a storage-computation fusion processor. In order to maximize the computing performance of the storage-computation fusion processor, a larger instruction memory iMEM and a high-speed cache iCache are preferably used to replace the iCache and its related multi-level caches in a traditional instruction fetch module, so as to reduce the cache miss rate and improve the instruction fetch performance. However, larger storage means greater delay. For this reason, the present invention designs a six-level pipeline instruction fetch logic to replace the original four-level pipeline instruction fetch logic, shortening the duration of the critical path. The system clock frequency is determined by the critical path duration, so the system clock frequency is increased, thereby greatly improving the system execution efficiency. Although the number of instruction fetch pipeline stages increases, due to the presence of a branch predictor and an instruction buffer FIFO, the performance of the instruction fetch pipeline is not reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pipeline instruction fetching, and in particular to an instruction fetching pipeline for a storage-computation fusion processor. Background Art

[0002] As the gap between processor and memory technology increases, the scissors fork of the memory wall under the von Neumann architecture continues to grow, and the problem of the memory access power consumption wall becomes increasingly prominent. The focus of industry and academia begins to shift from computing to storage. At the same time, the rapid development of applications such as high-access memory, high-parallelism, and low-precision artificial intelligence and brain-like computing has also driven the rapid development of computational storage / computing-in-memory / computing-in-memory. The rapid development of computational storage / computing-in-memory / computing-in-memory is bound to bring greater data throughput requirements.

[0003] The instruction fetch (IF) stage is the process of fetching an instruction from the main memory to the instruction register. In order to maximize the advantages of computational storage / computation-in-memory / computation-in-memory, it is necessary to design instruction fetch logic that matches its throughput. At present, the traditional instruction fetch module uses iCache to cache the instruction machine code, but the capacity of iCache is usually small, the probability of cache miss is high, and the cost of cache miss is usually high. In order to maximize the computing performance of the storage-computation fusion processor, it is advisable to use a larger instruction memory iMEM (SRAM) and a high-speed cache iCache (SRAM) to replace the iCache and its related multi-level cache in the traditional instruction fetch module, reduce the cache miss rate, and improve the instruction fetch performance, but larger storage will bring greater delays and reduce the system execution efficiency. Summary of the invention

[0004] In view of the delay problem existing in the existing instruction fetch pipeline applied to a storage-computing fusion processor using a large instruction memory and a high-speed cache, the present invention provides an instruction fetch pipeline for the storage-computing fusion processor, which effectively improves the program execution efficiency.

[0005] An instruction fetch pipeline for a storage-computation fusion processor includes six stages of pipeline instruction fetch logic from F1 to F6, which are:

[0006] The F1-level pipeline unit generates the correct instruction fetch address based on the execution characteristics of the application program;

[0007] The F2-level pipeline unit sends the read address and related control signals of the iCache / iMEM, and the related control signals include but are not limited to the read enable signal;

[0008] The F3-level pipeline unit stores the read data returned by iCache / iMEM when the pipeline is paused; when the pipeline pause is released, the stored read data is sent to the F4-level pipeline unit;

[0009] The F4 pipeline unit determines whether iCache / iMEM hits. When iCache is missing, it generates pipeline pause signals for F1, F2, and F3, starts AXIMaster to read data from the external memory and update iCache. According to the hit judgment result, it selects the instruction packet returned by iCache, iMEM, or AXIMaster to read the data memory, makes branch prediction for the returned instruction packet, and sends the prediction result to the F5 pipeline unit. The branch prediction result takes effect in the F5 pipeline.

[0010] The F5-level pipeline unit buffers instruction packets through the instruction buffer FIFO and sends the branch prediction target address to the F1-level pipeline unit;

[0011] The F6-level pipeline unit converts the instruction packet into an execution packet according to the content in the instruction buffer FIFO and the instruction line end flag, and sends the execution packet to the execution pipeline.

[0012] Furthermore, the F1-level pipeline unit includes an instruction fetch address generation circuit, which is mainly composed of a multiplexer and a register. The instruction fetch source of the multiplexer includes but is not limited to a reset signal, an interrupt controller output, a branch jump, a branch prediction, and a sequential execution, wherein the interrupt controller output includes the output generated by an interrupt, an interrupt return, or an interrupt cancellation.

[0013] Furthermore, the F4-level pipeline unit includes a branch predictor, which adopts a local two-bit prediction scheme; after power-on reset, all register units in the branch prediction register are set to 2'b10. When predicting a branch, the branch predictor prediction is accessed using the instruction line PC[9:0] where the conditional branch instruction is located. If prediction[PC[9:0]][1]=1'b1, it means that the branch needs to jump, otherwise it does not jump; if the branch prediction result is a jump, the pipeline refresh signals of F1, F2, F3, and F4 are generated in the F5-level pipeline unit;

[0014] The content in the branch prediction register is updated according to the final calculation result of the conditional branch. The branch predictor predicts all 8 slots of the instruction package. When the branch instruction line in the instruction package crosses lines, that is, part of the instructions in the branch instruction line are located in the instruction package of level F3, when the remaining instruction packages in level F3 reach level F4, branch prediction cannot be made. At the same time, when the branch prediction result reaches level F5, the pipeline of level F4 is not cleared.

[0015] Furthermore, the F5-level pipeline unit includes an instruction buffer FIFO. The FIFO has a 6-bit read pointer fifo_rd and a 3-bit write pointer fifo_wr. fifo_rd[4:3] is used as a FIFO row read pointer, fifo_rd[2:0] is used as a FIFO row offset pointer, and fifo_wr[1:0] is used as a FIFO row write pointer.

[0016] The empty and full states of the FIFO are predicted by fifo_rd and fifo_wr. When fifo_wr = fifo_rd, the FIFO is predicted to be empty; when fifo_wr = {~fifo_rd[5], fifo_rd[4:3]}, and the F4 level instruction packet is valid, the FIFO is predicted to be full; when the FIFO is predicted to be full, the pipeline pause signals of F1, F2, F3, and F4 are generated;

[0017] When the instruction packet is all zero, the FIFO sends out the all-zero instruction packet and the FIFO read pointer increases by 8.

[0018] The six-stage pipeline instruction fetch logic designed in the present invention replaces the original four-stage pipeline instruction fetch logic, shortens the duration of the critical path, and the system clock frequency is determined by the critical path duration, thereby improving the system clock frequency, thereby greatly improving the system execution efficiency; although the number of instruction fetch pipeline stages increases, due to the presence of the branch predictor and the instruction buffer FIFO, the performance of the instruction fetch pipeline is not reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is the instruction fetch pipeline of the storage-computing fusion processor architecture;

[0020] Figure 2 It is the instruction fetch address generation circuit;

[0021] Figure 3 is a two-bit branch prediction scheme state diagram;

[0022] Figure 4 It is the instruction buffer FIFO structure. DETAILED DESCRIPTION

[0023] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The embodiments of the present invention are provided for the purpose of illustration and description, and are not intended to be exhaustive or to limit the present invention to the disclosed forms. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments are selected and described in order to better illustrate the principles and practical applications of the present invention, and to enable those of ordinary skill in the art to understand the present invention and thereby design various embodiments with various modifications suitable for specific uses.

[0024] Example 1

[0025] An instruction fetch pipeline for a storage-computation fusion processor, such as Figure 1 As shown, it includes six-stage pipeline instruction fetch logic F1-F6. The following is an introduction to these six-stage pipeline units.

[0026] 1. F1 level flow unit

[0027] The F1 pipeline unit contains an instruction fetch address generation circuit, which is used to generate the correct instruction fetch address according to the execution characteristics of the application. There are three instruction sources, namely iCache, iMem and BIU. BIU is the communication interface between the core and external devices, and the data of the external memory is read through BIU.

[0028] The instruction fetch address generation circuit is mainly composed of multiplexers and registers, such as Figure 2 As shown, the instruction fetching sources of the multiplexer include but are not limited to reset signals, interrupt controller outputs, branch jumps, branch predictions, and sequential execution, wherein the interrupt controller outputs include outputs generated by interrupts, interrupt returns, or interrupt cancellations.

[0029] 2. F2 level flow unit

[0030] Send the read address and related control signals of iCache / iMEM, where the related control signals include but are not limited to read enable signals.

[0031] 3. F3 level flow unit

[0032] When the pipeline is stalled, the read data returned by iCache / iMEM is stored; when the pipeline is released from the stall, the stored read data is sent to the F4 pipeline unit. The pipeline stall / pause release is determined based on the status of the pipeline stall signal of each level of pipeline units. If the pipeline stall signal stall=1, the pipeline is stalled; if the pipeline stall signal stall=0, the pipeline is released from the stall.

[0033] 4. F4 level flow unit

[0034] Determine whether iCache / iMEM hits: If the value address is within the iMEM address range, iMEM hits, and selects to receive the instruction packet returned by iMEM reading the data memory; if the value address is not within the iMEM address range, first access iCache to determine whether there is a corresponding instruction in iCache. If so, iCache hits, and selects to receive the instruction packet returned by iCache reading the data memory. If not, iCache is missing.

[0035] When iCache is missing, pipeline stall signals (i.e., stall is set) are generated for F1, F2, and F3, AXIMaster is started to read data from the external memory and update iCache, and the instruction packet returned by AXIMaster reading the data memory is selected to be received.

[0036] The F4-level pipeline unit includes a branch predictor (using a local two-bit branch prediction scheme), which makes branch predictions for the returned instruction packets and sends the prediction results to the F5-level pipeline unit.

[0037] After power-on reset, all register units in the branch prediction register are set to 2'b10. When predicting a branch, the instruction line PC[9:0] where the conditional branch instruction is located is used to access the branch predictor prediction, where PC[9:0] is the address of the branch prediction table. The address width changes according to the size of the branch prediction table structure. If prediction[PC[9:0]][1]=1'b1, it means that the branch needs to jump, otherwise it does not jump. If the branch prediction result is a jump, the pipeline refresh signal flush of F1, F2, F3, and F4 is generated in the F5-level pipeline unit to refresh the previous pipeline. The flush signal is a high level for one clk clock cycle, during which the intermediate results in the pipeline are reset to the initial value (including clearing stall).

[0038] The state diagram of the two-bit branch prediction scheme is as follows Figure 3 As shown, the value stored in the branch predictor prediction corresponds to the state Figure 3 The content in the branch prediction register is updated according to the final calculation result of the conditional branch. The branch predictor predicts all 8 slots of the instruction package. When the branch instruction line in the instruction package crosses lines, that is, part of the instructions in the branch instruction line are located in the instruction package of level F3, when the remaining instruction package in level F3 reaches level F4, branch prediction cannot be made. At the same time, when the branch prediction result reaches level F5, the pipeline of level F4 is not cleared.

[0039] 5. F5 level pipeline unit

[0040] The F5-level pipeline unit includes an instruction buffer FIFO, which buffers instruction packets and sends the branch prediction target address to the F1-level pipeline unit.

[0041] The instruction buffer FIFO has a 6-bit read pointer fifo_rd and a 3-bit write pointer fifo_wr. fifo_rd[4:3] is used as the FIFO line read pointer, fifo_rd[2:0] is used as the FIFO line offset pointer, and fifo_wr[1:0] is used as the FIFO line write pointer. Figure 4 shown.

[0042] The empty and full states of the FIFO are predicted by fifo_rd and fifo_wr. When fifo_wr = fifo_rd, the FIFO is predicted to be empty; when fifo_wr = {~fifo_rd[5], fifo_rd[4:3]}, and the F4 level instruction packet is valid, the FIFO is predicted to be full.

[0043] When the FIFO is predicted to be full, pipeline pause signals of F1, F2, F3, and F4 are generated; when the FIFO is released from full state, the pipeline pause signals of F1, F2, F3, and F4 are cleared; when the instruction packet is all zero, the FIFO sends out the all-zero instruction packet, and the FIFO read pointer is increased by 8 (one row of the FIFO corresponds to 8 instruction slots).

[0044] 6. The F6-level pipeline unit converts the instruction packet into an execution packet according to the content in the instruction buffer FIFO and the instruction line end flag, and sends the execution packet to the execution pipeline.

[0045] Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field and related fields without creative work should fall within the scope of protection of the present invention.

Claims

1. An instruction fetch pipeline for a storage-computation fusion processor, characterized in that: Contains six-stage pipeline instruction fetch logic from F1 to F6, which are: The F1-level pipeline unit generates the correct instruction fetch address based on the execution characteristics of the application program; The F2-level pipeline unit sends the read address and related control signals of the iCache / iMEM, and the related control signals include but are not limited to the read enable signal; The F3 pipeline unit stores the read data returned by iCache / iMEM when the pipeline is paused; When the pipeline pause is released, the stored read data is sent to the F4-level pipeline unit; The F4 pipeline unit determines whether iCache / iMEM hits. When iCache is missing, it generates pipeline pause signals of F1, F2, and F3, starts AXI Master to read data from the external memory and update iCache; according to the hit judgment result, it selects to receive the instruction packet returned by iCache, iMEM or AXI Master reading the data memory, makes branch prediction for the returned instruction packet, and sends the prediction result to the F5 pipeline unit; The F5-level pipeline unit buffers instruction packets through the instruction buffer FIFO and sends the branch prediction target address to the F1-level pipeline unit; The F6-level pipeline unit converts the instruction packet into an execution packet according to the content in the instruction buffer FIFO and the instruction line end flag, and sends the execution packet to the execution pipeline.

2. The instruction fetch pipeline for a storage-computation fusion processor according to claim 1, characterized in that: The F1-level pipeline unit includes an instruction fetch address generation circuit, which is mainly composed of a multiplexer and a register. The instruction fetch sources of the multiplexer include but are not limited to reset signals, interrupt controller outputs, branch jumps, branch predictions, and sequential executions, wherein the interrupt controller outputs include outputs generated by interrupts, interrupt returns, or interrupt cancellations.

3. The instruction fetch pipeline for a storage-computation fusion processor according to claim 1, characterized in that: The F4-level pipeline unit contains a branch predictor that uses a local two-bit prediction scheme; After power-on reset, all register units in the branch prediction register are set to 2'b10. When predicting a branch, the instruction line PC[9:0] where the conditional branch instruction is located is used to access the branch predictor prediction. If prediction[PC[9:0]][1]=1'b1, it means that the branch needs to jump, otherwise it does not jump; if the branch prediction result is a jump, the pipeline refresh signals of F1, F2, F3, and F4 are generated in the F5-level pipeline unit; The content in the branch prediction register is updated according to the final calculation result of the conditional branch. The branch predictor predicts all 8 slots of the instruction package. When the branch instruction line in the instruction package crosses lines, that is, part of the instructions in the branch instruction line are located in the instruction package of level F3, when the remaining instruction packages in level F3 reach level F4, branch prediction cannot be made. At the same time, when the branch prediction result reaches level F5, the pipeline of level F4 is not cleared.

4. The instruction fetch pipeline for a storage-computation fusion processor according to claim 1, characterized in that: The F5-level pipeline unit contains an instruction buffer FIFO. The FIFO has a 6-bit read pointer fifo_rd and a 3-bit write pointer fifo_wr. fifo_rd[4:3] is used as the FIFO row read pointer, fifo_rd[2:0] is used as the FIFO row offset pointer, and fifo_wr[1:0] is used as the FIFO row write pointer. The empty and full states of the FIFO are predicted by fifo_rd and fifo_wr. When fifo_wr = fifo_rd, the FIFO is predicted to be empty; when fifo_wr = {~fifo_rd[5], fifo_rd[4:3]}, and the F4 level instruction packet is valid, the FIFO is predicted to be full; when the FIFO is predicted to be full, the pipeline pause signals of F1, F2, F3, and F4 are generated; When the instruction packet is all zero, the FIFO sends out the all-zero instruction packet and the FIFO read pointer increases by 8.

Citation Information

Patent Citations

  • Verification method for branch instructions and branch prediction functions in speculation execution processor

    CN107688468A

  • A four-stage assembly line RISC-V processor with a rapid data bypass structure

    CN109918130A

  • Methods and apparatus for branch prediction and processing of microprocessor instructions and the like

    WO2006026510A2