Skip to content

Commit 2a87f88

Browse files
committed
fix(no-matrix): Remove wires for diff mx when AME is disabled
1 parent f3dac08 commit 2a87f88

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/main/scala/xiangshan/backend/CtrlBlock.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ class CtrlBlockIO()(implicit p: Parameters, params: BackendParams) extends XSBun
997997
val lsdqFull = Bool()
998998
}
999999
})
1000-
val diff_mx_rat = if (params.basicDebugEn) Some(Vec(3, Output(UInt(PhyRegIdxWidth.W)))) else None
1000+
val diff_mx_rat = if (params.basicDebugEn && HasMatrixExtension) Some(Vec(3, Output(UInt(PhyRegIdxWidth.W)))) else None
10011001
val diff_vl_rat = if (params.basicDebugEn) Some(Vec(1, Output(UInt(PhyRegIdxWidth.W)))) else None
10021002

10031003
val sqCanAccept = Input(Bool())

src/main/scala/xiangshan/backend/datapath/DataPath.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,15 +321,15 @@ class DataPathImp(override val wrapper: DataPath)(implicit p: Parameters, params
321321
private val v0DiffReadData: Option[Vec[UInt]] =
322322
OptionWrapper(backendParams.basicDebugEn, Wire(Vec(V0PhyRegs, UInt(V0Data().dataWidth.W))))
323323
private val mxDiffRead: Option[(Vec[UInt], Vec[UInt])] =
324-
OptionWrapper(backendParams.basicDebugEn, (Wire(Vec(3, UInt(log2Up(MxPhyRegs).W))), Wire(Vec(3, UInt(MxData().dataWidth.W)))))
324+
OptionWrapper(backendParams.basicDebugEn && HasMatrixExtension, (Wire(Vec(3, UInt(log2Up(MxPhyRegs).W))), Wire(Vec(3, UInt(MxData().dataWidth.W)))))
325325
private val vlDiffRead: Option[(Vec[UInt], Vec[UInt])] =
326326
OptionWrapper(backendParams.basicDebugEn, (Wire(Vec(1, UInt(log2Up(VlPhyRegs).W))), Wire(Vec(1, UInt(VlData().dataWidth.W)))))
327327

328328
private val vecDiffNumPregs = 2 * (V0PhyRegs + vfSchdParams.numPregs)
329329
private val vecDiffReadData: Option[Vec[UInt]] =
330330
OptionWrapper(backendParams.basicDebugEn, Wire(Vec(vecDiffNumPregs, UInt(64.W)))) // v0 = Cat(Vec(1), Vec(0))
331331
private val mxDiffReadData: Option[Vec[UInt]] =
332-
OptionWrapper(backendParams.basicDebugEn, Wire(Vec(3, UInt(MxData().dataWidth.W))))
332+
OptionWrapper(backendParams.basicDebugEn && HasMatrixExtension, Wire(Vec(3, UInt(MxData().dataWidth.W))))
333333
private val vlDiffReadData: Option[UInt] =
334334
OptionWrapper(backendParams.basicDebugEn, Wire(UInt(VlData().dataWidth.W)))
335335

@@ -1094,8 +1094,8 @@ class DataPathIO()(implicit p: Parameters, params: BackendParams) extends XSBund
10941094

10951095
val diffVlRat = if (params.basicDebugEn) Some(Input(Vec(1, UInt(log2Up(VlPhyRegs).W)))) else None
10961096
val diffVl = if (params.basicDebugEn) Some(Output(UInt(VlData().dataWidth.W))) else None
1097-
val diffMxRat = if (params.basicDebugEn) Some(Input(Vec(3, UInt(log2Up(MxPhyRegs).W)))) else None
1098-
val diffMx = if (params.basicDebugEn) Some(Output(Vec(3, UInt(MxData().dataWidth.W)))) else None
1097+
val diffMxRat = if (params.basicDebugEn && HasMatrixExtension) Some(Input(Vec(3, UInt(log2Up(MxPhyRegs).W)))) else None
1098+
val diffMx = if (params.basicDebugEn && HasMatrixExtension) Some(Output(Vec(3, UInt(MxData().dataWidth.W)))) else None
10991099

11001100
val topDownInfo = new TopDownInfo
11011101
}

src/main/scala/xiangshan/backend/rename/RenameTable.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,11 @@ class RenameTableWrapper(implicit p: Parameters) extends XSModule {
253253
val debug_vec_rat = if (backendParams.debugEn) Some(Vec(31, Output(UInt(PhyRegIdxWidth.W)))) else None
254254
val debug_v0_rat = if (backendParams.debugEn) Some(Vec(1,Output(UInt(PhyRegIdxWidth.W)))) else None
255255
val debug_vl_rat = if (backendParams.debugEn) Some(Vec(1,Output(UInt(PhyRegIdxWidth.W)))) else None
256-
val debug_mx_rat = if (backendParams.debugEn) Some(Vec(3,Output(UInt(PhyRegIdxWidth.W)))) else None
256+
val debug_mx_rat = if (backendParams.debugEn && HasMatrixExtension) Some(Vec(3,Output(UInt(PhyRegIdxWidth.W)))) else None
257257

258258
// for difftest
259259
val diff_vl_rat = if (backendParams.basicDebugEn) Some(Vec(1,Output(UInt(PhyRegIdxWidth.W)))) else None
260-
val diff_mx_rat = if (backendParams.basicDebugEn) Some(Vec(3,Output(UInt(PhyRegIdxWidth.W)))) else None
260+
val diff_mx_rat = if (backendParams.basicDebugEn && HasMatrixExtension) Some(Vec(3,Output(UInt(PhyRegIdxWidth.W)))) else None
261261
})
262262

263263
val intRat = Module(new RenameTable(Reg_I))
@@ -468,8 +468,8 @@ class RenameTableWrapper(implicit p: Parameters) extends XSModule {
468468
io.debug_mx_rat.foreach(_ := mxRat.get.io.debug_rdata.get)
469469
io.diff_mx_rat.foreach(_ := mxRat.get.io.diff_rdata.get)
470470
} else {
471-
io.debug_mx_rat.get.foreach(_ := 0.U)
472-
io.diff_mx_rat.get.foreach(_ := 0.U)
471+
io.debug_mx_rat.foreach(_ := 0.U)
472+
io.diff_mx_rat.foreach(_ := 0.U)
473473
}
474474
mxRat.foreach(_.io.readPorts <> io.mxReadPorts.get.flatten)
475475
mxRat.foreach(_.io.redirect := io.redirect)

0 commit comments

Comments
 (0)