summaryrefslogtreecommitdiff
path: root/src/main/scala/FP.scala
diff options
context:
space:
mode:
authorjackbackrack2015-07-02 14:29:42 -0700
committerjackbackrack2015-07-02 14:29:42 -0700
commit13d92d7f523bd42ad94170ce41a8be794bdb171d (patch)
treef05a68a44f3fa318eb5fa7f7a7f5bf7262db763f /src/main/scala/FP.scala
parent3c2779ca34d72f4c0f15a1266e085c85a048a080 (diff)
rename id to cid, legalizeNames, better flo/dbl support in tester, better mux handling and check for uint/sint, support for bulk connect, filter ? as well
Diffstat (limited to 'src/main/scala/FP.scala')
-rw-r--r--src/main/scala/FP.scala24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/main/scala/FP.scala b/src/main/scala/FP.scala
index 8b1c2b0a..5ad50a92 100644
--- a/src/main/scala/FP.scala
+++ b/src/main/scala/FP.scala
@@ -41,7 +41,7 @@ object Flo {
def apply(x: Double): Flo = Flo(x.toFloat)
def floLit(value: Float): Flo = {
val b = new Flo(NO_DIR)
- pushCommand(DefFlo(b.defd.id, value))
+ pushCommand(DefFlo(b.defd.cid, value))
b
}
def apply(dir: Direction = null): Flo =
@@ -83,12 +83,12 @@ class Flo(dir: Direction = NO_DIR) extends Element(dir, 32) with Num[Flo] {
def cloneTypeWidth(width: Int): this.type = cloneType
override def fromBits(n: Bits): this.type = {
val d = cloneType
- pushCommand(DefPrim(d.defd.id, d.toType, BitsToFlo, Array(this.ref), NoLits))
+ pushCommand(DefPrim(d.defd.cid, d.toType, BitsToFlo, Array(this.ref), NoLits))
d
}
override def toBits: Bits = {
val d = new UInt(dir, 32)
- pushCommand(DefPrim(d.defd.id, d.toType, FloToBits, Array(this.ref), NoLits))
+ pushCommand(DefPrim(d.defd.cid, d.toType, FloToBits, Array(this.ref), NoLits))
d
}
def toType: Kind = FloType(isFlip)
@@ -100,17 +100,17 @@ class Flo(dir: Direction = NO_DIR) extends Element(dir, 32) with Num[Flo] {
private def flo_unop(op: PrimOp): Flo = {
val d = cloneType
- pushCommand(DefPrim(d.defd.id, d.toType, op, Array(this.ref), NoLits))
+ pushCommand(DefPrim(d.defd.cid, d.toType, op, Array(this.ref), NoLits))
d
}
private def flo_binop(op: PrimOp, other: Flo): Flo = {
val d = cloneType
- pushCommand(DefPrim(d.defd.id, d.toType, op, Array(this.ref, other.ref), NoLits))
+ pushCommand(DefPrim(d.defd.cid, d.toType, op, Array(this.ref, other.ref), NoLits))
d
}
private def flo_compop(op: PrimOp, other: Flo): Bool = {
val d = new Bool(dir)
- pushCommand(DefPrim(d.defd.id, d.toType, op, Array(this.ref, other.ref), NoLits))
+ pushCommand(DefPrim(d.defd.cid, d.toType, op, Array(this.ref, other.ref), NoLits))
d
}
@@ -151,7 +151,7 @@ object Dbl {
def apply(x: Double): Dbl = dblLit(x)
def dblLit(value: Double): Dbl = {
val b = new Dbl(NO_DIR)
- pushCommand(DefDbl(b.defd.id, value))
+ pushCommand(DefDbl(b.defd.cid, value))
b
}
def apply(dir: Direction = NO_DIR): Dbl =
@@ -197,12 +197,12 @@ class Dbl(dir: Direction = null) extends Element(dir, 64) with Num[Dbl] {
def cloneTypeWidth(width: Int): this.type = cloneType
override def fromBits(n: Bits): this.type = {
val d = cloneType
- pushCommand(DefPrim(d.defd.id, d.toType, BitsToDbl, Array(this.ref), NoLits))
+ pushCommand(DefPrim(d.defd.cid, d.toType, BitsToDbl, Array(this.ref), NoLits))
d
}
override def toBits: Bits = {
val d = new UInt(dir, 64)
- pushCommand(DefPrim(d.defd.id, d.toType, DblToBits, Array(this.ref), NoLits))
+ pushCommand(DefPrim(d.defd.cid, d.toType, DblToBits, Array(this.ref), NoLits))
d
}
def toType: Kind = DblType(isFlip)
@@ -214,17 +214,17 @@ class Dbl(dir: Direction = null) extends Element(dir, 64) with Num[Dbl] {
private def dbl_unop(op: PrimOp): Dbl = {
val d = cloneType
- pushCommand(DefPrim(d.defd.id, d.toType, op, Array(this.ref), NoLits))
+ pushCommand(DefPrim(d.defd.cid, d.toType, op, Array(this.ref), NoLits))
d
}
private def dbl_binop(op: PrimOp, other: Dbl): Dbl = {
val d = cloneType
- pushCommand(DefPrim(d.defd.id, d.toType, op, Array(this.ref, other.ref), NoLits))
+ pushCommand(DefPrim(d.defd.cid, d.toType, op, Array(this.ref, other.ref), NoLits))
d
}
private def dbl_compop(op: PrimOp, other: Dbl): Bool = {
val d = new Bool(dir)
- pushCommand(DefPrim(d.defd.id, d.toType, op, Array(this.ref, other.ref), NoLits))
+ pushCommand(DefPrim(d.defd.cid, d.toType, op, Array(this.ref, other.ref), NoLits))
d
}