2015-12-06 12:01:05 +01:00
|
|
|
package rocketchip
|
|
|
|
|
|
|
|
import Chisel._
|
|
|
|
import groundtest._
|
|
|
|
import rocket._
|
|
|
|
import uncore._
|
2016-01-07 06:38:35 +01:00
|
|
|
import junctions._
|
2016-02-22 18:07:26 +01:00
|
|
|
import scala.collection.mutable.LinkedHashSet
|
2016-04-22 04:37:08 +02:00
|
|
|
import cde.{Parameters, Config, Dump, Knob, CDEMatchError}
|
2015-12-06 12:01:05 +01:00
|
|
|
import scala.math.max
|
2016-03-16 22:21:47 +01:00
|
|
|
import ConfigUtils._
|
2015-12-06 12:01:05 +01:00
|
|
|
|
|
|
|
class WithGroundTest extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case TLKey("L1toL2") =>
|
|
|
|
TileLinkParameters(
|
|
|
|
coherencePolicy = new MESICoherence(site(L2DirectoryRepresentation)),
|
2016-01-15 00:10:40 +01:00
|
|
|
nManagers = site(NBanksPerMemoryChannel)*site(NMemoryChannels) + 1,
|
2015-12-06 12:01:05 +01:00
|
|
|
nCachingClients = site(NTiles),
|
2016-03-28 22:22:00 +02:00
|
|
|
nCachelessClients = site(NTiles) + site(ExtraL1Clients),
|
|
|
|
maxClientXacts = max(
|
|
|
|
site(NMSHRs) + 1,
|
|
|
|
if (site(BuildRoCC).isEmpty) 1 else site(RoccMaxTaggedMemXacts)),
|
2016-05-03 03:34:27 +02:00
|
|
|
maxClientsPerPort = 2,
|
2015-12-06 12:01:05 +01:00
|
|
|
maxManagerXacts = site(NAcquireTransactors) + 2,
|
2016-05-26 03:01:57 +02:00
|
|
|
dataBeats = site(MIFDataBeats),
|
2015-12-06 12:01:05 +01:00
|
|
|
dataBits = site(CacheBlockBytes)*8)
|
|
|
|
case BuildTiles => {
|
2016-05-04 02:11:25 +02:00
|
|
|
val groundtest = if (site(XLen) == 64)
|
|
|
|
DefaultTestSuites.groundtest64
|
|
|
|
else
|
|
|
|
DefaultTestSuites.groundtest32
|
|
|
|
TestGeneration.addSuite(groundtest("p"))
|
2016-05-03 03:34:27 +02:00
|
|
|
TestGeneration.addSuite(DefaultTestSuites.emptyBmarks)
|
2015-12-06 12:01:05 +01:00
|
|
|
(0 until site(NTiles)).map { i =>
|
|
|
|
(r: Bool, p: Parameters) =>
|
|
|
|
Module(new GroundTestTile(i, r)
|
|
|
|
(p.alterPartial({case TLId => "L1toL2"})))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case GroundTestMaxXacts => 1
|
2016-03-25 03:52:12 +01:00
|
|
|
case GroundTestCSRs => Nil
|
2016-05-04 05:21:13 +02:00
|
|
|
case TohostAddr => BigInt("80001000", 16)
|
2016-03-25 03:52:12 +01:00
|
|
|
case RoccNCSRs => site(GroundTestCSRs).size
|
2016-02-22 18:07:26 +01:00
|
|
|
case UseFPU => false
|
2016-05-26 03:01:57 +02:00
|
|
|
case UseAtomics => true
|
2016-04-22 04:37:08 +02:00
|
|
|
case _ => throw new CDEMatchError
|
2015-12-06 12:01:05 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
class WithMemtest extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case NGenerators => site(NTiles)
|
|
|
|
case GenerateUncached => true
|
|
|
|
case GenerateCached => true
|
|
|
|
case MaxGenerateRequests => 128
|
2016-05-03 03:34:27 +02:00
|
|
|
case GeneratorStartAddress => site(GlobalAddrHashMap)("mem").start
|
2015-12-06 12:01:05 +01:00
|
|
|
case BuildGroundTest =>
|
|
|
|
(id: Int, p: Parameters) => Module(new GeneratorTest(id)(p))
|
2016-04-22 04:37:08 +02:00
|
|
|
case _ => throw new CDEMatchError
|
2015-12-06 12:01:05 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
class WithCacheFillTest extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case BuildGroundTest =>
|
|
|
|
(id: Int, p: Parameters) => Module(new CacheFillTest()(p))
|
2016-04-22 04:37:08 +02:00
|
|
|
case _ => throw new CDEMatchError
|
2015-12-06 12:01:05 +01:00
|
|
|
},
|
|
|
|
knobValues = {
|
|
|
|
case "L2_WAYS" => 4
|
|
|
|
case "L2_CAPACITY_IN_KB" => 4
|
2016-04-22 04:37:08 +02:00
|
|
|
case _ => throw new CDEMatchError
|
2015-12-06 12:01:05 +01:00
|
|
|
})
|
|
|
|
|
2015-12-15 05:01:22 +01:00
|
|
|
class WithBroadcastRegressionTest extends Config(
|
2015-12-06 12:01:05 +01:00
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case BuildGroundTest =>
|
|
|
|
(id: Int, p: Parameters) => Module(new RegressionTest()(p))
|
2015-12-15 05:01:22 +01:00
|
|
|
case GroundTestRegressions =>
|
|
|
|
(p: Parameters) => RegressionTests.broadcastRegressions(p)
|
2015-12-17 06:06:39 +01:00
|
|
|
case GroundTestMaxXacts => 3
|
2016-04-22 04:37:08 +02:00
|
|
|
case _ => throw new CDEMatchError
|
2015-12-15 05:01:22 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
class WithCacheRegressionTest extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case BuildGroundTest =>
|
|
|
|
(id: Int, p: Parameters) => Module(new RegressionTest()(p))
|
|
|
|
case GroundTestRegressions =>
|
|
|
|
(p: Parameters) => RegressionTests.cacheRegressions(p)
|
2015-12-17 06:06:39 +01:00
|
|
|
case GroundTestMaxXacts => 3
|
2016-04-22 04:37:08 +02:00
|
|
|
case _ => throw new CDEMatchError
|
2015-12-06 12:01:05 +01:00
|
|
|
})
|
|
|
|
|
2015-11-18 03:21:52 +01:00
|
|
|
class WithDmaTest extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
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
|
2016-04-22 04:37:08 +02:00
|
|
|
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 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)
|
2016-04-22 04:37:08 +02:00
|
|
|
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 BuildGroundTest =>
|
|
|
|
(id: Int, p: Parameters) => Module(new NastiConverterTest()(p))
|
2016-04-22 04:37:08 +02:00
|
|
|
case _ => throw new CDEMatchError
|
2016-02-10 20:12:39 +01:00
|
|
|
})
|
|
|
|
|
2016-02-19 22:30:20 +01:00
|
|
|
class WithUnitTest extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case BuildGroundTest =>
|
|
|
|
(id: Int, p: Parameters) => Module(new UnitTestSuite()(p))
|
2016-04-22 04:37:08 +02:00
|
|
|
case _ => throw new CDEMatchError
|
2016-02-19 22:30:20 +01:00
|
|
|
})
|
|
|
|
|
2016-02-22 19:04:38 +01:00
|
|
|
class WithTraceGen extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case BuildGroundTest =>
|
|
|
|
(id: Int, p: Parameters) => Module(new GroundTestTraceGenerator(id)(p))
|
|
|
|
case NGenerators => site(NTiles)
|
|
|
|
case MaxGenerateRequests => 128
|
|
|
|
case AddressBag => List(0x8, 0x10, 0x108, 0x100008)
|
2016-04-22 04:37:08 +02:00
|
|
|
case _ => throw new CDEMatchError
|
2016-02-22 19:04:38 +01:00
|
|
|
})
|
|
|
|
|
2016-05-25 20:08:11 +02:00
|
|
|
class GroundTestConfig extends Config(new WithGroundTest ++ new BaseConfig)
|
2015-12-06 12:01:05 +01:00
|
|
|
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)
|
2015-12-15 05:01:22 +01:00
|
|
|
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)
|
2016-02-19 22:30:20 +01:00
|
|
|
class UnitTestConfig extends Config(new WithUnitTest ++ new GroundTestConfig)
|
2016-02-22 19:04:38 +01:00
|
|
|
class TraceGenConfig extends Config(new With2Cores ++ new WithL2Cache ++ new WithTraceGen ++ new GroundTestConfig)
|
2015-12-06 12:01:05 +01:00
|
|
|
|
|
|
|
class FancyMemtestConfig extends Config(
|
2016-04-02 02:53:59 +02:00
|
|
|
new With2Cores ++ new With2MemoryChannels ++ new With4BanksPerMemChannel ++
|
2015-12-06 12:01:05 +01:00
|
|
|
new WithMemtest ++ new WithL2Cache ++ new GroundTestConfig)
|