diff --git a/src/main/scala/diplomacy/BundleBridge.scala b/src/main/scala/diplomacy/BundleBridge.scala index 18af5d5068e..96626f1b8c6 100644 --- a/src/main/scala/diplomacy/BundleBridge.scala +++ b/src/main/scala/diplomacy/BundleBridge.scala @@ -49,7 +49,7 @@ case class BundleBridgeSink[T <: Data](genOpt: Option[() => T] = None) } def makeIO()(implicit valName: ValName): T = { - val io: T = IO(if (inferOutput) Output(chiselTypeOf(bundle)) else chiselTypeClone(bundle)) + val io: T = IO(if (inferOutput) Output(chiselTypeOf(bundle)) else chiselTypeClone[T](bundle)) io.suggestName(valName.name) io <> bundle io @@ -72,7 +72,7 @@ case class BundleBridgeSource[T <: Data](genOpt: Option[() => T] = None)(implici } def makeIO()(implicit valName: ValName): T = { - val io: T = IO(if (inferInput) Input(chiselTypeOf(bundle)) else Flipped(chiselTypeClone(bundle))) + val io: T = IO(if (inferInput) Input(chiselTypeOf(bundle)) else Flipped(chiselTypeClone[T](bundle))) io.suggestName(valName.name) bundle <> io io diff --git a/src/main/scala/util/BundleMap.scala b/src/main/scala/util/BundleMap.scala index 5cae5fbf027..c734f1700ea 100644 --- a/src/main/scala/util/BundleMap.scala +++ b/src/main/scala/util/BundleMap.scala @@ -104,7 +104,7 @@ class BundleMap(val fields: Seq[BundleFieldBase]) extends Record with CustomBulk // All fields must have distinct key.names require(fields.map(_.key.name).distinct.size == fields.size) - val elements: ListMap[String, Data] = ListMap(fields.map { bf => bf.key.name -> chisel3.experimental.DataMirror.internal.chiselTypeClone(bf.data) } :_*) + val elements: ListMap[String, Data] = ListMap(fields.map { bf => bf.key.name -> chisel3.experimental.DataMirror.internal.chiselTypeClone[Data](bf.data) } :_*) // A BundleMap is best viewed as a map from BundleKey to Data def keydata: Seq[(BundleKeyBase, Data)] = (fields zip elements) map { case (field, (_, data)) => (field.key, data) } diff --git a/src/main/scala/util/HeterogeneousBag.scala b/src/main/scala/util/HeterogeneousBag.scala index d56b644f99f..01ed433133b 100644 --- a/src/main/scala/util/HeterogeneousBag.scala +++ b/src/main/scala/util/HeterogeneousBag.scala @@ -7,7 +7,7 @@ import chisel3.experimental.DataMirror import scala.collection.immutable.VectorMap final case class HeterogeneousBag[T <: Data](elts: Seq[T]) extends Record with collection.IndexedSeq[T] { - val elements = VectorMap(elts.zipWithIndex.map { case (n,i) => (i.toString, DataMirror.internal.chiselTypeClone(n)) }:_*) + val elements = VectorMap(elts.zipWithIndex.map { case (n,i) => (i.toString, DataMirror.internal.chiselTypeClone[T](n)) }:_*) def apply(x: Int): T = { val key = elements.keys(x) // VectorMap.keys returns a Vector diff --git a/src/main/scala/util/RecordMap.scala b/src/main/scala/util/RecordMap.scala index 4dd6bc11ae9..cd47938521b 100644 --- a/src/main/scala/util/RecordMap.scala +++ b/src/main/scala/util/RecordMap.scala @@ -13,7 +13,7 @@ final class RecordMap[T <: Data] (eltMap: ListMap[String, T]) eltMap.foreach { case (name, elt) => requireIsChiselType(elt, name) } // This is needed for Record - val elements = ListMap[String, T]() ++ eltMap.mapValues(chiselTypeClone(_).asInstanceOf[T]) // mapValues return value is lazy + val elements = ListMap[String, T]() ++ eltMap.mapValues(chiselTypeClone[T](_)) // mapValues return value is lazy def apply(x: Int) = elements.values.toSeq(x) def apply(x: String) = elements.get(x)