-
Notifications
You must be signed in to change notification settings - Fork 1
Forwarding and Stalling
Zhenghao Gu edited this page Nov 11, 2018
·
4 revisions
This page lists all possible forwarding paths and is intended to replace all related issue pages.
For each section, it should clearly state the following:
- From which port the data come
- To which port the data go
- In what conditions the path will be used
- Complete condition formula
- If the condition is required after some stall.
- List all stall situations.
- How may cycles the stall may require?
- List all condition formulas for each of the stall situations.
- Consider all the formulas listed in 4, are they compatible with the stalling situations listed in 5.1?
Outside of any forwarding path, following should also be considered:
- Is there any stalling situation that requires more than one forwarding path?
- Is there any stalling situation that requires no forwarding?
- Source:
- ALU.flagZVN
- EX/MEM.flagZVN
- Destination:
- PC_Control.flagZVN
- Some instructions which modify the FLAG register followed by a conditional branch.
- The formula is complicate, see related commit.
- No stall required
- N/A
- Source: EX/MEM.AluResult
- Destination: ALU.A
- A non-zero register been written to is used immediately in the next instruction.
-
-
ID/EX.isALU1FromRegister
and -
EX/MEM.willWriteALUResultToRegister
and -
ID/EX.ALU1Register!=0
and EX/MEM.writeToRegister==ID/EX.ALU1Register
-
- No stall required
- N/A
- Source: EX/MEM.AluResult
- Destination: ALU.B
- A non-zero register been written to is used immediately in the next instruction.
-
-
ID/EX.isALU2FromRegister
and -
EX/MEM.willWriteALUResultToRegister
and -
ID/EX.ALU2Register!=0
and EX/MEM.writeToRegister==ID/EX.ALU2Register
-
- No stall required
- N/A
- Source: MEM/WB.RegWriteData
- Destination: ALU.A
- A non-zero register is written to and is used by the second next instruction:
- It can be writeAluResult-anotherInstruction-useRegister
- or can be loadDataToRegister-useRegister
MEM/WB.willWriteToRegister && ID/EX.isALU1FromRegister && ID/EX.ALU1Register!=0 && MEM/WB.writeToRegister==ID/EX.ALU1Register
- Forwarding case 3.2 requires an one cycle stall before it:
- Stall formula:
ID/EX.willLoadToRegister && IF/ID.isALU1FromRegister && IF/ID.ALU1Register!=0 && IF/ID.ALU1Register==ID/EX.writeToRegister
- Stall formula:
- TODO
- Source: MEM/WB.RegWriteData
- Destination: ALU.B
- A non-zero register is written to and is used by the second next instruction:
- It can be writeAluResult-anotherInstruction-useRegister
- or can be loadDataToRegister-useRegister
MEM/WB.willWriteToRegister && ID/EX.isALU2FromRegister && ID/EX.ALU2Register!=0 && MEM/WB.writeToRegister==ID/EX.ALU2Register
- Forwarding case 3.2 requires an one cycle stall before it:
- Stall formula:
ID/EX.willLoadToRegister && IF/ID.isALU2FromRegister && IF/ID.ALU2Register!=0 && IF/ID.ALU2Register==ID/EX.writeToRegister
- Stall formula:
- TODO
- Source: MEM/WB.RegWriteData
- Destination: DataMem.DataIn
- A non-zero register is loaded to and immediately store from
MEM/WB.willWriteToRegister && EX/MEM.willWriteToDataMem && MEM/WB.writeToRegister==EX/MEM.storeFromRegister && MEM/WB.writeToRegister!=0
- No stall required
- N/A