summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chiselFrontend/src/main/scala/chisel3/core/Bits.scala2
-rw-r--r--src/main/scala/chisel3/package.scala1
-rw-r--r--src/main/scala/chisel3/util/BitPat.scala1
3 files changed, 4 insertions, 0 deletions
diff --git a/chiselFrontend/src/main/scala/chisel3/core/Bits.scala b/chiselFrontend/src/main/scala/chisel3/core/Bits.scala
index 741f6aee..c4161a32 100644
--- a/chiselFrontend/src/main/scala/chisel3/core/Bits.scala
+++ b/chiselFrontend/src/main/scala/chisel3/core/Bits.scala
@@ -463,6 +463,7 @@ sealed class UInt private[core] (width: Width, lit: Option[ULit] = None)
override def do_<= (that: UInt)(implicit sourceInfo: SourceInfo): Bool = compop(sourceInfo, LessEqOp, that)
override def do_>= (that: UInt)(implicit sourceInfo: SourceInfo): Bool = compop(sourceInfo, GreaterEqOp, that)
+ @deprecated("Use '=/=', which avoids potential precedence problems", "chisel3")
final def != (that: UInt): Bool = macro SourceInfoTransform.thatArg
final def =/= (that: UInt): Bool = macro SourceInfoTransform.thatArg
final def === (that: UInt): Bool = macro SourceInfoTransform.thatArg
@@ -658,6 +659,7 @@ sealed class SInt private (width: Width, lit: Option[SLit] = None)
override def do_<= (that: SInt)(implicit sourceInfo: SourceInfo): Bool = compop(sourceInfo, LessEqOp, that)
override def do_>= (that: SInt)(implicit sourceInfo: SourceInfo): Bool = compop(sourceInfo, GreaterEqOp, that)
+ @deprecated("Use '=/=', which avoids potential precedence problems", "chisel3")
final def != (that: SInt): Bool = macro SourceInfoTransform.thatArg
final def =/= (that: SInt): Bool = macro SourceInfoTransform.thatArg
final def === (that: SInt): Bool = macro SourceInfoTransform.thatArg
diff --git a/src/main/scala/chisel3/package.scala b/src/main/scala/chisel3/package.scala
index 0a57b7de..d0808980 100644
--- a/src/main/scala/chisel3/package.scala
+++ b/src/main/scala/chisel3/package.scala
@@ -152,6 +152,7 @@ package object chisel3 { // scalastyle:ignore package.object.name
implicit class fromUIntToBitPatComparable(val x: UInt) extends AnyVal {
final def === (that: BitPat): Bool = macro SourceInfoTransform.thatArg
+ @deprecated("Use '=/=', which avoids potential precedence problems", "chisel3")
final def != (that: BitPat): Bool = macro SourceInfoTransform.thatArg
final def =/= (that: BitPat): Bool = macro SourceInfoTransform.thatArg
diff --git a/src/main/scala/chisel3/util/BitPat.scala b/src/main/scala/chisel3/util/BitPat.scala
index 972010a6..e58258c7 100644
--- a/src/main/scala/chisel3/util/BitPat.scala
+++ b/src/main/scala/chisel3/util/BitPat.scala
@@ -82,6 +82,7 @@ sealed class BitPat(val value: BigInt, val mask: BigInt, width: Int) {
def getWidth: Int = width
def === (that: UInt): Bool = macro SourceInfoTransform.thatArg
def =/= (that: UInt): Bool = macro SourceInfoTransform.thatArg
+ @deprecated("Use '=/=', which avoids potential precedence problems", "chisel3")
def != (that: UInt): Bool = macro SourceInfoTransform.thatArg
def do_=== (that: UInt)(implicit sourceInfo: SourceInfo): Bool = value.asUInt === (that & mask.asUInt) // scalastyle:ignore method.name