-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sc
99 lines (81 loc) · 3.12 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
import os.Path
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.difftest.build
trait HasChisel
extends ScalaModule {
// Define these for building chisel from source
def chiselModule: Option[ScalaModule]
override def moduleDeps = super.moduleDeps ++ chiselModule
def chiselPluginJar: T[Option[PathRef]]
override def scalacOptions = T(
super.scalacOptions() ++ chiselPluginJar().map(path => s"-Xplugin:${path.path}") ++ Seq(
"-Ymacro-annotations",
"-deprecation",
"-feature",
"-language:reflectiveCalls",
"-language:existentials",
"-language:implicitConversions",
"-Xcheckinit"
)
)
override def scalacPluginClasspath: T[Agg[PathRef]] = T(super.scalacPluginClasspath() ++ chiselPluginJar())
// Define these for building chisel from ivy
def chiselIvy: Option[Dep]
override def ivyDeps = T(super.ivyDeps() ++ chiselIvy)
def chiselPluginIvy: Option[Dep]
override def scalacPluginIvyDeps: T[Agg[Dep]] = T(super.scalacPluginIvyDeps() ++ chiselPluginIvy.map(Agg(_)).getOrElse(Agg.empty[Dep]))
}
// Build form source only for dev
object chisel extends Chisel
trait Chisel
extends millbuild.dependencies.chisel.build.Chisel {
def crossValue = "2.13.15"
override def millSourcePath = os.pwd / "dependencies" / "chisel"
def scalaVersion = T("2.13.15")
}
//66bab812796eb5a5c0bbe3308ee01fc6752557eb (chisel-nix)
trait MyModule extends ScalaModule with HasChisel{
def scalaVersion = "2.13.15"
def chiselModule = Some(chisel)
def chiselPluginJar = T(Some(chisel.pluginModule.jar()))
def chiselIvy = None
def chiselPluginIvy = None
def repositoriesTask = T.task { Seq(
coursier.MavenRepository("https://repo.scala-sbt.org/scalasbt/maven-releases"),
coursier.MavenRepository("https://oss.sonatype.org/content/repositories/releases"),
coursier.MavenRepository("https://oss.sonatype.org/content/repositories/snapshots"),
) ++ super.repositoriesTask() }
def ivyDeps = Agg(
ivy"com.lihaoyi::mainargs:0.5.0",
ivy"com.lihaoyi::upickle:3.3.1",
ivy"com.lihaoyi::geny:1.1.1",
ivy"com.lihaoyi::os-lib:0.9.1"
)
def sources = super.sources() ++ Seq(PathRef(os.pwd / "dependencies" / "rvdecoderdb" / "rvdecoderdb"))
}
//xiangshan difftest
object difftest extends millbuild.dependencies.difftest.build.CommonDiffTest {
def crossValue: String = "chisel"
override def millSourcePath = os.pwd / "dependencies" /"difftest"
}
object rtl extends MyModule {
}
object elaborateRTL extends MyModule {
override def millSourcePath = os.pwd / "elaborate" / "elaborateRTL"
def moduleDeps = Seq(rtl)
}
object tb extends MyModule {
override def millSourcePath: Path = os.pwd / "tb" / "chisel-tb"
def moduleDeps = super.moduleDeps ++ Seq(rtl)
}
object elaborateTB extends MyModule {
override def millSourcePath: Path = os.pwd / "elaborate" / "elaborateTB"
def moduleDeps = super.moduleDeps ++ Seq(tb) ++ Seq(rtl) ++ Seq(elaborateRTL)
}