Skip to content

Commit

Permalink
Merge branch 'sequencer/debug_hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
sequencer committed Oct 17, 2023
2 parents c05114e + 624cd52 commit a3def26
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@
[submodule "dependencies/chisel"]
path = dependencies/chisel
url = https://github.com/chipsalliance/chisel.git
[submodule "dependencies/rvdecoderdb"]
path = dependencies/rvdecoderdb
url = https://github.com/sequencer/rvdecoderdb.git
[submodule "dependencies/riscv-opcodes"]
path = dependencies/riscv-opcodes
url = https://github.com/riscv/riscv-opcodes.git
37 changes: 30 additions & 7 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ import coursier.maven.MavenRepository
import $file.dependencies.hardfloat.common
import $file.dependencies.cde.common
import $file.dependencies.chisel.build
import $file.dependencies.rvdecoderdb.common
import $file.common

object v {
val scala = "2.13.12"
// the first version in this Map is the mainly supported version which will be used to run tests
val chiselCrossVersions = Map(
"3.6.0" -> (ivy"edu.berkeley.cs::chisel3:3.6.0", ivy"edu.berkeley.cs:::chisel3-plugin:3.6.0"),
"5.0.0" -> (ivy"org.chipsalliance::chisel:5.0.0", ivy"org.chipsalliance:::chisel-plugin:5.0.0"),
// "5.0.0" -> (ivy"org.chipsalliance::chisel:5.0.0", ivy"org.chipsalliance:::chisel-plugin:5.0.0"),
// build from project from source
"source" -> (ivy"org.chipsalliance::chisel:99", ivy"org.chipsalliance:::chisel-plugin:99"),
)
val mainargs = ivy"com.lihaoyi::mainargs:0.5.0"
val oslib = ivy"com.lihaoyi::os-lib:0.9.1"
val upickle = ivy"com.lihaoyi::upickle:3.1.3"
val json4sJackson = ivy"org.json4s::json4s-jackson:4.0.5"
val scalaReflect = ivy"org.scala-lang:scala-reflect:${scala}"
}
Expand Down Expand Up @@ -75,6 +77,23 @@ trait CDE
override def millSourcePath = os.pwd / "dependencies" / "cde" / "cde"
}

object rvdecoderdb extends RVDecoderDB

trait RVDecoderDB
extends millbuild.dependencies.rvdecoderdb.common.RVDecoderDBJVMModule
with RocketChipPublishModule
with ScalaModule {

def scalaVersion: T[String] = T(v.scala)

def osLibIvy = v.oslib

def upickleIvy = v.upickle

override def millSourcePath = os.pwd / "dependencies" / "rvdecoderdb" / "rvdecoderdb"
}


object rocketchip extends Cross[RocketChip](v.chiselCrossVersions.keys.toSeq)

trait RocketChip
Expand All @@ -100,6 +119,8 @@ trait RocketChip

def cdeModule = cde

def rvdecoderdbModule = rvdecoderdb

def mainargsIvy = v.mainargs

def json4sJacksonIvy = v.json4sJackson
Expand Down Expand Up @@ -132,7 +153,7 @@ trait Emulator extends Cross.Module2[String, String] {
os.proc(
mill.util.Jvm.javaExe,
"-jar",
rocketchip(v.chiselCrossVersions.keys.head).assembly().path,
rocketchip(v.chiselCrossVersions.keys.last).assembly().path,
"--dir", T.dest.toString,
"--top", top,
config.split('_').flatMap(c => Seq("--config", c)),
Expand Down Expand Up @@ -232,6 +253,7 @@ trait Emulator extends Cross.Module2[String, String] {
| ${mfccompiler.rtls().map(_.path.toString).mkString("\n")}
| TOP_MODULE TestHarness
| PREFIX VTestHarness
| TRACE
| VERILATOR_ARGS ${verilatorArgs().mkString(" ")}
|)
|""".stripMargin
Expand All @@ -242,10 +264,11 @@ trait Emulator extends Cross.Module2[String, String] {
Seq(
// format: off
"-Wno-UNOPTTHREADS", "-Wno-STMTDLY", "-Wno-LATCH", "-Wno-WIDTH", "--no-timing",
"--x-assign unique",
"--x-assign 0",
"--x-initial 0",
"""+define+PRINTF_COND=\$c\(\"verbose\",\"&&\",\"done_reset\"\)""",
"""+define+STOP_COND=\$c\(\"done_reset\"\)""",
"+define+RANDOMIZE_GARBAGE_ASSIGN",
"+define+RANDOM=0",
"--output-split 20000",
"--output-split-cfuncs 20000",
"--max-num-width 1048576",
Expand Down Expand Up @@ -307,8 +330,8 @@ object emulator extends Cross[Emulator](
//
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32Config"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultFP16Config"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.BitManipCryptoConfig"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.BitManipCrypto32Config"),
// ("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.BitManipCryptoConfig"),
// ("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.BitManipCrypto32Config"),
)

object `runnable-riscv-test` extends mill.Cross[RiscvTest](
Expand Down
5 changes: 4 additions & 1 deletion common.sc
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,14 @@ trait RocketChipModule
// should be cde/common.sc#CDEModule
def cdeModule: ScalaModule

// should be dependencies/rvdecoderdb/common.sc#RVDecoderDB
def rvdecoderdbModule: ScalaModule

def mainargsIvy: Dep

def json4sJacksonIvy: Dep

override def moduleDeps = super.moduleDeps ++ Seq(macrosModule, hardfloatModule, cdeModule)
override def moduleDeps = super.moduleDeps ++ Seq(macrosModule, hardfloatModule, cdeModule, rvdecoderdbModule)

override def ivyDeps = T(
super.ivyDeps() ++ Agg(
Expand Down
1 change: 1 addition & 0 deletions dependencies/riscv-opcodes
Submodule riscv-opcodes added at 2c457d
1 change: 1 addition & 0 deletions dependencies/rvdecoderdb
Submodule rvdecoderdb added at 2b322c

0 comments on commit a3def26

Please sign in to comment.