fix(if): 修复第一个pc初始值问题

This commit is contained in:
Liphen 2024-05-06 16:05:40 +08:00
parent f6e8eeb381
commit 333ced6e19
2 changed files with 2 additions and 5 deletions

View File

@ -30,7 +30,7 @@ object playground extends ScalaModule with ScalafmtModule { m =>
override def ivyDeps = m.ivyDeps() ++ Agg(
ivy"com.lihaoyi::utest:0.8.1",
if (useChisel5) ivy"edu.berkeley.cs::chiseltest:5.0.0" else
if (useChisel5) ivy"edu.berkeley.cs::chiseltest:6.1.0" else
if (useChisel6) ivy"edu.berkeley.cs::chiseltest:6.1.0" else
ivy"edu.berkeley.cs::chiseltest:0.6.0",
)
}

View File

@ -12,11 +12,8 @@ class FetchUnit extends Module {
val decodeStage = new FetchUnitDecodeUnit()
val instSram = new InstSram()
})
val pc = RegNext(io.instSram.addr, PC_INIT)
val pc_next_temp = Wire(UInt(XLEN.W))
pc_next_temp := pc
val pc = RegNext(io.instSram.addr, (PC_INIT - 4.U))
io.instSram.addr := MuxCase(
pc + 4.U,