Skip to content

Commit bf0b6b6

Browse files
Bump Mill 0.11.1, Scala 2.13.10, and Chisel 3.6.0 (OpenXiangShan#67)
Co-authored-by: Haojin Tang <[email protected]>
1 parent ae0940c commit bf0b6b6

File tree

8 files changed

+62
-72
lines changed

8 files changed

+62
-72
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Setup Mill
4141
uses: jodersky/[email protected]
4242
with:
43-
mill-version: 0.9.8
43+
mill-version: 0.11.1
4444

4545
# - name: Check scalafmt
4646
# run: make checkformat

.mill-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.8
1+
0.11.1

build.sc

+52-59
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import scalafmt._
44
import os.Path
55
import publish._
66
import $file.`rocket-chip`.common
7+
import $file.`rocket-chip`.common
78
import $file.`rocket-chip`.cde.common
89
import $file.`rocket-chip`.hardfloat.build
910

1011
val defaultVersions = Map(
11-
"chisel3" -> "3.5.4",
12-
"chisel3-plugin" -> "3.5.4",
13-
"chiseltest" -> "0.3.2",
14-
"scala" -> "2.12.13",
15-
"scalatest" -> "3.2.7"
12+
"chisel3" -> "3.6.0",
13+
"chisel3-plugin" -> "3.6.0",
14+
"chiseltest" -> "0.6.2",
15+
"scala" -> "2.13.10",
1616
)
1717

1818
def getVersion(dep: String, org: String = "edu.berkeley.cs", cross: Boolean = false) = {
@@ -23,98 +23,91 @@ def getVersion(dep: String, org: String = "edu.berkeley.cs", cross: Boolean = fa
2323
ivy"$org::$dep:$version"
2424
}
2525

26-
trait CommonModule extends ScalaModule {
27-
override def scalaVersion = defaultVersions("scala")
26+
trait HasChisel extends ScalaModule {
27+
def chiselModule: Option[ScalaModule] = None
2828

29-
override def scalacOptions = Seq("-Xsource:2.11")
29+
def chiselPluginJar: T[Option[PathRef]] = None
3030

31-
val macroParadise = ivy"org.scalamacros:::paradise:2.1.1"
32-
val chisel3Plugin = ivy"edu.berkeley.cs:::chisel3-plugin:3.5.4"
31+
def chiselIvy: Option[Dep] = Some(getVersion("chisel3"))
3332

34-
override def compileIvyDeps = Agg(macroParadise)
35-
override def scalacPluginIvyDeps = Agg(macroParadise, chisel3Plugin)
33+
def chiselPluginIvy: Option[Dep] = Some(getVersion("chisel3-plugin", cross=true))
3634

37-
}
35+
override def scalaVersion = defaultVersions("scala")
3836

39-
object rocketchip extends `rocket-chip`.common.CommonRocketChip {
37+
override def scalacOptions = super.scalacOptions() ++
38+
Agg("-language:reflectiveCalls", "-Ymacro-annotations", "-Ytasty-reader")
4039

41-
val rcPath = os.pwd / "rocket-chip"
40+
override def ivyDeps = super.ivyDeps() ++ Agg(chiselIvy.get)
4241

43-
override def scalaVersion = defaultVersions("scala")
42+
override def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ Agg(chiselPluginIvy.get)
43+
}
4444

45-
override def scalacOptions = Seq("-Xsource:2.11")
45+
object rocketchip extends `rocket-chip`.common.RocketChipModule with HasChisel {
4646

47+
val rcPath = os.pwd / "rocket-chip"
4748
override def millSourcePath = rcPath
4849

49-
object cdeRocket extends `rocket-chip`.cde.common.CDEModule with PublishModule {
50-
override def millSourcePath = rcPath / "cde" / "cde"
51-
52-
override def scalaVersion = T {
53-
rocketchip.scalaVersion()
54-
}
50+
def mainargsIvy = ivy"com.lihaoyi::mainargs:0.5.0"
5551

56-
override def pomSettings = T {
57-
rocketchip.pomSettings()
58-
}
52+
def json4sJacksonIvy = ivy"org.json4s::json4s-jackson:4.0.5"
5953

60-
override def publishVersion = T {
61-
rocketchip.publishVersion()
62-
}
54+
object macros extends `rocket-chip`.common.MacrosModule with HasChisel {
55+
def scalaReflectIvy = ivy"org.scala-lang:scala-reflect:${scalaVersion}"
6356
}
6457

65-
object hardfloatRocket extends `rocket-chip`.hardfloat.build.hardfloat {
66-
override def millSourcePath = rcPath / "hardfloat"
67-
68-
override def scalaVersion = T {
69-
rocketchip.scalaVersion()
70-
}
71-
72-
def chisel3IvyDeps = if(chisel3Module.isEmpty) Agg(
73-
`rocket-chip`.common.getVersion("chisel3")
74-
) else Agg.empty[Dep]
75-
76-
def chisel3PluginIvyDeps = Agg(`rocket-chip`.common.getVersion("chisel3-plugin", cross=true))
58+
object cde extends `rocket-chip`.cde.common.CDEModule with HasChisel {
59+
override def millSourcePath = rcPath / "cde" / "cde"
7760
}
7861

79-
def hardfloatModule = hardfloatRocket
62+
object hardfloat extends `rocket-chip`.hardfloat.common.HardfloatModule with HasChisel {
63+
override def millSourcePath = rcPath / "hardfloat" / "hardfloat"
64+
}
8065

81-
def cdeModule = cdeRocket
66+
def macrosModule = macros
8267

83-
}
68+
def hardfloatModule = hardfloat
8469

85-
object utility extends SbtModule with ScalafmtModule with CommonModule {
70+
def cdeModule = cde
8671

87-
override def ivyDeps = Agg(`rocket-chip`.common.getVersion("chisel3"))
72+
}
8873

89-
override def millSourcePath = os.pwd / "utility"
74+
object utility extends SbtModule with HasChisel {
75+
override def millSourcePath = os.pwd / "utility"
9076

91-
override def moduleDeps = super.moduleDeps ++ Seq(rocketchip)
77+
override def moduleDeps = super.moduleDeps ++ Seq(rocketchip)
9278
}
9379

94-
object huancun extends SbtModule with ScalafmtModule with CommonModule {
80+
object huancun extends SbtModule with HasChisel {
9581
override def millSourcePath = os.pwd / "HuanCun"
9682
override def moduleDeps = super.moduleDeps ++ Seq(
9783
rocketchip, utility
9884
)
9985
}
10086

101-
object CoupledL2 extends SbtModule with ScalafmtModule with CommonModule {
87+
trait CoupledL2Module extends ScalaModule {
88+
89+
def rocketModule: ScalaModule
90+
91+
def utilityModule: ScalaModule
92+
93+
def huancunModule: ScalaModule
94+
95+
override def moduleDeps = super.moduleDeps ++ Seq(rocketModule, utilityModule, huancunModule)
96+
}
97+
98+
object CoupledL2 extends SbtModule with HasChisel with CoupledL2Module {
10299

103100
override def millSourcePath = millOuterCtx.millSourcePath
104101

102+
def rocketModule: ScalaModule = rocketchip
105103

106-
override def ivyDeps = super.ivyDeps() ++ Agg(
107-
getVersion("chisel3"),
108-
getVersion("chiseltest"),
109-
)
104+
def utilityModule: ScalaModule = utility
110105

111-
override def moduleDeps = super.moduleDeps ++ Seq(rocketchip, utility, huancun)
106+
def huancunModule: ScalaModule = huancun
112107

113-
object test extends Tests {
108+
object test extends SbtModuleTests with TestModule.ScalaTest {
114109
override def ivyDeps = super.ivyDeps() ++ Agg(
115-
getVersion("scalatest","org.scalatest")
110+
getVersion("chiseltest"),
116111
)
117-
118-
def testFramework = "org.scalatest.tools.Framework"
119112
}
120113
}

rocket-chip

Submodule rocket-chip updated 201 files

src/main/scala/coupledL2/L2Param.scala

+1-6
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,7 @@ case class L1Param
4848

4949
// Pass virtual address of upper level cache
5050
case object VaddrKey extends ControlKey[UInt]("vaddr")
51-
case class VaddrField(width: Int) extends BundleField(VaddrKey) {
52-
override def data: UInt = Output(UInt(width.W))
53-
override def default(x: UInt): Unit = {
54-
x := 0.U(width.W)
55-
}
56-
}
51+
case class VaddrField(width: Int) extends BundleField[UInt](VaddrKey, Output(UInt(width.W)), _ := 0.U(width.W))
5752

5853
case class L2Param
5954
(

src/test/scala/TestTop.scala

+4-2
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ class TestTop_L2L3L2()(implicit p: Parameters) extends LazyModule {
322322
val l1d_nodes = (0 until nrL2).map(i => createClientNode(s"l1d$i", 32))
323323
val master_nodes = l1d_nodes
324324

325-
val l2_nodes = (0 until nrL2).map(i => LazyModule(new CoupledL2()(new Config((_, _, _) => {
325+
val coupledL2 = (0 until nrL2).map(i => LazyModule(new CoupledL2()(new Config((_, _, _) => {
326326
case L2ParamKey => L2Param(
327327
name = s"l2$i",
328328
ways = 4,
@@ -331,7 +331,8 @@ class TestTop_L2L3L2()(implicit p: Parameters) extends LazyModule {
331331
echoField = Seq(DirtyField()),
332332
hartIds = Seq{i}
333333
)
334-
}))).node)
334+
}))))
335+
val l2_nodes = coupledL2.map(_.node)
335336

336337
val l3 = LazyModule(new HuanCun()(new Config((_, _, _) => {
337338
case HCCacheParamsKey => HCCacheParameters(
@@ -382,6 +383,7 @@ class TestTop_L2L3L2()(implicit p: Parameters) extends LazyModule {
382383
dontTouch(clean)
383384
dontTouch(dump)
384385

386+
coupledL2.foreach(_.module.io.debugTopDown := DontCare)
385387
master_nodes.zipWithIndex.foreach {
386388
case (node, i) =>
387389
node.makeIOs()(ValName(s"master_port_$i"))

0 commit comments

Comments
 (0)