2014-09-12 19:15:04 +02:00
|
|
|
// See LICENSE for license details.
|
|
|
|
|
2014-09-02 22:51:57 +02:00
|
|
|
package rocketchip
|
2014-08-23 10:26:03 +02:00
|
|
|
|
|
|
|
import Chisel._
|
2015-07-30 02:56:19 +02:00
|
|
|
import junctions._
|
2016-08-11 02:20:00 +02:00
|
|
|
import rocket._
|
2016-10-04 00:17:36 +02:00
|
|
|
import diplomacy._
|
2016-06-28 22:16:48 +02:00
|
|
|
import uncore.agents._
|
2016-08-11 02:20:00 +02:00
|
|
|
import uncore.tilelink._
|
2016-06-28 22:16:48 +02:00
|
|
|
import uncore.devices._
|
2016-07-07 01:54:58 +02:00
|
|
|
import uncore.converters._
|
2016-09-28 06:27:07 +02:00
|
|
|
import util._
|
2016-08-11 02:20:00 +02:00
|
|
|
import coreplex._
|
2015-06-26 08:17:35 +02:00
|
|
|
import scala.math.max
|
2016-08-02 04:07:03 +02:00
|
|
|
import scala.collection.mutable.{LinkedHashSet, ListBuffer}
|
2016-08-20 03:26:34 +02:00
|
|
|
import scala.collection.immutable.HashMap
|
2015-07-13 23:54:26 +02:00
|
|
|
import DefaultTestSuites._
|
2016-04-22 04:37:08 +02:00
|
|
|
import cde.{Parameters, Config, Dump, Knob, CDEMatchError}
|
2014-08-23 10:26:03 +02:00
|
|
|
|
2016-09-11 08:39:29 +02:00
|
|
|
class BasePlatformConfig extends Config(
|
|
|
|
topDefinitions = {
|
|
|
|
(pname,site,here) => {
|
|
|
|
type PF = PartialFunction[Any,Any]
|
|
|
|
def findBy(sname:Any):Any = here[PF](site[Any](sname))(pname)
|
|
|
|
pname match {
|
|
|
|
//Memory Parameters
|
2016-10-09 21:34:10 +02:00
|
|
|
case TLEmitMonitors => true
|
2016-09-11 08:39:29 +02:00
|
|
|
case NExtTopInterrupts => 2
|
2016-11-17 23:07:53 +01:00
|
|
|
case SOCBusConfig => site(L1toL2Config)
|
|
|
|
case PeripheryBusConfig => TLBusConfig(beatBytes = 4)
|
|
|
|
case PeripheryBusArithmetic => true
|
2016-09-11 08:39:29 +02:00
|
|
|
// Note that PLIC asserts that this is > 0.
|
|
|
|
case IncludeJtagDTM => false
|
|
|
|
case NMemoryChannels => Dump("N_MEM_CHANNELS", 1)
|
2016-11-18 00:38:11 +01:00
|
|
|
case ExtMem => AXIMasterConfig(0x80000000L, 0x10000000L, 8, 4)
|
|
|
|
case ExtBus => AXIMasterConfig(0x60000000L, 0x20000000L, 8, 4)
|
2016-09-11 08:39:29 +02:00
|
|
|
case RTCPeriod => 100 // gives 10 MHz RTC assuming 1 GHz uncore clock
|
|
|
|
case _ => throw new CDEMatchError
|
2016-03-15 02:03:33 +01:00
|
|
|
}
|
2015-09-25 18:41:19 +02:00
|
|
|
}
|
2016-09-11 08:39:29 +02:00
|
|
|
})
|
2015-12-16 19:24:57 +01:00
|
|
|
|
2016-08-11 02:20:00 +02:00
|
|
|
class BaseConfig extends Config(new BaseCoreplexConfig ++ new BasePlatformConfig)
|
|
|
|
class DefaultConfig extends Config(new WithBlockingL1 ++ new BaseConfig)
|
2015-11-21 08:26:28 +01:00
|
|
|
|
2016-05-25 20:08:11 +02:00
|
|
|
class DefaultL2Config extends Config(new WithL2Cache ++ new BaseConfig)
|
2016-07-05 02:07:58 +02:00
|
|
|
class DefaultBufferlessConfig extends Config(
|
|
|
|
new WithBufferlessBroadcastHub ++ new BaseConfig)
|
|
|
|
|
2015-10-22 03:23:58 +02:00
|
|
|
class FPGAConfig extends Config (
|
2014-10-06 22:43:40 +02:00
|
|
|
(pname,site,here) => pname match {
|
2015-07-31 01:30:00 +02:00
|
|
|
case NAcquireTransactors => 4
|
2016-06-08 01:13:01 +02:00
|
|
|
case _ => throw new CDEMatchError
|
2014-09-24 02:05:14 +02:00
|
|
|
}
|
2014-10-06 22:43:40 +02:00
|
|
|
)
|
2014-09-24 02:05:14 +02:00
|
|
|
|
2016-08-11 02:20:00 +02:00
|
|
|
class DefaultFPGAConfig extends Config(new FPGAConfig ++ new BaseConfig)
|
|
|
|
class DefaultL2FPGAConfig extends Config(
|
|
|
|
new WithL2Capacity(64) ++ new WithL2Cache ++ new DefaultFPGAConfig)
|
|
|
|
|
|
|
|
class PLRUL2Config extends Config(new WithPLRU ++ new DefaultL2Config)
|
|
|
|
|
|
|
|
class WithNMemoryChannels(n: Int) extends Config(
|
|
|
|
(pname,site,here) => pname match {
|
|
|
|
case NMemoryChannels => Dump("N_MEM_CHANNELS", n)
|
2016-06-08 01:13:01 +02:00
|
|
|
case _ => throw new CDEMatchError
|
2016-05-25 20:08:11 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2016-08-18 01:31:34 +02:00
|
|
|
class WithExtMemSize(n: Long) extends Config(
|
|
|
|
(pname,site,here) => pname match {
|
2016-11-18 00:38:11 +01:00
|
|
|
case ExtMem => site(ExtMem).copy(size = n)
|
2016-08-18 01:31:34 +02:00
|
|
|
case _ => throw new CDEMatchError
|
|
|
|
}
|
|
|
|
)
|
2016-07-01 03:20:43 +02:00
|
|
|
|
2016-09-03 00:59:16 +02:00
|
|
|
class WithScratchpads extends Config(new WithNMemoryChannels(0) ++ new WithDataScratchpad(16384))
|
|
|
|
|
2016-06-23 01:08:27 +02:00
|
|
|
class DefaultFPGASmallConfig extends Config(new WithSmallCores ++ new DefaultFPGAConfig)
|
|
|
|
class DefaultSmallConfig extends Config(new WithSmallCores ++ new BaseConfig)
|
2016-09-07 10:58:25 +02:00
|
|
|
class DefaultRV32Config extends Config(new WithRV32 ++ new DefaultConfig)
|
2015-08-06 21:51:18 +02:00
|
|
|
|
2016-06-14 01:24:01 +02:00
|
|
|
class DualBankConfig extends Config(
|
|
|
|
new WithNBanksPerMemChannel(2) ++ new BaseConfig)
|
2015-11-19 02:07:01 +01:00
|
|
|
class DualBankL2Config extends Config(
|
2016-06-14 01:24:01 +02:00
|
|
|
new WithNBanksPerMemChannel(2) ++ new WithL2Cache ++ new BaseConfig)
|
2015-11-03 05:10:10 +01:00
|
|
|
|
2016-06-14 01:24:01 +02:00
|
|
|
class DualChannelConfig extends Config(new WithNMemoryChannels(2) ++ new BaseConfig)
|
2015-11-19 02:07:01 +01:00
|
|
|
class DualChannelL2Config extends Config(
|
2016-06-14 01:24:01 +02:00
|
|
|
new WithNMemoryChannels(2) ++ new WithL2Cache ++ new BaseConfig)
|
2015-11-19 02:07:01 +01:00
|
|
|
|
|
|
|
class DualChannelDualBankConfig extends Config(
|
2016-06-14 01:24:01 +02:00
|
|
|
new WithNMemoryChannels(2) ++
|
|
|
|
new WithNBanksPerMemChannel(2) ++ new BaseConfig)
|
2015-11-19 02:07:01 +01:00
|
|
|
class DualChannelDualBankL2Config extends Config(
|
2016-06-14 01:24:01 +02:00
|
|
|
new WithNMemoryChannels(2) ++ new WithNBanksPerMemChannel(2) ++
|
2016-05-25 20:08:11 +02:00
|
|
|
new WithL2Cache ++ new BaseConfig)
|
2015-11-19 02:07:01 +01:00
|
|
|
|
2016-05-25 20:08:11 +02:00
|
|
|
class RoccExampleConfig extends Config(new WithRoccExample ++ new BaseConfig)
|
2015-11-21 08:26:28 +01:00
|
|
|
|
2016-09-28 00:11:31 +02:00
|
|
|
class WithEdgeDataBits(dataBits: Int) extends Config(
|
2016-07-01 03:20:43 +02:00
|
|
|
(pname, site, here) => pname match {
|
2016-11-18 00:38:11 +01:00
|
|
|
case ExtMem => site(ExtMem).copy(beatBytes = dataBits/8)
|
2016-09-16 04:47:18 +02:00
|
|
|
case _ => throw new CDEMatchError
|
2016-07-01 03:20:43 +02:00
|
|
|
})
|
|
|
|
|
2016-09-28 00:11:31 +02:00
|
|
|
class Edge128BitConfig extends Config(
|
|
|
|
new WithEdgeDataBits(128) ++ new BaseConfig)
|
|
|
|
class Edge32BitConfig extends Config(
|
|
|
|
new WithEdgeDataBits(32) ++ new BaseConfig)
|
2016-07-01 03:20:43 +02:00
|
|
|
|
2015-11-21 08:26:28 +01:00
|
|
|
class SmallL2Config extends Config(
|
2016-06-14 01:24:01 +02:00
|
|
|
new WithNMemoryChannels(2) ++ new WithNBanksPerMemChannel(4) ++
|
|
|
|
new WithL2Capacity(256) ++ new DefaultL2Config)
|
2016-01-07 06:38:35 +01:00
|
|
|
|
2016-06-14 01:24:01 +02:00
|
|
|
class SingleChannelBenchmarkConfig extends Config(new WithL2Capacity(256) ++ new DefaultL2Config)
|
|
|
|
class DualChannelBenchmarkConfig extends Config(new WithNMemoryChannels(2) ++ new SingleChannelBenchmarkConfig)
|
|
|
|
class QuadChannelBenchmarkConfig extends Config(new WithNMemoryChannels(4) ++ new SingleChannelBenchmarkConfig)
|
|
|
|
class OctoChannelBenchmarkConfig extends Config(new WithNMemoryChannels(8) ++ new SingleChannelBenchmarkConfig)
|
2016-02-18 00:23:30 +01:00
|
|
|
|
2016-06-14 01:24:01 +02:00
|
|
|
class EightChannelConfig extends Config(new WithNMemoryChannels(8) ++ new BaseConfig)
|
2016-02-26 10:33:25 +01:00
|
|
|
|
2016-02-29 23:49:18 +01:00
|
|
|
class SplitL2MetadataTestConfig extends Config(new WithSplitL2Metadata ++ new DefaultL2Config)
|
2016-03-28 22:22:00 +02:00
|
|
|
|
2016-06-21 02:58:26 +02:00
|
|
|
class DualCoreConfig extends Config(
|
|
|
|
new WithNCores(2) ++ new WithL2Cache ++ new BaseConfig)
|
2016-07-22 20:36:45 +02:00
|
|
|
|
|
|
|
class TinyConfig extends Config(
|
2016-09-03 00:59:16 +02:00
|
|
|
new WithScratchpads ++
|
2016-09-07 08:53:12 +02:00
|
|
|
new WithSmallCores ++ new WithRV32 ++
|
2016-07-22 20:36:45 +02:00
|
|
|
new WithStatelessBridge ++ new BaseConfig)
|
2016-08-04 01:33:30 +02:00
|
|
|
|
2016-08-19 18:46:43 +02:00
|
|
|
class WithJtagDTM extends Config (
|
|
|
|
(pname, site, here) => pname match {
|
2016-09-16 04:47:18 +02:00
|
|
|
case IncludeJtagDTM => true
|
|
|
|
case _ => throw new CDEMatchError
|
2016-08-19 18:46:43 +02:00
|
|
|
}
|
|
|
|
)
|
2016-09-28 00:52:13 +02:00
|
|
|
|
|
|
|
class WithNoPeripheryArithAMO extends Config (
|
|
|
|
(pname, site, here) => pname match {
|
2016-11-17 23:07:53 +01:00
|
|
|
case PeripheryBusArithmetic => false
|
2016-09-28 00:52:13 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
class With64BitPeriphery extends Config (
|
|
|
|
(pname, site, here) => pname match {
|
2016-11-17 23:07:53 +01:00
|
|
|
case PeripheryBusConfig => TLBusConfig(beatBytes = 8)
|
2016-09-28 00:52:13 +02:00
|
|
|
}
|
|
|
|
)
|
2016-10-09 21:34:10 +02:00
|
|
|
|
|
|
|
class WithTLMonitors extends Config (
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case TLEmitMonitors => true
|
|
|
|
case _ => throw new CDEMatchError
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
class WithoutTLMonitors extends Config (
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case TLEmitMonitors => false
|
|
|
|
case _ => throw new CDEMatchError
|
|
|
|
}
|
|
|
|
)
|