1
0

util: restore dontTouch annotation; Chisel's is broken on 0 element Aggregates

This commit is contained in:
Henry Cook 2018-03-08 16:12:15 -08:00
parent d6e2c1a73f
commit 1b93b27da4

View File

@ -4,7 +4,7 @@
package freechips.rocketchip.util
import Chisel._
import chisel3.experimental.{dontTouch, RawModule}
import chisel3.experimental.{ChiselAnnotation, RawModule}
import freechips.rocketchip.config.Parameters
import scala.math._
@ -14,6 +14,13 @@ class ParameterizedBundle(implicit p: Parameters) extends Bundle
trait DontTouch {
self: RawModule =>
def dontTouch(data: Data): Unit = data match {
case agg: Aggregate =>
agg.getElements.foreach(dontTouch)
case elt: Element =>
annotate(ChiselAnnotation(elt, classOf[firrtl.Transform], "DONTtouch!"))
}
/** Marks every port as don't touch
*
* @note This method can only be called after the Module has been fully constructed