Install Clash on Linux
1. Choose your platform
2. Install Stack
Install Stack. Stack is a build tool for Haskell / Clash projects.
If you want to setup a Clash project with Cabal instead, read the starter project’s README.md.
3. Setup Clash
Depending on your goals, you might want to simply run Clash on its own, or setup a proper project. The first one will get you up and running quickly and you won’t have to learn build tools. However, you won’t be able to use dependencies from Hackage and it is harder to get a consistent build environment.
Option A. Run Clash on its own
The following compiles a file HelloWorld.hs
to VHDL:
stack exec --resolver lts-19 --package clash-ghc -- clash HelloWorld.hs --vhdl
Option B. Setup a starter project
To setup a new project based on the provided starter projects, run:
stack new my-clash-project clash-lang/simple
This will create a new project called my-clash-project
in a folder named the same. The folder will contain a README.md
to get you up and running. Alternatively, you can read it online. People familiar with the Haskell ecosystem might prefer to use Cabal instead. To do so, download the starter project as a zip and follow the instructions in README.md
.