Skip to content

Commit 31774e0

Browse files
committed
Switch to Chisel 3.6 and Scala 2.13
1 parent 376622e commit 31774e0

File tree

14 files changed

+29
-28
lines changed

14 files changed

+29
-28
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,11 +177,13 @@ sbt "Test / run s4noc.PerformanceTest"
177177

178178
#### TODO (S4NOC)
179179

180+
* NetworkTest and LatencyTest disabled, as they (now) run too long
180181
* Share testing code between ideal and concrete NIs
181182
* Play with configuration
182183
* Check memory FIFO if it is memory in an FPGA
183184
* Should also check how much HW the translation is, probably nothing. Max 4 LUTs for a table for 16 cores
184185
* Play with FIFO buffer variations
186+
* Have Raw tester with Verilator annotation
185187

186188
To analyze memory issues (e.g., increase the heap size with Xmx) use a ```.sbtopts``` with
187189
```

build.sbt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
scalaVersion := "2.12.13"
1+
scalaVersion := "2.13.14"
22

33
scalacOptions ++= Seq(
44
"-deprecation",
@@ -7,19 +7,19 @@ scalacOptions ++= Seq(
77
"-language:reflectiveCalls",
88
)
99

10-
val chiselVersion = "3.5.5"
10+
val chiselVersion = "3.6.1"
1111
addCompilerPlugin("edu.berkeley.cs" %% "chisel3-plugin" % chiselVersion cross CrossVersion.full)
1212
libraryDependencies += "edu.berkeley.cs" %% "chisel3" % chiselVersion
13-
libraryDependencies += "edu.berkeley.cs" %% "chiseltest" % "0.5.5"
13+
libraryDependencies += "edu.berkeley.cs" %% "chiseltest" % "0.6.2"
1414

1515
// For FIFO buffers
16-
libraryDependencies += "edu.berkeley.cs" % "ip-contributions" % "0.5.1"
16+
libraryDependencies += "edu.berkeley.cs" % "ip-contributions" % "0.6.1"
1717

1818
// library name
1919
name := "soc-comm"
2020

2121
// library version
22-
version := "0.1.5"
22+
version := "0.1.6"
2323

2424
// groupId, SCM, license information
2525
organization := "io.github.t-crest"

src/main/scala/arbiter/ArbiterTree.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package arbiter
22

33
import chisel3._
4-
// TODO: which Chisel version moves this into chisel3.util._?
5-
import chisel3.experimental.ChiselEnum
64
import chisel3.util._
75

86

src/main/scala/noc/Butterfly.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@ class Butterfly extends Module {
8282
}
8383

8484
object Butterfly extends App {
85-
(new chisel3.stage.ChiselStage).emitVerilog(new Butterfly(), Array("--target-dir", "generated"))
85+
emitVerilog(new Butterfly(), Array("--target-dir", "generated"))
8686
}

src/main/scala/s4noc/S4Router.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ class S4Router[T <: Data](schedule: Array[Array[Int]], dt: T) extends Module {
4545
}
4646

4747
object S4Router extends App {
48-
(new chisel3.stage.ChiselStage).emitVerilog(new S4Router(Schedule.genRandomSchedule(7), UInt(32.W)), Array("--target-dir", "generated"))
48+
emitVerilog(new S4Router(Schedule.genRandomSchedule(7), UInt(32.W)), Array("--target-dir", "generated"))
4949
}

src/main/scala/s4noc/Schedule.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class Schedule(val n: Int) {
103103
schedule.foreach(a => {
104104
s += "( "
105105
a.foreach(v => {
106-
s += v + " "
106+
s += s"$v "
107107
})
108108
s += ")\n"
109109
})

src/main/scala/s4noc/ScheduleHardware.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ class ScheduleHardware[T <: Data](schedule: Array[Array[Int]], dt: T) extends Mo
3737
}
3838

3939
object ScheduleHardware extends App {
40-
(new chisel3.stage.ChiselStage).emitVerilog(new ScheduleHardware(Schedule(args(0).toInt).schedule, UInt(32.W)), Array("--target-dir", "generated"))
40+
emitVerilog(new ScheduleHardware(Schedule(args(0).toInt).schedule, UInt(32.W)), Array("--target-dir", "generated"))
4141
}

src/main/scala/s4noc/ScheduleTable.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,8 @@ object ScheduleTable {
414414
" eel|"
415415

416416
def main(args: Array[String]): Unit = {
417-
var cnt = Source.fromFile(args(0)).getLines.length
418-
val lines = Source.fromFile(args(0)).getLines
417+
var cnt = Source.fromFile(args(0)).getLines().length
418+
val lines = Source.fromFile(args(0)).getLines()
419419
for (l <- lines) {
420420
val end = if (cnt > 1) " +" else ""
421421
println(" \"" + l + "l|\"" + end)

src/test/scala/noc/ButterflyTester.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ButterflyTester extends AnyFlatSpec with ChiselScalatestTester {
1212
c.io.inPorts(3).port(0).data.poke(7.U)
1313
for (i <- 0 until 10) {
1414
c.clock.step(1)
15-
println(c.io.outPorts(0).port(3).data.peek.litValue)
15+
println(c.io.outPorts(0).port(3).data.peekInt())
1616
}
1717
c.io.outPorts(0).port(3).data.expect(7.U)
1818
}

src/test/scala/s4noc/LatencyTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import soc._
77
/**
88
* Do some performance/latency tests.
99
*/
10-
class LatencyTest extends AnyFlatSpec with ChiselScalatestTester {
10+
class LatencyTest(dontRun: String) extends AnyFlatSpec with ChiselScalatestTester {
1111

1212
behavior of "S4NoC"
1313

@@ -33,7 +33,7 @@ class LatencyTest extends AnyFlatSpec with ChiselScalatestTester {
3333
assert(d.toInt == data(i))
3434
}
3535
println("" + CNT + " words sent")
36-
println("Bandwidth = " + (d.io.cycCnt.peek.litValue.toFloat / CNT) + " clock cycles per word")
36+
println("Bandwidth = " + (d.io.cycCnt.peekInt().toFloat / CNT) + " clock cycles per word")
3737

3838
th.join()
3939
}

0 commit comments

Comments
 (0)