From 131c6e7654cbea8cf4617a0ed260eab14e1b47cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20W=C3=A4chter?= Date: Mon, 14 Jun 2021 06:59:20 +0200 Subject: [PATCH 1/5] bump sbt (1.5.3) and Scala (2.12.14) --- build.sbt | 8 ++++---- project/build.properties | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index 8128915..df03737 100644 --- a/build.sbt +++ b/build.sbt @@ -1,12 +1,12 @@ name := "SpinalTemplateSbt" version := "1.0" -scalaVersion := "2.11.12" +scalaVersion := "2.12.14" val spinalVersion = "1.4.3" libraryDependencies ++= Seq( - "com.github.spinalhdl" % "spinalhdl-core_2.11" % spinalVersion, - "com.github.spinalhdl" % "spinalhdl-lib_2.11" % spinalVersion, - compilerPlugin("com.github.spinalhdl" % "spinalhdl-idsl-plugin_2.11" % spinalVersion) + "com.github.spinalhdl" %% "spinalhdl-core" % spinalVersion, + "com.github.spinalhdl" %% "spinalhdl-lib" % spinalVersion, + compilerPlugin("com.github.spinalhdl" %% "spinalhdl-idsl-plugin" % spinalVersion) ) fork := true diff --git a/project/build.properties b/project/build.properties index 0837f7a..67d27a1 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.3.13 +sbt.version=1.5.3 From 08d79c6134528a93662b91c4a11006715dca87a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20W=C3=A4chter?= Date: Mon, 14 Jun 2021 07:03:42 +0200 Subject: [PATCH 2/5] Add gitignore for metals --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index a9701de..5ca560e 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,9 @@ project/plugins/project/ .idea out +# Metals +.metals + # Eclipse bin/ .classpath From bb5f15798eafc8b318fd1832f718e9ed6517ccd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20W=C3=A4chter?= Date: Mon, 14 Jun 2021 07:29:01 +0200 Subject: [PATCH 3/5] restructure build.sbt according to latest sbt docs --- build.sbt | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/build.sbt b/build.sbt index df03737..8ef2c55 100644 --- a/build.sbt +++ b/build.sbt @@ -1,12 +1,16 @@ -name := "SpinalTemplateSbt" -version := "1.0" -scalaVersion := "2.12.14" -val spinalVersion = "1.4.3" +ThisBuild / version := "1.0" +ThisBuild / scalaVersion := "2.12.14" +ThisBuild / organization := "org.example" -libraryDependencies ++= Seq( - "com.github.spinalhdl" %% "spinalhdl-core" % spinalVersion, - "com.github.spinalhdl" %% "spinalhdl-lib" % spinalVersion, - compilerPlugin("com.github.spinalhdl" %% "spinalhdl-idsl-plugin" % spinalVersion) -) +val spinalVersion = "1.4.3" +val spinalCore = "com.github.spinalhdl" %% "spinalhdl-core" % spinalVersion +val spinalLib = "com.github.spinalhdl" %% "spinalhdl-lib" % spinalVersion +val spinalIdslPlugin = compilerPlugin("com.github.spinalhdl" %% "spinalhdl-idsl-plugin" % spinalVersion) + +lazy val mylib = (project in file(".")) + .settings( + name := "SpinalTemplateSbt", + libraryDependencies ++= Seq(spinalCore, spinalLib, spinalIdslPlugin) + ) fork := true From 9b3093e19382ba4486e2abb2d282606f50db4287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20W=C3=A4chter?= Date: Mon, 14 Jun 2021 08:35:22 +0200 Subject: [PATCH 4/5] add support for Mill --- .mill-version | 1 + README.md | 30 +++++++++++++++++++++++++++++- build.sc | 13 +++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 .mill-version create mode 100644 build.sc diff --git a/.mill-version b/.mill-version new file mode 100644 index 0000000..e3e1807 --- /dev/null +++ b/.mill-version @@ -0,0 +1 @@ +0.9.8 diff --git a/README.md b/README.md index 58629f0..931686a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repository is a base SBT project added to help non Scala/SBT native people Just one important note, you need a java JDK >= 8 -On debian : +On debian : ```sh sudo add-apt-repository -y ppa:openjdk-r/ppa @@ -109,3 +109,31 @@ And do the following : Normally, this must generate output file ```MyTopLevel.v```. +## Mill Support (Experimental) + +This Spinal Base Project contains support for the [Mill build tool](https://com-lihaoyi.github.io/mill). + +The prerequisites are the same as for using SBT, except for sbt itself. Additionally, the ```mill``` executable needs to be installed on the path. Download it to ```/usr/local/bin/mill``` or ```~/bin/mill``` according to the [installation instructions](https://com-lihaoyi.github.io/mill/mill/Intro_to_Mill.html#_installation). + +You can clone and use this repository in the following way. + +```sh +git clone https://github.com/SpinalHDL/SpinalTemplateSbt.git +``` + +Open a terminal in the root of it and execute your favorite mill command. At the first execution, the process could take some seconds + +```sh +cd SpinalTemplateSbt + +//If you want to generate the Verilog of your design +mill mylib.runMain mylib.MyTopLevelVerilog + +//If you want to generate the VHDL of your design +mill mylib.runMain mylib.MyTopLevelVhdl + +//If you want to run the scala written testbench +mill mylib.runMain mylib.MyTopLevelSim +``` + +The top level spinal code is defined into src\main\scala\mylib diff --git a/build.sc b/build.sc new file mode 100644 index 0000000..55c2fa3 --- /dev/null +++ b/build.sc @@ -0,0 +1,13 @@ +import mill._, scalalib._ + +val spinalVersion = "1.4.3" + +object mylib extends SbtModule { + def scalaVersion = "2.12.14" + override def millSourcePath = os.pwd + def ivyDeps = Agg( + ivy"com.github.spinalhdl::spinalhdl-core:$spinalVersion", + ivy"com.github.spinalhdl::spinalhdl-lib:$spinalVersion" + ) + def scalacPluginIvyDeps = Agg(ivy"com.github.spinalhdl::spinalhdl-idsl-plugin:$spinalVersion") +} From ef4d9b7db3850b8a83b6ff01ee270413b093e042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20W=C3=A4chter?= Date: Mon, 14 Jun 2021 17:05:43 +0200 Subject: [PATCH 5/5] reverted Scala to 2.11.12 and sbt to 1.4.7 --- build.sbt | 2 +- project/build.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 8ef2c55..31d0f72 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,5 @@ ThisBuild / version := "1.0" -ThisBuild / scalaVersion := "2.12.14" +ThisBuild / scalaVersion := "2.11.12" ThisBuild / organization := "org.example" val spinalVersion = "1.4.3" diff --git a/project/build.properties b/project/build.properties index 67d27a1..0b2e09c 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.5.3 +sbt.version=1.4.7