mirror of
https://github.com/SpinalHDL/SpinalTemplateSbt.git
synced 2025-10-25 00:38:44 +08:00
Compare commits
15 Commits
dev
...
withAssemb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
514b43937b | ||
|
|
b524ddddd8 | ||
|
|
648d530e4d | ||
|
|
3cd200f9b6 | ||
|
|
4f93c929d4 | ||
|
|
4c1ec24f9b | ||
|
|
83ae9ff28b | ||
|
|
13cd788fdc | ||
|
|
53b4595be9 | ||
|
|
8ab19a2b3e | ||
|
|
9ff9388be2 | ||
|
|
70ee49e249 | ||
|
|
31f3b617a9 | ||
|
|
0c8143eebc | ||
|
|
84b413aefc |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -38,3 +38,4 @@ bin/
|
|||||||
|
|
||||||
simWorkspace/
|
simWorkspace/
|
||||||
tmp/
|
tmp/
|
||||||
|
null
|
||||||
|
|||||||
24
README.md
24
README.md
@@ -2,13 +2,25 @@ Spinal Base Project
|
|||||||
============
|
============
|
||||||
This repository is a base SBT project added to help non Scala/SBT native people in their first steps.
|
This repository is a base SBT project added to help non Scala/SBT native people in their first steps.
|
||||||
|
|
||||||
## Basics, without any IDE
|
Just one important note, you need a java JDK >= 8
|
||||||
|
|
||||||
You need to install Java JDK and SBT
|
On debian :
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo apt-get install openjdk-8-jdk
|
sudo add-apt-repository -y ppa:openjdk-r/ppa
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install openjdk-8-jdk -y
|
||||||
|
|
||||||
|
#To set the default java
|
||||||
|
sudo update-alternatives --config java
|
||||||
|
sudo update-alternatives --config javac
|
||||||
|
```
|
||||||
|
|
||||||
|
## Basics, without any IDE
|
||||||
|
|
||||||
|
You need to install SBT
|
||||||
|
|
||||||
|
```sh
|
||||||
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
|
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
|
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
@@ -46,13 +58,13 @@ Open a terminal in the root of it and run "sbt run". At the first execution, the
|
|||||||
cd SpinalTemplateSbt
|
cd SpinalTemplateSbt
|
||||||
|
|
||||||
//If you want to generate the Verilog of your design
|
//If you want to generate the Verilog of your design
|
||||||
sbt "run-main mylib.MyTopLevelVerilog"
|
sbt "runMain mylib.MyTopLevelVerilog"
|
||||||
|
|
||||||
//If you want to generate the VHDL of your design
|
//If you want to generate the VHDL of your design
|
||||||
sbt "run-main mylib.MyTopLevelVhdl"
|
sbt "runMain mylib.MyTopLevelVhdl"
|
||||||
|
|
||||||
//If you want to run the scala written testbench
|
//If you want to run the scala written testbench
|
||||||
sbt "run-main mylib.MyTopLevelSim"
|
sbt "runMain mylib.MyTopLevelSim"
|
||||||
```
|
```
|
||||||
|
|
||||||
The top level spinal code is defined into src\main\scala\mylib
|
The top level spinal code is defined into src\main\scala\mylib
|
||||||
|
|||||||
11
build.sbt
11
build.sbt
@@ -1,14 +1,13 @@
|
|||||||
name := "SpinalTemplateSbt"
|
name := "SpinalTemplateSbt"
|
||||||
|
|
||||||
version := "1.0"
|
version := "1.0"
|
||||||
|
|
||||||
scalaVersion := "2.11.12"
|
scalaVersion := "2.11.12"
|
||||||
|
val spinalVersion = "1.4.0"
|
||||||
EclipseKeys.withSource := true
|
|
||||||
|
|
||||||
libraryDependencies ++= Seq(
|
libraryDependencies ++= Seq(
|
||||||
"com.github.spinalhdl" % "spinalhdl-core_2.11" % "1.3.0",
|
"com.github.spinalhdl" % "spinalhdl-core_2.11" % spinalVersion,
|
||||||
"com.github.spinalhdl" % "spinalhdl-lib_2.11" % "1.3.0"
|
"com.github.spinalhdl" % "spinalhdl-lib_2.11" % spinalVersion,
|
||||||
|
compilerPlugin("com.github.spinalhdl" % "spinalhdl-idsl-plugin_2.11" % spinalVersion)
|
||||||
)
|
)
|
||||||
|
|
||||||
fork := true
|
fork := true
|
||||||
|
EclipseKeys.withSource := true
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
sbt.version=1.2.7
|
sbt.version=1.3.3
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")
|
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")
|
||||||
|
|
||||||
|
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ object MyTopLevelSim {
|
|||||||
dut.clockDomain.forkStimulus(period = 10)
|
dut.clockDomain.forkStimulus(period = 10)
|
||||||
|
|
||||||
var modelState = 0
|
var modelState = 0
|
||||||
var idx = 0
|
for(idx <- 0 to 99){
|
||||||
while(idx < 100){
|
|
||||||
//Drive the dut inputs with random values
|
//Drive the dut inputs with random values
|
||||||
dut.io.cond0 #= Random.nextBoolean()
|
dut.io.cond0 #= Random.nextBoolean()
|
||||||
dut.io.cond1 #= Random.nextBoolean()
|
dut.io.cond1 #= Random.nextBoolean()
|
||||||
@@ -33,8 +32,6 @@ object MyTopLevelSim {
|
|||||||
if(dut.io.cond0.toBoolean) {
|
if(dut.io.cond0.toBoolean) {
|
||||||
modelState = (modelState + 1) & 0xFF
|
modelState = (modelState + 1) & 0xFF
|
||||||
}
|
}
|
||||||
|
|
||||||
idx += 1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user