diff options
| author | Andrew Waterman | 2015-07-27 12:59:35 -0700 |
|---|---|---|
| committer | Andrew Waterman | 2015-07-27 12:59:35 -0700 |
| commit | 0ba4d6008b7d80b87a7507d55fe228ff947e0121 (patch) | |
| tree | 63ff87b118473159af2070da2c0d65b361cf3840 /src | |
| parent | 54c57837d357af7d629bfe591b55fe645cd0ca9d (diff) | |
Use exceptions, not -1, to signal errors
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/Chisel/Core.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/scala/Chisel/Core.scala b/src/main/scala/Chisel/Core.scala index 94f97468..b1bcf63e 100644 --- a/src/main/scala/Chisel/Core.scala +++ b/src/main/scala/Chisel/Core.scala @@ -333,7 +333,7 @@ abstract class Data(dirArg: Direction) extends Id { def name = getRefForId(cid).name def debugName = mod.debugName + "." + getRefForId(cid).debugName def litArg(): LitArg = null - def litValue(): BigInt = -1 + def litValue(): BigInt = None.get def isLitValue(): Boolean = false def setLitValue(x: LitArg) { } def floLitValue: Float = intBitsToFloat(litValue().toInt) @@ -578,7 +578,7 @@ abstract class Bits(dirArg: Direction, width: Int) extends Element(dirArg, width override def litArg(): LitArg = litValueVar.get override def isLitValue(): Boolean = litValueVar.isDefined - override def litValue(): BigInt = if (isLitValue) litValueVar.get.num else -1 + override def litValue(): BigInt = litValueVar.get.num override def setLitValue(x: LitArg) { litValueVar = Some(x) } override def cloneType : this.type = cloneTypeWidth(width) def fromInt(x: BigInt): this.type = makeLit(x, -1) |
