summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman2015-07-16 17:02:56 -0700
committerAndrew Waterman2015-07-16 17:02:56 -0700
commit9477032c1c2fcd432aca0c423dbe5330cd95a221 (patch)
treef31ddd7b15ea5bbbf590bf97b8b9b7d36f7a8a0a
parent3452a7a335b271c34247f099fc714c02a66ac887 (diff)
toBits should return UInt
-rw-r--r--src/main/scala/Core.scala4
-rw-r--r--src/main/scala/FP.scala4
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