# clash-lang/clash-compiler

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/clash-lang-clash-compiler).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

1,599 stars · 166 forks · Haskell · NOASSERTION

## Links

- GitHub: https://github.com/clash-lang/clash-compiler
- Homepage: https://clash-lang.org/
- awesome-repositories: https://awesome-repositories.com/repository/clash-lang-clash-compiler.md

## Topics

`asic` `fpga` `hardware-description-language` `haskell` `systemverilog` `verilog` `vhdl`

## Description

Clash is a functional hardware compiler and hardware description language compiler that translates strongly typed functional programs written in Haskell into synthesizable VHDL, Verilog, and SystemVerilog code. It serves as a development tool allowing digital designers to write hardware descriptions in functional languages and compile them directly to FPGA targets and physical netlists.

The compilation infrastructure covers structural hardware compilation, including graph-based code normalization, functional language translation, and netlist generation. It features type-level clock domain safety checks to enforce validation rules across multiple asynchronous clock frequencies, phases, and domain boundaries. Additional capabilities include interactive hardware evaluation interpreters for verifying logic behavior without external test benches, and stream-based sequential modeling for representing digital logic and feedback loops.

The system also provides compiler configuration utilities for command-line options and typechecker plugins, along with debugging tools for rewrite history inspection and terminal-based replay of optimization steps.

## Tags

### Hardware & IoT

- [FPGA Hardware Design](https://awesome-repositories.com/f/hardware-iot/fpga-hardware-design.md) — Compiles strongly typed functional programs written in Haskell directly into target-ready VHDL, Verilog, and SystemVerilog code for physical FPGAs.
- [Logic Design Simulations](https://awesome-repositories.com/f/hardware-iot/control-logic-design/logic-design-simulations.md) — Loads hardware descriptions directly into an interactive interpreter to verify component logic behavior without external test benches. ([source](https://github.com/clash-lang/clash-compiler#readme))
- [Digital Circuit Construction](https://awesome-repositories.com/f/hardware-iot/digital-circuit-construction.md) — Models digital logic using infinite streams of values flowing through components to enable natural descriptions of feedback loops. ([source](https://github.com/clash-lang/clash-compiler/tree/master/clash-prelude))
- [Netlist Generation](https://awesome-repositories.com/f/hardware-iot/netlist-generation.md) — Converts normalized core intermediate representations into structured structural descriptions of hardware parts, wires, and interconnections.
- [Parametric Hardware Generators](https://awesome-repositories.com/f/hardware-iot/parametric-hardware-generators.md) — Creates flexible digital components using higher-order functions combined with type inference to parameterize hardware generation. ([source](https://github.com/clash-lang/clash-compiler/tree/master/clash-prelude))

### Programming Languages & Runtimes

- [Hardware-Targeted Compilation](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-compilers/multi-target-compilers/hardware-targeted-compilation.md) — Translates high-level functional source code into synthesizable low-level description code for hardware targets. ([source](https://github.com/clash-lang/clash-compiler#readme))
- [Functional Programming Compilers](https://awesome-repositories.com/f/programming-languages-runtimes/functional-programming-compilers.md) — Transforms purely functional code into synthesizable netlists and hardware description language modules for digital circuit design.
- [Hardware Description Languages](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-varieties/hardware-description-languages.md) — Translates high-level functional programs written in strongly typed languages into synthesizable VHDL, Verilog, and SystemVerilog code. ([source](https://github.com/clash-lang/clash-compiler/blob/master/ARCHITECTURE.md))
- [Interactive Read-Eval-Print Loops](https://awesome-repositories.com/f/programming-languages-runtimes/expression-evaluators/interactive-read-eval-print-loops.md) — Loads compiled hardware component descriptions into an interactive evaluation loop to verify logic behavior.
- [Higher Order Function Implementation](https://awesome-repositories.com/f/programming-languages-runtimes/higher-order-function-implementation.md) — Transforms functional language constructs and type inference engines into synthesizable digital logic netlists.
- [Haskell Resources](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-varieties/programming-languages/language-specific-resources/functional-programming-ecosystems/haskell-resources.md) — Designs synthesizable digital hardware using strong functional programming concepts and rich type systems from Haskell.

### Artificial Intelligence & ML

- [Source Code Translations](https://awesome-repositories.com/f/artificial-intelligence-ml/language-translation-services/source-code-translations.md) — Translates high-level functional programming language source code into standard hardware description languages. ([source](https://github.com/clash-lang/clash-compiler/blob/master/ARCHITECTURE.md))

### Development Tools & Productivity

- [FPGA](https://awesome-repositories.com/f/development-tools-productivity/workflow-automation-tools/build-task-automation/build-automation/fpga.md) — Translates high-level functional algorithms into VHDL, Verilog, or SystemVerilog for targeting physical FPGA devices.

### Operating Systems & Systems Programming

- [Clock Domain Conversion](https://awesome-repositories.com/f/operating-systems-systems-programming/clock-domain-conversion.md) — Coordinates designs operating across different clock frequencies and phases by enforcing safety checks during clock domain crossings. ([source](https://github.com/clash-lang/clash-compiler#readme))

### Scientific & Mathematical Computing

- [Type-Safe Clock Domains](https://awesome-repositories.com/f/scientific-mathematical-computing/type-safe-clock-domains.md) — Enforces compile-time validation rules and safety checks across multiple asynchronous clock frequencies and phases.

### Software Engineering & Architecture

- [Graph Pattern Rewriters](https://awesome-repositories.com/f/software-engineering-architecture/code-transformation-tools/pattern-based-replacements/graph-pattern-rewriters.md) — Applies algebraic rewrite systems and transformation passes to reduce core expression graphs into standardized component forms.
- [Normalization](https://awesome-repositories.com/f/software-engineering-architecture/compile-time-code-generation/compile-time-hooks/abstract-syntax-tree-transformations/normalization.md) — Applies rewrite systems and transformation passes to reduce core expressions into standardized normal forms. ([source](https://github.com/clash-lang/clash-compiler/blob/master/ARCHITECTURE.md))
- [Component-Based Sequential Processing](https://awesome-repositories.com/f/software-engineering-architecture/component-based-sequential-processing.md) — Represents digital logic and feedback loops using continuous streams of values flowing through discrete time-stepped components.

### Testing & Quality Assurance

- [Interactive Logic Testing](https://awesome-repositories.com/f/testing-quality-assurance/built-in-testing-frameworks/interactive-logic-testing.md) — Verifies digital logic behavior directly inside an interactive interpreter environment without external test benches.
