Skip to content

Commit

Permalink
[t1rocketemu] add probe for T1IssueRegDequeue
Browse files Browse the repository at this point in the history
  • Loading branch information
FanShupei committed Oct 2, 2024
1 parent d4b0312 commit d074b4b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
31 changes: 18 additions & 13 deletions t1/src/T1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -298,23 +298,26 @@ case class T1Parameter(
}

class T1Probe(parameter: T1Parameter) extends Bundle {
val instructionCounter: UInt = UInt(parameter.instructionIndexBits.W)
val instructionIssue: Bool = Bool()
val issueTag: UInt = UInt(parameter.instructionIndexBits.W)
val retireValid: Bool = Bool()
val instructionCounter: UInt = UInt(parameter.instructionIndexBits.W)
val instructionIssue: Bool = Bool()
val issueTag: UInt = UInt(parameter.instructionIndexBits.W)
val retireValid: Bool = Bool()
// for profiler
val requestReg: ValidIO[InstructionPipeBundle] = ValidIO(new InstructionPipeBundle(parameter))
val requestRegReady: Bool = Bool()
// write queue enq for mask unit
val writeQueueEnq: ValidIO[UInt] = Valid(UInt(parameter.instructionIndexBits.W))
val writeQueueEnqMask: UInt = UInt((parameter.datapathWidth / 8).W)
val writeQueueEnq: ValidIO[UInt] = Valid(UInt(parameter.instructionIndexBits.W))
val writeQueueEnqMask: UInt = UInt((parameter.datapathWidth / 8).W)
// mask unit instruction valid
val instructionValid: UInt = UInt((parameter.chainingSize * 2).W)
val instructionValid: UInt = UInt((parameter.chainingSize * 2).W)
// instruction index for check rd
val responseCounter: UInt = UInt(parameter.instructionIndexBits.W)
val responseCounter: UInt = UInt(parameter.instructionIndexBits.W)
// probes
val lsuProbe: LSUProbe = new LSUProbe(parameter.lsuParameters)
val laneProbes: Vec[LaneProbe] = Vec(parameter.laneNumber, new LaneProbe(parameter.laneParam))
val issue: ValidIO[UInt] = Valid(UInt(parameter.instructionIndexBits.W))
val retire: ValidIO[UInt] = Valid(UInt(parameter.xLen.W))
val idle: Bool = Bool()
val lsuProbe: LSUProbe = new LSUProbe(parameter.lsuParameters)
val laneProbes: Vec[LaneProbe] = Vec(parameter.laneNumber, new LaneProbe(parameter.laneParam))
val issue: ValidIO[UInt] = Valid(UInt(parameter.instructionIndexBits.W))
val retire: ValidIO[UInt] = Valid(UInt(parameter.xLen.W))
val idle: Bool = Bool()
}

class T1Interface(parameter: T1Parameter) extends Record {
Expand Down Expand Up @@ -1751,6 +1754,8 @@ class T1(val parameter: T1Parameter)
probeWire.instructionIssue := requestRegDequeue.fire
probeWire.issueTag := requestReg.bits.instructionIndex
probeWire.retireValid := retire
probeWire.requestReg := requestReg
probeWire.requestRegReady := requestRegDequeue.ready
// maskUnitWrite maskUnitWriteReady
probeWire.writeQueueEnq.valid := maskUnitWrite.valid && maskUnitWriteReady
probeWire.writeQueueEnq.bits := maskUnitWrite.bits.instructionIndex
Expand Down
6 changes: 3 additions & 3 deletions t1rocket/src/T1RocketTile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ class T1RocketProbe(parameter: T1RocketTileParameter) extends Bundle {
val fpuProbe: Option[FPUProbe] = parameter.fpuParameter.map(param => Output(new FPUProbe(param)))
val t1Probe: T1Probe = Output(new T1Probe(parameter.t1Parameter))

val t1IssueDeq: DecoupledIO[T1Issue] = DecoupledIO(new T1Issue(parameter.xLen, parameter.vLen))
val t1Retire: T1Retire = Output(new T1Retire(parameter.xLen))
val t1IssueDeq: DecoupledIO[T1Issue] = DecoupledIO(new T1Issue(parameter.xLen, parameter.vLen))
val t1Retire: T1Retire = Output(new T1Retire(parameter.xLen))
}

class T1RocketTileInterface(parameter: T1RocketTileParameter) extends Bundle {
Expand Down Expand Up @@ -624,6 +624,6 @@ class T1RocketTile(val parameter: T1RocketTileParameter)
}

probeWire.t1IssueDeq := t1.io.issue
probeWire.t1Retire := t1.io.retire
probeWire.t1Retire := t1.io.retire
}
}
5 changes: 4 additions & 1 deletion t1rocketemu/src/TestBench.scala
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,16 @@ class TestBench(generator: SerializableModuleGenerator[T1RocketTile, T1RocketTil
val t1IssueEnqPc = WireInit(probe.rocketProbe.wbRegPc)
val t1IssueEnq = WireInit(probe.rocketProbe.t1IssueEnq.get)
val t1IssueDeq = WireInit(probe.t1IssueDeq)
val t1IssueRegDeq = WireInit(probe.t1Probe.requestReg)
val t1IssueRegDeqReady = WireInit(probe.t1Probe.requestRegReady)
val t1Retire = WireInit(probe.t1Retire)

dontTouch(this.clock)
dontTouch(this.reset)
dontTouch(t1IssueEnq)
dontTouch(t1IssueEnq)
dontTouch(t1IssueDeq)
dontTouch(t1IssueRegDeq)
dontTouch(t1IssueRegDeqReady)
dontTouch(t1Retire)
})
profData.probe := t1RocketProbe
Expand Down

0 comments on commit d074b4b

Please sign in to comment.