diff --git a/riscv-tools b/riscv-tools index 886d8131..40919ef9 160000 --- a/riscv-tools +++ b/riscv-tools @@ -1 +1 @@ -Subproject commit 886d8131dbd23533fb04d2d76a80be21d5f9ee7a +Subproject commit 40919ef94f7e6426785bf534fb018ae8d0d79fb3 diff --git a/src/main/scala/coreplex/Configs.scala b/src/main/scala/coreplex/Configs.scala index d8b1cc6a..82746a89 100644 --- a/src/main/scala/coreplex/Configs.scala +++ b/src/main/scala/coreplex/Configs.scala @@ -119,16 +119,51 @@ class BaseCoreplexConfig extends Config ( class WithNCores(n: Int) extends Config( (pname,site,here) => pname match { case NTiles => n + case _ => throw new CDEMatchError }) class WithNBanksPerMemChannel(n: Int) extends Config( (pname, site, here, up) => pname match { case BankedL2Config => up(BankedL2Config).copy(nBanksPerChannel = n) + case _ => throw new CDEMatchError }) class WithNTrackersPerBank(n: Int) extends Config( (pname, site, here, up) => pname match { case BroadcastConfig => up(BroadcastConfig).copy(nTrackers = n) + case _ => throw new CDEMatchError + }) + +// This is the number of sets **per way** +class WithL1ICacheSets(sets: Int) extends Config( + (pname, site, here, up) => pname match { + case CacheName("L1I") => up(CacheName("L1I")).copy(nSets = sets) + case _ => throw new CDEMatchError + }) + +// This is the number of sets **per way** +class WithL1DCacheSets(sets: Int) extends Config( + (pname, site, here, up) => pname match { + case CacheName("L1D") => up(CacheName("L1D")).copy(nSets = sets) + case _ => throw new CDEMatchError + }) + +class WithL1ICacheWays(ways: Int) extends Config( + (pname, site, here, up) => pname match { + case CacheName("L1I") => up(CacheName("L1I")).copy(nWays = ways) + case _ => throw new CDEMatchError + }) + +class WithL1DCacheWays(ways: Int) extends Config( + (pname, site, here, up) => pname match { + case CacheName("L1D") => up(CacheName("L1D")).copy(nWays = ways) + case _ => throw new CDEMatchError + }) + +class WithCacheBlockBytes(linesize: Int) extends Config( + (pname,site,here) => pname match { + case CacheBlockBytes => linesize + case _ => throw new CDEMatchError }) class WithDataScratchpad(n: Int) extends Config( @@ -238,3 +273,33 @@ class WithRoccExample extends Config( case RoccMaxTaggedMemXacts => 1 case _ => throw new CDEMatchError }) + +class WithDefaultBtb extends Config( + (pname,site,here) => pname match { + case BtbKey => BtbParameters() + case _ => throw new CDEMatchError + }) + +class WithFastMulDiv extends Config( + (pname,site,here) => pname match { + case MulDivKey => Some(MulDivConfig(mulUnroll = 8, mulEarlyOut = (site(XLen) > 32), divEarlyOut = true)) + case _ => throw new CDEMatchError + }) + +class WithoutMulDiv extends Config( + (pname, site, here) => pname match { + case MulDivKey => None + case _ => throw new CDEMatchError + }) + +class WithoutFPU extends Config( + (pname, site, here) => pname match { + case FPUKey => None + case _ => throw new CDEMatchError + }) + +class WithFPUWithoutDivSqrt extends Config ( + (pname, site, here) => pname match { + case FPUKey => Some(FPUConfig(divSqrt = false)) + case _ => throw new CDEMatchError + }) diff --git a/src/main/scala/rocketchip/Configs.scala b/src/main/scala/rocketchip/Configs.scala index 93b8e7af..47c0937a 100644 --- a/src/main/scala/rocketchip/Configs.scala +++ b/src/main/scala/rocketchip/Configs.scala @@ -154,3 +154,17 @@ class WithoutTLMonitors extends Config ( case _ => throw new CDEMatchError } ) + +class WithNExtTopInterrupts(nExtInts: Int) extends Config( + (pname, site, here) => pname match { + case NExtTopInterrupts => nExtInts + case _ => throw new CDEMatchError + } +) + +class WithNBreakpoints(hwbp: Int) extends Config ( + (pname,site,here) => pname match { + case NBreakpoints => hwbp + case _ => throw new CDEMatchError + } +)