1
0

refactoring groundtest configuration

This commit is contained in:
Howard Mao 2016-07-08 11:40:16 -07:00
parent eeac405ef8
commit 358668699f
3 changed files with 55 additions and 106 deletions

@ -1 +1 @@
Subproject commit 9eeefb6e859cb8b68a91065b00992949ef677fe6
Subproject commit dadf8beac1204a805f0ef1e27372457c9c5f90ef

View File

@ -191,9 +191,6 @@ class BaseConfig extends Config (
case RoccNMemChannels => site(BuildRoCC).map(_.nMemChannels).foldLeft(0)(_ + _)
case RoccNPTWPorts => site(BuildRoCC).map(_.nPTWPorts).foldLeft(0)(_ + _)
case RoccNCSRs => site(BuildRoCC).map(_.csrs.size).foldLeft(0)(_ + _)
case NDmaTransactors => 3
case NDmaXacts => site(NDmaTransactors) * site(NTiles)
case NDmaClients => site(NTiles)
//Rocket Core Constants
case FetchWidth => 1
case RetireWidth => 1
@ -513,20 +510,6 @@ class MIF128BitConfig extends Config(
class MIF32BitConfig extends Config(
new WithMIFDataBits(32) ++ new BaseConfig)
class WithDmaController extends Config(
(pname, site, here) => pname match {
case BuildRoCC => Seq(
RoccParameters(
opcodes = OpcodeSet.custom2,
generator = (p: Parameters) => Module(new DmaController()(p)),
nPTWPorts = 1,
csrs = Seq.range(
DmaCtrlRegNumbers.CSR_BASE,
DmaCtrlRegNumbers.CSR_END)))
case RoccMaxTaggedMemXacts => 1
case _ => throw new CDEMatchError
})
class WithStreamLoopback extends Config(
(pname, site, here) => pname match {
case UseStreamLoopback => true
@ -535,9 +518,6 @@ class WithStreamLoopback extends Config(
case _ => throw new CDEMatchError
})
class DmaControllerConfig extends Config(new WithDmaController ++ new WithStreamLoopback ++ new DefaultL2Config)
class DmaControllerFPGAConfig extends Config(new WithDmaController ++ new WithStreamLoopback ++ new DefaultFPGAConfig)
class SmallL2Config extends Config(
new WithNMemoryChannels(2) ++ new WithNBanksPerMemChannel(4) ++
new WithL2Capacity(256) ++ new DefaultL2Config)

View File

@ -21,9 +21,9 @@ class WithGroundTest extends Config(
nManagers = site(NBanksPerMemoryChannel)*site(NMemoryChannels) + 1,
nCachingClients = site(NCachedTileLinkPorts),
nCachelessClients = site(NUncachedTileLinkPorts),
maxClientXacts = max(
site(NMSHRs) + 1,
site(GroundTestMaxXacts)),
maxClientXacts = ((site(NMSHRs) + 1) +:
site(GroundTestKey).map(_.maxXacts))
.reduce(max(_, _)),
maxClientsPerPort = 1,
maxManagerXacts = site(NAcquireTransactors) + 2,
dataBeats = 8,
@ -36,22 +36,18 @@ class WithGroundTest extends Config(
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({
val tileSettings = site(GroundTestKey)(i)
(r: Bool, p: Parameters) => {
Module(new GroundTestTile(r)(p.alterPartial({
case TLId => "L1toL2"
case NCachedTileLinkPorts =>
if (p(GroundTestCachedClients) > 0) 1 else 0
case NUncachedTileLinkPorts => p(GroundTestUncachedClients)
case GroundTestId => i
case NCachedTileLinkPorts => if(tileSettings.cached > 0) 1 else 0
case NUncachedTileLinkPorts => tileSettings.uncached
case RoccNCSRs => tileSettings.csrs
})))
}
}
case GroundTestCachedClients => 0
case GroundTestUncachedClients => 0
case GroundTestNPTW => 0
case GroundTestMaxXacts => 1
case GroundTestCSRs => Nil
case TohostAddr => BigInt("80001000", 16)
case RoccNCSRs => site(GroundTestCSRs).size
}
case UseFPU => false
case UseAtomics => false
case _ => throw new CDEMatchError
@ -59,16 +55,17 @@ class WithGroundTest extends Config(
class WithComparator extends Config(
(pname, site, here) => pname match {
case GroundTestUncachedClients => site(ComparatorKey).targets.size
case GroundTestKey => Seq.fill(site(NTiles)) {
GroundTestTileSettings(uncached = site(ComparatorKey).targets.size)
}
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new ComparatorCore()(p))
(p: Parameters) => Module(new ComparatorCore()(p))
case ComparatorKey => ComparatorParameters(
targets = Seq(0L, 0x100L).map(site(GlobalAddrMap)("mem").start.longValue + _),
width = 8,
operations = 1000,
atomics = site(UseAtomics),
prefetches = site("COMPARATOR_PREFETCHES"))
case TohostAddr => BigInt("80001000", 16) // quit test by writing here
case UseFPU => false
case UseAtomics => false
case "COMPARATOR_PREFETCHES" => false
@ -78,42 +75,43 @@ class WithComparator extends Config(
class WithAtomics extends Config(
(pname, site, here) => pname match {
case UseAtomics => true
case _ => throw new CDEMatchError
})
class WithPrefetches extends Config(
(pname, site, here) => pname match {
case "COMPARATOR_PREFETCHES" => true
case _ => throw new CDEMatchError
})
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 GroundTestKey => Seq.fill(site(NTiles)) {
GroundTestTileSettings(1, 1)
}
case GeneratorKey => GeneratorParameters(
maxRequests = 128,
startAddress = site(GlobalAddrMap)("mem").start)
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new GeneratorTest(id)(p))
(p: Parameters) => Module(new GeneratorTest()(p))
case _ => throw new CDEMatchError
})
class WithNCachedGenerators(n: Int) extends Config(
class WithNGenerators(nUncached: Int, nCached: 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 GroundTestKey => Seq.fill(site(NTiles)) {
GroundTestTileSettings(nUncached, nCached)
}
case _ => throw new CDEMatchError
})
class WithCacheFillTest extends Config(
(pname, site, here) => pname match {
case GroundTestUncachedClients => 1
case GroundTestKey => Seq.fill(site(NTiles)) {
GroundTestTileSettings(uncached = 1)
}
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new CacheFillTest()(p))
(p: Parameters) => Module(new CacheFillTest()(p))
case _ => throw new CDEMatchError
},
knobValues = {
@ -124,81 +122,56 @@ class WithCacheFillTest extends Config(
class WithBroadcastRegressionTest extends Config(
(pname, site, here) => pname match {
case GroundTestCachedClients => 1
case GroundTestUncachedClients => 1
case GroundTestKey => Seq.fill(site(NTiles)) {
GroundTestTileSettings(1, 1, maxXacts = 3)
}
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new RegressionTest()(p))
(p: Parameters) => Module(new RegressionTest()(p))
case GroundTestRegressions =>
(p: Parameters) => RegressionTests.broadcastRegressions(p)
case GroundTestMaxXacts => 3
case _ => throw new CDEMatchError
})
class WithCacheRegressionTest extends Config(
(pname, site, here) => pname match {
case GroundTestCachedClients => 1
case GroundTestUncachedClients => 1
case GroundTestKey => Seq.fill(site(NTiles)) {
GroundTestTileSettings(1, 1, maxXacts = 5)
}
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new RegressionTest()(p))
(p: Parameters) => Module(new RegressionTest()(p))
case GroundTestRegressions =>
(p: Parameters) => RegressionTests.cacheRegressions(p)
case GroundTestMaxXacts => 5
case _ => throw new CDEMatchError
})
class WithDmaTest extends Config(
(pname, site, here) => pname match {
case GroundTestNPTW => 1
case GroundTestUncachedClients => 1
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
})
class WithDmaStreamTest extends Config(
(pname, site, here) => pname match {
case GroundTestNPTW => 1
case GroundTestUncachedClients => 1
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new DmaStreamTest()(p))
case DmaStreamTestSettings => DmaStreamTestConfig(
source = 0x10, dest = 0x28, len = 0x18,
size = site(StreamLoopbackWidth) / 8)
case GroundTestCSRs =>
Seq(DmaCtrlRegNumbers.CSR_BASE + DmaCtrlRegNumbers.OUTSTANDING)
case _ => throw new CDEMatchError
})
class WithNastiConverterTest extends Config(
(pname, site, here) => pname match {
case GroundTestUncachedClients => 1
case GroundTestKey => Seq.fill(site(NTiles)) {
GroundTestTileSettings(uncached = 1)
}
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new NastiConverterTest()(p))
(p: Parameters) => Module(new NastiConverterTest()(p))
case _ => throw new CDEMatchError
})
class WithUnitTest extends Config(
(pname, site, here) => pname match {
case GroundTestKey => Seq.fill(site(NTiles)) { GroundTestTileSettings() }
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new UnitTestSuite()(p))
(p: Parameters) => Module(new UnitTestSuite()(p))
case _ => throw new CDEMatchError
})
class WithTraceGen extends Config(
(pname, site, here) => pname match {
case GroundTestCachedClients => 1
case GroundTestKey => Seq.fill(site(NTiles)) {
GroundTestTileSettings(cached = 1)
}
case BuildGroundTest =>
(id: Int, p: Parameters) => Module(new GroundTestTraceGenerator(id)(p))
case MaxGenerateRequests => 128
(p: Parameters) => Module(new GroundTestTraceGenerator()(p))
case GeneratorKey => GeneratorParameters(
maxRequests = 128,
startAddress = 0)
case AddressBag => List(0x8, 0x10, 0x108, 0x100008)
case _ => throw new CDEMatchError
})
@ -219,8 +192,7 @@ class MemtestBufferlessConfig extends Config(
new WithMemtest ++ new WithBufferlessBroadcastHub ++ new GroundTestConfig)
// Test ALL the things
class FancyMemtestConfig extends Config(
new WithNCachedGenerators(1) ++ new WithNUncachedGenerators(2) ++
new WithNCores(2) ++ new WithMemtest ++
new WithNGenerators(1, 2) ++ new WithNCores(2) ++ new WithMemtest ++
new WithNMemoryChannels(2) ++ new WithNBanksPerMemChannel(4) ++
new WithSplitL2Metadata ++ new WithL2Cache ++ new GroundTestConfig)
@ -234,10 +206,7 @@ class BufferlessRegressionTestConfig extends Config(
class CacheRegressionTestConfig extends Config(
new WithCacheRegressionTest ++ new WithL2Cache ++ new GroundTestConfig)
class DmaTestConfig extends Config(new WithDmaTest ++ new WithL2Cache ++ new GroundTestConfig)
class DmaStreamTestConfig extends Config(new WithDmaStreamTest ++ new WithStreamLoopback ++ new WithL2Cache ++ new GroundTestConfig)
class NastiConverterTestConfig extends Config(new WithNastiConverterTest ++ new GroundTestConfig)
class UnitTestConfig extends Config(new WithUnitTest ++ new GroundTestConfig)
class TraceGenConfig extends Config(