-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sc
More file actions
124 lines (85 loc) · 3.51 KB
/
build.sc
File metadata and controls
124 lines (85 loc) · 3.51 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import mill._
import scalalib._
import scalafmt._
import publish._
import $file.common
import $file.`rocket-chip`.common
import $file.`rocket-chip`.cde.common
import $file.`rocket-chip`.hardfloat.common
import $file.`coupledL2`.HuanCun.common
import $file.`coupledL2`.common
val projectRoot = os.pwd
val depsRoot = projectRoot / "coupledL2"
val defaultScalaVersion = "2.13.15"
def defaultVersions = Map(
"chisel" -> ivy"org.chipsalliance::chisel:6.7.0",
"chisel-plugin" -> ivy"org.chipsalliance:::chisel-plugin:6.7.0",
"chiseltest" -> ivy"edu.berkeley.cs::chiseltest:6.0.0"
)
trait HasChisel extends ScalaModule {
def chiselModule: Option[ScalaModule] = None
def chiselPluginJar: T[Option[PathRef]] = None
def chiselIvy: Option[Dep] = Some(defaultVersions("chisel"))
def chiselPluginIvy: Option[Dep] = Some(defaultVersions("chisel-plugin"))
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 `rocket-chip`.common.RocketChipModule with HasChisel {
val rcPath = millOuterCtx.millSourcePath / "rocket-chip"
override def millSourcePath = rcPath
def mainargsIvy = ivy"com.lihaoyi::mainargs:0.7.0"
def json4sJacksonIvy = ivy"org.json4s::json4s-jackson:4.0.7"
object macros extends `rocket-chip`.common.MacrosModule with HasChisel {
def scalaReflectIvy = ivy"org.scala-lang:scala-reflect:${scalaVersion}"
}
object cde extends `rocket-chip`.cde.common.CDEModule with HasChisel {
override def millSourcePath = rcPath / "cde" / "cde"
}
object hardfloat extends `rocket-chip`.hardfloat.common.HardfloatModule with HasChisel {
override def millSourcePath = rcPath / "hardfloat" / "hardfloat"
}
def macrosModule = macros
def hardfloatModule = hardfloat
def cdeModule = cde
}
object utility extends SbtModule with HasChisel {
override def millSourcePath = millOuterCtx.millSourcePath / "utility"
override def moduleDeps = super.moduleDeps ++ Seq(rocketchip)
}
object huancun extends SbtModule with HasChisel {
override def millSourcePath = millOuterCtx.millSourcePath / "coupledL2" / "HuanCun"
override def moduleDeps = super.moduleDeps ++ Seq(
rocketchip, utility
)
}
object CoupledL2 extends SbtModule with HasChisel
with coupledL2.common.CoupledL2Module {
override def millSourcePath = millOuterCtx.millSourcePath / "coupledL2"
def rocketModule = rocketchip
def utilityModule = utility
def huancunModule = huancun
object test extends SbtTests with TestModule.ScalaTest {
override def ivyDeps = super.ivyDeps() ++ Agg(
defaultVersions("chiseltest"),
)
}
}
object difftest extends SbtModule with HasChisel {
override def millSourcePath = millOuterCtx.millSourcePath / "difftest"
}
object CUTE extends SbtModule with HasChisel with $file.common.CUTEModule {
override def millSourcePath = millOuterCtx.millSourcePath
def rocketModule: ScalaModule = rocketchip
def utilityModule: ScalaModule = utility
def coupledL2Module: ScalaModule = CoupledL2
def difftestModule: ScalaModule = difftest
object test extends SbtTests with TestModule.ScalaTest {
override def ivyDeps = super.ivyDeps() ++ Agg(
defaultVersions("chiseltest"),
)
}
override def scalacOptions = super.scalacOptions() ++ Agg("-deprecation", "-feature")
}