mirror of
https://github.com/SpinalHDL/SpinalTemplateSbt.git
synced 2025-10-25 00:38:44 +08:00
Compare commits
11 Commits
dev
...
compiler_p
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cd200f9b6 | ||
|
|
4c1ec24f9b | ||
|
|
83ae9ff28b | ||
|
|
13cd788fdc | ||
|
|
53b4595be9 | ||
|
|
8ab19a2b3e | ||
|
|
9ff9388be2 | ||
|
|
70ee49e249 | ||
|
|
31f3b617a9 | ||
|
|
0c8143eebc | ||
|
|
84b413aefc |
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.
|
||||
|
||||
## 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
|
||||
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
|
||||
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2EE0EA64E40A89B84B2DF73499E82A75642AC823
|
||||
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
|
||||
|
||||
//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
|
||||
sbt "run-main mylib.MyTopLevelVhdl"
|
||||
sbt "runMain mylib.MyTopLevelVhdl"
|
||||
|
||||
//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
|
||||
|
||||
@@ -7,8 +7,9 @@ scalaVersion := "2.11.12"
|
||||
EclipseKeys.withSource := true
|
||||
|
||||
libraryDependencies ++= Seq(
|
||||
"com.github.spinalhdl" % "spinalhdl-core_2.11" % "1.3.0",
|
||||
"com.github.spinalhdl" % "spinalhdl-lib_2.11" % "1.3.0"
|
||||
"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")
|
||||
)
|
||||
|
||||
fork := true
|
||||
|
||||
@@ -15,8 +15,7 @@ object MyTopLevelSim {
|
||||
dut.clockDomain.forkStimulus(period = 10)
|
||||
|
||||
var modelState = 0
|
||||
var idx = 0
|
||||
while(idx < 100){
|
||||
for(idx <- 0 to 99){
|
||||
//Drive the dut inputs with random values
|
||||
dut.io.cond0 #= Random.nextBoolean()
|
||||
dut.io.cond1 #= Random.nextBoolean()
|
||||
@@ -33,8 +32,6 @@ object MyTopLevelSim {
|
||||
if(dut.io.cond0.toBoolean) {
|
||||
modelState = (modelState + 1) & 0xFF
|
||||
}
|
||||
|
||||
idx += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user