Skip to content

Commit 4b16c51

Browse files
committed
Upgrade to Chisel 3.6 and Ubuntu 24.04 LTS
Core Upgrades: - Chisel: 3.4 → 3.6 - Scala: 2.11.12 → 2.12.10 - chisel-iotesters: 1.5 → 2.5 - chiseltest: 0.3 → 0.6 - dsptools: 1.4 → 1.5 - breeze: 0.13.2 → 1.0 - firrtl-diagrammer: 1.3 → 1.6 API Migration: - Replace chisel3.Driver.emit with ChiselStage().emitChirrtl - Replace chisel3.Driver.execute with ChiselStage().emitVerilog - Update type: chisel3.core.UserModule → chisel3.Module - Remove thunk wrappers: () => module no longer needed Docker Improvements: - Ubuntu: 20.04 → 24.04 LTS - Fix pip installation for Python 3.12 - Remove obsolete python3-distutils package - Use --break-system-packages for pip in container Fixes: - binder/postBuild: Fix shell syntax (separate env vars) - Notebooks: Update FIRRTL emission in 4.1 and 4.4 - Validate all changes for Chisel 3.6 compatibility
1 parent 6951317 commit 4b16c51

File tree

5 files changed

+23
-27
lines changed

5 files changed

+23
-27
lines changed

4.1_firrtl_ast.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
},
101101
"outputs": [],
102102
"source": [
103-
"println(chisel3.Driver.emit(() => new DelayBy2(4)))"
103+
"println((new chisel3.stage.ChiselStage).emitChirrtl(new DelayBy2(4)))\n"
104104
]
105105
},
106106
{
@@ -129,7 +129,7 @@
129129
},
130130
"outputs": [],
131131
"source": [
132-
"val firrtlSerialization = chisel3.Driver.emit(() => new DelayBy2(4))\n",
132+
"val firrtlSerialization = (new chisel3.stage.ChiselStage).emitChirrtl(new DelayBy2(4))\n",
133133
"val firrtlAST = firrtl.Parser.parse(firrtlSerialization.split(\"\\n\").toIterator, Parser.GenInfo(\"file.fir\"))\n",
134134
"\n",
135135
"println(firrtlAST)"
@@ -343,4 +343,4 @@
343343
},
344344
"nbformat": 4,
345345
"nbformat_minor": 2
346-
}
346+
}

4.4_firrtl_add_ops_per_module.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@
257257
},
258258
"outputs": [],
259259
"source": [
260-
"val firrtlSerialization = chisel3.Driver.emit(() => new AddMe(8, 4))"
260+
"val firrtlSerialization = (new chisel3.stage.ChiselStage).emitChirrtl(new AddMe(8, 4))\n"
261261
]
262262
},
263263
{
@@ -317,4 +317,4 @@
317317
},
318318
"nbformat": 4,
319319
"nbformat_minor": 2
320-
}
320+
}

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# First stage : setup the system and environment
2-
FROM ubuntu:20.04 as base
2+
FROM ubuntu:24.04 as base
33

44
RUN \
55
apt-get update && \
@@ -8,15 +8,13 @@ RUN \
88
curl \
99
graphviz \
1010
openjdk-8-jre-headless \
11-
python3-distutils \
1211
gcc \
1312
python3-dev \
1413
&& \
1514
rm -rf /var/lib/apt/lists/*
1615

17-
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
18-
RUN python3 get-pip.py
19-
RUN pip3 install jupyter jupyterlab
16+
RUN apt-get update && apt-get install -y python3-pip && rm -rf /var/lib/apt/lists/*
17+
RUN pip3 install --no-cache-dir --break-system-packages jupyter jupyterlab
2018

2119
RUN useradd -ms /bin/bash bootcamp
2220

binder/postBuild

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

3-
SCALA_VERSION=2.12.10 ALMOND_VERSION=0.9.1
3+
SCALA_VERSION=2.12.10
4+
ALMOND_VERSION=0.9.1
45

56
# Install coursier
67
curl -Lo coursier https://git.io/coursier-cli

source/load-ivy.sc

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,32 @@ interp.repositories() ::: List(
44

55
@
66

7-
interp.configureCompiler(x => x.settings.source.value = scala.tools.nsc.settings.ScalaVersion("2.11.12"))
7+
interp.configureCompiler(x => x.settings.source.value = scala.tools.nsc.settings.ScalaVersion("2.12.10"))
88

99
// Uncomment and change to use proxy
1010
// System.setProperty("https.proxyHost", "proxy.example.com")
1111
// System.setProperty("https.proxyPort", "3128")
1212

13-
import $ivy.`edu.berkeley.cs::chisel3:3.4.+`
14-
import $ivy.`edu.berkeley.cs::chisel-iotesters:1.5.+`
15-
import $ivy.`edu.berkeley.cs::chiseltest:0.3.+`
16-
import $ivy.`edu.berkeley.cs::dsptools:1.4.+`
17-
import $ivy.`org.scalanlp::breeze:0.13.2`
13+
import $ivy.`edu.berkeley.cs::chisel3:3.6.+`
14+
import $ivy.`edu.berkeley.cs::chisel-iotesters:2.5.+`
15+
import $ivy.`edu.berkeley.cs::chiseltest:0.6.+`
16+
import $ivy.`edu.berkeley.cs::dsptools:1.5.+`
17+
import $ivy.`org.scalanlp::breeze:1.0`
1818
import $ivy.`edu.berkeley.cs::rocket-dsptools:1.2.0`
19-
import $ivy.`edu.berkeley.cs::firrtl-diagrammer:1.3.+`
19+
import $ivy.`edu.berkeley.cs::firrtl-diagrammer:1.6.+`
2020

2121
import $ivy.`org.scalatest::scalatest:3.2.2`
2222

2323
// Convenience function to invoke Chisel and grab emitted Verilog.
24-
def getVerilog(dut: => chisel3.core.UserModule): String = {
25-
import firrtl._
26-
return chisel3.Driver.execute(Array[String](), {() => dut}) match {
27-
case s:chisel3.ChiselExecutionSuccess => s.firrtlResultOption match {
28-
case Some(f:FirrtlExecutionSuccess) => f.emitted
29-
}
30-
}
24+
def getVerilog(dut: => chisel3.Module): String = {
25+
import chisel3.stage.ChiselStage
26+
(new ChiselStage).emitVerilog(dut)
3127
}
3228

3329
// Convenience function to invoke Chisel and grab emitted FIRRTL.
34-
def getFirrtl(dut: => chisel3.core.UserModule): String = {
35-
return chisel3.Driver.emit({() => dut})
30+
def getFirrtl(dut: => chisel3.Module): String = {
31+
import chisel3.stage.ChiselStage
32+
(new ChiselStage).emitChirrtl(dut)
3633
}
3734

3835
def compileFIRRTL(

0 commit comments

Comments
 (0)