Skip to content

Commit

Permalink
Scala 2.13 and verions 0.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
schoeberl committed Nov 1, 2024
1 parent 73434ad commit d314ef1
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 14 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(_ > _))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(_ > _))
Expand All @@ -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))
8 changes: 4 additions & 4 deletions src/test/scala/chisel/lib/fifo/FifoSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/chisel/lib/firfilter/RandomSignalTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/chisel/lib/iirfilter/RandomSignalTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/chisel/lib/spi/SpiTester.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d314ef1

Please sign in to comment.