Skip to content

Commit

Permalink
Merge pull request #38 from Harry-Chen/pipeline_fix
Browse files Browse the repository at this point in the history
Wrong type conversion in the generation of hazard control signals
  • Loading branch information
mortbopet committed Sep 3, 2019
2 parents f914100 + 1ea81c3 commit 8621c95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pipeline.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "pipeline.h"
#include "pipeline.h"

#include "parser.h"

Expand Down Expand Up @@ -596,7 +596,7 @@ void Pipeline::hazardControlGen() {
bool branchHazard = branchEcallHazardFromMem || branchEcallHazardFromEx;

// Load Use hazard: Loaded variable is needed in execute stage
bool loadUseHazard = (r1 == (uint32_t)r_writeReg_IDEX || r2 == (uint32_t)r_writeReg_IDEX) && (bool)r_MemRead_IDEX;
bool loadUseHazard = (r1 == (uint32_t)r_writeReg_IDEX || r2 == (uint32_t)r_writeReg_IDEX) && (int)r_MemRead_IDEX;

if (branchHazard || loadUseHazard) {
// Stall until hazard is resolved - keep IFID and PC vaues, and reset IDEX registers
Expand Down

0 comments on commit 8621c95

Please sign in to comment.