-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.sc
69 lines (51 loc) · 1.67 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
import mill._
import scalalib._
import scalafmt._
val defaultVersions = Map(
"chisel3" -> "3.6.0",
"chisel3-plugin" -> "3.6.0",
"chiseltest" -> "0.3.2",
"scala" -> "2.13.10",
"scalatest" -> "3.2.7"
)
def getVersion(dep: String, org: String = "edu.berkeley.cs", cross: Boolean = false) = {
val version = sys.env.getOrElse(dep + "Version", defaultVersions(dep))
if (cross)
ivy"$org:::$dep:$version"
else
ivy"$org::$dep:$version"
}
trait CommonModule extends ScalaModule {
override def scalaVersion = defaultVersions("scala")
}
object `rocket-chip` extends SbtModule with CommonModule {
override def ivyDeps = super.ivyDeps() ++ Agg(
ivy"${scalaOrganization()}:scala-reflect:${scalaVersion()}",
ivy"org.json4s::json4s-jackson:3.6.1",
getVersion("chisel3"),
)
object macros extends SbtModule with CommonModule
object cde extends CommonModule {
override def millSourcePath = super.millSourcePath / "cde" / "cde"
}
object hardfloat extends SbtModule with CommonModule {
override def ivyDeps = super.ivyDeps() ++ Agg(getVersion("chisel3"))
}
override def moduleDeps = super.moduleDeps ++ Seq(
cde, macros, hardfloat
)
}
object utility extends SbtModule with ScalafmtModule with CommonModule {
override def millSourcePath = millOuterCtx.millSourcePath
override def ivyDeps = super.ivyDeps() ++ Agg(
getVersion("chisel3"),
getVersion("chiseltest"),
)
override def moduleDeps = super.moduleDeps ++ Seq(`rocket-chip`)
object test extends Tests {
override def ivyDeps = super.ivyDeps() ++ Agg(
getVersion("scalatest","org.scalatest")
)
def testFrameworks = Seq("org.scalatest.tools.Framework")
}
}