1
0

AHB: include bridge unit tests

This commit is contained in:
Wesley W. Terpstra 2017-03-13 16:24:57 -07:00
parent 0c5fd76089
commit c95c2ca9c8
2 changed files with 64 additions and 2 deletions

View File

@ -16,10 +16,10 @@ class RRTest1(address: BigInt)(implicit p: Parameters) extends AHBRegisterRouter
new AHBRegBundle((), _) with RRTest1Bundle)(
new AHBRegModule((), _, _) with RRTest1Module)
class AHBFuzzBridge()(implicit p: Parameters) extends LazyModule
class AHBFuzzNative()(implicit p: Parameters) extends LazyModule
{
val fuzz = LazyModule(new TLFuzzer(5000))
val model = LazyModule(new TLRAMModel("AHBFuzzMaster"))
val model = LazyModule(new TLRAMModel("AHBFuzzNative"))
var xbar = LazyModule(new AHBFanout)
val ram = LazyModule(new AHBRAM(AddressSet(0x0, 0xff)))
val gpio = LazyModule(new RRTest0(0x100))
@ -34,6 +34,67 @@ class AHBFuzzBridge()(implicit p: Parameters) extends LazyModule
}
}
class AHBNativeTest()(implicit p: Parameters) extends UnitTest(500000) {
val dut = Module(LazyModule(new AHBFuzzNative).module)
io.finished := dut.io.finished
}
class AHBFuzzMaster()(implicit p: Parameters) extends LazyModule
{
val node = AHBOutputNode()
val fuzz = LazyModule(new TLFuzzer(5000))
val model = LazyModule(new TLRAMModel("AHBFuzzMaster"))
model.node := fuzz.node
node :=
TLToAHB()(
TLDelayer(0.2)(
TLBuffer(TLBufferParams.flow)(
TLDelayer(0.2)(
model.node))))
lazy val module = new LazyModuleImp(this) {
val io = new Bundle {
val out = node.bundleOut
val finished = Bool(OUTPUT)
}
io.finished := fuzz.module.io.finished
}
}
class AHBFuzzSlave()(implicit p: Parameters) extends LazyModule
{
val node = AHBInputNode()
val ram = LazyModule(new TLTestRAM(AddressSet(0x0, 0xfff)))
ram.node :=
TLFragmenter(4, 16)(
TLDelayer(0.2)(
TLBuffer(TLBufferParams.flow)(
TLDelayer(0.2)(
AHBToTL()(
node)))))
lazy val module = new LazyModuleImp(this) {
val io = new Bundle {
val in = node.bundleIn
}
}
}
class AHBFuzzBridge()(implicit p: Parameters) extends LazyModule
{
val master = LazyModule(new AHBFuzzMaster)
val slave = LazyModule(new AHBFuzzSlave)
slave.node := master.node
lazy val module = new LazyModuleImp(this) with HasUnitTestIO {
io.finished := master.module.io.finished
}
}
class AHBBridgeTest()(implicit p: Parameters) extends UnitTest(500000) {
val dut = Module(LazyModule(new AHBFuzzBridge).module)
io.finished := dut.io.finished

View File

@ -13,6 +13,7 @@ class WithUncoreUnitTests extends Config((site, here, up) => {
Seq(
Module(new uncore.tilelink2.TLFuzzRAMTest),
Module(new uncore.ahb.AHBBridgeTest),
Module(new uncore.ahb.AHBNativeTest),
Module(new uncore.apb.APBBridgeTest),
Module(new uncore.axi4.AXI4LiteFuzzRAMTest),
Module(new uncore.axi4.AXI4FullFuzzRAMTest),