2016-11-28 01:16:37 +01:00
|
|
|
// See LICENSE.SiFive for license details.
|
2016-09-15 03:10:21 +02:00
|
|
|
|
2016-09-15 22:04:01 +02:00
|
|
|
package unittest
|
2016-09-15 03:10:21 +02:00
|
|
|
|
|
|
|
import Chisel._
|
2016-11-18 23:05:14 +01:00
|
|
|
import config._
|
2016-09-22 23:31:45 +02:00
|
|
|
import rocketchip.{BaseConfig, BasePlatformConfig}
|
2016-09-15 03:10:21 +02:00
|
|
|
|
2017-05-17 21:17:08 +02:00
|
|
|
case object TestDurationMultiplier extends Field[Int]
|
|
|
|
|
|
|
|
class WithTestDuration(x: Int) extends Config((site, here, up) => {
|
|
|
|
case TestDurationMultiplier => x
|
|
|
|
})
|
|
|
|
|
2017-01-13 23:41:19 +01:00
|
|
|
class WithUncoreUnitTests extends Config((site, here, up) => {
|
|
|
|
case uncore.tilelink.TLId => "L1toL2"
|
|
|
|
case UnitTests => (q: Parameters) => {
|
|
|
|
implicit val p = q
|
2017-05-17 21:17:08 +02:00
|
|
|
val txns = 100 * site(TestDurationMultiplier)
|
|
|
|
val timeout = 50000 * site(TestDurationMultiplier)
|
2017-01-13 23:41:19 +01:00
|
|
|
Seq(
|
2017-05-17 23:02:14 +02:00
|
|
|
Module(new uncore.tilelink2.TLFuzzRAMTest( txns=3*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.ahb.AHBBridgeTest(true, txns=8*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.ahb.AHBNativeTest(true, txns=6*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.ahb.AHBNativeTest(false, txns=6*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.apb.APBBridgeTest(true, txns=6*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.apb.APBBridgeTest(false, txns=6*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.axi4.AXI4LiteFuzzRAMTest( txns=6*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.axi4.AXI4FullFuzzRAMTest( txns=3*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.axi4.AXI4BridgeTest( txns=3*txns, timeout=timeout))) }
|
2017-01-13 23:41:19 +01:00
|
|
|
})
|
2016-09-15 03:10:21 +02:00
|
|
|
|
2017-01-13 23:41:19 +01:00
|
|
|
class WithTLSimpleUnitTests extends Config((site, here, up) => {
|
|
|
|
case UnitTests => (q: Parameters) => {
|
|
|
|
implicit val p = q
|
2017-05-17 21:17:08 +02:00
|
|
|
val txns = 100 * site(TestDurationMultiplier)
|
|
|
|
val timeout = 50000 * site(TestDurationMultiplier)
|
2017-01-13 23:41:19 +01:00
|
|
|
Seq(
|
2017-05-17 23:02:14 +02:00
|
|
|
Module(new uncore.tilelink2.TLRAMSimpleTest(1, txns=15*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRAMSimpleTest(4, txns=15*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRAMSimpleTest(16, txns=15*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRAMZeroDelayTest(4, txns=15*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRR0Test( txns= 3*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRR1Test( txns= 3*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRAMRationalCrossingTest(txns= 3*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRAMAsyncCrossingTest( txns= 5*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRAMAtomicAutomataTest( txns=10*txns, timeout=timeout)) ) }
|
2017-01-13 23:41:19 +01:00
|
|
|
})
|
2016-09-29 02:15:12 +02:00
|
|
|
|
2017-01-13 23:41:19 +01:00
|
|
|
class WithTLWidthUnitTests extends Config((site, here, up) => {
|
|
|
|
case UnitTests => (q: Parameters) => {
|
|
|
|
implicit val p = q
|
2017-05-17 21:17:08 +02:00
|
|
|
val txns = 100 * site(TestDurationMultiplier)
|
|
|
|
val timeout = 50000 * site(TestDurationMultiplier)
|
2017-01-13 23:41:19 +01:00
|
|
|
Seq(
|
2017-05-17 23:02:14 +02:00
|
|
|
Module(new uncore.tilelink2.TLRAMFragmenterTest( 4, 256, txns= 5*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRAMFragmenterTest(16, 64, txns=15*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRAMFragmenterTest( 4, 16, txns=15*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRAMWidthWidgetTest( 1, 1, txns= 1*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRAMWidthWidgetTest( 4, 64, txns= 4*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRAMWidthWidgetTest(64, 4, txns= 5*txns, timeout=timeout)) ) }
|
2017-01-13 23:41:19 +01:00
|
|
|
})
|
2016-09-29 02:15:12 +02:00
|
|
|
|
2017-01-13 23:41:19 +01:00
|
|
|
class WithTLXbarUnitTests extends Config((site, here, up) => {
|
|
|
|
case UnitTests => (q: Parameters) => {
|
|
|
|
implicit val p = q
|
2017-05-17 21:17:08 +02:00
|
|
|
val txns = 100 * site(TestDurationMultiplier)
|
|
|
|
val timeout = 50000 * site(TestDurationMultiplier)
|
2017-01-13 23:41:19 +01:00
|
|
|
Seq(
|
2017-05-17 21:17:08 +02:00
|
|
|
Module(new uncore.tilelink2.TLRAMXbarTest(1, txns=5*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRAMXbarTest(2, txns=5*txns, timeout=timeout)),
|
|
|
|
Module(new uncore.tilelink2.TLRAMXbarTest(8, txns=5*txns, timeout=timeout)),
|
2017-05-17 23:02:14 +02:00
|
|
|
Module(new uncore.tilelink2.TLMulticlientXbarTest(4,4, txns=2*txns, timeout=timeout)) ) }
|
2017-01-13 23:41:19 +01:00
|
|
|
})
|
2016-09-29 00:11:05 +02:00
|
|
|
|
2017-05-17 21:17:08 +02:00
|
|
|
class UncoreUnitTestConfig extends Config(new WithUncoreUnitTests ++ new WithTestDuration(10) ++ new BasePlatformConfig)
|
|
|
|
class TLSimpleUnitTestConfig extends Config(new WithTLSimpleUnitTests ++ new WithTestDuration(10) ++ new BasePlatformConfig)
|
|
|
|
class TLWidthUnitTestConfig extends Config(new WithTLWidthUnitTests ++ new WithTestDuration(10) ++ new BasePlatformConfig)
|
|
|
|
class TLXbarUnitTestConfig extends Config(new WithTLXbarUnitTests ++ new WithTestDuration(10) ++ new BasePlatformConfig)
|