From d314ef1dfeed5765175275a6b8503c3fc7b6a68e Mon Sep 17 00:00:00 2001 From: Martin Schoeberl Date: Thu, 31 Oct 2024 23:37:12 -0700 Subject: [PATCH] Scala 2.13 and verions 0.5.4 --- README.md | 13 +++++++++++-- build.sbt | 4 ++-- .../lib/bitonicsorter/ExhaustiveSorterTest.scala | 2 +- .../chisel/lib/bitonicsorter/RandomSorterTest.scala | 5 +++-- src/test/scala/chisel/lib/fifo/FifoSpec.scala | 8 ++++---- .../chisel/lib/firfilter/RandomSignalTest.scala | 2 +- .../chisel/lib/iirfilter/RandomSignalTest.scala | 2 +- src/test/scala/chisel/lib/spi/SpiTester.scala | 2 +- 8 files changed, 24 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 5ce3d6a..8f31c3e 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,19 @@ the community. This is the place to do it. line to your ```build.sbt``` ``` -libraryDependencies += "edu.berkeley.cs" % "ip-contributions" % "0.5.3" - +libraryDependencies += "edu.berkeley.cs" % "ip-contributions" % "0.5.4" ``` +### Versions + + +| ip-contributions | Chisel | Scala | +|------------------|--------|-------| +| 0.5.4 | 3.5.6 | 2.13 | +| 0.5.3 | 3.5.6 | 2.12 | +| 0.5.1 | 3.5.5 | 2.12 | +| 0.4.0 | 3.4.x | 2.12 | + ### Getting Started To begin with you should have some working Chisel code. diff --git a/build.sbt b/build.sbt index 31028f5..a00f8d2 100644 --- a/build.sbt +++ b/build.sbt @@ -1,8 +1,8 @@ // See README.md for license details. -ThisBuild / scalaVersion := "2.12.17" +ThisBuild / scalaVersion := "2.13.10" ThisBuild / crossScalaVersions := Seq("2.12.17", "2.13.10") -ThisBuild / version := "0.5.3" +ThisBuild / version := "0.5.4" lazy val publishSettings = Seq ( diff --git a/src/test/scala/chisel/lib/bitonicsorter/ExhaustiveSorterTest.scala b/src/test/scala/chisel/lib/bitonicsorter/ExhaustiveSorterTest.scala index 210b19c..2a3f917 100644 --- a/src/test/scala/chisel/lib/bitonicsorter/ExhaustiveSorterTest.scala +++ b/src/test/scala/chisel/lib/bitonicsorter/ExhaustiveSorterTest.scala @@ -21,7 +21,7 @@ class ExhaustiveSorterTest[T <: Bool](factory: () => SorterModuleIfc[T]) test(factory()).runPeekPoke { c => new PeekPokeTester(c) { - def example(a: IndexedSeq[BigInt]) { + def example(a: IndexedSeq[BigInt]) : Unit = { poke(c.io.a, a) step(1) expect(c.io.z, a.sortWith(_ > _)) diff --git a/src/test/scala/chisel/lib/bitonicsorter/RandomSorterTest.scala b/src/test/scala/chisel/lib/bitonicsorter/RandomSorterTest.scala index 1ab210d..dd376e8 100644 --- a/src/test/scala/chisel/lib/bitonicsorter/RandomSorterTest.scala +++ b/src/test/scala/chisel/lib/bitonicsorter/RandomSorterTest.scala @@ -29,7 +29,7 @@ class RandomSorterTest[T <: UInt]( it should "work" in { test(factory()).runPeekPoke { c => new PeekPokeTester(c) { - def example(a: IndexedSeq[BigInt]) { + def example(a: IndexedSeq[BigInt]): Unit = { poke(c.io.a, a) step(1) expect(c.io.z, a.sortWith(_ > _)) @@ -48,6 +48,7 @@ class RandomSorterTest[T <: UInt]( class BoolBitonicSorterModule(n: Int) extends BitonicSorterModule(n, Bool(), (x: UInt, y: UInt) => x < y) class UInt8BitonicSorterModule(n: Int) extends BitonicSorterModule(n, UInt(8.W), (x: UInt, y: UInt) => x < y) -class RandomBitonicSorterTest64 extends RandomSorterTest(10000, () => new UInt8BitonicSorterModule(64)) +// this test takes forever +// class RandomBitonicSorterTest64 extends RandomSorterTest(10000, () => new UInt8BitonicSorterModule(64)) //This tests takes a bit long to do every time // class RandomBitonicSorterTest384 extends RandomSorterTest( 10000, () => new UInt8BitonicSorterModule( 384)) diff --git a/src/test/scala/chisel/lib/fifo/FifoSpec.scala b/src/test/scala/chisel/lib/fifo/FifoSpec.scala index b94ef8d..2e40215 100644 --- a/src/test/scala/chisel/lib/fifo/FifoSpec.scala +++ b/src/test/scala/chisel/lib/fifo/FifoSpec.scala @@ -24,7 +24,7 @@ object testFifo { dut.io.enq.bits.poke(value.U) dut.io.enq.valid.poke(true.B) // wait for slot to become available - while (!dut.io.enq.ready.peekBoolean) { + while (!dut.io.enq.ready.peekBoolean()) { dut.clock.step() } dut.clock.step() @@ -34,7 +34,7 @@ object testFifo { private def pop(dut: Fifo[UInt]): BigInt = { // wait for value to become available - while (!dut.io.deq.valid.peekBoolean) { + while (!dut.io.deq.valid.peekBoolean()) { dut.clock.step() } // check value @@ -49,7 +49,7 @@ object testFifo { private def pop(dut: Fifo[UInt], value: BigInt): Unit = { // wait for value to become available - while (!dut.io.deq.valid.peekBoolean) { + while (!dut.io.deq.valid.peekBoolean()) { dut.clock.step() } // check value @@ -76,7 +76,7 @@ object testFifo { var cnt = 0 for (i <- 0 until 100) { dut.io.enq.bits.poke(i.U) - if (dut.io.enq.ready.peekBoolean) { + if (dut.io.enq.ready.peekBoolean()) { cnt += 1 } dut.clock.step() diff --git a/src/test/scala/chisel/lib/firfilter/RandomSignalTest.scala b/src/test/scala/chisel/lib/firfilter/RandomSignalTest.scala index 19c5751..a38aa64 100644 --- a/src/test/scala/chisel/lib/firfilter/RandomSignalTest.scala +++ b/src/test/scala/chisel/lib/firfilter/RandomSignalTest.scala @@ -108,7 +108,7 @@ class RandomSignalTest extends AnyFlatSpec with FIRFilterBehavior with ChiselSca val coefDecimalWidth = 28 // Generate random input data [-1., 1.] - val inputData = Seq.fill(100)(-1.0 + Random.nextDouble * 2.0) + val inputData = Seq.fill(100)(-1.0 + Random.nextDouble() * 2.0) // Compute expected outputs val expectedOutput = computeExpectedOutput(coefs, inputData) diff --git a/src/test/scala/chisel/lib/iirfilter/RandomSignalTest.scala b/src/test/scala/chisel/lib/iirfilter/RandomSignalTest.scala index f338f62..4d8b0ed 100644 --- a/src/test/scala/chisel/lib/iirfilter/RandomSignalTest.scala +++ b/src/test/scala/chisel/lib/iirfilter/RandomSignalTest.scala @@ -124,7 +124,7 @@ class RandomSignalTest extends AnyFlatSpec with IIRFilterBehavior with ChiselSca val outputWidth = inputWidth + coefWidth + log2Ceil(num.length + den.length) + 1 // Generate random input data [-1., 1.] - val inputData = Seq.fill(100)(-1.0 + Random.nextDouble * 2.0) + val inputData = Seq.fill(100)(-1.0 + Random.nextDouble() * 2.0) // Compute expected outputs val expectedOutput = computeExpectedOutput(num, den, inputData) diff --git a/src/test/scala/chisel/lib/spi/SpiTester.scala b/src/test/scala/chisel/lib/spi/SpiTester.scala index f34226d..2139876 100644 --- a/src/test/scala/chisel/lib/spi/SpiTester.scala +++ b/src/test/scala/chisel/lib/spi/SpiTester.scala @@ -11,7 +11,7 @@ class SpiMasterTest extends AnyFlatSpec with ChiselScalatestTester { val frequency = 100000000 val clkfreq = 10000000 - def transferOneWord(bsize: Int, mode: Int, msbFirst: Boolean, dut: => Master) { + def transferOneWord(bsize: Int, mode: Int, msbFirst: Boolean, dut: => Master): Unit = { test(dut) { dut => val clkStepPerHalfSclk = (frequency + clkfreq / 2) / clkfreq / 2 - 1