@@ -21,21 +21,15 @@ class WBU extends Module with InstConfig {
2121 protected val inst = wbReg.inst
2222 protected val pc = wbReg.pc
2323 protected val isa = wbReg.isa
24- protected val src1 = wbReg.src1
25- protected val src2 = wbReg.src2
26- protected val imm = wbReg.imm
2724 protected val wen = wbReg.wen
2825 protected val wdest = wbReg.wdest
2926 protected val aluRes = wbReg.aluRes
30- protected val branch = wbReg.branch
31- protected val tgt = wbReg.tgt
3227 protected val link = wbReg.link
3328 protected val auipc = wbReg.auipc
3429 protected val loadData = wbReg.loadData
3530 protected val csrData = wbReg.csrData
3631 protected val cvalid = wbReg.cvalid
3732 protected val timeIntrEn = wbReg.timeIntrEn
38- protected val ecallEn = wbReg.ecallEn
3933 protected val csr = wbReg.csr
4034
4135 protected val wbdata = aluRes | link | auipc | loadData | csrData
@@ -73,24 +67,22 @@ class WBU extends Module with InstConfig {
7367 cycleCnt.inc()
7468 when(io.globalEn && valid) { instrCnt.inc() }
7569
76- instComm.io.clock := clock
77- instComm.io.coreid := 0 .U
78- instComm.io.index := 0 .U
79- instComm.io.valid := diffValid && ~ timeIntrEnReg
80- instComm.io.pc := RegEnable (pc, 0 .U , io.globalEn)
81- instComm.io.instr := RegEnable (inst, 0 .U , io.globalEn)
82- instComm.io.special := 0 .U
83- instComm.io.skip := diffValid && RegEnable (printVis || mcycleVis || mmioEn || mipVis, false .B , io.globalEn)
84- instComm.io.isRVC := false .B
85- instComm.io.scFailed := false .B
86- instComm.io.wen := RegEnable (wen, false .B , io.globalEn)
87- instComm.io.wdata := RegEnable (wbdata, 0 .U , io.globalEn)
88- instComm.io.wdest := RegEnable (wdest, 0 .U , io.globalEn)
89-
90- archIntRegState.io.clock := clock
91- archIntRegState.io.coreid := 0 .U
92- archIntRegState.io.gpr := io.gpr
93-
70+ instComm.io.clock := clock
71+ instComm.io.coreid := 0 .U
72+ instComm.io.index := 0 .U
73+ instComm.io.valid := diffValid && ~ timeIntrEnReg
74+ instComm.io.pc := RegEnable (pc, 0 .U , io.globalEn)
75+ instComm.io.instr := RegEnable (inst, 0 .U , io.globalEn)
76+ instComm.io.special := 0 .U
77+ instComm.io.skip := diffValid && RegEnable (printVis || mcycleVis || mmioEn || mipVis, false .B , io.globalEn)
78+ instComm.io.isRVC := false .B
79+ instComm.io.scFailed := false .B
80+ instComm.io.wen := RegEnable (wen, false .B , io.globalEn)
81+ instComm.io.wdata := RegEnable (wbdata, 0 .U , io.globalEn)
82+ instComm.io.wdest := RegEnable (wdest, 0 .U , io.globalEn)
83+ archIntRegState.io.clock := clock
84+ archIntRegState.io.coreid := 0 .U
85+ archIntRegState.io.gpr := io.gpr
9486 csrState.io.clock := clock
9587 csrState.io.coreid := 0 .U
9688 csrState.io.mstatus := csr.mstatus
@@ -111,24 +103,21 @@ class WBU extends Module with InstConfig {
111103 csrState.io.mtvec := csr.mtvec
112104 csrState.io.stvec := 0 .U
113105 csrState.io.priviledgeMode := 3 .U
114-
115- archEvt.io.clock := clock
116- archEvt.io.coreid := 0 .U
117- archEvt.io.intrNO := Mux (diffValid && timeIntrEnReg, 7 .U , 0 .U )
118- archEvt.io.cause := 0 .U
119- archEvt.io.exceptionPC := RegEnable (pc, 0 .U , io.globalEn)
120- archEvt.io.exceptionInst := RegEnable (inst, 0 .U , io.globalEn)
121-
122- trapEvt.io.clock := clock
123- trapEvt.io.coreid := 0 .U
124- trapEvt.io.valid := diffValid && RegEnable (haltVis, false .B , io.globalEn)
125- trapEvt.io.code := io.gpr(10 )(7 , 0 )
126- trapEvt.io.pc := RegEnable (pc, 0 .U , io.globalEn)
127- trapEvt.io.cycleCnt := cycleCnt.value
128- trapEvt.io.instrCnt := instrCnt.value
129-
130- archFpRegState.io.clock := clock
131- archFpRegState.io.coreid := 0 .U
132- archFpRegState.io.fpr := RegInit (VecInit (Seq .fill(RegfileNum )(0 .U (XLen .W ))))
106+ archEvt.io.clock := clock
107+ archEvt.io.coreid := 0 .U
108+ archEvt.io.intrNO := Mux (diffValid && timeIntrEnReg, 7 .U , 0 .U )
109+ archEvt.io.cause := 0 .U
110+ archEvt.io.exceptionPC := RegEnable (pc, 0 .U , io.globalEn)
111+ archEvt.io.exceptionInst := RegEnable (inst, 0 .U , io.globalEn)
112+ trapEvt.io.clock := clock
113+ trapEvt.io.coreid := 0 .U
114+ trapEvt.io.valid := diffValid && RegEnable (haltVis, false .B , io.globalEn)
115+ trapEvt.io.code := io.gpr(10 )(7 , 0 )
116+ trapEvt.io.pc := RegEnable (pc, 0 .U , io.globalEn)
117+ trapEvt.io.cycleCnt := cycleCnt.value
118+ trapEvt.io.instrCnt := instrCnt.value
119+ archFpRegState.io.clock := clock
120+ archFpRegState.io.coreid := 0 .U
121+ archFpRegState.io.fpr := RegInit (VecInit (Seq .fill(RegfileNum )(0 .U (XLen .W ))))
133122 }
134123}
0 commit comments