提交 a153fb1a 编写于 作者: W William Wang

LSQ: add XSPerf

上级 e3cc58c4
......@@ -421,7 +421,7 @@ class LoadQueue extends XSModule
XSDebug(
l1Violation,
"need rollback (l4 load) pc %x roqidx %d target %x\n",
"need rollback (l1 load) pc %x roqidx %d target %x\n",
io.storeIn(i).bits.uop.cf.pc, io.storeIn(i).bits.uop.roqIdx.asUInt, l1ViolationUop.roqIdx.asUInt
)
XSDebug(
......@@ -601,6 +601,15 @@ class LoadQueue extends XSModule
allowEnqueue := validCount + enqNumber <= (LoadQueueSize - RenameWidth).U
// perf counter
XSPerf("lqRollback", io.rollback.valid, acc = true) // rollback redirect generated
XSPerf("lqFull", !io.allowEnqueue, acc = true)
XSPerf("lqMmioCycle", uncacheState =/= s_idle, acc = true) // lq is busy dealing with uncache req
XSPerf("lqMmioCnt", io.uncache.req.fire(), acc = true)
XSPerf("lqRefill", io.dcache.valid, acc = true)
XSPerf("lqWriteback", PopCount(VecInit(0 until LoadPipelineWidth).map(_ => io.ldout(_).fire())), acc = true)
XSPerf("lqWbBlocked", PopCount(VecInit(0 until LoadPipelineWidth).map(_ => io.ldout(_).valid && !io.ldout(_).ready), acc = true)
// debug info
XSDebug("enqPtrExt %d:%d deqPtrExt %d:%d\n", enqPtrExt(0).flag, enqPtr, deqPtrExt.flag, deqPtr)
......
......@@ -404,6 +404,16 @@ class StoreQueue extends XSModule with HasDCacheParameters with HasCircularQueue
// for 1 cycle will also promise that sq is empty in that cycle
io.sqempty := RegNext(enqPtrExt(0).value === deqPtrExt(0).value && enqPtrExt(0).flag === deqPtrExt(0).flag)
// perf counter
XSPerf("sqFull", !io.allowEnqueue, acc = true)
XSPerf("sqMmioCycle", uncacheState =/= s_idle, acc = true) // lq is busy dealing with uncache req
XSPerf("sqMmioCnt", io.uncache.req.fire(), acc = true)
XSPerf("sqWriteback", io.mmioStout.fire(), acc = true)
XSPerf("sqWbBlocked", io.mmioStout.valid && !io.mmioStout.ready, acc = true)
XSPerf("sqValidEntryCnt", distanceBetween(enqPtrExt(0), deqPtrExt(0)))
XSPerf("sqCmtEntryCnt", distanceBetween(cmtPtrExt(0), deqPtrExt(0)))
XSPerf("sqNCmtEntryCnt", distanceBetween(enqPtrExt(0), cmtPtrExt(0)))
// debug info
XSDebug("enqPtrExt %d:%d deqPtrExt %d:%d\n", enqPtrExt(0).flag, enqPtr, deqPtrExt(0).flag, deqPtr)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册