[firechip] Label FASED instances with an associated memory region name

This commit is contained in:
David Biancolin
2019-12-01 22:27:12 -08:00
parent fbc47af67c
commit ba19987984
2 changed files with 33 additions and 4 deletions

View File

@@ -20,6 +20,14 @@ class WithNumNodes(n: Int) extends Config((pname, site, here) => {
case NumNodes => n
})
// Hacky: Set before each node is generated. Ideally we'd give IO binders
// accesses to the the Harness's parameters instance. We could then alter that.
object NodeIdx {
private var idx = 0
def increment(): Unit = {idx = idx + 1 }
def apply(): Int = idx
}
class FireSim(implicit val p: Parameters) extends RawModule {
val clockBridge = Module(new RationalClockBridge)
val clock = clockBridge.io.clocks.head
@@ -32,8 +40,9 @@ class FireSim(implicit val p: Parameters) extends RawModule {
// if that Mixin trait is present in the target's class instance
//
// Apply each partial function to each DUT instance
for ((target) <- targets) {
for (target <- targets) {
p(IOBinders).values.map(fn => fn(clock, reset.asBool, false.B, target))
NodeIdx.increment()
}
}
}