View on GitHub


CAES Language for Synchronous Hardware

Download this project as a .zip file Download this project as a tar.gz file



CλaSH (pronounced ‘clash’) is a functional hardware description language that borrows both its syntax and semantics from the functional programming language Haskell. The merits of using a functional language to describe hardware comes from the fact that combinational circuits can be directly modeled as mathematical functions and that functional languages lend themselves very well at describing and (de-)composing mathematical functions. The CλaSH compiler transforms these high-level descriptions to low-level synthesizable VHDL.

An experimental version of the new CλaSH compiler and some examples can be found below.
!! The compiler and the CλaSH Prelude library are subject to change !!


The CλaSH compiler and Prelude library for circuit design only work with the GHC Haskell compiler version 7.8.* and up.

  1. Install GHC (version 7.8.* or higher)

    • Download and install GHC for your platform. Unix user can use ./configure prefix=<LOCATION> to set the installation location.

    • Make sure that the bin directory of GHC is in your PATH.

  2. Install Cabal (version 1.18.* or higher)

    • Binary, when available:

    • Source:

      • Download the sources for cabal-install
      • Unpack (tar xf) the archive and cd to the directory
      • Run sh
      • Follow the instructions to add cabal to your PATH
    • Run cabal update

  3. Install CλaSH

    • Run cabal install clash-ghc
    • Add cabal's bin directory to your PATH:
      • Windows: %appdata%\cabal\bin
      • Unix: $HOME/.cabal/bin
  4. Verify that everything is working by:

    • Downloading the FIR.hs example
    • Run clash --interactive FIR.hs
    • Execute, in the interpreter, the :vhdl command.
    • Execute, in the interpreter, the :systemverilog command.
    • Exit the interpreter using :q
    • Examine the VHDL code in the vhdl directory
    • Examine the SystemVerilog code in the systemverilog directory


Reference documentation


Calculator.hs (Requires CalculatorTypes.hs )


For updates and questions join the mailing list or read the forum.
Bug reports for the CLaSH compiler:
Bug reports for the CLaSH prelude library: