diff --git a/tapeout/src/main/scala/transforms/ResetInverter.scala b/tapeout/src/main/scala/transforms/ResetInverter.scala index d2f756f0..cbdb0907 100644 --- a/tapeout/src/main/scala/transforms/ResetInverter.scala +++ b/tapeout/src/main/scala/transforms/ResetInverter.scala @@ -58,7 +58,9 @@ class ResetInverterTransform extends Transform { trait ResetInverter { self: chisel3.Module => - def invert(component: InstanceId): Unit = { - annotate(chisel3.experimental.ChiselAnnotation(component, classOf[ResetInverterTransform], "invert")) + def invert[T <: chisel3.experimental.LegacyModule](module: T): Unit = { + chisel3.experimental.annotate(new chisel3.experimental.ChiselAnnotation{ + def toFirrtl: Annotation = ResetInverterAnnotation(module.toNamed) + }) } } diff --git a/tapeout/src/main/scala/transforms/retime/Retime.scala b/tapeout/src/main/scala/transforms/retime/Retime.scala index 0f67adea..a2a39b04 100644 --- a/tapeout/src/main/scala/transforms/retime/Retime.scala +++ b/tapeout/src/main/scala/transforms/retime/Retime.scala @@ -39,7 +39,9 @@ class RetimeTransform extends Transform { trait RetimeLib { self: chisel3.Module => - def retime(component: InstanceId): Unit = { - annotate(chisel3.experimental.ChiselAnnotation(component, classOf[RetimeTransform], "retime")) + def retime[T <: chisel3.experimental.LegacyModule](module: T): Unit = { + chisel3.experimental.annotate(new chisel3.experimental.ChiselAnnotation{ + def toFirrtl: Annotation = RetimeAnnotation(module.toNamed) + }) } } diff --git a/tapeout/src/main/scala/transforms/utils/ProgrammaticBundle.scala b/tapeout/src/main/scala/transforms/utils/ProgrammaticBundle.scala index c3eec670..d73d05db 100644 --- a/tapeout/src/main/scala/transforms/utils/ProgrammaticBundle.scala +++ b/tapeout/src/main/scala/transforms/utils/ProgrammaticBundle.scala @@ -4,7 +4,7 @@ import chisel3._ import scala.collection.immutable.ListMap class CustomBundle[T <: Data](elts: (String, T)*) extends Record { - val elements = ListMap(elts map { case (field, elt) => field -> elt.chiselCloneType }: _*) + val elements = ListMap(elts map { case (field, elt) => field -> chiselTypeOf(elt) }: _*) def apply(elt: String): T = elements(elt) def apply(elt: Int): T = elements(elt.toString) override def cloneType = (new CustomBundle(elements.toList: _*)).asInstanceOf[this.type] @@ -12,9 +12,9 @@ class CustomBundle[T <: Data](elts: (String, T)*) extends Record { class CustomIndexedBundle[T <: Data](elts: (Int, T)*) extends Record { // Must be String, Data - val elements = ListMap(elts map { case (field, elt) => field.toString -> elt.chiselCloneType }: _*) + val elements = ListMap(elts map { case (field, elt) => field.toString -> chiselTypeOf(elt) }: _*) // TODO: Make an equivalent to the below work publicly (or only on subclasses?) - def indexedElements = ListMap(elts map { case (field, elt) => field -> elt.chiselCloneType }: _*) + def indexedElements = ListMap(elts map { case (field, elt) => field -> chiselTypeOf(elt) }: _*) def apply(elt: Int): T = elements(elt.toString) override def cloneType = (new CustomIndexedBundle(indexedElements.toList: _*)).asInstanceOf[this.type] } @@ -23,4 +23,4 @@ object CustomIndexedBundle { def apply[T <: Data](gen: T, idxs: Seq[Int]) = new CustomIndexedBundle(idxs.map(_ -> gen): _*) // Allows Vecs of elements of different types/widths def apply[T <: Data](gen: Seq[T]) = new CustomIndexedBundle(gen.zipWithIndex.map{ case (elt, field) => field -> elt }: _*) -} \ No newline at end of file +}