Returns true if `id_ex` is a load whose result is needed by the instruction currently in the IF/ID register (identified by its raw-word rs1/rs2 fields).
(id_ex: &IDEXReg, if_id_rs1: usize, if_id_rs2: usize)
| 102 | |
| 103 | // --- Data forwarding --- |
| 104 | |
| 105 | pub struct ForwardedValues { |
| 106 | pub rs1: u64, |
| 107 | pub rs2: u64, |
| 108 | pub frs1: u64, |
| 109 | pub frs2: u64, |
| 110 | } |
| 111 | |
| 112 | /// The rs1/rs2/frs1/frs2 values for EX with forwarding applied: EX/MEM (newest producer) |
| 113 | /// beats MEM/WB, and load results skip EX/MEM since their data only exists after MEM. |
| 114 | pub fn compute_forwarding( |
| 115 | ex_mem: Option<&EXMEMReg>, |
| 116 | mem_wb: Option<&MEMWBReg>, |