diff options
| -rw-r--r-- | src/main/scala/Chisel/Core.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/scala/Chisel/Core.scala b/src/main/scala/Chisel/Core.scala index 9f0b1ce6..7ba4444c 100644 --- a/src/main/scala/Chisel/Core.scala +++ b/src/main/scala/Chisel/Core.scala @@ -736,6 +736,7 @@ class UInt(dir: Direction, width: Int, lit: Option[LitArg] = None) extends Bits( def - (other: UInt): UInt = this -% other def -% (other: UInt): UInt = binop(SubModOp, other, maxWidth(other, 0)) def * (other: UInt): UInt = binop(TimesOp, other, sumWidth(other, 0)) + def * (other: SInt): SInt = other * this def / (other: UInt): UInt = binop(DivideOp, other, sumWidth(0)) def % (other: UInt): UInt = binop(ModOp, other, sumWidth(0)) override def << (other: BigInt): UInt = binop(ShiftLeftOp, other, sumWidth(other)) @@ -815,6 +816,7 @@ class SInt(dir: Direction, width: Int, lit: Option[LitArg] = None) extends Bits( def -% (other: SInt): SInt = binop(SubModOp, other, maxWidth(other, 0)) def - (other: SInt): SInt = this -% other def * (other: SInt): SInt = binop(TimesOp, other, sumWidth(other, 0)) + def * (other: UInt): SInt = binop(TimesOp, other, sumWidth(other, 0)) def / (other: SInt): SInt = binop(DivideOp, other, sumWidth(0)) def % (other: SInt): SInt = binop(ModOp, other, sumWidth(0)) override def << (other: BigInt): SInt = binop(ShiftLeftOp, other, sumWidth(other)) |
