2 Star 20 Fork 7

austin / SpinalWorkshop

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

SpinalHDL labs

There is the list of RTL labs :

  • Counter : src/main/scala/workshop/counter
  • PWM with APB : src/main/scala/workshop/pwm
  • UART : src/main/scala/workshop/uart
  • Prime : src/main/scala/workshop/prime
  • Function : src/main/scala/workshop/function
  • Apb3Decoder : src/main/scala/workshop/apb3decoder
  • Timer with BusSlaveFactory : src/main/scala/workshop/timer
  • Blackbox and Clockdomain : src/main/scala/workshop/blackboxAndClock
  • Stream : src/main/scala/workshop/stream
  • Mandelbrot : src/main/scala/workshop/mandelbrot
  • UDP : src/main/scala/workshop/udp
  • WavePlayer : src/main/scala/workshop/waveplayer

In each labs, there is an assets folder which contain a starting template and a solution.
In each labs, there is an spec.md which give basics of the lab. (You can get the Intellij plugin to read it in the IDE)
In the case a lab specification isn't clear, you can find in waves.tar.gz the corresponding working waves.
Those labs make the assumption that you are already comfortable with standards HDL.

Generate your RTL

For each labs, you will find a scala main which will generate your RTL.

For example, to run the CounterMain by using SBT, you can do as following in the root folder of this repository :

sbt
runMain workshop.counter.CounterMain

# Run again
runMain workshop.counter.CounterMain

# Run again
runMain workshop.counter.CounterMain

Or in a single (But slower) command :

sbt "runMain workshop.counter.CounterMain"

All generated RTL will be in root_of_this_repository/rtl.

Test your RTL

For each labs, you will find an automated regression suite in src/test/scala/workshop/xxx

For example, to run the CounterTester regression by using SBT, you can do as following in the root folder of this repository :

sbt
testOnly *.CounterTester

# To test again
testOnly *.CounterTester

# To test again
testOnly *.CounterTester

Or in a single (But slower) command :

sbt "testOnly *.CounterTester"

Note : Each tester regenerate the hardware, you don't need to do it manualy.

All simulation waves files will be written in root_of_this_repository/waves in the VCD format.

SpinalSim labs

There is the list of SpinalSim labs :

  • SimCounter : src/main/python/workshop/simCounter
  • SimStreamJoinFork : src/main/python/workshop/simStreamJoinFork

In each labs, there is an assets folder which contain a starting template and a solution.
In each labs, there is an spec.md which give basics of the lab. (You can get the Intellij plugin to read it in the IDE)
For SpinalSim, the simulation waves are located in the simWorkspace folder.

Cocotb labs

There is the list of Cocotb labs :

  • Counter with cocotb : src/test/python/workshop/counter
  • FIFO with cocotb : src/test/python/workshop/fifo

To run cocotb labs, you have to run make in the testbench folder.

Minimum requirements

Those labs use various tools to generate and verify the hardware :

For the first row of labs, you don't need cocotb/python stuffs.

There is how to setup by command line a Debian distribution :

# JAVA 8
sudo add-apt-repository -y ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk -y
sudo update-alternatives --config java
sudo update-alternatives --config javac

# SBT
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
sudo apt-get install sbt -y

# Verilator
sudo apt-get install git make autoconf g++ flex bison -y  # First time prerequisites
git clone http://git.veripool.org/git/verilator   # Only first time

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 tag         # See what versions exist
#git checkout HEAD                 # Use HEAD development version
#git checkout verilator_{version}  # Switch to specified version
autoconf        # Create ./configure script
./configure
make -j$(nproc)
sudo make install
cd ..

# iverilog (debian package 9.7 contain bugs)
sudo apt-get install -y gperf readline-common bison flex autoconf
wget https://github.com/steveicarus/iverilog/archive/v10_0.tar.gz
tar -xvf v10_0.tar.gz
cd iverilog-10_0
autoconf
./configure
make -j4
sudo make install
cd ..

# COCOTB
sudo apt-get install -y git make gcc g++ swig python-dev
git clone https://github.com/potentialventures/cocotb
export COCOTB=$(pwd)/cocotb
echo export COCOTB=$(pwd)/cocotb >> ~/.bashrc 

# GTKwave
sudo apt-get install gtkwave -y

# Used for the mandelbrot lab
sudo apt-get install python-tk -y

# Clone this repo
git clone --recursive https://github.com/SpinalHDL/SpinalWorkshop.git SpinalWorkshop
cd SpinalWorkshop
sbt compile

空文件

简介

Labs to learn SpinalHDL 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Scala
1
https://gitee.com/peasent/SpinalWorkshop.git
git@gitee.com:peasent/SpinalWorkshop.git
peasent
SpinalWorkshop
SpinalWorkshop
workshop

搜索帮助