33 Commits

Author SHA1 Message Date
Dolu1990
8e8b22f6ec SpinalHDL 1.7.3 2022-09-19 13:29:58 +02:00
Dolu1990
4570b17a29 Merge pull request #17 from numero-744/patch-2
Update scala version to latest maintenance release
2022-08-03 10:23:32 +02:00
Dolu1990
a9de93a481 Update build.sbt 2022-08-03 10:23:18 +02:00
Côme
310df743af Update scala version to latest maintenance release
https://www.scala-lang.org/download/2.12.16.html
2022-07-27 09:52:35 +02:00
Dolu1990
599a1e6daf SpinalHDL 1.7.1 2022-07-11 12:29:06 +02:00
Dolu1990
23f8152f1f Merge pull request #14 from numero-744/patch-1
Update sbt
2022-05-25 10:56:26 +02:00
Côme
3a93d0fe88 Update sbt
The previously chosen version of SBT does not work with JDK18.
2022-05-25 10:27:00 +02:00
Dolu1990
e2c55528af SpinalHDL 1.7.0a 2022-05-09 11:32:08 +02:00
Charles Papon
993e66c242 Update mill spinalhdl version 2022-05-05 10:54:40 +02:00
Dolu1990
1e8a644b8a Add formal comment 2022-04-29 15:26:32 +02:00
Dolu1990
df28313eea SpinalHDL 1.7.0 + formal example 2022-04-29 15:18:33 +02:00
Dolu1990
181684644c SpinalHDL 1.6.4 2022-02-16 14:27:15 +01:00
Dolu1990
884c4a7ca6 SpinalHDL 1.6.2 2022-02-05 12:09:54 +01:00
Dolu1990
16cca3e7ca Merge pull request #11 from name1e5s/master
SpinalHDL 1.6.0
2021-10-13 19:10:32 +01:00
name1e5s
2e50a23fcc SpinalHDL 1.6.0 2021-07-16 20:10:07 +08:00
Dolu1990
5502e4f7f6 update readme 2021-07-09 09:42:47 +02:00
Dolu1990
666dcbba79 SpinalHDL 1.5.0 2021-06-15 15:53:45 +02:00
Dolu1990
9c0aed7c0d Merge pull request #10 from typingArtist/sbt-mill-unification
Sbt mill unification
2021-06-14 19:34:46 +02:00
Matthias Wächter
ef4d9b7db3 reverted Scala to 2.11.12 and sbt to 1.4.7 2021-06-14 17:05:43 +02:00
Matthias Wächter
9b3093e193 add support for Mill 2021-06-14 08:35:22 +02:00
Matthias Wächter
bb5f15798e restructure build.sbt according to latest sbt docs 2021-06-14 07:29:01 +02:00
Matthias Wächter
08d79c6134 Add gitignore for metals 2021-06-14 07:03:42 +02:00
Matthias Wächter
131c6e7654 bump sbt (1.5.3) and Scala (2.12.14) 2021-06-14 06:59:20 +02:00
Dolu1990
e03a66e8f9 Notes about eclipse added #8 2021-04-12 13:05:33 +02:00
Dolu1990
8acbd1d747 update verilator version 2021-04-09 16:25:56 +02:00
Dolu1990
173bbb9bb8 Remove eclipse plugin 2021-04-06 11:32:10 +02:00
Dolu1990
162e9b5c6b Merge pull request #7 from azaparov/patch-1
Fix to correct verilator branch
2021-03-29 12:58:43 +02:00
Alexey Zaparovanny
c7e1834cb4 Fix to correct verilator branch
Update README.md to reflect correct verilator branch for checkout
2021-03-28 13:42:26 -04:00
Dolu1990
754351b8a1 SpinalHDL 1.4.3 2021-02-01 12:33:12 +01:00
Dolu1990
fd7f2b7165 SpinalHDL 1.4.2 2020-10-15 12:41:48 +02:00
Dolu1990
b524ddddd8 cleanup build.sbt 2020-03-09 12:34:41 +01:00
Dolu1990
648d530e4d Merge remote-tracking branch 'origin/compiler_plugin' 2020-03-09 12:25:15 +01:00
Dolu1990
4f93c929d4 sbt 1.3.3 for windows compatibility 2020-03-02 19:41:14 +01:00
9 changed files with 94 additions and 21 deletions

4
.gitignore vendored
View File

@@ -20,6 +20,9 @@ project/plugins/project/
.idea
out
# Metals
.metals
# Eclipse
bin/
.classpath
@@ -38,3 +41,4 @@ bin/
simWorkspace/
tmp/
null

1
.mill-version Normal file
View File

@@ -0,0 +1 @@
0.9.8

View File

@@ -21,8 +21,9 @@ sudo update-alternatives --config javac
You need to install SBT
```sh
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add
sudo apt-get update
sudo apt-get install sbt
```
@@ -36,7 +37,7 @@ unsetenv VERILATOR_ROOT # For csh; ignore error if on bash
unset VERILATOR_ROOT # For bash
cd verilator
git pull # Make sure we're up-to-date
git checkout verilator_3_916
git checkout v4.040
autoconf # Create ./configure script
./configure
make -j$(nproc)
@@ -89,6 +90,8 @@ Normally, this must generate an MyTopLevel.v output files.
## Basics, with Eclipse and its scala plugin
First, i "strongly" suggest to use intellij idea instead.
You need to install :
- Java JDK
@@ -100,9 +103,38 @@ You need to install :
And do the following :
- Clone or download this repository.
- Revert changes from https://github.com/SpinalHDL/SpinalTemplateSbt/commit/173bbb9bb8cbf70087339104f6ebced9321908dd
- Run ```sbt eclipse``` in the ```SpinalTemplateSbt``` directory.
- Import the eclipse project from eclipse.
- In the project (eclipse project GUI), right click on src/main/scala/mylib/MyTopLevel.scala, right click on MyTopLevelVerilog, and select run it
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

View File

@@ -1,15 +1,16 @@
name := "SpinalTemplateSbt"
ThisBuild / version := "1.0"
ThisBuild / scalaVersion := "2.12.16"
ThisBuild / organization := "org.example"
version := "1.0"
val spinalVersion = "1.7.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)
scalaVersion := "2.11.12"
EclipseKeys.withSource := true
libraryDependencies ++= Seq(
"com.github.spinalhdl" % "spinalhdl-core_2.11" % "1.4.0",
"com.github.spinalhdl" % "spinalhdl-lib_2.11" % "1.4.0",
compilerPlugin("com.github.spinalhdl" % "spinalhdl-idsl-plugin_2.11" % "1.4.0")
lazy val mylib = (project in file("."))
.settings(
name := "SpinalTemplateSbt",
libraryDependencies ++= Seq(spinalCore, spinalLib, spinalIdslPlugin)
)
fork := true

13
build.sc Normal file
View File

@@ -0,0 +1,13 @@
import mill._, scalalib._
val spinalVersion = "1.7.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")
}

View File

@@ -1 +1 @@
sbt.version=1.2.7
sbt.version=1.6.0

View File

@@ -1,2 +0,0 @@
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")

View File

@@ -26,9 +26,9 @@ import scala.util.Random
//Hardware definition
class MyTopLevel extends Component {
val io = new Bundle {
val cond0 = in Bool
val cond1 = in Bool
val flag = out Bool
val cond0 = in Bool()
val cond1 = in Bool()
val flag = out Bool()
val state = out UInt(8 bits)
}
val counter = Reg(UInt(8 bits)) init(0)

View File

@@ -0,0 +1,24 @@
package mylib
import spinal.core._
import spinal.core.formal._
// You need SymbiYosys to be installed.
// See https://spinalhdl.github.io/SpinalDoc-RTD/master/SpinalHDL/Formal%20verification/index.html#installing-requirements
object MyTopLevelFormal {
def main(args: Array[String]) {
FormalConfig.withBMC(10).doVerify(new Component {
val dut = FormalDut(new MyTopLevel)
// Ensure the formal test start with a reset
assumeInitial(clockDomain.isResetActive)
// Provide some stimulus
anyseq(dut.io.cond0)
anyseq(dut.io.cond1)
// Check the state initial value and increment
assert(dut.io.state === past(dut.io.state + U(dut.io.cond0)).init(0))
})
}
}