-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sc
187 lines (146 loc) · 5.5 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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: 2024 Jiuyang Liu <[email protected]>
import mill._
import mill.scalalib._
import mill.define.{Command, TaskModule}
import mill.scalalib.publish._
import mill.scalalib.scalafmt._
import mill.scalalib.TestModule.Utest
import mill.util.Jvm
import coursier.maven.MavenRepository
import $file.dependencies.chisel.build
import $file.dependencies.`chisel-interface`.common
import $file.common
object v {
val scala = "2.13.14"
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.3.1"
}
object chisel extends Chisel
trait Chisel extends millbuild.dependencies.chisel.build.Chisel {
def crossValue = v.scala
override def millSourcePath = os.pwd / "dependencies" / "chisel"
}
object axi4 extends AXI4
trait AXI4 extends millbuild.dependencies.`chisel-interface`.common.AXI4Module {
override def millSourcePath = os.pwd / "dependencies" / "chisel-interface" / "axi4"
def scalaVersion = v.scala
def mainargsIvy = v.mainargs
def chiselModule = Some(chisel)
def chiselPluginJar = T(Some(chisel.pluginModule.jar()))
def chiselIvy = None
def chiselPluginIvy = None
}
// API to be upstreamed to axi4
object regrouter extends millbuild.common.HasChisel with ScalafmtModule {
def scalaVersion = T(v.scala)
override def moduleDeps = super.moduleDeps ++ Seq(axi4)
def chiselModule = Some(chisel)
def chiselPluginJar = T(Some(chisel.pluginModule.jar()))
def chiselIvy = None
def chiselPluginIvy = None
}
object dwbb extends DWBB
trait DWBB extends millbuild.dependencies.`chisel-interface`.common.DWBBModule {
override def millSourcePath = os.pwd / "dependencies" / "chisel-interface" / "dwbb"
def scalaVersion = v.scala
def mainargsIvy = v.mainargs
def chiselModule = Some(chisel)
def chiselPluginJar = T(Some(chisel.pluginModule.jar()))
def chiselIvy = None
def chiselPluginIvy = None
}
/** [[https://github.com/riscv/riscv-aclint]] */
object aclint extends ACLINT
trait ACLINT extends millbuild.common.ACLINTModule with ScalafmtModule {
def scalaVersion = T(v.scala)
def axi4Module: ScalaModule = axi4
def dwbbModule: ScalaModule = dwbb
def chiselModule = Some(chisel)
def chiselPluginJar = T(Some(chisel.pluginModule.jar()))
def chiselIvy = None
def chiselPluginIvy = None
override def moduleDeps = super.moduleDeps ++ Seq(regrouter)
}
/** [[https://github.com/riscv/riscv-plic-spec]] */
object plic extends PLIC
trait PLIC extends millbuild.common.PLICModule with ScalafmtModule {
def scalaVersion = T(v.scala)
def axi4Module: ScalaModule = axi4
def dwbbModule: ScalaModule = dwbb
def chiselModule = Some(chisel)
def chiselPluginJar = T(Some(chisel.pluginModule.jar()))
def chiselIvy = None
def chiselPluginIvy = None
override def moduleDeps = super.moduleDeps ++ Seq(regrouter)
}
/** [[https://github.com/riscv/riscv-debug-spec]] */
object dm extends DM
trait DM extends millbuild.common.DMModule with ScalafmtModule {
def scalaVersion = T(v.scala)
def axi4Module: ScalaModule = axi4
def dwbbModule: ScalaModule = dwbb
def chiselModule = Some(chisel)
def chiselPluginJar = T(Some(chisel.pluginModule.jar()))
def chiselIvy = None
def chiselPluginIvy = None
override def moduleDeps = super.moduleDeps ++ Seq(regrouter)
}
/** [[https://github.com/riscv/riscv-fast-interrupt]] */
object clic extends CLIC
trait CLIC extends millbuild.common.CLICModule with ScalafmtModule {
def scalaVersion = T(v.scala)
def axi4Module: ScalaModule = axi4
def dwbbModule: ScalaModule = dwbb
def chiselModule = Some(chisel)
def chiselPluginJar = T(Some(chisel.pluginModule.jar()))
def chiselIvy = None
def chiselPluginIvy = None
override def moduleDeps = super.moduleDeps ++ Seq(regrouter)
}
/** [[https://github.com/riscv/riscv-aia]] */
object aia extends AIA
trait AIA extends millbuild.common.AIAModule with ScalafmtModule {
def scalaVersion = T(v.scala)
def axi4Module: ScalaModule = axi4
def dwbbModule: ScalaModule = dwbb
def chiselModule = Some(chisel)
def chiselPluginJar = T(Some(chisel.pluginModule.jar()))
def chiselIvy = None
def chiselPluginIvy = None
override def moduleDeps = super.moduleDeps ++ Seq(regrouter)
}
/** [[https://github.com/riscv/riscv-aia]] */
object iommu extends IOMMU
trait IOMMU extends millbuild.common.IOMMUModule with ScalafmtModule {
def scalaVersion = T(v.scala)
def axi4Module: ScalaModule = axi4
def dwbbModule: ScalaModule = dwbb
def chiselModule = Some(chisel)
def chiselPluginJar = T(Some(chisel.pluginModule.jar()))
def chiselIvy = None
def chiselPluginIvy = None
override def moduleDeps = super.moduleDeps ++ Seq(regrouter)
}
object elaborator extends Elaborator
trait Elaborator extends millbuild.common.ElaboratorModule with ScalafmtModule {
def scalaVersion = T(v.scala)
def panamaconverterModule = panamaconverter
def circtInstallPath =
T.input(PathRef(os.Path(T.ctx().env("CIRCT_INSTALL_PATH"))))
def generators = Seq(aclint, plic, dm, clic, aia, iommu)
def mainargsIvy = v.mainargs
def chiselModule = Some(chisel)
def chiselPluginJar = T(Some(chisel.pluginModule.jar()))
def chiselPluginIvy = None
def chiselIvy = None
override def moduleDeps = super.moduleDeps ++ Seq(regrouter)
}
object panamaconverter extends PanamaConverter
trait PanamaConverter extends millbuild.dependencies.chisel.build.PanamaConverter {
def crossValue = v.scala
override def millSourcePath =
os.pwd / "dependencies" / "chisel" / "panamaconverter"
def scalaVersion = T(v.scala)
}