提交 7ccd034b 编写于 作者: J jinyue110

icache: add performance counter

上级 5c979681
...@@ -3,7 +3,7 @@ NANOS_HOME ?= $(AM_HOME)/../nanos-lite ...@@ -3,7 +3,7 @@ NANOS_HOME ?= $(AM_HOME)/../nanos-lite
SINGLETEST = ALL=min3 SINGLETEST = ALL=min3
B ?= 0 B ?= 0
E ?= -1 E ?= 0
V ?= ALL V ?= ALL
#V ?= OFF #V ?= OFF
EMU_ARGS = B=$(B) E=$(E) V=$(V) EMU_ARGS = B=$(B) E=$(E) V=$(V)
......
...@@ -793,7 +793,9 @@ class CSR extends FunctionUnit(csrCfg) with HasCSRConst{ ...@@ -793,7 +793,9 @@ class CSR extends FunctionUnit(csrCfg) with HasCSRConst{
"ITlbMissCnt0"-> (0xb24, "perfCntItlbMissCnt0" ), "ITlbMissCnt0"-> (0xb24, "perfCntItlbMissCnt0" ),
"PtwReqCnt" -> (0xb25, "perfCntPtwReqCnt" ), "PtwReqCnt" -> (0xb25, "perfCntPtwReqCnt" ),
"PtwCycleCnt" -> (0xb26, "perfCntPtwCycleCnt" ), "PtwCycleCnt" -> (0xb26, "perfCntPtwCycleCnt" ),
"PtwL2TlbHit" -> (0xb27, "perfCntPtwL2TlbHit" ) "PtwL2TlbHit" -> (0xb27, "perfCntPtwL2TlbHit" ),
"ICacheReq" -> (0xb28, "perfCntIcacheReqCnt" ),
"ICacheMiss" -> (0xb29, "perfCntIcacheMissCnt" )
// "Custom1" -> (0xb1b, "Custom1" ), // "Custom1" -> (0xb1b, "Custom1" ),
// "Custom2" -> (0xb1c, "Custom2" ), // "Custom2" -> (0xb1c, "Custom2" ),
// "Custom3" -> (0xb1d, "Custom3" ), // "Custom3" -> (0xb1d, "Custom3" ),
......
package xiangshan.cache package xiangshan.cache
import chisel3.util.experimental.BoringUtils
import chipsalliance.rocketchip.config.Parameters
import chisel3._ import chisel3._
import chisel3.util._ import chisel3.util._
import device._ import device._
import xiangshan._ import xiangshan._
import xiangshan.frontend._ import xiangshan.frontend._
import utils._ import utils._
import chisel3.ExcitingUtils._
import chisel3.util.experimental.BoringUtils
import chipsalliance.rocketchip.config.Parameters
import freechips.rocketchip.tilelink.{TLBundleA,TLBundleD,TLBundleE,TLEdgeOut} import freechips.rocketchip.tilelink.{TLBundleA,TLBundleD,TLBundleE,TLEdgeOut}
import freechips.rocketchip.diplomacy.{AddressSet,IdRange,LazyModule, LazyModuleImp, TransferSizes} import freechips.rocketchip.diplomacy.{AddressSet,IdRange,LazyModule, LazyModuleImp, TransferSizes}
...@@ -406,5 +407,11 @@ class ICacheImp(outer: ICache) extends ICacheModule(outer) ...@@ -406,5 +407,11 @@ class ICacheImp(outer: ICache) extends ICacheModule(outer)
bus.d.ready := true.B bus.d.ready := true.B
XSDebug("[flush] flush_0:%d flush_1:%d\n",io.flush(0),io.flush(1)) XSDebug("[flush] flush_0:%d flush_1:%d\n",io.flush(0),io.flush(1))
//Performance Counter
if (!env.FPGAPlatform ) {
ExcitingUtils.addSource( s3_valid && (state === s_idle), "perfCntIcacheReqCnt", Perf)
ExcitingUtils.addSource( s3_valid && (state === s_idle) && s3_miss, "perfCntIcacheMissCnt", Perf)
}
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册