clash-compiler

Haskell to VHDL/Verilog/SystemVerilog compiler

Github星跟蹤圖

Clash - A functional hardware description language

Pipeline status
Hackage
Hackage Dependencies

Clash is a functional hardware description language that borrows both
its syntax and semantics from the functional programming language
Haskell. The Clash compiler transforms these high-level descriptions to
low-level synthesizable VHDL, Verilog, or SystemVerilog.

Features of Clash:

  • Strongly typed, but with a very high degree of type inference, enabling both
    safe and fast prototyping using concise descriptions.

  • Interactive REPL: load your designs in an interpreter and easily test all
    your component without needing to setup a test bench.

  • Higher-order functions, with type inference, result in designs that are
    fully parametric by default.

  • Synchronous sequential circuit design based on streams of values, called
    Signals, lead to natural descriptions of feedback loops.

  • Support for multiple clock domains, with type safe clock domain crossing.

Community

Mailing list: for updates and questions join the mailing list clash-language+subscribe@googlegroups.com or read the forum

Slack: Invite yourself at fpchat-invite.herokuapp.com. To join #clash, click on "Channels" and search for "clash".

IRC: freenode#clash-lang

Installing Clash

Installing via Snap

Clash is released as a binary package on snapcraft. Snap is supported on all
major Linux distributions. Visit Clash’s snapcraft page,
scroll down, and choose your distribution for installation instructions. To
install the latest stable version, use:

snap install clash

To install the latest development version of Clash, run:

snap install clash --edge

This version is updated every 24 hours.

Installing via Source (Linux / MacOS)

Install the latest nix and run:

curl -s -L https://github.com/clash-lang/clash-compiler/archive/1.0.tar.gz, tar xz
nix-shell clash-compiler-1.0/shell.nix

See the releases page
for all available versions of the compiler.

Installing via Source (Windows)

  1. Install GHC Platform. Make sure to install Stack along with it.
  2. Download the source code of Clash 1.0
  3. Unpack the archive
  4. Use cd to navigate to the unpacked directory
  5. Run stack build clash-ghc. This will take a while.

See the releases page
for all available versions of the compiler.

Installing via Source (HEAD)

Clone Clash from github using git and enter the cloned directory:

git clone https://github.com/clash-lang/clash-compiler.git
cd clash-compiler

Use one of the build tools below to get Clash up and running.

Cabal

Install Cabal >= 2.4 and GHC >= 8.4. Even though GHC 8.6 is supported, we currently recommend running 8.4 as the former contains some known bugs concerning documentation generation. If you're using Ubuntu, add HVR's PPA and install them using APT:

sudo add-apt-repository -u ppa:hvr/ghc
sudo apt install ghc-8.4.4 cabal-install-2.4

Add /opt/ghc/bin to your PATH. Finally, run Clash using cabal:

cabal new-run --write-ghc-environment-files=always -- clash

Stack

You can use Stack to build and run Clash too:

stack run -- clash

Nix

Or use Nix to get a shell with the clash and clashi binaries on your PATH:

nix-shell

主要指標

概覽
名稱與所有者clash-lang/clash-compiler
主編程語言Haskell
編程語言Shell (語言數: 10)
平台
許可證Other
所有者活动
創建於2013-07-04 09:29:15
推送於2025-07-19 13:37:02
最后一次提交2025-07-19 11:24:13
發布數62
最新版本名稱v1.8.2 (發布於 )
第一版名稱v0.3.1 (發布於 )
用户参与
星數1.5k
關注者數53
派生數162
提交數6.1k
已啟用問題?
問題數1037
打開的問題數354
拉請求數1769
打開的拉請求數20
關閉的拉請求數141
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?