Fix issues after chisel update for august 2019
This commit is contained in:
@@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 }: _*)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user