Skip to content

Commit 6906ee3

Browse files
committed
Merge remote-tracking branch 'origin/new_decoder' into dec-test
2 parents 15f39d0 + a5d9d5a commit 6906ee3

File tree

15 files changed

+1406
-247
lines changed

15 files changed

+1406
-247
lines changed

.gitmodules

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
[submodule "hardfloat"]
2-
path = hardfloat
1+
[submodule "dependencies/hardfloat"]
2+
path = dependencies/hardfloat
33
url = https://github.com/ucb-bar/berkeley-hardfloat.git
4-
[submodule "torture"]
5-
path = torture
6-
url = https://github.com/ucb-bar/riscv-torture.git
7-
[submodule "cde"]
8-
path = cde
4+
[submodule "dependencies/cde"]
5+
path = dependencies/cde
96
url = https://github.com/chipsalliance/cde.git
7+
[submodule "dependencies/chisel"]
8+
path = dependencies/chisel
9+
url = https://github.com/chipsalliance/chisel.git
10+
[submodule "dependencies/rvdecoderdb"]
11+
path = dependencies/rvdecoderdb
12+
url = https://github.com/sequencer/rvdecoderdb.git
13+
[submodule "dependencies/riscv-opcodes"]
14+
path = dependencies/riscv-opcodes
15+
url = https://github.com/riscv/riscv-opcodes.git

build.sc

Lines changed: 56 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,40 @@ import mill._
22
import mill.scalalib._
33
import mill.scalalib.publish._
44
import 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
79
import $file.common
810

911
object 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+
2339
object macros extends Macros
2440

2541
trait Macros
@@ -35,37 +51,54 @@ trait Macros
3551
object hardfloat extends mill.define.Cross[Hardfloat](v.chiselCrossVersions.keys.toSeq)
3652

3753
trait 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

5773
object cde extends CDE
5874

5975
trait 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+
69102
object rocketchip extends Cross[RocketChip](v.chiselCrossVersions.keys.toSeq)
70103

71104
trait 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

307344
object `runnable-riscv-test` extends mill.Cross[RiscvTest](

common.sc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,14 @@ trait RocketChipModule
4545
// should be cde/common.sc#CDEModule
4646
def cdeModule: ScalaModule
4747

48+
// should be dependencies/rvdecoderdb/common.sc#RVDecoderDB
49+
def rvdecoderdbModule: ScalaModule
50+
4851
def mainargsIvy: Dep
4952

5053
def json4sJacksonIvy: Dep
5154

52-
override def moduleDeps = super.moduleDeps ++ Seq(macrosModule, hardfloatModule, cdeModule)
55+
override def moduleDeps = super.moduleDeps ++ Seq(macrosModule, hardfloatModule, cdeModule, rvdecoderdbModule)
5356

5457
override def ivyDeps = T(
5558
super.ivyDeps() ++ Agg(

dependencies/chisel

Submodule chisel added at 4474816

dependencies/riscv-opcodes

Submodule riscv-opcodes added at 2c457dd

dependencies/rvdecoderdb

Submodule rvdecoderdb added at 2b322c4

src/main/scala/rocket/CustomInstructions.scala renamed to src/main/scala/deprecate/rocket/CustomInstructions.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package freechips.rocketchip.rocket
55

66
import chisel3.util._
7+
import freechips.rocketchip.rocket._
78

89
object CustomInstructions {
910
def MNRET = BitPat("b01110000001000000000000001110011")

src/main/scala/rocket/Decode.scala renamed to src/main/scala/deprecate/rocket/Decode.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package freechips.rocketchip.rocket
55
import chisel3._
66
import chisel3.util.BitPat
77
import chisel3.util.experimental.decode._
8+
import freechips.rocketchip.rocket._
89

910
object DecodeLogic
1011
{

0 commit comments

Comments
 (0)