From 66d803fe145eaf6e4a1dd367da42afc8ddbf7b16 Mon Sep 17 00:00:00 2001 From: SingularityKChen Date: Mon, 26 Dec 2022 23:08:15 +0800 Subject: [PATCH] fix: chisel3 pr #2758 + Remove parenthesized forms of asUInt(), isLit(); + replace MultiIOModule with Module; --- .../dsptools/numbers/chisel_concrete/DspComplex.scala | 2 +- src/main/scala/dsptools/numbers/rounding/Saturate.scala | 2 +- src/test/scala/dsptools/ShiftRegisterDelaySpec.scala | 2 +- src/test/scala/dsptools/numbers/SaturateSpec.scala | 7 ++++--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/scala/dsptools/numbers/chisel_concrete/DspComplex.scala b/src/main/scala/dsptools/numbers/chisel_concrete/DspComplex.scala index 40855adb..1c6e1353 100644 --- a/src/main/scala/dsptools/numbers/chisel_concrete/DspComplex.scala +++ b/src/main/scala/dsptools/numbers/chisel_concrete/DspComplex.scala @@ -11,7 +11,7 @@ import chisel3.experimental.BundleLiterals.AddBundleLiteralConstructor object DspComplex { def apply[T <: Data:Ring](gen: T): DspComplex[T] = { - if (gen.isLit()) throw DspException("Cannot use Lit in single argument DspComplex.apply") + if (gen.isLit) throw DspException("Cannot use Lit in single argument DspComplex.apply") apply(gen.cloneType, gen.cloneType) } diff --git a/src/main/scala/dsptools/numbers/rounding/Saturate.scala b/src/main/scala/dsptools/numbers/rounding/Saturate.scala index 5c1944a7..53f1a4ca 100644 --- a/src/main/scala/dsptools/numbers/rounding/Saturate.scala +++ b/src/main/scala/dsptools/numbers/rounding/Saturate.scala @@ -25,7 +25,7 @@ case class SaturateChiselAnnotation(target: SaturateDummyModule[_ <: Data], op: def transformClass: Class[SaturateTransform] = classOf[SaturateTransform] } -trait SaturateModule[T <: Data] extends MultiIOModule { +trait SaturateModule[T <: Data] extends Module { val a: T val b: T val c: T diff --git a/src/test/scala/dsptools/ShiftRegisterDelaySpec.scala b/src/test/scala/dsptools/ShiftRegisterDelaySpec.scala index d26e5ff0..5ac041b5 100644 --- a/src/test/scala/dsptools/ShiftRegisterDelaySpec.scala +++ b/src/test/scala/dsptools/ShiftRegisterDelaySpec.scala @@ -24,7 +24,7 @@ class AbsCircuitWithDelays[T <: Data : Signed](gen: T, val delays: Int) extends DspContext.withNumAddPipes(delays) { val con = io.in.context_abs() - printf("io.in %d con %d\n", io.in.asUInt(), con.asUInt()) + printf("io.in %d con %d\n", io.in.asUInt, con.asUInt) io.outContextAbs := con } } diff --git a/src/test/scala/dsptools/numbers/SaturateSpec.scala b/src/test/scala/dsptools/numbers/SaturateSpec.scala index 5462762b..097ed618 100644 --- a/src/test/scala/dsptools/numbers/SaturateSpec.scala +++ b/src/test/scala/dsptools/numbers/SaturateSpec.scala @@ -9,7 +9,8 @@ import dsptools.numbers.rounding.Saturate import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers -class SaturateUIntMod(val add: Boolean) extends MultiIOModule { + +class SaturateUIntMod(val add: Boolean) extends Module { val a = IO(Input(UInt(8.W))) val b = IO(Input(UInt(8.W))) val c = IO(Output(UInt())) @@ -53,7 +54,7 @@ class SaturateUIntTester(dut: SaturateUIntMod) extends PeekPokeTester(dut) { } } -class SaturateSIntMod(val add: Boolean) extends MultiIOModule { +class SaturateSIntMod(val add: Boolean) extends Module { val a = IO(Input(SInt(8.W))) val b = IO(Input(SInt(8.W))) val c = IO(Output(SInt())) @@ -96,7 +97,7 @@ class SaturateSIntTester(dut: SaturateSIntMod) extends PeekPokeTester(dut) { } } -class SaturateFixedPointMod(val add: Boolean, val aBP: Int = 0, val bBP: Int = 0) extends MultiIOModule { +class SaturateFixedPointMod(val add: Boolean, val aBP: Int = 0, val bBP: Int = 0) extends Module { val cBP = aBP max bBP val a = IO(Input(FixedPoint(8.W, aBP.BP))) val b = IO(Input(FixedPoint(8.W, bBP.BP)))