2016-09-15 22:04:01 +02:00
|
|
|
package groundtest
|
2016-08-11 02:20:00 +02:00
|
|
|
|
|
|
|
import Chisel._
|
|
|
|
import rocket._
|
2016-10-04 00:17:36 +02:00
|
|
|
import diplomacy._
|
2016-08-11 02:20:00 +02:00
|
|
|
import uncore.tilelink._
|
|
|
|
import uncore.coherence._
|
|
|
|
import uncore.agents._
|
|
|
|
import uncore.devices.NTiles
|
|
|
|
import junctions._
|
2016-11-18 23:05:14 +01:00
|
|
|
import config._
|
2016-08-11 02:20:00 +02:00
|
|
|
import scala.math.max
|
2016-09-15 22:04:01 +02:00
|
|
|
import coreplex._
|
|
|
|
import rocketchip._
|
|
|
|
import util.ConfigUtils._
|
|
|
|
|
|
|
|
/** Actual testing target Configs */
|
|
|
|
|
|
|
|
class GroundTestConfig extends Config(new WithGroundTest ++ new BaseConfig)
|
|
|
|
|
|
|
|
class ComparatorConfig extends Config(
|
|
|
|
new WithComparator ++ new GroundTestConfig)
|
|
|
|
class ComparatorL2Config extends Config(
|
|
|
|
new WithAtomics ++ new WithPrefetches ++
|
|
|
|
new WithL2Cache ++ new ComparatorConfig)
|
|
|
|
class ComparatorBufferlessConfig extends Config(
|
|
|
|
new WithBufferlessBroadcastHub ++ new ComparatorConfig)
|
|
|
|
class ComparatorStatelessConfig extends Config(
|
|
|
|
new WithStatelessBridge ++ new ComparatorConfig)
|
|
|
|
|
|
|
|
class MemtestConfig extends Config(new WithMemtest ++ new GroundTestConfig)
|
|
|
|
class MemtestL2Config extends Config(
|
|
|
|
new WithL2Cache ++ new MemtestConfig)
|
|
|
|
class MemtestBufferlessConfig extends Config(
|
|
|
|
new WithBufferlessBroadcastHub ++ new MemtestConfig)
|
|
|
|
class MemtestStatelessConfig extends Config(
|
|
|
|
new WithNGenerators(0, 1) ++ new WithStatelessBridge ++ new MemtestConfig)
|
|
|
|
// Test ALL the things
|
|
|
|
class FancyMemtestConfig extends Config(
|
|
|
|
new WithNGenerators(1, 2) ++ new WithNCores(2) ++ new WithMemtest ++
|
|
|
|
new WithNMemoryChannels(2) ++ new WithNBanksPerMemChannel(4) ++
|
2016-11-18 21:02:33 +01:00
|
|
|
new WithL2Cache ++ new GroundTestConfig)
|
2016-09-15 22:04:01 +02:00
|
|
|
|
|
|
|
class CacheFillTestConfig extends Config(
|
2016-11-18 21:02:33 +01:00
|
|
|
new WithNL2Ways(4) ++ new WithL2Capacity(4) ++ new WithCacheFillTest ++ new WithPLRU ++ new WithL2Cache ++ new GroundTestConfig)
|
2016-09-15 22:04:01 +02:00
|
|
|
|
|
|
|
class BroadcastRegressionTestConfig extends Config(
|
|
|
|
new WithBroadcastRegressionTest ++ new GroundTestConfig)
|
|
|
|
class BufferlessRegressionTestConfig extends Config(
|
|
|
|
new WithBufferlessBroadcastHub ++ new BroadcastRegressionTestConfig)
|
|
|
|
class CacheRegressionTestConfig extends Config(
|
|
|
|
new WithCacheRegressionTest ++ new WithL2Cache ++ new GroundTestConfig)
|
|
|
|
|
|
|
|
class TraceGenConfig extends Config(
|
|
|
|
new WithNCores(2) ++ new WithTraceGen ++ new GroundTestConfig)
|
|
|
|
class TraceGenBufferlessConfig extends Config(
|
|
|
|
new WithBufferlessBroadcastHub ++ new TraceGenConfig)
|
|
|
|
class TraceGenL2Config extends Config(
|
|
|
|
new WithNL2Ways(1) ++ new WithL2Capacity(32 * 64 / 1024) ++
|
|
|
|
new WithL2Cache ++ new TraceGenConfig)
|
|
|
|
|
2016-09-28 00:11:31 +02:00
|
|
|
class Edge128BitComparatorConfig extends Config(
|
|
|
|
new WithEdgeDataBits(128) ++ new ComparatorConfig)
|
|
|
|
class Edge128BitMemtestConfig extends Config(
|
|
|
|
new WithEdgeDataBits(128) ++ new MemtestConfig)
|
2016-09-15 22:04:01 +02:00
|
|
|
|
2016-09-28 00:11:31 +02:00
|
|
|
class Edge32BitComparatorConfig extends Config(
|
|
|
|
new WithEdgeDataBits(32) ++ new ComparatorL2Config)
|
|
|
|
class Edge32BitMemtestConfig extends Config(
|
|
|
|
new WithEdgeDataBits(32) ++ new MemtestConfig)
|
2016-09-15 22:04:01 +02:00
|
|
|
|
|
|
|
/* Composable Configs to set individual parameters */
|
|
|
|
class WithGroundTest extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case TLKey("L1toL2") => {
|
2016-11-11 22:07:45 +01:00
|
|
|
val useMEI = site(NTiles) <= 1
|
2016-09-28 00:11:31 +02:00
|
|
|
val dataBeats = (8 * site(CacheBlockBytes)) / site(XLen)
|
2016-09-15 22:04:01 +02:00
|
|
|
TileLinkParameters(
|
|
|
|
coherencePolicy = (
|
|
|
|
if (useMEI) new MEICoherence(site(L2DirectoryRepresentation))
|
|
|
|
else new MESICoherence(site(L2DirectoryRepresentation))),
|
2016-11-18 02:26:49 +01:00
|
|
|
nManagers = site(BankedL2Config).nBanks + 1,
|
2016-11-11 22:07:45 +01:00
|
|
|
nCachingClients = 1,
|
2016-11-16 03:27:52 +01:00
|
|
|
nCachelessClients = 1,
|
2016-09-15 22:04:01 +02:00
|
|
|
maxClientXacts = ((site(DCacheKey).nMSHRs + 1) +:
|
|
|
|
site(GroundTestKey).map(_.maxXacts))
|
|
|
|
.reduce(max(_, _)),
|
2016-11-17 20:07:49 +01:00
|
|
|
maxClientsPerPort = site(GroundTestKey).map(_.uncached).sum,
|
2016-09-15 22:04:01 +02:00
|
|
|
maxManagerXacts = site(NAcquireTransactors) + 2,
|
2016-09-28 00:11:31 +02:00
|
|
|
dataBeats = dataBeats,
|
2016-09-15 22:04:01 +02:00
|
|
|
dataBits = site(CacheBlockBytes)*8)
|
|
|
|
}
|
|
|
|
case FPUKey => None
|
2016-11-17 01:16:08 +01:00
|
|
|
case UseAtomics => false
|
2016-09-15 22:04:01 +02:00
|
|
|
case UseCompressed => false
|
|
|
|
case _ => throw new CDEMatchError
|
|
|
|
})
|
2016-08-11 02:20:00 +02:00
|
|
|
|
|
|
|
class WithComparator extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case GroundTestKey => Seq.fill(site(NTiles)) {
|
2016-10-28 07:27:43 +02:00
|
|
|
GroundTestTileSettings(uncached = 2)
|
2016-08-11 02:20:00 +02:00
|
|
|
}
|
|
|
|
case BuildGroundTest =>
|
|
|
|
(p: Parameters) => Module(new ComparatorCore()(p))
|
|
|
|
case ComparatorKey => ComparatorParameters(
|
2016-11-18 00:38:11 +01:00
|
|
|
targets = Seq(site(ExtMem).base, testRamAddr),
|
2016-08-11 02:20:00 +02:00
|
|
|
width = 8,
|
|
|
|
operations = 1000,
|
2016-09-22 08:07:54 +02:00
|
|
|
atomics = site(UseAtomics),
|
2016-11-18 21:02:33 +01:00
|
|
|
prefetches = false)
|
2016-08-17 09:57:35 +02:00
|
|
|
case FPUConfig => None
|
2016-08-11 02:20:00 +02:00
|
|
|
case UseAtomics => false
|
|
|
|
case _ => throw new CDEMatchError
|
|
|
|
})
|
|
|
|
|
|
|
|
class WithAtomics extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case UseAtomics => true
|
|
|
|
case _ => throw new CDEMatchError
|
|
|
|
})
|
|
|
|
|
|
|
|
class WithPrefetches extends Config(
|
2016-11-18 21:52:36 +01:00
|
|
|
(pname, site, here, up) => pname match {
|
|
|
|
case ComparatorKey => up(ComparatorKey).copy(prefetches = true)
|
2016-08-11 02:20:00 +02:00
|
|
|
case _ => throw new CDEMatchError
|
|
|
|
})
|
|
|
|
|
|
|
|
class WithMemtest extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case GroundTestKey => Seq.fill(site(NTiles)) {
|
|
|
|
GroundTestTileSettings(1, 1)
|
|
|
|
}
|
2016-09-22 23:57:18 +02:00
|
|
|
case GeneratorKey => TrafficGeneratorParameters(
|
2016-08-11 02:20:00 +02:00
|
|
|
maxRequests = 128,
|
2016-11-18 00:38:11 +01:00
|
|
|
startAddress = BigInt(site(ExtMem).base))
|
2016-08-11 02:20:00 +02:00
|
|
|
case BuildGroundTest =>
|
|
|
|
(p: Parameters) => Module(new GeneratorTest()(p))
|
|
|
|
case _ => throw new CDEMatchError
|
|
|
|
})
|
|
|
|
|
|
|
|
class WithNGenerators(nUncached: Int, nCached: Int) extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case GroundTestKey => Seq.fill(site(NTiles)) {
|
|
|
|
GroundTestTileSettings(nUncached, nCached)
|
|
|
|
}
|
|
|
|
case _ => throw new CDEMatchError
|
|
|
|
})
|
|
|
|
|
|
|
|
class WithCacheFillTest extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case GroundTestKey => Seq.fill(site(NTiles)) {
|
|
|
|
GroundTestTileSettings(uncached = 1)
|
|
|
|
}
|
|
|
|
case BuildGroundTest =>
|
|
|
|
(p: Parameters) => Module(new CacheFillTest()(p))
|
|
|
|
case _ => throw new CDEMatchError
|
|
|
|
})
|
|
|
|
|
|
|
|
class WithBroadcastRegressionTest extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case GroundTestKey => Seq.fill(site(NTiles)) {
|
|
|
|
GroundTestTileSettings(1, 1, maxXacts = 3)
|
|
|
|
}
|
|
|
|
case BuildGroundTest =>
|
|
|
|
(p: Parameters) => Module(new RegressionTest()(p))
|
|
|
|
case GroundTestRegressions =>
|
|
|
|
(p: Parameters) => RegressionTests.broadcastRegressions(p)
|
|
|
|
case _ => throw new CDEMatchError
|
|
|
|
})
|
|
|
|
|
|
|
|
class WithCacheRegressionTest extends Config(
|
|
|
|
(pname, site, here) => pname match {
|
|
|
|
case GroundTestKey => Seq.fill(site(NTiles)) {
|
|
|
|
GroundTestTileSettings(1, 1, maxXacts = 5)
|
|
|
|
}
|
|
|
|
case BuildGroundTest =>
|
|
|
|
(p: Parameters) => Module(new RegressionTest()(p))
|
|
|
|
case GroundTestRegressions =>
|
|
|
|
(p: Parameters) => RegressionTests.cacheRegressions(p)
|
|
|
|
case _ => throw new CDEMatchError
|
|
|
|
})
|
|
|
|
|
|
|
|
class WithTraceGen extends Config(
|
2016-11-18 21:52:36 +01:00
|
|
|
(pname, site, here, up) => pname match {
|
2016-08-11 02:20:00 +02:00
|
|
|
case GroundTestKey => Seq.fill(site(NTiles)) {
|
|
|
|
GroundTestTileSettings(uncached = 1, cached = 1)
|
|
|
|
}
|
|
|
|
case BuildGroundTest =>
|
|
|
|
(p: Parameters) => Module(new GroundTestTraceGenerator()(p))
|
2016-09-22 23:57:18 +02:00
|
|
|
case GeneratorKey => TrafficGeneratorParameters(
|
2016-08-11 02:20:00 +02:00
|
|
|
maxRequests = 256,
|
|
|
|
startAddress = 0)
|
|
|
|
case AddressBag => {
|
|
|
|
val nSets = 32 // L2 NSets
|
|
|
|
val nWays = 1
|
|
|
|
val blockOffset = site(CacheBlockOffsetBits)
|
2016-09-28 00:11:31 +02:00
|
|
|
val nBeats = site(TLKey("L1toL2")).dataBeats
|
2016-08-11 02:20:00 +02:00
|
|
|
List.tabulate(4 * nWays) { i =>
|
2016-09-23 08:53:07 +02:00
|
|
|
Seq.tabulate(nBeats) { j => BigInt((j * 8) + ((i * nSets) << blockOffset)) }
|
|
|
|
}.flatten
|
2016-08-11 02:20:00 +02:00
|
|
|
}
|
|
|
|
case UseAtomics => true
|
2016-11-18 21:52:36 +01:00
|
|
|
case CacheName("L1D") => up(CacheName("L1D")).copy(nSets = 16, nWays = 1)
|
2016-09-16 04:47:18 +02:00
|
|
|
case _ => throw new CDEMatchError
|
2016-08-11 02:20:00 +02:00
|
|
|
})
|