From 215d71c20e0b3e609eb5ac0f957c475fe3d61357 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Sun, 17 Jan 2016 01:47:58 -0800 Subject: Add =/= operator to BitPat --- src/main/scala/Chisel/BitPat.scala | 3 ++- src/main/scala/Chisel/Bits.scala | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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. */ -- cgit v1.2.3