aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui
diff options
context:
space:
mode:
authorPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-02 23:38:56 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-02 23:38:56 +0100
commit12536c28a74e3b1fd6f5d1213311c809f9ddf824 (patch)
tree1c9f2969a58bb1deadcad6a366e51173f3913c89 /qtmips_gui
parente7343cdbb296f51ce83a7236441008c62bc2b52c (diff)
downloadqtmips-12536c28a74e3b1fd6f5d1213311c809f9ddf824.tar.gz
qtmips-12536c28a74e3b1fd6f5d1213311c809f9ddf824.tar.bz2
qtmips-12536c28a74e3b1fd6f5d1213311c809f9ddf824.zip
Implement realistic hazard resolution for JR, JALR, BEQ, BNE, BLTZ, BGEZ instructions.
The previous code worked by chance only because decode has been fully processed including forwarding from M and W before PC processing started. But in real hardware the PC processing runs in parallel with ALU and cannot read its results in the same cycle. Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_gui')
-rw-r--r--qtmips_gui/coreview.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/qtmips_gui/coreview.cpp b/qtmips_gui/coreview.cpp
index 71c8113..4885d6c 100644
--- a/qtmips_gui/coreview.cpp
+++ b/qtmips_gui/coreview.cpp
@@ -407,7 +407,10 @@ CoreViewScenePipelined::CoreViewScenePipelined(machine::QtMipsMachine *machine)
NEW_V(610, 385, memory_regw_num_value, false, 2);
if (machine->config().hazard_unit() == machine::MachineConfig::HU_STALL_FORWARD) {
- NEW_V(448, 460, execute_reg1_ff_value, false, 1); // Register 1 forward
- NEW_V(462, 460, execute_reg2_ff_value, false, 1); // Register 1 forward
- }
+ NEW_V(448, 460, execute_reg1_ff_value, false, 1); // Register 1 forward to ALU
+ NEW_V(462, 460, execute_reg2_ff_value, false, 1); // Register 2 forward to ALU
+
+ NEW_V(310, 290, forward_m_d_rs_value, false, 1); // Register 1 forward for bxx and jr, jalr
+ NEW_V(325, 290, forward_m_d_rt_value, false, 1); // Register 2 forward for beq, bne
+ }
}