diff options
| author | Andrew Waterman | 2015-08-10 17:43:59 -0700 |
|---|---|---|
| committer | Andrew Waterman | 2015-08-10 17:43:59 -0700 |
| commit | d161470df3ba1e07b6926b37f06798ffa2dd3417 (patch) | |
| tree | 3a30ebe123d664fa4712a7256cebf813a17dc49e /src | |
| parent | 3e6a0b2777296fa22771ac2184479b0b866b673d (diff) | |
Force toUInt = asUInt, toSInt = asSInt
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/Chisel/Core.scala | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/main/scala/Chisel/Core.scala b/src/main/scala/Chisel/Core.scala index 4a46fda3..4b8d2ca3 100644 --- a/src/main/scala/Chisel/Core.scala +++ b/src/main/scala/Chisel/Core.scala @@ -637,8 +637,8 @@ sealed abstract class Bits(dirArg: Direction, width: Width, override val litArg: def asSInt(): SInt def asUInt(): UInt - def toSInt(): SInt - def toUInt(): UInt + final def toSInt(): SInt = asSInt + final def toUInt(): UInt = asUInt def toBool(): Bool = this(0) override def toBits = asUInt @@ -728,8 +728,6 @@ sealed class UInt(dir: Direction, width: Width, lit: Option[ULit] = None) extend def zext(): SInt = pushOp(DefPrim(SInt(NO_DIR, width + 1), ConvertOp, ref)) def asSInt(): SInt = pushOp(DefPrim(SInt(NO_DIR, width), AsSIntOp, ref)) - def toSInt(): SInt = asSInt() - def toUInt(): UInt = this def asUInt(): UInt = this } @@ -806,9 +804,7 @@ sealed class SInt(dir: Direction, width: Width, lit: Option[SLit] = None) extend def >> (other: UInt): SInt = binop(SInt(NO_DIR, this.width), DynamicShiftRightOp, other) def asUInt(): UInt = pushOp(DefPrim(UInt(NO_DIR, width), AsUIntOp, ref)) - def toUInt(): UInt = asUInt() def asSInt(): SInt = this - def toSInt(): SInt = this } object SInt { |
