-
Notifications
You must be signed in to change notification settings - Fork 31
/
build.sc
88 lines (76 loc) · 3.33 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
88
import mill._
import scalalib._
import $file.`rocket-chip`.dependencies.hardfloat.common
import $file.`rocket-chip`.dependencies.cde.common
import $file.`rocket-chip`.dependencies.diplomacy.common
import $file.`rocket-chip`.common
val chiselVersion = "7.0.0-M1"
val defaultScalaVersion = "2.13.10"
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 millbuild.`rocket-chip`.common.RocketChipModule with HasThisChisel {
def scalaVersion: T[String] = T(defaultScalaVersion)
override def millSourcePath = os.pwd / "rocket-chip"
def dependencyPath = millSourcePath / "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 millbuild.`rocket-chip`.common.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 millbuild.`rocket-chip`.dependencies.hardfloat.common.HardfloatModule with HasThisChisel {
def scalaVersion: T[String] = T(defaultScalaVersion)
override def millSourcePath = dependencyPath / "hardfloat" / "hardfloat"
}
object cde extends CDE
trait CDE extends millbuild.`rocket-chip`.dependencies.cde.common.CDEModule with ScalaModule {
def scalaVersion: T[String] = T(defaultScalaVersion)
override def millSourcePath = dependencyPath / "cde" / "cde"
}
object diplomacy extends Diplomacy
trait Diplomacy extends millbuild.`rocket-chip`.dependencies.diplomacy.common.DiplomacyModule {
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 = os.pwd
def rocketModule = rocketchip
override def sources = T.sources {
super.sources() ++ Seq(PathRef(millSourcePath / "src"))
}
}