diff --git a/src/main/scala/util/Misc.scala b/src/main/scala/util/Misc.scala index 8ff24fb9..14a2510d 100644 --- a/src/main/scala/util/Misc.scala +++ b/src/main/scala/util/Misc.scala @@ -35,6 +35,11 @@ trait DontTouch { self.getModulePorts.foreach(dontTouch(_)) self } + + def dontTouchPortsExcept(f: Data => Boolean): this.type = { + self.getModulePorts.filterNot(f).foreach(dontTouch(_)) + self + } } trait Clocked extends Bundle {