mirror of
https://github.com/SpinalHDL/SpinalTemplateSbt.git
synced 2025-10-22 23:58:44 +08:00
Merge pull request #10 from typingArtist/sbt-mill-unification
Sbt mill unification
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -20,6 +20,9 @@ project/plugins/project/
|
|||||||
.idea
|
.idea
|
||||||
out
|
out
|
||||||
|
|
||||||
|
# Metals
|
||||||
|
.metals
|
||||||
|
|
||||||
# Eclipse
|
# Eclipse
|
||||||
bin/
|
bin/
|
||||||
.classpath
|
.classpath
|
||||||
|
1
.mill-version
Normal file
1
.mill-version
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0.9.8
|
28
README.md
28
README.md
@@ -109,3 +109,31 @@ And do the following :
|
|||||||
|
|
||||||
Normally, this must generate output file ```MyTopLevel.v```.
|
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
|
||||||
|
20
build.sbt
20
build.sbt
@@ -1,12 +1,16 @@
|
|||||||
name := "SpinalTemplateSbt"
|
ThisBuild / version := "1.0"
|
||||||
version := "1.0"
|
ThisBuild / scalaVersion := "2.11.12"
|
||||||
scalaVersion := "2.11.12"
|
ThisBuild / organization := "org.example"
|
||||||
val spinalVersion = "1.4.3"
|
|
||||||
|
|
||||||
libraryDependencies ++= Seq(
|
val spinalVersion = "1.4.3"
|
||||||
"com.github.spinalhdl" % "spinalhdl-core_2.11" % spinalVersion,
|
val spinalCore = "com.github.spinalhdl" %% "spinalhdl-core" % spinalVersion
|
||||||
"com.github.spinalhdl" % "spinalhdl-lib_2.11" % spinalVersion,
|
val spinalLib = "com.github.spinalhdl" %% "spinalhdl-lib" % spinalVersion
|
||||||
compilerPlugin("com.github.spinalhdl" % "spinalhdl-idsl-plugin_2.11" % 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
|
fork := true
|
||||||
|
13
build.sc
Normal file
13
build.sc
Normal file
@@ -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")
|
||||||
|
}
|
@@ -1 +1 @@
|
|||||||
sbt.version=1.3.13
|
sbt.version=1.4.7
|
||||||
|
Reference in New Issue
Block a user