62 lines
2.1 KiB
Scala
62 lines
2.1 KiB
Scala
// See README.md for license details.
|
|
|
|
ThisBuild / scalaVersion := "2.13.10"
|
|
ThisBuild / version := "0.1.0"
|
|
ThisBuild / organization := "%ORGANIZATION%"
|
|
|
|
val chiselVersion = "3.5.6"
|
|
|
|
lazy val commonSettings = Seq(
|
|
// organization := "edu.berkeley.cs",
|
|
// version := "1.6",
|
|
assembly / assemblyMergeStrategy := { _ match {
|
|
case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
|
|
case _ => MergeStrategy.first}},
|
|
scalacOptions ++= Seq(
|
|
"-deprecation",
|
|
"-unchecked",
|
|
"-Ymacro-annotations"), // fix hierarchy API
|
|
)
|
|
|
|
lazy val chiselSettings = Seq(
|
|
libraryDependencies ++= Seq("edu.berkeley.cs" %% "chisel3" % chiselVersion,
|
|
"org.apache.commons" % "commons-lang3" % "3.12.0",
|
|
"org.apache.commons" % "commons-text" % "1.9"),
|
|
addCompilerPlugin("edu.berkeley.cs" % "chisel3-plugin" % chiselVersion cross CrossVersion.full))
|
|
|
|
/**
|
|
* It has been a struggle for us to override settings in subprojects.
|
|
* An example would be adding a dependency to rocketchip on midas's targetutils library,
|
|
* or replacing dsptools's maven dependency on chisel with the local chisel project.
|
|
*
|
|
* This function works around this by specifying the project's root at src/ and overriding
|
|
* scalaSource and resourceDirectory.
|
|
*/
|
|
def freshProject(name: String, dir: File): Project = {
|
|
Project(id = name, base = dir / "src")
|
|
.settings(
|
|
Compile / scalaSource := baseDirectory.value / "main" / "scala",
|
|
Compile / resourceDirectory := baseDirectory.value / "main" / "resources"
|
|
)
|
|
}
|
|
|
|
|
|
|
|
lazy val root = (project in file("."))
|
|
.settings(
|
|
name := "%NAME%",
|
|
libraryDependencies ++= Seq(
|
|
"edu.berkeley.cs" %% "chisel3" % chiselVersion,
|
|
"edu.berkeley.cs" %% "chiseltest" % "0.5.4" % "test"
|
|
),
|
|
scalacOptions ++= Seq(
|
|
"-language:reflectiveCalls",
|
|
"-deprecation",
|
|
"-feature",
|
|
"-Xcheckinit",
|
|
"-P:chiselplugin:genBundleElements",
|
|
),
|
|
addCompilerPlugin("edu.berkeley.cs" % "chisel3-plugin" % chiselVersion cross CrossVersion.full),
|
|
)
|
|
|