-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Bohan Hu
committed
Nov 30, 2020
1 parent
a3af963
commit 8c57119
Showing
4 changed files
with
90 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
verilog: | ||
mill chiselModule.runMain sim.SimTop --output-file SimTop.v | ||
copy: verilog | ||
cat SimTop.v > ../Sim_Workspace/verilog/top.v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import mill._, scalalib._ | ||
import coursier.maven.MavenRepository | ||
|
||
object CustomZincWorkerModule extends ZincWorkerModule { | ||
def repositories() = super.repositories ++ Seq( | ||
MavenRepository("https://oss.sonatype.org/content/repositories/releases"), | ||
MavenRepository("https://oss.sonatype.org/content/repositories/snapshots") | ||
) | ||
} | ||
|
||
/** | ||
* Scala 2.12 module that is source-compatible with 2.11. | ||
* This is due to Chisel's use of structural types. See | ||
* https://github.com/freechipsproject/chisel3/issues/606 | ||
*/ | ||
trait HasXsource211 extends ScalaModule { | ||
override def scalacOptions = T { | ||
super.scalacOptions() ++ Seq( | ||
"-deprecation", | ||
"-unchecked", | ||
"-Xsource:2.11" | ||
) | ||
} | ||
} | ||
|
||
trait HasChisel3 extends ScalaModule { | ||
override def ivyDeps = Agg( | ||
ivy"edu.berkeley.cs::chisel3:3.3.2" | ||
) | ||
} | ||
|
||
trait HasChiselTests extends CrossSbtModule { | ||
object test extends Tests { | ||
override def ivyDeps = Agg(ivy"org.scalatest::scalatest:3.0.4", ivy"edu.berkeley.cs::chisel-iotesters:1.2+") | ||
def testFrameworks = Seq("org.scalatest.tools.Framework") | ||
} | ||
} | ||
|
||
trait HasMacroParadise extends ScalaModule { | ||
// Enable macro paradise for @chiselName et al | ||
val macroPlugins = Agg(ivy"org.scalamacros:::paradise:2.1.0") | ||
def scalacPluginIvyDeps = macroPlugins | ||
def compileIvyDeps = macroPlugins | ||
} | ||
|
||
object chiselModule extends CrossSbtModule with HasChisel3 with HasChiselTests with HasXsource211 with HasMacroParadise { | ||
def zincWorker = CustomZincWorkerModule | ||
def crossScalaVersion = "2.11.12" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters