Skip to content

Blackwire SpinalHDL components implementing WireGuard primitives

License

Notifications You must be signed in to change notification settings

FPGA-House-AG/BlackwireSpinal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlackwireSpinal

Ethernet processing modules components (or modules) for FPGA that can be used to extend the Corundum FPGA PCIe/Ethernet framework. The modules are operating on AXI Streaming interfaces and can be controlled through an (optional) AXI4 slave.

Because of the plumbing involved, SpinalHDL was investigated as an appropriate HDL to generate the RTL. SpinalHDL has all the benefits of RTL with the power of a Scala (Java-alike) language to elaborate the HDL. Creating and connecting bus and stream interfaces is extremely simple.

SpinalHDL Docker

git@github.com:likewise/vexriscv-dockerfile.git 754f14bcec9eef288c46b4e777dd9be147c4e63e

TODO

Check for correct usage of last signals etc.

See Fragment.scala: def first: Bool = signalCache(pimped, "first")(RegNextWhen(pimped.last, pimped.fire, True).setCompositeName(pimped, "first", true)) def tail: Bool = !first def isFirst: Bool = pimped.valid && first def isTail : Bool = pimped.valid && tail def isLast: Bool = pimped.valid && pimped.last def lastFire : Bool = pimped.fire && pimped.last def firstFire : Bool = pimped.fire && pimped.first

The remainder of these notes are from the SpinalHDLSbtTemplate project, from which this is forked.

Spinal Base Project

This repository is a base SBT project added to help non Scala/SBT native people in their first steps.

Just one important note, you need a java JDK >= 8

On debian :

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

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

If you want to run the scala written testbench, you have to be on linux and have Verilator installed (a recent version) :

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 checkout v4.040
autoconf        # Create ./configure script
./configure
make -j$(nproc)
sudo make install
cd ..
echo "DONE"

Clone or download this repository.

git clone https://github.com/SpinalHDL/SpinalTemplateSbt.git

Open a terminal in the root of it and run "sbt run". At the first execution, the process could take some seconds

cd SpinalTemplateSbt

//If you want to generate the Verilog of your design
sbt "runMain corundum.MuxHighPrioFragmentStreamVerilog"

//If you want to generate the VHDL of your design
sbt "runMain corundum.MuxHighPrioFragmentStreamVhdl"

//If you want to run the scala written testbench
sbt "runMain corundum.MuxHighPrioFragmentStreamSim"

The top level spinal code is defined into src\main\scala\corundum

Basics, with Intellij IDEA and its scala plugin

You need to install :

  • Java JDK 8
  • SBT
  • Intellij IDEA (the free Community Edition is good enough)
  • Intellij IDEA Scala plugin (when you run Intellij IDEA the first time, he will ask you about it)

And do the following :

  • Clone or download this repository.
  • In Intellij IDEA, "import project" with the root of this repository, Import project from external model SBT
  • In addition maybe you need to specify some path like JDK to Intellij
  • In the project (Intellij project GUI), go in src/main/scala/corundum/MuxHighPrioFragmentStream.scala, right click on MuxHighPrioFragmentStreamVerilog, "Run MuxHighPrioFragmentStreamVerilog"

Normally, this must generate an MuxHighPrioFragmentStream.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
  • Scala
  • SBT
  • Eclipse (tested with Mars.2 - 4.5.2)
  • scala plugin (tested with 4.4.1)

And do the following :

Normally, this must generate output file MuxHighPrioFragmentStream.v.

Mill Support (Experimental)

This Spinal Base Project contains support for the Mill build tool.

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.

You can clone and use this repository in the following way.

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

cd SpinalTemplateSbt

//If you want to generate the Verilog of your design
mill corundum.runMain corundum.MuxHighPrioFragmentStreamVerilog

//If you want to generate the VHDL of your design
mill corundum.runMain corundum.MuxHighPrioFragmentStreamVhdl

//If you want to run the scala written testbench
mill corundum.runMain corundum.MuxHighPrioFragmentStreamSim

The top level spinal code is defined into src\main\scala\corundum

About

Blackwire SpinalHDL components implementing WireGuard primitives

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published