Install Clash on Windows

1. Choose your platform🔗️



2. Install Stack🔗️

Download Stack from get.haskellstack.org and install it. Stack is a build tool for Haskell / Clash projects.

3. Setup Clash🔗️

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 with the same name. The folder will contain a README.md to get you up and running. Alternatively, you can read it online.

Alternatives🔗️

A starter project using Stack is the recommended way to use Clash, and is fully supported. Alternative methods sometimes exhibit issues that can be confusing even to people used to working with GHC, since Clash is pretty non-standard. Clash is a modification to the GHC compiler rather than a normal Haskell package, and it uses several GHC plugins to extend the functionality of type-level naturals, which are extensively used in Clash designs.

Run Clash on its own🔗️

The following compiles the file ShortBlinker.hs to VHDL:

stack exec --resolver lts-23.15 --package clash-ghc -- clash ShortBlinker.hs --vhdl

The resulting HDL should be very similar to the following: