1
0

[tilelink2] allow TL monitors to be globally enabled or disabled (#392)

This commit is contained in:
Henry Cook
2016-10-09 12:34:10 -07:00
committed by GitHub
parent 53360f4c2c
commit 1e69a2dc1c
3 changed files with 27 additions and 3 deletions

View File

@ -20,12 +20,17 @@ object TLImp extends NodeImp[TLClientPortParameters, TLManagerPortParameters, TL
Vec(ei.size, TLBundle(ei.map(_.bundle).reduce(_.union(_)))).flip
}
var emitMonitors = true
def colour = "#000000" // black
def connect(bo: => TLBundle, bi: => TLBundle, ei: => TLEdgeIn)(implicit sourceInfo: SourceInfo): (Option[LazyModule], () => Unit) = {
val monitor = LazyModule(new TLMonitor(() => new TLBundleSnoop(bo.params), () => ei, sourceInfo))
(Some(monitor), () => {
val monitor = if (emitMonitors) {
Some(LazyModule(new TLMonitor(() => new TLBundleSnoop(bo.params), () => ei, sourceInfo)))
} else {
None
}
(monitor, () => {
bi <> bo
monitor.module.io.in := TLBundleSnoop(bo)
monitor.foreach { _.module.io.in := TLBundleSnoop(bo) }
})
}