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
|
2015-12-06 12:01:05 +01:00
|
|
|
import cde.{Parameters, Config, Dump, Knob}
|
|
|
|
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)),
|
|
|
|
maxClientsPerPort = if (site(BuildRoCC).isEmpty) 1 else 2,
|
2015-12-06 12:01:05 +01:00
|
|
|
maxManagerXacts = site(NAcquireTransactors) + 2,
|
|
|
|
dataBits = site(CacheBlockBytes)*8)
|
|
|
|
case BuildTiles => {
|
2016-02-24 01:56:13 +01:00
|
|
|
TestGeneration.addSuite(new AssemblyGroundTestSuite)
|
|
|
|
TestGeneration.addSuite(new BenchmarkGroundTestSuite)
|
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
|
|
|
|
case RoccNCSRs => site(GroundTestCSRs).size
|
2016-02-22 18:07:26 +01:00
|
|
|
case UseFPU => false
|
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
|
|
|
|
case GeneratorStartAddress => 0
|
|
|
|
case BuildGroundTest =>
|
|
|
|
(id: Int, p: Parameters) => Module(new GeneratorTest(id)(p))
|
|
|
|
})
|
|
|
|
|
|
|
|
class WithCacheFillTest extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case BuildGroundTest =>
|
|
|
|
(id: Int, p: Parameters) => Module(new CacheFillTest()(p))
|
|
|
|
},
|
|
|
|
knobValues = {
|
|
|
|
case "L2_WAYS" => 4
|
|
|
|
case "L2_CAPACITY_IN_KB" => 4
|
|
|
|
})
|
|
|
|
|
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
|
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
|
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-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-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-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-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)
|
|
|
|
})
|
|
|
|
|
2015-12-06 12:01:05 +01:00
|
|
|
class GroundTestConfig extends Config(new WithGroundTest ++ new DefaultConfig)
|
|
|
|
class MemtestConfig extends Config(new WithMemtest ++ new GroundTestConfig)
|
|
|
|
class MemtestL2Config extends Config(
|
|
|
|
new WithMemtest ++ new WithL2Cache ++ new GroundTestConfig)
|
|
|
|
class CacheFillTestConfig extends Config(
|
|
|
|
new WithCacheFillTest ++ 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(
|
|
|
|
new With2Cores ++ new With2MemoryChannels ++ new With2BanksPerMemChannel ++
|
|
|
|
new WithMemtest ++ new WithL2Cache ++ new GroundTestConfig)
|
2016-04-01 03:40:35 +02:00
|
|
|
|
|
|
|
class MemoryMuxMemtestConfig extends Config(
|
|
|
|
new With2MemoryChannels ++ new WithOneOrMaxChannels ++
|
|
|
|
new WithMemtest ++ new GroundTestConfig)
|