1
0
rocket-chip/src/main/scala/TestConfigs.scala

226 lines
8.2 KiB
Scala
Raw Normal View History

package rocketchip
import Chisel._
import groundtest._
import rocket._
import uncore._
2016-01-07 06:38:35 +01:00
import junctions._
import scala.collection.mutable.LinkedHashSet
import cde.{Parameters, Config, Dump, Knob, CDEMatchError}
import scala.math.max
import ConfigUtils._
class WithGroundTest extends Config(
(pname, site, here) => pname match {
case TLKey("L1toL2") =>
TileLinkParameters(
coherencePolicy = new MESICoherence(site(L2DirectoryRepresentation)),
nManagers = site(NBanksPerMemoryChannel)*site(NMemoryChannels) + 1,
nCachingClients = site(NCachedTileLinkPorts),
nCachelessClients = site(NUncachedTileLinkPorts),
maxClientXacts = max(
site(NMSHRs) + 1,
2016-06-09 04:59:35 +02:00
site(GroundTestMaxXacts)),
maxClientsPerPort = 1,
maxManagerXacts = site(NAcquireTransactors) + 2,
dataBeats = site(MIFDataBeats),
dataBits = site(CacheBlockBytes)*8)
case BuildTiles => {
val groundtest = if (site(XLen) == 64)
DefaultTestSuites.groundtest64
else
DefaultTestSuites.groundtest32
TestGeneration.addSuite(groundtest("p"))
TestGeneration.addSuite(DefaultTestSuites.emptyBmarks)
(0 until site(NTiles)).map { i =>
(r: Bool, p: Parameters) =>
Module(new GroundTestTile(i, r)(p.alterPartial({
case TLId => "L1toL2"
2016-06-23 21:17:26 +02:00
case NUncachedTileLinkPorts => p(GroundTestUncachedClients)
})))
}
}
case GroundTestCachedClients => 0
case GroundTestUncachedClients => 0
case GroundTestNPTW => 0
case GroundTestMaxXacts => 1
2016-03-25 03:52:12 +01:00
case GroundTestCSRs => Nil
case TohostAddr => BigInt("80001000", 16)
2016-03-25 03:52:12 +01:00
case RoccNCSRs => site(GroundTestCSRs).size
case UseFPU => false
case UseAtomics => false
case _ => throw new CDEMatchError
})
2016-06-06 19:48:25 +02:00
class WithComparator extends Config(
(pname, site, here) => pname match {
case GroundTestUncachedClients => site(ComparatorKey).targets.size
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new ComparatorCore()(p))
2016-06-06 19:48:25 +02:00
case ComparatorKey => ComparatorParameters(
targets = Seq(0L, 0x100L).map(site(GlobalAddrMap)("mem").start.longValue + _),
2016-06-06 19:48:25 +02:00
width = 8,
operations = 1000,
atomics = site(UseAtomics),
prefetches = site("COMPARATOR_PREFETCHES"))
2016-06-06 19:48:25 +02:00
case TohostAddr => BigInt("80001000", 16) // quit test by writing here
case UseFPU => false
case UseAtomics => false
case "COMPARATOR_PREFETCHES" => false
2016-06-06 19:48:25 +02:00
case _ => throw new CDEMatchError
})
class WithAtomics extends Config(
(pname, site, here) => pname match {
case UseAtomics => true
})
class WithPrefetches extends Config(
(pname, site, here) => pname match {
case "COMPARATOR_PREFETCHES" => true
})
class WithMemtest extends Config(
(pname, site, here) => pname match {
case GroundTestCachedClients => 1
case GroundTestUncachedClients => 1
case GroundTestNPTW => 0
case MaxGenerateRequests => 128
case GeneratorStartAddress => site(TohostAddr) + BigInt(site(CacheBlockBytes))
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new GeneratorTest(id)(p))
case _ => throw new CDEMatchError
})
class WithCacheFillTest extends Config(
(pname, site, here) => pname match {
case GroundTestUncachedClients => 1
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new CacheFillTest()(p))
case _ => throw new CDEMatchError
},
knobValues = {
case "L2_WAYS" => 4
case "L2_CAPACITY_IN_KB" => 4
case _ => throw new CDEMatchError
})
class WithBroadcastRegressionTest extends Config(
(pname, site, here) => pname match {
case GroundTestCachedClients => 1
case GroundTestUncachedClients => 1
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new RegressionTest()(p))
case GroundTestRegressions =>
(p: Parameters) => RegressionTests.broadcastRegressions(p)
2015-12-17 06:06:39 +01:00
case GroundTestMaxXacts => 3
case _ => throw new CDEMatchError
})
class WithCacheRegressionTest extends Config(
(pname, site, here) => pname match {
case GroundTestCachedClients => 1
case GroundTestUncachedClients => 1
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new RegressionTest()(p))
case GroundTestRegressions =>
(p: Parameters) => RegressionTests.cacheRegressions(p)
case GroundTestMaxXacts => 5
case _ => throw new CDEMatchError
})
2015-11-18 03:21:52 +01:00
class WithDmaTest extends Config(
(pname, site, here) => pname match {
case GroundTestNPTW => 1
case GroundTestUncachedClients => 1
2015-11-18 03:21:52 +01:00
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new DmaTest()(p))
case DmaTestSet => DmaTestCases(
(0x00001FF0, 0x00002FF4, 72),
(0x00001FF4, 0x00002FF0, 72),
(0x00001FF0, 0x00002FE0, 72),
(0x00001FE0, 0x00002FF0, 72),
(0x00884DA4, 0x008836C0, 40),
(0x00800008, 0x00800008, 64))
case DmaTestDataStart => 0x3012CC00
case DmaTestDataStride => 8
case _ => throw new CDEMatchError
2015-11-18 03:21:52 +01:00
})
2016-01-07 06:38:35 +01:00
class WithDmaStreamTest extends Config(
(pname, site, here) => pname match {
case GroundTestNPTW => 1
case GroundTestUncachedClients => 1
2016-01-07 06:38:35 +01:00
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new DmaStreamTest()(p))
case DmaStreamTestSettings => DmaStreamTestConfig(
source = 0x10, dest = 0x28, len = 0x18,
size = site(StreamLoopbackWidth) / 8)
2016-03-25 03:52:12 +01:00
case GroundTestCSRs =>
Seq(DmaCtrlRegNumbers.CSR_BASE + DmaCtrlRegNumbers.OUTSTANDING)
case _ => throw new CDEMatchError
2016-01-07 06:38:35 +01:00
})
2016-02-10 20:12:39 +01:00
class WithNastiConverterTest extends Config(
(pname, site, here) => pname match {
case GroundTestUncachedClients => 1
2016-02-10 20:12:39 +01:00
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new NastiConverterTest()(p))
case _ => throw new CDEMatchError
2016-02-10 20:12:39 +01:00
})
class WithUnitTest extends Config(
(pname, site, here) => pname match {
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new UnitTestSuite()(p))
case _ => throw new CDEMatchError
})
class WithTraceGen extends Config(
(pname, site, here) => pname match {
case GroundTestCachedClients => 1
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new GroundTestTraceGenerator(id)(p))
case MaxGenerateRequests => 128
case AddressBag => List(0x8, 0x10, 0x108, 0x100008)
case _ => throw new CDEMatchError
})
class ComparatorConfig extends Config(new WithComparator ++ new GroundTestConfig)
class ComparatorL2Config extends Config(
new WithAtomics ++ new WithPrefetches ++
new WithL2Cache ++ new ComparatorConfig)
2016-05-25 20:08:11 +02:00
class GroundTestConfig extends Config(new WithGroundTest ++ new BaseConfig)
class MemtestConfig extends Config(new WithMemtest ++ new GroundTestConfig)
class MemtestL2Config extends Config(
new WithMemtest ++ new WithL2Cache ++ new GroundTestConfig)
class CacheFillTestConfig extends Config(
2016-05-03 22:39:04 +02:00
new WithCacheFillTest ++ new WithPLRU ++ new WithL2Cache ++ new GroundTestConfig)
class BroadcastRegressionTestConfig extends Config(
new WithBroadcastRegressionTest ++ new GroundTestConfig)
class CacheRegressionTestConfig extends Config(
new WithCacheRegressionTest ++ new WithL2Cache ++ new GroundTestConfig)
2015-11-18 03:21:52 +01:00
class DmaTestConfig extends Config(new WithDmaTest ++ new WithL2Cache ++ new GroundTestConfig)
2016-01-07 06:38:35 +01:00
class DmaStreamTestConfig extends Config(new WithDmaStreamTest ++ new WithStreamLoopback ++ new WithL2Cache ++ new GroundTestConfig)
2016-02-10 20:12:39 +01:00
class NastiConverterTestConfig extends Config(new WithNastiConverterTest ++ new GroundTestConfig)
class UnitTestConfig extends Config(new WithUnitTest ++ new GroundTestConfig)
class TraceGenConfig extends Config(new WithNCores(2) ++ new WithL2Cache ++ new WithTraceGen ++ new GroundTestConfig)
class WithNCachedGenerators(n: Int) extends Config(
(pname, site, here) => pname match {
case GroundTestCachedClients => n
case _ => throw new CDEMatchError
})
class WithNUncachedGenerators(n: Int) extends Config(
(pname, site, here) => pname match {
case GroundTestUncachedClients => n
case _ => throw new CDEMatchError
})
class FancyMemtestConfig extends Config(
new WithNCachedGenerators(1) ++ new WithNUncachedGenerators(2) ++
new WithNCores(2) ++
new WithNMemoryChannels(2) ++ new WithNBanksPerMemChannel(4) ++
new WithMemtest ++ new WithL2Cache ++ new GroundTestConfig)