diff options
| author | Andrew Waterman | 2015-07-16 17:02:56 -0700 |
|---|---|---|
| committer | Andrew Waterman | 2015-07-16 17:02:56 -0700 |
| commit | 9477032c1c2fcd432aca0c423dbe5330cd95a221 (patch) | |
| tree | f31ddd7b15ea5bbbf590bf97b8b9b7d36f7a8a0a | |
| parent | 3452a7a335b271c34247f099fc714c02a66ac887 (diff) | |
toBits should return UInt
| -rw-r--r-- | src/main/scala/Core.scala | 4 | ||||
| -rw-r--r-- | src/main/scala/FP.scala | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main/scala/Core.scala b/src/main/scala/Core.scala index 119af0b6..f2f62243 100644 --- a/src/main/scala/Core.scala +++ b/src/main/scala/Core.scala @@ -345,9 +345,9 @@ abstract class Data(dirArg: Direction) extends Id { } wire.asInstanceOf[this.type] } - def toBits(): Bits = { + def toBits: UInt = { val elts = this.flatten - Cat(elts.head, elts.tail:_*) + Cat(elts.head, elts.tail:_*).asUInt } def makeLit(value: BigInt, width: Int): this.type = { val x = cloneType diff --git a/src/main/scala/FP.scala b/src/main/scala/FP.scala index 3c16ce4c..7f2615f3 100644 --- a/src/main/scala/FP.scala +++ b/src/main/scala/FP.scala @@ -87,7 +87,7 @@ class Flo(dir: Direction = NO_DIR, val value:Option[Float] = None) extends Eleme pushCommand(DefPrim(d.defd.cid, d.toType, BitsToFlo, Array(this.ref), NoLits)) d } - override def toBits: Bits = { + override def toBits: UInt = { val d = new UInt(dir, 32) pushCommand(DefPrim(d.defd.cid, d.toType, FloToBits, Array(this.ref), NoLits)) d @@ -202,7 +202,7 @@ class Dbl(dir: Direction, val value: Option[Double] = None) extends Element(dir, pushCommand(DefPrim(d.defd.cid, d.toType, BitsToDbl, Array(this.ref), NoLits)) d } - override def toBits: Bits = { + override def toBits: UInt = { val d = new UInt(dir, 64) pushCommand(DefPrim(d.defd.cid, d.toType, DblToBits, Array(this.ref), NoLits)) d |
