In this lab, you will be asked several questions to verify your understanding of Out-of-Order.
Read through the CVA6 Execute Stage Documentation and the CVA6 Issue Stage Documentation, and use them to answer the following questions.
-
What is the purpose of Out-of-Order?
-
Give a brief explanation of Scoreboarding and Tomasulo's Algorithm. What are the pros and cons of each? Which OoO strategy does CVA6 use? (Extra: Tomasulo's original paper)
-
CVA6's rename unit will not be enabled for this lab. However, provide pseudocode that would run faster assuming the rename unit was enabled.
-
CVA6 has 7 functional units in
"ex_stage.sv"
: ALU, Branch Unit, LSU, Multiplier, CSR Buffer, FPU, and CVXIF. For each of the 7 functional units, provide:- A brief explanation of its function.
- Which instructions it handles.
- How many cycles it takes to execute. (You don't have to do this question for the FPU and CVXIF).
-
Briefly describe when the following hazards can occur:
- Read after Write (RAW)
- Write after Write (WAW)
- Write after Read (WAR)
-
Using the following diagram of the CVA6 backend, explain the path that an instruction must take through the issue and execute stage. Be sure to include the issue queue, transaction IDs, source operands, the destination register,
rd_clobber
, the scoreboard, and any other important logic in your explanation. -
After looking through the issue stage and scoreboard RTL, Provide a GitHub permalink to the following in CVA6:
- The issue queue instantiation
- The logic that specifies if a functional unit is ready to execute a new instruction
- The logic that stalls the pipeline due to the execute stage being too full for the next instruction
- The logic that determines which instruction(s) will be committed on the next cycle
Write a program that demonstrates the following situations:
- Out-of-Order Execution
- Read after Write hazard
- Write after Write hazard
- Write after Read hazard
- A branch miss
- The issue queue full
Note:
- A dependency hazard exists only if the instructions are run out-of-order when the dependency is removed. Verify this when writing your RAW, WAW, and WAR hazards.
- To enable out-of-order execution, your program must use a mix of instructions from the 3 functional unit types:
- No more than 1 fixed latency unit operation (
ALU
,CTRL_FLOW
,CSR
,MULT
) can be run simultaneously. - No more than 1 floating point unit operation (
FPU
,FPU_VEC
) can be run simultaneously. - No more than 1 load-store unit operation (
LOAD
,STORE
) can be run simultaneously.
- No more than 1 fixed latency unit operation (
An example of how to run RISC-V floating point instructions (RVF) is provided here: "fpu_example.S"
When providing screenshots of waveforms, please include all signals you decide are relevant to demonstrate the event. Improper justification will result in a lower score.
- Share your program. Be sure each situation is clearly commented.
- Provide a waveform screenshot and a brief explanation of how the issue queue is affected for each of the following situations:
- Out-of-Order Execution
- Read after Write hazard
- Write after Write hazard
- Write after Read hazard
- A branch miss
- The issue queue full