Skip to content

Commit

Permalink
Add reset logic to prevent 'X'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bohan Hu committed Dec 5, 2020
1 parent 70d8b81 commit 4c6dbe0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/main/scala/core/regfile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ class Regfile extends Module {
when(io.wrPort.wen & io.wrPort.waddr.orR) {
Regs(io.wrPort.waddr) := io.wrPort.wdata
}
when(reset.asBool()) {
for (i <- 0 until 8)
Regs(i) := 0.U
}
BoringUtils.addSource(VecInit((0 to 31).map(i => Regs(i))), "difftestRegs")
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/mmu/tlb.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ class TLB extends Module{
}
}
}
when(io.flush) {
tlbRegs(i).valid := false.B
when(io.flush | reset.asBool()) {
tlbRegs(i) := 0.U.asTypeOf(new TLBEntry)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/sim/axiram.scala
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class AXI_ram extends BlackBox with HasBlackBoxInline {
// Width of ID signal
parameter ID_WIDTH = 4,
// Extra pipeline register on output
parameter PIPELINE_OUTPUT = 0
parameter PIPELINE_OUTPUT = 1
)
(
input wire clock,
Expand Down

0 comments on commit 4c6dbe0

Please sign in to comment.