SpinalHDL / SpinalTemplateSbt

A basic SpinalHDL project
77 stars 64 forks source link

SpinalHDL Base Project

This repository is a base project to help Spinal users set-up project without knowledge about Scala and SBT.

If it is your are learning SpinalHDL

You can follow the tutorial on the Getting Started page.

More specifically:

TL;DR Things have already been set up in my environment, how do I run things to try SpinalHDL?

Once in the SpinalTemplateSbt directory, when tools are installed, the commands below can be run to use sbt.

// To generate the Verilog from the example
sbt "runMain projectname.MyTopLevelVerilog"

// To generate the VHDL from the example
sbt "runMain projectname.MyTopLevelVhdl"

// To run the testbench
sbt "runMain projectname.MyTopLevelSim"

When you really start working with SpinalHDL, it is recommended (both for comfort and efficiency) to use an IDE, see the Getting started.

If you want to create a new project from this template

Change project name

You might want to change the project name, which is currently projectname. To do so (let's say your actual project name is myproject; it must be all lowercase with no separators):

Change project structure

You can change the project structure as you want. The only restrictions (from Scala environment) are (let's say your actual project name is myproject):

Once the project structure is modified, update configurations:

Update this README

Of course you can replace/modify this file to help people with your own project!

Mill Support (Experimental)

The Mill build tool can be installed and used instead of sbt.

// To generate the Verilog from the example
mill projectname.runMain projectname.MyTopLevelVerilog

// To generate the VHDL from the example
mill projectname.runMain projectname.MyTopLevelVhdl

// To run the testbench
mill projectname.runMain projectname.MyTopLevelSim