forked from OpenXiangShan/XiangShan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sc
128 lines (97 loc) · 3.57 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
/***************************************************************************************
* Copyright (c) 2020-2021 Institute of Computing Technology, Chinese Academy of Sciences
* Copyright (c) 2020-2021 Peng Cheng Laboratory
*
* XiangShan is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
*
* See the Mulan PSL v2 for more details.
***************************************************************************************/
import os.Path
import mill._
import scalalib._
import coursier.maven.MavenRepository
trait CommonModule extends ScalaModule {
override def scalaVersion = "2.12.10"
override def scalacOptions = Seq("-Xsource:2.11")
private val macroParadise = ivy"org.scalamacros:::paradise:2.1.0"
override def compileIvyDeps = Agg(macroParadise)
override def scalacPluginIvyDeps = Agg(macroParadise)
override def repositoriesTask = T.task {
super.repositoriesTask() ++ Seq(
MavenRepository("https://oss.sonatype.org/content/repositories/snapshots")
)
}
}
val chisel = Agg(
ivy"edu.berkeley.cs::chisel3:3.5-SNAPSHOT"
)
object `api-config-chipsalliance` extends CommonModule {
override def millSourcePath = super.millSourcePath / "design" / "craft"
}
object hardfloat extends SbtModule with CommonModule {
override def millSourcePath = os.pwd / "berkeley-hardfloat"
override def ivyDeps = super.ivyDeps() ++ chisel
}
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"
) ++ chisel
object macros extends SbtModule with CommonModule
override def moduleDeps = super.moduleDeps ++ Seq(
`api-config-chipsalliance`, macros, hardfloat
)
}
object huancun extends SbtModule with CommonModule {
override def ivyDeps = super.ivyDeps() ++ chisel
override def millSourcePath = super.millSourcePath
override def moduleDeps = super.moduleDeps ++ Seq(
`rocket-chip`
)
}
object chiseltest extends CommonModule with SbtModule {
override def ivyDeps = super.ivyDeps() ++ Agg(
ivy"edu.berkeley.cs::treadle:1.3.0",
ivy"org.scalatest::scalatest:3.2.0",
ivy"com.lihaoyi::utest:0.7.4"
) ++ chisel
object test extends Tests {
def ivyDeps = Agg(ivy"org.scalacheck::scalacheck:1.14.3")
def testFrameworks = Seq("org.scalatest.tools.Framework")
}
}
object difftest extends SbtModule with CommonModule {
override def millSourcePath = os.pwd / "difftest"
override def ivyDeps = super.ivyDeps() ++ chisel
}
object fudian extends CommonModule with SbtModule {
override def ivyDeps = super.ivyDeps() ++ chisel
}
object XiangShan extends CommonModule with SbtModule {
override def millSourcePath = millOuterCtx.millSourcePath
override def forkArgs = Seq("-Xmx64G", "-Xss256m")
override def ivyDeps = super.ivyDeps() ++ chisel
override def moduleDeps = super.moduleDeps ++ Seq(
`rocket-chip`,
chiseltest,
difftest,
huancun,
fudian
)
object test extends Tests {
override def forkArgs = Seq("-Xmx64G", "-Xss256m")
override def ivyDeps = super.ivyDeps() ++ Agg(
ivy"org.scalatest::scalatest:3.2.0"
)
def testFrameworks = Seq(
"org.scalatest.tools.Framework"
)
}
}