提交 71326897 编写于 作者: Z ZhangZifei

perf: add some slot util perf counters of id/rn/dp

上级 bc8bcc94
......@@ -76,6 +76,10 @@ class DecodeStage(implicit p: Parameters) extends XSModule with HasPerfEvents {
XSPerfAccumulate("waitInstr", PopCount((0 until DecodeWidth).map(i => io.in(i).valid && !io.in(i).ready)))
XSPerfAccumulate("stall_cycle", hasValid && !io.out(0).ready)
XSPerfHistogram("slots_fire", PopCount(io.out.map(_.fire)), true.B, 0, DecodeWidth+1, 1)
XSPerfHistogram("slots_valid_pure", PopCount(io.in.map(_.valid)), io.out(0).fire, 0, DecodeWidth+1, 1)
XSPerfHistogram("slots_valid_rough", PopCount(io.in.map(_.valid)), true.B, 0, DecodeWidth+1, 1)
if (env.EnableTopDown) {
XSPerfAccumulate("slots_issued", PopCount(io.out.map(_.fire)))
XSPerfAccumulate("decode_bubbles", PopCount(io.out.map(x => !x.valid && x.ready))) // Unutilized issue-pipeline slots while there is no backend-stall
......
......@@ -105,7 +105,7 @@ class Dispatch(implicit p: Parameters) extends XSModule with HasPerfEvents {
val updatedUop = Wire(Vec(RenameWidth, new MicroOp))
val updatedCommitType = Wire(Vec(RenameWidth, CommitType()))
val checkpoint_id = RegInit(0.U(64.W))
checkpoint_id := checkpoint_id + PopCount((0 until RenameWidth).map(i =>
checkpoint_id := checkpoint_id + PopCount((0 until RenameWidth).map(i =>
io.fromRename(i).fire()
))
......@@ -151,7 +151,7 @@ class Dispatch(implicit p: Parameters) extends XSModule with HasPerfEvents {
if(i == 0){
debug_runahead_checkpoint_id := checkpoint_id
} else {
debug_runahead_checkpoint_id := checkpoint_id + PopCount((0 until i).map(i =>
debug_runahead_checkpoint_id := checkpoint_id + PopCount((0 until i).map(i =>
io.fromRename(i).fire()
))
}
......@@ -204,6 +204,7 @@ class Dispatch(implicit p: Parameters) extends XSModule with HasPerfEvents {
// (1) resources are ready
// (2) previous instructions are ready
val thisCanActualOut = (0 until RenameWidth).map(i => !thisIsBlocked(i) && notBlockedByPrevious(i))
val thisActualOut = (0 until RenameWidth).map(i => io.enqRob.req(i).valid && io.enqRob.canAccept)
val hasValidException = io.fromRename.zip(hasException).map(x => x._1.valid && x._2)
// input for ROB, LSQ, Dispatch Queue
......@@ -277,6 +278,11 @@ class Dispatch(implicit p: Parameters) extends XSModule with HasPerfEvents {
XSPerfAccumulate("stall_cycle_fp_dq", stall_fp_dq)
XSPerfAccumulate("stall_cycle_ls_dq", stall_ls_dq)
XSPerfHistogram("slots_fire", PopCount(thisActualOut), true.B, 0, RenameWidth+1, 1)
// Explaination: when out(0) not fire, PopCount(valid) is not meaningfull
XSPerfHistogram("slots_valid_pure", PopCount(io.enqRob.req.map(_.valid)), thisActualOut(0), 0, RenameWidth+1, 1)
XSPerfHistogram("slots_valid_rough", PopCount(io.enqRob.req.map(_.valid)), true.B, 0, RenameWidth+1, 1)
if (env.EnableTopDown) {
val rob_first_load = WireDefault(false.B)
val rob_first_store = WireDefault(false.B)
......
......@@ -372,11 +372,16 @@ class Rename(implicit p: Parameters) extends XSModule with HasCircularQueuePtrHe
XSPerfAccumulate("stall_cycle_walk", hasValid && io.out(0).ready && fpFreeList.io.canAllocate && intFreeList.io.canAllocate && io.robCommits.isWalk)
XSPerfAccumulate("recovery_bubbles", PopCount(io.in.map(_.valid && io.out(0).ready && fpFreeList.io.canAllocate && intFreeList.io.canAllocate && io.robCommits.isWalk)))
XSPerfHistogram("slots_fire", PopCount(io.out.map(_.fire)), true.B, 0, RenameWidth+1, 1)
// Explaination: when out(0) not fire, PopCount(valid) is not meaningfull
XSPerfHistogram("slots_valid_pure", PopCount(io.in.map(_.valid)), io.out(0).fire, 0, RenameWidth+1, 1)
XSPerfHistogram("slots_valid_rough", PopCount(io.in.map(_.valid)), true.B, 0, RenameWidth+1, 1)
XSPerfAccumulate("move_instr_count", PopCount(io.out.map(out => out.fire && out.bits.ctrl.isMove)))
val is_fused_lui_load = io.out.map(o => o.fire && o.bits.ctrl.fuType === FuType.ldu && o.bits.ctrl.srcType(0) === SrcType.imm)
XSPerfAccumulate("fused_lui_load_instr_count", PopCount(is_fused_lui_load))
val renamePerf = Seq(
("rename_in ", PopCount(io.in.map(_.valid & io.in(0).ready )) ),
("rename_waitinstr ", PopCount((0 until RenameWidth).map(i => io.in(i).valid && !io.in(i).ready)) ),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册