@@ -2,24 +2,40 @@ import mill._
22import mill .scalalib ._
33import mill .scalalib .publish ._
44import coursier .maven .MavenRepository
5- import $file .hardfloat .common
6- import $file .cde .common
5+ import $file .dependencies .hardfloat .common
6+ import $file .dependencies .cde .common
7+ import $file .dependencies .chisel .build
8+ import $file .dependencies .rvdecoderdb .common
79import $file .common
810
911object v {
10- val scala = " 2.13.10 "
12+ val scala = " 2.13.12 "
1113 // the first version in this Map is the mainly supported version which will be used to run tests
1214 val chiselCrossVersions = Map (
1315 " 5.0.0" -> (ivy " org.chipsalliance::chisel:5.0.0+30-115743e1-SNAPSHOT " , ivy " org.chipsalliance:::chisel-plugin:5.0.0+30-115743e1-SNAPSHOT " ),
16+ // build from project from source
17+ " source" -> (ivy " org.chipsalliance::chisel:99 " , ivy " org.chipsalliance:::chisel-plugin:99 " ),
1418 )
1519 val mainargs = ivy " com.lihaoyi::mainargs:0.5.0 "
20+ val oslib = ivy " com.lihaoyi::os-lib:0.9.1 "
21+ val upickle = ivy " com.lihaoyi::upickle:3.1.3 "
1622 val json4sJackson = ivy " org.json4s::json4s-jackson:4.0.5 "
1723 val scalaReflect = ivy " org.scala-lang:scala-reflect: ${scala}"
1824 val sonatypesSnapshots = Seq (
1925 MavenRepository (" https://s01.oss.sonatype.org/content/repositories/snapshots" )
2026 )
2127}
2228
29+ // Build form source only for dev
30+ object chisel extends Chisel
31+
32+ trait Chisel
33+ extends millbuild.dependencies.chisel.build.Chisel {
34+ def crossValue = v.scala
35+ override def millSourcePath = os.pwd / " dependencies" / " chisel"
36+ def scalaVersion = T (v.scala)
37+ }
38+
2339object macros extends Macros
2440
2541trait Macros
@@ -35,37 +51,54 @@ trait Macros
3551object hardfloat extends mill.define.Cross [Hardfloat ](v.chiselCrossVersions.keys.toSeq)
3652
3753trait Hardfloat
38- extends millbuild.hardfloat.common.HardfloatModule
54+ extends millbuild.dependencies. hardfloat.common.HardfloatModule
3955 with RocketChipPublishModule
4056 with Cross .Module [String ] {
4157
4258 def scalaVersion : T [String ] = T (v.scala)
4359
44- override def millSourcePath = os.pwd / " hardfloat" / " hardfloat"
60+ override def millSourcePath = os.pwd / " dependencies " / " hardfloat" / " hardfloat"
4561
46- def chiselModule = None
62+ def chiselModule = Option .when(crossValue == " source " )(chisel)
4763
48- def chiselPluginJar = None
64+ def chiselPluginJar = T ( Option .when(crossValue == " source " )(chisel.pluginModule.jar()))
4965
50- def chiselIvy = Some (v.chiselCrossVersions(crossValue)._1)
66+ def chiselIvy = Option .when(crossValue != " source " ) (v.chiselCrossVersions(crossValue)._1)
5167
52- def chiselPluginIvy = Some (v.chiselCrossVersions(crossValue)._2)
68+ def chiselPluginIvy = Option .when(crossValue != " source " ) (v.chiselCrossVersions(crossValue)._2)
5369
5470 def repositoriesTask = T .task(super .repositoriesTask() ++ v.sonatypesSnapshots)
5571}
5672
5773object cde extends CDE
5874
5975trait CDE
60- extends millbuild.cde.common.CDEModule
76+ extends millbuild.dependencies. cde.common.CDEModule
6177 with RocketChipPublishModule
6278 with ScalaModule {
6379
6480 def scalaVersion : T [String ] = T (v.scala)
6581
66- override def millSourcePath = os.pwd / " cde" / " cde"
82+ override def millSourcePath = os.pwd / " dependencies " / " cde" / " cde"
6783}
6884
85+ object rvdecoderdb extends RVDecoderDB
86+
87+ trait RVDecoderDB
88+ extends millbuild.dependencies.rvdecoderdb.common.RVDecoderDBJVMModule
89+ with RocketChipPublishModule
90+ with ScalaModule {
91+
92+ def scalaVersion : T [String ] = T (v.scala)
93+
94+ def osLibIvy = v.oslib
95+
96+ def upickleIvy = v.upickle
97+
98+ override def millSourcePath = os.pwd / " dependencies" / " rvdecoderdb" / " rvdecoderdb"
99+ }
100+
101+
69102object rocketchip extends Cross [RocketChip ](v.chiselCrossVersions.keys.toSeq)
70103
71104trait RocketChip
@@ -77,20 +110,22 @@ trait RocketChip
77110
78111 override def millSourcePath = super .millSourcePath / os.up
79112
80- def chiselModule = None
113+ def chiselModule = Option .when(crossValue == " source " )(chisel)
81114
82- def chiselPluginJar = None
115+ def chiselPluginJar = T ( Option .when(crossValue == " source " )(chisel.pluginModule.jar()))
83116
84- def chiselIvy = Some (v.chiselCrossVersions(crossValue)._1)
117+ def chiselIvy = Option .when(crossValue != " source " ) (v.chiselCrossVersions(crossValue)._1)
85118
86- def chiselPluginIvy = Some (v.chiselCrossVersions(crossValue)._2)
119+ def chiselPluginIvy = Option .when(crossValue != " source " ) (v.chiselCrossVersions(crossValue)._2)
87120
88121 def macrosModule = macros
89122
90123 def hardfloatModule = hardfloat(crossValue)
91124
92125 def cdeModule = cde
93126
127+ def rvdecoderdbModule = rvdecoderdb
128+
94129 def mainargsIvy = v.mainargs
95130
96131 def json4sJacksonIvy = v.json4sJackson
@@ -225,6 +260,7 @@ trait Emulator extends Cross.Module2[String, String] {
225260 | ${mfccompiler.rtls().map(_.path.toString).mkString(" \n " )}
226261 | TOP_MODULE TestHarness
227262 | PREFIX VTestHarness
263+ | TRACE
228264 | VERILATOR_ARGS ${verilatorArgs().mkString(" " )}
229265 |)
230266 | """ .stripMargin
@@ -235,10 +271,11 @@ trait Emulator extends Cross.Module2[String, String] {
235271 Seq (
236272 // format: off
237273 " -Wno-UNOPTTHREADS" , " -Wno-STMTDLY" , " -Wno-LATCH" , " -Wno-WIDTH" , " --no-timing" ,
238- " --x-assign unique" ,
274+ " --x-assign 0" ,
275+ " --x-initial 0" ,
239276 """ +define+PRINTF_COND=\$c\(\"verbose\",\"&&\",\"done_reset\"\)""" ,
240277 """ +define+STOP_COND=\$c\(\"done_reset\"\)""" ,
241- " +define+RANDOMIZE_GARBAGE_ASSIGN " ,
278+ " +define+RANDOM=0 " ,
242279 " --output-split 20000" ,
243280 " --output-split-cfuncs 20000" ,
244281 " --max-num-width 1048576" ,
@@ -300,8 +337,8 @@ object emulator extends Cross[Emulator](
300337 //
301338 (" freechips.rocketchip.system.TestHarness" , " freechips.rocketchip.system.DefaultRV32Config" ),
302339 (" freechips.rocketchip.system.TestHarness" , " freechips.rocketchip.system.DefaultFP16Config" ),
303- (" freechips.rocketchip.system.TestHarness" , " freechips.rocketchip.system.BitManipCryptoConfig" ),
304- (" freechips.rocketchip.system.TestHarness" , " freechips.rocketchip.system.BitManipCrypto32Config" ),
340+ // ("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.BitManipCryptoConfig"),
341+ // ("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.BitManipCrypto32Config"),
305342)
306343
307344object `runnable-riscv-test` extends mill.Cross [RiscvTest ](
0 commit comments