diff options
| author | Chick Markley | 2021-10-07 14:31:16 -0700 |
|---|---|---|
| committer | GitHub | 2021-10-07 21:31:16 +0000 |
| commit | baaa2adcbfcf4fb508d8e5e71345afd1d7e5a352 (patch) | |
| tree | 047ce2d70ec2cb2f63aa6b3ac06df0d6a213edeb /core/src/main | |
| parent | cba0ba65e9a4f95430087a13627bc6b3c5ae5885 (diff) | |
Fixed bug with unary minus on FixedPoint and Interval (#2154)
In `Bits.scala`, `FixedPoint` and `Interval` did not defeine the `do_unary_-` methods (the `do_`) was missing
The recent PR #2124 combined with the above fact made DspTools break. This fix is necessary to get
that repo to build.
Diffstat (limited to 'core/src/main')
| -rw-r--r-- | core/src/main/scala/chisel3/Bits.scala | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/src/main/scala/chisel3/Bits.scala b/core/src/main/scala/chisel3/Bits.scala index a96d2732..81b43483 100644 --- a/core/src/main/scala/chisel3/Bits.scala +++ b/core/src/main/scala/chisel3/Bits.scala @@ -1330,9 +1330,9 @@ package experimental { final def unary_-%(dummy: Int*): FixedPoint = macro SourceInfoTransform.noArgDummy /** @group SourceInfoTransformMacro */ - def unary_- (implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): FixedPoint = FixedPoint.fromBigInt(0) - this + def do_unary_- (implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): FixedPoint = FixedPoint.fromBigInt(0) - this /** @group SourceInfoTransformMacro */ - def unary_-% (implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): FixedPoint = FixedPoint.fromBigInt(0) -% this + def do_unary_-% (implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): FixedPoint = FixedPoint.fromBigInt(0) -% this /** add (default - no growth) operator */ override def do_+ (that: FixedPoint)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): FixedPoint = @@ -1772,10 +1772,11 @@ package experimental { @deprecated("Calling this function with an empty argument list is invalid in Scala 3. Use the form without parentheses instead", "Chisel 3.5") final def unary_-%(dummy: Int*): Interval = macro SourceInfoTransform.noArgDummy - def unary_-(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Interval = { + /** @group SourceInfoTransformMacro */ + def do_unary_-(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Interval = { Interval.Zero - this } - def unary_-%(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Interval = { + def do_unary_-%(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): Interval = { Interval.Zero -% this } |
