diff options
| author | Andrew Waterman | 2016-01-17 01:47:58 -0800 |
|---|---|---|
| committer | Andrew Waterman | 2016-01-17 01:47:58 -0800 |
| commit | 215d71c20e0b3e609eb5ac0f957c475fe3d61357 (patch) | |
| tree | d7cca76a2791728a730f04665573f66e5834b301 /src/main | |
| parent | fc3587aa24132991a50fbba1fbe4dc769953a3db (diff) | |
Add =/= operator to BitPat
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/scala/Chisel/BitPat.scala | 3 | ||||
| -rw-r--r-- | src/main/scala/Chisel/Bits.scala | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/main/scala/Chisel/BitPat.scala b/src/main/scala/Chisel/BitPat.scala index b4138992..a1bf1985 100644 --- a/src/main/scala/Chisel/BitPat.scala +++ b/src/main/scala/Chisel/BitPat.scala @@ -75,5 +75,6 @@ object BitPat { sealed class BitPat(val value: BigInt, val mask: BigInt, width: Int) { def getWidth: Int = width def === (other: UInt): Bool = UInt(value) === (other & UInt(mask)) - def != (other: UInt): Bool = !(this === other) + def =/= (other: UInt): Bool = !(this === other) + def != (other: UInt): Bool = this =/= other } diff --git a/src/main/scala/Chisel/Bits.scala b/src/main/scala/Chisel/Bits.scala index d6bef0d0..57d88244 100644 --- a/src/main/scala/Chisel/Bits.scala +++ b/src/main/scala/Chisel/Bits.scala @@ -321,6 +321,7 @@ sealed class UInt private[Chisel] (dir: Direction, width: Width, lit: Option[ULi def === (that: BitPat): Bool = that === this def != (that: BitPat): Bool = that != this + def =/= (that: BitPat): Bool = that =/= this /** Returns this UInt as a [[SInt]] with an additional zero in the MSB. */ |
