Skip to content

Commit

Permalink
Merge pull request chipsalliance#3675 from chipsalliance/dev
Browse files Browse the repository at this point in the history
Sync dev to master
  • Loading branch information
jerryz123 authored Aug 21, 2024
2 parents dbcb06a + 14b81e4 commit cff28b8
Show file tree
Hide file tree
Showing 237 changed files with 5,188 additions and 5,856 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/mill-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
config: [DefaultConfig, DefaultBufferlessConfig, DefaultRV32Config, TinyConfig, DefaultFP16Config]
config: [DefaultConfig, DefaultBufferlessConfig, DefaultRV32Config, TinyConfig, DefaultFP16Config, DefaultBConfig, DefaultRV32BConfig]
steps:
- uses: actions/checkout@v2
with:
Expand Down
18 changes: 11 additions & 7 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[submodule "hardfloat"]
path = hardfloat
[submodule "dependencies/hardfloat"]
path = dependencies/hardfloat
url = https://github.com/ucb-bar/berkeley-hardfloat.git
[submodule "torture"]
path = torture
url = https://github.com/ucb-bar/riscv-torture.git
[submodule "cde"]
path = cde
[submodule "dependencies/cde"]
path = dependencies/cde
url = https://github.com/chipsalliance/cde.git
[submodule "dependencies/chisel"]
path = dependencies/chisel
url = https://github.com/chipsalliance/chisel.git
[submodule "dependencies/diplomacy"]
path = dependencies/diplomacy
url = https://github.com/chipsalliance/diplomacy.git
branch = master
101 changes: 80 additions & 21 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,37 @@ import mill._
import mill.scalalib._
import mill.scalalib.publish._
import coursier.maven.MavenRepository
import $file.hardfloat.common
import $file.cde.common
import $file.dependencies.hardfloat.common
import $file.dependencies.cde.common
import $file.dependencies.diplomacy.common
import $file.dependencies.chisel.build
import $file.common

object v {
val scala = "2.13.10"
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.1.0" -> (ivy"org.chipsalliance::chisel:5.1.0", ivy"org.chipsalliance:::chisel-plugin:5.1.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 json4sJackson = ivy"org.json4s::json4s-jackson:4.0.5"
val scalaReflect = ivy"org.scala-lang:scala-reflect:${scala}"
val sourcecode = ivy"com.lihaoyi::sourcecode:0.3.1"
val sonatypesSnapshots = Seq(
MavenRepository("https://s01.oss.sonatype.org/content/repositories/snapshots")
)
}

// Build form source only for dev
object chisel extends Chisel

trait Chisel
extends millbuild.dependencies.chisel.build.Chisel {
def crossValue = v.scala
override def millSourcePath = os.pwd / "dependencies" / "chisel"
def scalaVersion = T(v.scala)
}

object macros extends Macros
Expand All @@ -33,33 +50,60 @@ trait Macros
object hardfloat extends mill.define.Cross[Hardfloat](v.chiselCrossVersions.keys.toSeq)

trait Hardfloat
extends millbuild.hardfloat.common.HardfloatModule
extends millbuild.dependencies.hardfloat.common.HardfloatModule
with RocketChipPublishModule
with Cross.Module[String] {

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

override def millSourcePath = os.pwd / "hardfloat" / "hardfloat"
override def millSourcePath = os.pwd / "dependencies" / "hardfloat" / "hardfloat"

def chiselModule = Option.when(crossValue == "source")(chisel)

def chiselModule = None
def chiselPluginJar = T(Option.when(crossValue == "source")(chisel.pluginModule.jar()))

def chiselPluginJar = None
def chiselIvy = Option.when(crossValue != "source")(v.chiselCrossVersions(crossValue)._1)

def chiselIvy = Some(v.chiselCrossVersions(crossValue)._1)
def chiselPluginIvy = Option.when(crossValue != "source")(v.chiselCrossVersions(crossValue)._2)

def chiselPluginIvy = Some(v.chiselCrossVersions(crossValue)._2)
def repositoriesTask = T.task(super.repositoriesTask() ++ v.sonatypesSnapshots)
}

object cde extends CDE

trait CDE
extends millbuild.cde.common.CDEModule
extends millbuild.dependencies.cde.common.CDEModule
with RocketChipPublishModule
with ScalaModule {

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

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

object diplomacy extends mill.define.Cross[Diplomacy](v.chiselCrossVersions.keys.toSeq)

trait Diplomacy
extends millbuild.dependencies.diplomacy.common.DiplomacyModule
with RocketChipPublishModule
with Cross.Module[String] {

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

override def millSourcePath = os.pwd / "dependencies" / "diplomacy" / "diplomacy"

// dont use chisel from source
def chiselModule = Option.when(crossValue == "source")(chisel)
def chiselPluginJar = T(Option.when(crossValue == "source")(chisel.pluginModule.jar()))

// use chisel from ivy
def chiselIvy = Option.when(crossValue != "source")(v.chiselCrossVersions(crossValue)._1)
def chiselPluginIvy = Option.when(crossValue != "source")(v.chiselCrossVersions(crossValue)._2)

// use CDE from source until published to sonatype
def cdeModule = cde

def sourcecodeIvy = v.sourcecode
}

object rocketchip extends Cross[RocketChip](v.chiselCrossVersions.keys.toSeq)
Expand All @@ -73,23 +117,29 @@ trait RocketChip

override def millSourcePath = super.millSourcePath / os.up

def chiselModule = None
def chiselModule = Option.when(crossValue == "source")(chisel)

def chiselPluginJar = None
def chiselPluginJar = T(Option.when(crossValue == "source")(chisel.pluginModule.jar()))

def chiselIvy = Some(v.chiselCrossVersions(crossValue)._1)
def chiselIvy = Option.when(crossValue != "source")(v.chiselCrossVersions(crossValue)._1)

def chiselPluginIvy = Some(v.chiselCrossVersions(crossValue)._2)
def chiselPluginIvy = Option.when(crossValue != "source")(v.chiselCrossVersions(crossValue)._2)

def macrosModule = macros

def hardfloatModule = hardfloat(crossValue)

def cdeModule = cde

def diplomacyModule = diplomacy(crossValue)

def diplomacyIvy = None

def mainargsIvy = v.mainargs

def json4sJacksonIvy = v.json4sJackson

def repositoriesTask = T.task(super.repositoriesTask() ++ v.sonatypesSnapshots)
}

trait RocketChipPublishModule
Expand All @@ -108,7 +158,6 @@ trait RocketChipPublishModule
override def publishVersion: T[String] = T("1.6-SNAPSHOT")
}


// Tests
trait Emulator extends Cross.Module2[String, String] {
val top: String = crossValue
Expand Down Expand Up @@ -267,6 +316,7 @@ object emulator extends Cross[Emulator](
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultBufferlessConfig"),
// RocketSuiteC
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.TinyConfig"),

// Unittest
("freechips.rocketchip.unittest.TestHarness", "freechips.rocketchip.unittest.AMBAUnitTestConfig"),
("freechips.rocketchip.unittest.TestHarness", "freechips.rocketchip.unittest.TLSimpleUnitTestConfig"),
Expand Down Expand Up @@ -294,6 +344,9 @@ 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.DefaultBConfig"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32BConfig"),

)

object `runnable-riscv-test` extends mill.Cross[RiscvTest](
Expand Down Expand Up @@ -355,8 +408,8 @@ object `runnable-riscv-test` extends mill.Cross[RiscvTest](
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32Config", "rv32uc-v", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32Config", "rv32uf-p", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32Config", "rv32uf-v", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32Config", "rv32ui-p", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32Config", "rv32ui-v", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32Config", "rv32ui-p", "ma_data"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32Config", "rv32ui-v", "ma_data"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32Config", "rv32um-p", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32Config", "rv32um-v", "none"),

Expand All @@ -368,11 +421,17 @@ object `runnable-riscv-test` extends mill.Cross[RiscvTest](
// lsrc is not implemented if usingDataScratchpad
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.TinyConfig", "rv32ua-p", "lrsc"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.TinyConfig", "rv32uc-p", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.TinyConfig", "rv32ui-p", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.TinyConfig", "rv32ui-p", "ma_data"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.TinyConfig", "rv32um-p", "none"),

("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultFP16Config", "rv64uzfh-p", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultFP16Config", "rv64uzfh-v", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultBConfig", "rv64uzba-p", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultBConfig", "rv64uzbb-p", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultBConfig", "rv64uzbs-p", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32BConfig", "rv32uzba-p", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32BConfig", "rv32uzbb-p", "none"),
("freechips.rocketchip.system.TestHarness", "freechips.rocketchip.system.DefaultRV32BConfig", "rv32uzbs-p", "none"),
)

object `runnable-arch-test` extends mill.Cross[ArchTest](
Expand Down
7 changes: 3 additions & 4 deletions common.sc
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,18 @@ trait RocketChipModule
// should be hardfloat/common.sc#HardfloatModule
def hardfloatModule: ScalaModule

// should be cde/common.sc#CDEModule
def cdeModule: ScalaModule
def diplomacyModule: ScalaModule

def mainargsIvy: Dep

def json4sJacksonIvy: Dep

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

override def ivyDeps = T(
super.ivyDeps() ++ Agg(
mainargsIvy,
json4sJacksonIvy
json4sJacksonIvy,
)
)
}
Submodule cde updated from 000000 to 52768c
1 change: 1 addition & 0 deletions dependencies/chisel
Submodule chisel added at e3bcc9
1 change: 1 addition & 0 deletions dependencies/diplomacy
Submodule diplomacy added at edf375
2 changes: 1 addition & 1 deletion docs/src/diplomacy/adder_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ behavior of typical Chisel width inference.
```scala mdoc:invisible
import chipsalliance.rocketchip.config.{Config, Parameters}
import chisel3._
import chisel3.internal.sourceinfo.SourceInfo
import chisel3.experimental.SourceInfo
import chisel3.stage.ChiselStage
import chisel3.util.random.FibonacciLFSR
import freechips.rocketchip.diplomacy.{SimpleNodeImp, RenderedEdge, ValName, SourceNode,
Expand Down
30 changes: 24 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
mill
dtc
verilator cmake ninja
python3 python3Packages.bootstrapped-pip
python3
python3Packages.pip
pkgsCross.riscv64-embedded.buildPackages.gcc
pkgsCross.riscv64-embedded.buildPackages.gdb
openocd
Expand Down
4 changes: 2 additions & 2 deletions overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ final: prev: {
});
riscvTests = final.pkgsCross.riscv64-embedded.stdenv.mkDerivation rec {
pname = "riscv-tests";
version = "55bbcc8c06637a31cc01970881ba8072838a9121";
version = "f2f748ebb9cf8ea049103f85c4cbf7e8a2927b16";
src = final.fetchgit {
url = "https://github.com/riscv-software-src/riscv-tests.git";
rev = "${version}";
fetchSubmodules = true;
sha256 = "sha256-TcIU+WFQxPqAG7lvfKPgHm4CnBpTkosqe+fYOxS+J7I=";
sha256 = "sha256-E3RfrP+PFIYy9c/pY04jYPxeGpnfgWwjV8iwL5+s+9w=";
};

enableParallelBuilding = true;
Expand Down

This file was deleted.

Loading

0 comments on commit cff28b8

Please sign in to comment.