From d4a55ffdfea6f5d0d23730ac891b771d2f2f6aab Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Mon, 10 Feb 2020 23:42:36 -0500 Subject: [PATCH 1/2] Add support for mill Signed-off-by: Edward Wang --- build.sc | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 build.sc diff --git a/build.sc b/build.sc new file mode 100644 index 0000000..f6460a5 --- /dev/null +++ b/build.sc @@ -0,0 +1,51 @@ +// Works with mill 0.6.0 +import mill._, scalalib._ +import coursier.MavenRepository + +/** + * 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.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+", + ivy"edu.berkeley.cs::chiseltest:0.2-SNAPSHOT" + ) + def repositories = super.repositories ++ Seq( + MavenRepository("https://oss.sonatype.org/content/repositories/snapshots") + ) + 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 chiselwatt extends CrossSbtModule with HasChisel3 with HasChiselTests with HasXsource211 with HasMacroParadise { + override def millSourcePath = super.millSourcePath + def crossScalaVersion = "2.12.10" +} + From db7736a92bdf28085ba1bdecd1f6b109effd4bc1 Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Mon, 10 Feb 2020 23:42:56 -0500 Subject: [PATCH 2/2] Add test_run_dir to gitignore Signed-off-by: Edward Wang --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6b7cd73..9ad7f61 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ project/ target/ obj_dir/ out/ +test_run_dir/ *.anno.json *.fir *.vcd