提交 84521de7 编写于 作者: L Lingrui98

calculate average for each histogram

上级 2c1a69a0
...@@ -83,6 +83,20 @@ object XSPerfHistogram extends HasRegularPerfName { ...@@ -83,6 +83,20 @@ object XSPerfHistogram extends HasRegularPerfName {
ExcitingUtils.addSink(perfClean, "XSPERF_CLEAN") ExcitingUtils.addSink(perfClean, "XSPERF_CLEAN")
ExcitingUtils.addSink(perfDump, "XSPERF_DUMP") ExcitingUtils.addSink(perfDump, "XSPERF_DUMP")
val sum = RegInit(0.U(64.W))
val nSamples = RegInit(0.U(64.W))
when (perfClean) {
sum := 0.U
nSamples := 0.U
} .elsewhen (enable) {
sum := sum + perfCnt
nSamples := nSamples + 1.U
}
when (perfDump) {
XSPerfPrint(p"${perfName}_mean, ${sum/nSamples}\n")
}
// drop each perfCnt value into a bin // drop each perfCnt value into a bin
val nBins = (stop - start) / step val nBins = (stop - start) / step
require(start >= 0) require(start >= 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册