1
0

Merge pull request #6 from ucb-bar/chisel3

Chisel 3 Support
This commit is contained in:
Andrew Waterman 2016-02-05 17:15:49 -08:00
commit b4856da819
2 changed files with 12 additions and 2 deletions

View File

@ -57,7 +57,7 @@ class MemPipeIO(implicit p: Parameters) extends ParameterizedBundle()(p) {
class MemSerializedIO(w: Int)(implicit p: Parameters) extends ParameterizedBundle()(p) {
val req = Decoupled(Bits(width = w))
val resp = Valid(Bits(width = w)).flip
//override def cloneType = new MemSerializedIO(w)(p).asInstanceOf[this.type]
override def cloneType = new MemSerializedIO(w)(p).asInstanceOf[this.type]
}
class MemSerdes(w: Int)(implicit p: Parameters) extends MIFModule

View File

@ -8,7 +8,17 @@ object bigIntPow2 {
}
class ParameterizedBundle(implicit p: Parameters) extends Bundle {
override def cloneType = this.getClass.getConstructors.head.newInstance(p).asInstanceOf[this.type]
override def cloneType = {
try {
this.getClass.getConstructors.head.newInstance(p).asInstanceOf[this.type]
} catch {
case e: java.lang.IllegalArgumentException =>
throwException("Unable to use ParamaterizedBundle.cloneType on " +
this.getClass + ", probably because " + this.getClass +
"() takes more than one argument. Consider overriding " +
"cloneType() on " + this.getClass, e)
}
}
}
class HellaFlowQueue[T <: Data](val entries: Int)(data: => T) extends Module {