提交 269c405a 编写于 作者: J jinyue110

icache: use plru replacement policy

上级 f73e37d0
......@@ -187,6 +187,7 @@ trait HasXSParameter {
val icacheParameters = ICacheParameters(
tagECC = Some("parity"),
dataECC = Some("parity"),
replacer = Some("setlru"),
nMissEntries = 2
)
......
......@@ -16,6 +16,7 @@ case class ICacheParameters(
nTLBEntries: Int = 32,
tagECC: Option[String] = None,
dataECC: Option[String] = None,
replacer: Option[String] = Some("random"),
nSDQ: Int = 17,
nRPQ: Int = 16,
nMissEntries: Int = 1,
......@@ -25,7 +26,7 @@ case class ICacheParameters(
def tagCode: Code = Code.fromString(tagECC)
def dataCode: Code = Code.fromString(dataECC)
def replacement = new RandomReplacement(nWays)
def replacement = ReplacementPolicy.fromString(replacer,nWays,nSets)
}
trait HasICacheParameters extends HasL1CacheParameters with HasIFUConst with HasInstrMMIOConst {
......@@ -341,7 +342,9 @@ class ICache extends ICacheModule
val refillInvalidWaymask = PriorityMask(invalidVec)
val replacer = cacheParams.replacement
val victimWayMask = UIntToOH(replacer.way)
val victimWayMask = UIntToOH(replacer.way(s2_idx))
when(s2_hit) {replacer.access(s2_idx, OHToUInt(hitVec))}
//deal with icache exception
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册