From 1f2383fb61ca7c4e4def0c7c4ee1a19e58c36288 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Wed, 5 Aug 2015 01:28:58 -0700 Subject: Use Width object, not Int Please, no more -1 --- src/main/scala/Chisel/FP.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/scala/Chisel/FP.scala') diff --git a/src/main/scala/Chisel/FP.scala b/src/main/scala/Chisel/FP.scala index 4e9a84d4..17ef0df8 100644 --- a/src/main/scala/Chisel/FP.scala +++ b/src/main/scala/Chisel/FP.scala @@ -78,10 +78,10 @@ object FloPrimOp { } import FloPrimOp._ -class Flo(dir: Direction = NO_DIR, val value:Option[Float] = None) extends Element(dir, 32) with Num[Flo] { +class Flo(dir: Direction = NO_DIR, val value:Option[Float] = None) extends Element(dir, Width(32)) with Num[Flo] { type T = Flo; override def floLitValue: Float = value.get - def cloneTypeWidth(width: Int): this.type = cloneType + def cloneTypeWidth(width: Width): this.type = cloneType override def fromBits(n: Bits): this.type = { val d = cloneType pushCommand(DefPrim(d, d.toType, BitsToFlo, Array(this.ref), NoLits)) @@ -189,14 +189,14 @@ object DblPrimOp { } import DblPrimOp._ -class Dbl(dir: Direction, val value: Option[Double] = None) extends Element(dir, 64) with Num[Dbl] { +class Dbl(dir: Direction, val value: Option[Double] = None) extends Element(dir, Width(64)) with Num[Dbl] { // setIsSigned // override def setIsTypeNode = {inputs(0).setIsSigned; super.setIsTypeNode} type T = Dbl; override def dblLitValue: Double = value.get - def cloneTypeWidth(width: Int): this.type = cloneType + def cloneTypeWidth(width: Width): this.type = cloneType override def fromBits(n: Bits): this.type = { val d = cloneType pushCommand(DefPrim(d, d.toType, BitsToDbl, Array(this.ref), NoLits)) -- cgit v1.2.3