Add TL client node to MemTraceDriver
This commit is contained in:
@@ -8,7 +8,8 @@ import freechips.rocketchip.config.Parameters
|
|||||||
import freechips.rocketchip.diplomacy._
|
import freechips.rocketchip.diplomacy._
|
||||||
import freechips.rocketchip.unittest._
|
import freechips.rocketchip.unittest._
|
||||||
|
|
||||||
class CoalescingUnit(txns: Int = 5000)(implicit p: Parameters) extends LazyModule {
|
class CoalescingUnit(txns: Int = 5000)(implicit p: Parameters)
|
||||||
|
extends LazyModule {
|
||||||
val fuzz = LazyModule(new TLFuzzer(txns))
|
val fuzz = LazyModule(new TLFuzzer(txns))
|
||||||
val model = LazyModule(new TLRAMModel("Xbar"))
|
val model = LazyModule(new TLRAMModel("Xbar"))
|
||||||
val xbar = LazyModule(new TLXbar)
|
val xbar = LazyModule(new TLXbar)
|
||||||
@@ -25,7 +26,19 @@ class CoalescingUnit(txns: Int = 5000)(implicit p: Parameters) extends LazyModul
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MemTraceDriver(implicit p: Parameters) extends Module with UnitTestModule {
|
class MemTraceDriver(implicit p: Parameters) extends LazyModule {
|
||||||
|
// TODO: generate TL request here
|
||||||
|
// testchipip provides TLHelper.makeClientNode convenience wrapper for this.
|
||||||
|
val clients = Seq(
|
||||||
|
TLMasterParameters.v1(
|
||||||
|
name = "MemTraceDriver",
|
||||||
|
sourceId = IdRange(0, 1 /*FIXME*/ )
|
||||||
|
)
|
||||||
|
)
|
||||||
|
val node = TLClientNode(Seq(TLMasterPortParameters.v1(clients)))
|
||||||
|
|
||||||
|
lazy val module = new Impl
|
||||||
|
class Impl extends LazyModuleImp(this) with UnitTestModule {
|
||||||
val sim = Module(new SimMemTrace)
|
val sim = Module(new SimMemTrace)
|
||||||
sim.io.clock := clock
|
sim.io.clock := clock
|
||||||
sim.io.reset := reset.asBool
|
sim.io.reset := reset.asBool
|
||||||
@@ -35,11 +48,10 @@ class MemTraceDriver(implicit p: Parameters) extends Module with UnitTestModule
|
|||||||
println("sim.io.valid!")
|
println("sim.io.valid!")
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: generate TL request here
|
|
||||||
|
|
||||||
// we're finished when there is no more memtrace to read
|
// we're finished when there is no more memtrace to read
|
||||||
io.finished := !sim.io.trace_read.valid
|
io.finished := !sim.io.trace_read.valid
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class SimMemTrace extends BlackBox with HasBlackBoxResource {
|
class SimMemTrace extends BlackBox with HasBlackBoxResource {
|
||||||
val io = IO(new Bundle {
|
val io = IO(new Bundle {
|
||||||
@@ -58,12 +70,11 @@ class SimMemTrace extends BlackBox with HasBlackBoxResource {
|
|||||||
addResource("/csrc/SimMemTrace.cc")
|
addResource("/csrc/SimMemTrace.cc")
|
||||||
}
|
}
|
||||||
|
|
||||||
class CoalescingUnitTest(txns: Int = 5000, timeout: Int = 500000)(implicit p: Parameters)
|
class CoalescingUnitTest(txns: Int = 5000, timeout: Int = 500000)(implicit
|
||||||
extends UnitTest(timeout) {
|
p: Parameters
|
||||||
// val dut = Module(LazyModule(new CoalescingUnit(txns)).module)
|
) extends UnitTest(timeout) {
|
||||||
// dut.io.start := io.start
|
val coal = Module(LazyModule(new CoalescingUnit(txns)).module)
|
||||||
|
val driver = Module(LazyModule(new MemTraceDriver).module)
|
||||||
val driver = Module(new MemTraceDriver)
|
|
||||||
driver.io.start := io.start
|
driver.io.start := io.start
|
||||||
|
|
||||||
io.finished := driver.io.finished
|
io.finished := driver.io.finished
|
||||||
|
|||||||
Reference in New Issue
Block a user