From bab504cc3fa209669e837f5c0bfa17d9bb7e2d2c Mon Sep 17 00:00:00 2001 From: Richard Xia Date: Fri, 18 Nov 2016 10:49:42 -0800 Subject: [PATCH] Add various granular and composable configs. --- src/main/scala/coreplex/Configs.scala | 71 +++++++++++++++++++++++++ src/main/scala/rocketchip/Configs.scala | 14 +++++ 2 files changed, 85 insertions(+) diff --git a/src/main/scala/coreplex/Configs.scala b/src/main/scala/coreplex/Configs.scala index b04556a0..2dbe8a04 100644 --- a/src/main/scala/coreplex/Configs.scala +++ b/src/main/scala/coreplex/Configs.scala @@ -191,6 +191,43 @@ class WithNTrackersPerBank(n: Int) extends Config( case _ => throw new CDEMatchError }) +// This is the number of sets **per way** +class WithL1ICacheSets(sets: Int) extends Config ( + knobValues = { + case "L1I_SETS" => sets + case _ => throw new CDEMatchError + } +) + +// This is the number of sets **per way** +class WithL1DCacheSets(sets: Int) extends Config ( + knobValues = { + case "L1D_SETS" => sets + case _ => throw new CDEMatchError + } +) + +class WithL1ICacheWays(ways: Int) extends Config ( + knobValues = { + case "L1I_WAYS" => ways + case _ => throw new CDEMatchError + } +) + +class WithL1DCacheWays(ways: Int) extends Config ( + knobValues = { + case "L1D_WAYS" => ways + case _ => throw new CDEMatchError + } +) + +class WithCacheBlockBytes(linesize: Int) extends Config ( + topDefinitions = { (pname,site,here) => pname match { + case CacheBlockBytes => Dump("CACHE_BLOCK_BYTES", linesize) + case _ => throw new CDEMatchError + }} +) + class WithDataScratchpad(n: Int) extends Config( (pname,site,here) => pname match { case DataScratchpadSize => n @@ -332,3 +369,37 @@ class WithRoccExample extends Config( class WithSplitL2Metadata extends Config( knobValues = { case "L2_SPLIT_METADATA" => true; case _ => throw new CDEMatchError }) + +class WithDefaultBtb extends Config ( + topDefinitions = { (pname,site,here) => pname match { + case BtbKey => BtbParameters() + case _ => throw new CDEMatchError + }} +) + +class WithFastMulDiv extends Config ( + topDefinitions = { (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 92643944..32853a42 100644 --- a/src/main/scala/rocketchip/Configs.scala +++ b/src/main/scala/rocketchip/Configs.scala @@ -199,3 +199,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 + } +)