Thanks for using Compiler Explorer
Jakt
C++
Ada
Analysis
Assembly
C
Carbon
C++ (Circle)
CIRCT
Clean
CMake
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Erlang
Fortran
F#
Go
Haskell
HLSL
Hook
ispc
Java
Kotlin
LLVM IR
Nim
OCaml
OpenCL C
Pascal
Pony
Python
Racket
Ruby
Rust
Scala
Solidity
Swift
Toit
TypeScript Native
Visual Basic
Zig
circt source #1
Output
Compile to binary
Execute the code
Intel asm syntax
Demangle identifiers
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Compiler
Options
Source code
// Example code of a simple counter. // CIRCT example code may not always work out of the box because the textual MLIR format is not always stable. // The example tries to be compatible with the latest CIRCT version, using relatively stable IR. hw.module @Counter(%clock: i1, %reset: i1) -> (count: i8) { %c0_i8 = hw.constant 0 : i8 %c1_i8 = hw.constant 1 : i8 %counter = seq.compreg %0, %clock, %reset, %c0_i8 : i8 %0 = comb.add %counter, %c1_i8 : i8 hw.output %counter : i8 }
Become a Patron
Sponsor on GitHub
Donate via PayPal
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
About the author
Changelog
Version tree