-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.sc
87 lines (75 loc) · 3.31 KB
/
build.sc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import mill._
import scalalib._
import $file.`rocket-chip`.dependencies.hardfloat.{common => hardfloatCommon}
import $file.`rocket-chip`.dependencies.cde.{common => cdeCommon}
import $file.`rocket-chip`.dependencies.diplomacy.{common => diplomacyCommon}
import $file.`rocket-chip`.{common => rocketChipCommon}
val chiselVersion = "7.0.0-M2"
val defaultScalaVersion = "2.13.14"
val pwd = os.Path(sys.env("MILL_WORKSPACE_ROOT"))
object v {
def chiselIvy: Option[Dep] = Some(ivy"org.chipsalliance::chisel:${chiselVersion}")
def chiselPluginIvy: Option[Dep] = Some(ivy"org.chipsalliance:::chisel-plugin:${chiselVersion}")
}
trait HasThisChisel extends SbtModule {
def chiselModule: Option[ScalaModule] = None
def chiselPluginJar: T[Option[PathRef]] = None
def chiselIvy: Option[Dep] = v.chiselIvy
def chiselPluginIvy: Option[Dep] = v.chiselPluginIvy
override def scalaVersion = defaultScalaVersion
override def scalacOptions = super.scalacOptions() ++
Agg("-language:reflectiveCalls", "-Ymacro-annotations", "-Ytasty-reader")
override def ivyDeps = super.ivyDeps() ++ Agg(chiselIvy.get)
override def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ Agg(chiselPluginIvy.get)
}
object rocketchip extends RocketChip
trait RocketChip extends rocketChipCommon.RocketChipModule with HasThisChisel {
override def scalaVersion: T[String] = T(defaultScalaVersion)
override def millSourcePath = pwd / "rocket-chip"
def dependencyPath = pwd / "rocket-chip" / "dependencies"
def macrosModule = macros
def hardfloatModule = hardfloat
def cdeModule = cde
def diplomacyModule = diplomacy
def diplomacyIvy = None
def mainargsIvy = ivy"com.lihaoyi::mainargs:0.5.4"
def json4sJacksonIvy = ivy"org.json4s::json4s-jackson:4.0.6"
object macros extends Macros
trait Macros extends rocketChipCommon.MacrosModule with SbtModule {
def scalaVersion: T[String] = T(defaultScalaVersion)
def scalaReflectIvy = ivy"org.scala-lang:scala-reflect:${defaultScalaVersion}"
}
object hardfloat extends Hardfloat
trait Hardfloat extends hardfloatCommon.HardfloatModule with HasThisChisel {
override def scalaVersion: T[String] = T(defaultScalaVersion)
override def millSourcePath = dependencyPath / "hardfloat" / "hardfloat"
}
object cde extends CDE
trait CDE extends cdeCommon.CDEModule with ScalaModule {
def scalaVersion: T[String] = T(defaultScalaVersion)
override def millSourcePath = dependencyPath / "cde" / "cde"
}
object diplomacy extends Diplomacy
trait Diplomacy extends diplomacyCommon.DiplomacyModule with ScalaModule {
def scalaVersion: T[String] = T(defaultScalaVersion)
override def millSourcePath = dependencyPath / "diplomacy" / "diplomacy"
def chiselModule: Option[ScalaModule] = None
def chiselPluginJar: T[Option[PathRef]] = None
def chiselIvy: Option[Dep] = v.chiselIvy
def chiselPluginIvy: Option[Dep] = v.chiselPluginIvy
def cdeModule = cde
def sourcecodeIvy = ivy"com.lihaoyi::sourcecode:0.3.1"
}
}
trait ysyxSoCModule extends ScalaModule {
def rocketModule: ScalaModule
override def moduleDeps = super.moduleDeps ++ Seq(
rocketModule,
)
}
object ysyxsoc extends ysyxSoC
trait ysyxSoC extends ysyxSoCModule with HasThisChisel {
override def millSourcePath = pwd
override def sources = Task.Sources(millSourcePath / "src")
def rocketModule = rocketchip
}