@@ -5,16 +5,15 @@ import chisel3.util._
55
66import difftest ._
77
8- import treecorel2 .common .ConstVal
9- import treecorel2 .common .InstConfig
8+ import treecorel2 .common .{ConstVal , InstConfig }
109
1110class WBU extends Module with InstConfig {
1211 val io = IO (new Bundle {
1312 val globalEn = Input (Bool ())
1413 val socEn = Input (Bool ())
1514 val mem2wb = Flipped (new MEM2WBIO )
1615 val wbdata = new WBDATAIO
17- val gpr = Input (Vec (32 , UInt (64 .W )))
16+ val gpr = Input (Vec (RegfileNum , UInt (XLen .W )))
1817 })
1918
2019 protected val wbReg = RegEnable (io.mem2wb, WireInit (0 .U .asTypeOf(new MEM2WBIO ())), io.globalEn)
@@ -55,14 +54,14 @@ class WBU extends Module with InstConfig {
5554 }
5655
5756 // for difftest commit
58- protected val mmioEn = cvalid
59- protected val csrVis = isa.CSRRW || isa.CSRRS || isa.CSRRC || isa.CSRRWI || isa.CSRRSI || isa.CSRRCI
60- protected val mcycleVis = csrVis && (inst(31 , 20 ) === ConstVal .mcycleAddr)
61- protected val mipVis = csrVis && (inst(31 , 20 ) === ConstVal .mipAddr)
62- protected val timeIntrEnReg = RegEnable (timeIntrEn, false .B , io.globalEn)
63- protected val diffValid = io.globalEn && (RegEnable (valid, false .B , io.globalEn) || timeIntrEnReg)
64-
6557 if (! SoCEna ) {
58+ val mmioEn = cvalid
59+ val csrVis = isa.CSRRW || isa.CSRRS || isa.CSRRC || isa.CSRRWI || isa.CSRRSI || isa.CSRRCI
60+ val mcycleVis = csrVis && (inst(31 , 20 ) === ConstVal .mcycleAddr)
61+ val mipVis = csrVis && (inst(31 , 20 ) === ConstVal .mipAddr)
62+ val timeIntrEnReg = RegEnable (timeIntrEn, false .B , io.globalEn)
63+ val diffValid = io.globalEn && (RegEnable (valid, false .B , io.globalEn) || timeIntrEnReg)
64+
6665 val instComm = Module (new DifftestInstrCommit )
6766 val archIntRegState = Module (new DifftestArchIntRegState )
6867 val csrState = Module (new DifftestCSRState )
@@ -130,6 +129,6 @@ class WBU extends Module with InstConfig {
130129
131130 archFpRegState.io.clock := clock
132131 archFpRegState.io.coreid := 0 .U
133- archFpRegState.io.fpr := RegInit (VecInit (Seq .fill(32 )(0 .U (64 .W ))))
132+ archFpRegState.io.fpr := RegInit (VecInit (Seq .fill(RegfileNum )(0 .U (XLen .W ))))
134133 }
135134}
0 commit comments