提交 175bcfe9 编写于 作者: L LinJiawei

Disable L2 and L3 in MinimalConfig

上级 45c767e3
...@@ -12,11 +12,11 @@ case class SoCParameters ...@@ -12,11 +12,11 @@ case class SoCParameters
( (
cores: List[XSCoreParameters], cores: List[XSCoreParameters],
EnableILA: Boolean = false, EnableILA: Boolean = false,
extIntrs: Int = 150 extIntrs: Int = 150,
useFakeL3Cache: Boolean = false
){ ){
val PAddrBits = cores.map(_.PAddrBits).reduce((x, y) => if(x > y) x else y) val PAddrBits = cores.map(_.PAddrBits).reduce((x, y) => if(x > y) x else y)
// L3 configurations // L3 configurations
val useFakeL3Cache = false
val L3InnerBusWidth = 256 val L3InnerBusWidth = 256
val L3Size = 4 * 1024 * 1024 // 4MB val L3Size = 4 * 1024 * 1024 // 4MB
val L3BlockSize = 64 val L3BlockSize = 64
......
...@@ -29,7 +29,7 @@ object ArgParser { ...@@ -29,7 +29,7 @@ object ArgParser {
val c = Class.forName(prefix + confString).getConstructor(Integer.TYPE) val c = Class.forName(prefix + confString).getConstructor(Integer.TYPE)
c.newInstance(1.asInstanceOf[Object]).asInstanceOf[Parameters] c.newInstance(1.asInstanceOf[Object]).asInstanceOf[Parameters]
} }
def parse(args: Array[String]): (Parameters, Array[String]) = { def parse(args: Array[String], fpga: Boolean = true): (Parameters, Array[String]) = {
val default = new DefaultConfig(1) val default = new DefaultConfig(1)
var firrtlOpts = Array[String]() var firrtlOpts = Array[String]()
@tailrec @tailrec
...@@ -68,6 +68,12 @@ object ArgParser { ...@@ -68,6 +68,12 @@ object ArgParser {
nextOption(config, tail) nextOption(config, tail)
} }
} }
(nextOption(default, args.toList), firrtlOpts) var config = nextOption(default, args.toList)
if(!fpga){
config = config.alter((site, here, up) => {
case DebugOptionsKey => up(DebugOptionsKey).copy(FPGAPlatform = false)
})
}
(config, firrtlOpts)
} }
} }
...@@ -25,7 +25,6 @@ class MinimalConfig(n: Int = 1) extends Config( ...@@ -25,7 +25,6 @@ class MinimalConfig(n: Int = 1) extends Config(
new DefaultConfig(n).alter((site, here, up) => { new DefaultConfig(n).alter((site, here, up) => {
case SoCParamsKey => up(SoCParamsKey).copy( case SoCParamsKey => up(SoCParamsKey).copy(
cores = up(SoCParamsKey).cores.map(_.copy( cores = up(SoCParamsKey).cores.map(_.copy(
HasL2Cache = false,
IssQueSize = 8, IssQueSize = 8,
NRPhyRegs = 80, NRPhyRegs = 80,
LoadQueueSize = 16, LoadQueueSize = 16,
...@@ -44,7 +43,17 @@ class MinimalConfig(n: Int = 1) extends Config( ...@@ -44,7 +43,17 @@ class MinimalConfig(n: Int = 1) extends Config(
), ),
EnableBPD = false, // disable TAGE EnableBPD = false, // disable TAGE
EnableLoop = false, EnableLoop = false,
)) TlbEntrySize = 4,
TlbSPEntrySize = 2,
PtwL1EntrySize = 2,
PtwL2EntrySize = 2,
PtwL3EntrySize = 4,
PtwSPEntrySize = 2,
useFakeDCache = true,
useFakePTW = true,
useFakeL1plusCache = true,
)),
useFakeL3Cache = true
) )
}) })
) )
\ No newline at end of file
...@@ -14,7 +14,6 @@ case object XSCoreParamsKey extends Field[XSCoreParameters] ...@@ -14,7 +14,6 @@ case object XSCoreParamsKey extends Field[XSCoreParameters]
case class XSCoreParameters case class XSCoreParameters
( (
HasL2Cache: Boolean = false,
HasPrefetch: Boolean = false, HasPrefetch: Boolean = false,
HartId: Int = 0, HartId: Int = 0,
XLEN: Int = 64, XLEN: Int = 64,
...@@ -93,6 +92,9 @@ case class XSCoreParameters ...@@ -93,6 +92,9 @@ case class XSCoreParameters
PtwL1EntrySize: Int = 16, PtwL1EntrySize: Int = 16,
PtwL2EntrySize: Int = 2048, //(256 * 8) PtwL2EntrySize: Int = 2048, //(256 * 8)
NumPerfCounters: Int = 16, NumPerfCounters: Int = 16,
useFakePTW: Boolean = false,
useFakeDCache: Boolean = false,
useFakeL1plusCache: Boolean = false
){ ){
val loadExuConfigs = Seq.fill(exuParameters.LduCnt)(LdExeUnitCfg) val loadExuConfigs = Seq.fill(exuParameters.LduCnt)(LdExeUnitCfg)
val storeExuConfigs = Seq.fill(exuParameters.StuCnt)(StExeUnitCfg) val storeExuConfigs = Seq.fill(exuParameters.StuCnt)(StExeUnitCfg)
...@@ -195,7 +197,6 @@ trait HasXSParameter { ...@@ -195,7 +197,6 @@ trait HasXSParameter {
val DTLBWidth = coreParams.LoadPipelineWidth + coreParams.StorePipelineWidth val DTLBWidth = coreParams.LoadPipelineWidth + coreParams.StorePipelineWidth
val TlbEntrySize = coreParams.TlbEntrySize val TlbEntrySize = coreParams.TlbEntrySize
val TlbSPEntrySize = coreParams.TlbSPEntrySize val TlbSPEntrySize = coreParams.TlbSPEntrySize
val useFakePTW = false
val PtwL3EntrySize = coreParams.PtwL3EntrySize val PtwL3EntrySize = coreParams.PtwL3EntrySize
val PtwSPEntrySize = coreParams.PtwSPEntrySize val PtwSPEntrySize = coreParams.PtwSPEntrySize
val PtwL1EntrySize = coreParams.PtwL1EntrySize val PtwL1EntrySize = coreParams.PtwL1EntrySize
...@@ -212,7 +213,6 @@ trait HasXSParameter { ...@@ -212,7 +213,6 @@ trait HasXSParameter {
nMissEntries = 2 nMissEntries = 2
) )
val useFakeL1plusCache = false
val l1plusCacheParameters = L1plusCacheParameters( val l1plusCacheParameters = L1plusCacheParameters(
tagECC = Some("secded"), tagECC = Some("secded"),
dataECC = Some("secded"), dataECC = Some("secded"),
...@@ -220,7 +220,6 @@ trait HasXSParameter { ...@@ -220,7 +220,6 @@ trait HasXSParameter {
nMissEntries = 8 nMissEntries = 8
) )
val useFakeDCache = false
val dcacheParameters = DCacheParameters( val dcacheParameters = DCacheParameters(
tagECC = Some("secded"), tagECC = Some("secded"),
dataECC = Some("secded"), dataECC = Some("secded"),
...@@ -237,6 +236,9 @@ trait HasXSParameter { ...@@ -237,6 +236,9 @@ trait HasXSParameter {
// cache hierarchy configurations // cache hierarchy configurations
val l1BusDataWidth = 256 val l1BusDataWidth = 256
val useFakeDCache = coreParams.useFakeDCache
val useFakePTW = coreParams.useFakePTW
val useFakeL1plusCache = coreParams.useFakeL1plusCache
// L2 configurations // L2 configurations
val useFakeL2Cache = useFakeDCache && useFakePTW && useFakeL1plusCache val useFakeL2Cache = useFakeDCache && useFakePTW && useFakeL1plusCache
val L1BusWidth = 256 val L1BusWidth = 256
......
...@@ -71,7 +71,7 @@ class SimTop(implicit p: Parameters) extends Module { ...@@ -71,7 +71,7 @@ class SimTop(implicit p: Parameters) extends Module {
object SimTop extends App { object SimTop extends App {
override def main(args: Array[String]): Unit = { override def main(args: Array[String]): Unit = {
val (config, firrtlOpts) = ArgParser.parse(args) val (config, firrtlOpts) = ArgParser.parse(args, fpga = false)
// generate verilog // generate verilog
XiangShanStage.execute( XiangShanStage.execute(
firrtlOpts, firrtlOpts,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册