Add fragment to configure PMPs

Surprisingly there is no existing fragment to do this defined in rocketchip. Add our own here.
This commit is contained in:
Jerry Zhao
2021-03-09 00:02:24 -08:00
committed by GitHub
parent d98d6d1875
commit 8f511aeaf3

View File

@@ -151,6 +151,16 @@ class WithNPerfCounters(n: Int = 29) extends Config((site, here, up) => {
}
})
class WithNPMPs(n: Int = 8) extends Config((site, here, up) => {
case TilesLocated(InSubsystem) => up(TilesLocated(InSubsystem), site) map {
case tp: RocketTileAttachParams => tp.copy(tileParams = tp.tileParams.copy(
core = tp.tileParams.core.copy(nPMPs = n)))
case tp: BoomTileAttachParams => tp.copy(tileParams = tp.tileParams.copy(
core = tp.tileParams.core.copy(nPMPs = n)))
case other => other
}
})
class WithRocketICacheScratchpad extends Config((site, here, up) => {
case RocketTilesKey => up(RocketTilesKey, site) map { r =>
r.copy(icache = r.icache.map(_.copy(itimAddr = Some(0x300000 + r.hartId * 0x10000))))