Fix issues after chisel update for august 2019
This commit is contained in:
@@ -58,7 +58,9 @@ class ResetInverterTransform extends Transform {
|
|||||||
|
|
||||||
trait ResetInverter {
|
trait ResetInverter {
|
||||||
self: chisel3.Module =>
|
self: chisel3.Module =>
|
||||||
def invert(component: InstanceId): Unit = {
|
def invert[T <: chisel3.experimental.LegacyModule](module: T): Unit = {
|
||||||
annotate(chisel3.experimental.ChiselAnnotation(component, classOf[ResetInverterTransform], "invert"))
|
chisel3.experimental.annotate(new chisel3.experimental.ChiselAnnotation{
|
||||||
|
def toFirrtl: Annotation = ResetInverterAnnotation(module.toNamed)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ class RetimeTransform extends Transform {
|
|||||||
|
|
||||||
trait RetimeLib {
|
trait RetimeLib {
|
||||||
self: chisel3.Module =>
|
self: chisel3.Module =>
|
||||||
def retime(component: InstanceId): Unit = {
|
def retime[T <: chisel3.experimental.LegacyModule](module: T): Unit = {
|
||||||
annotate(chisel3.experimental.ChiselAnnotation(component, classOf[RetimeTransform], "retime"))
|
chisel3.experimental.annotate(new chisel3.experimental.ChiselAnnotation{
|
||||||
|
def toFirrtl: Annotation = RetimeAnnotation(module.toNamed)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import chisel3._
|
|||||||
import scala.collection.immutable.ListMap
|
import scala.collection.immutable.ListMap
|
||||||
|
|
||||||
class CustomBundle[T <: Data](elts: (String, T)*) extends Record {
|
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: String): T = elements(elt)
|
||||||
def apply(elt: Int): T = elements(elt.toString)
|
def apply(elt: Int): T = elements(elt.toString)
|
||||||
override def cloneType = (new CustomBundle(elements.toList: _*)).asInstanceOf[this.type]
|
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 {
|
class CustomIndexedBundle[T <: Data](elts: (Int, T)*) extends Record {
|
||||||
// Must be String, Data
|
// 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?)
|
// 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)
|
def apply(elt: Int): T = elements(elt.toString)
|
||||||
override def cloneType = (new CustomIndexedBundle(indexedElements.toList: _*)).asInstanceOf[this.type]
|
override def cloneType = (new CustomIndexedBundle(indexedElements.toList: _*)).asInstanceOf[this.type]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user