Skip to content

Language introduction

Flux uses C++ syntax and adds a small number of constructs:

Construct Hardware meaning
__fpga function A hardware module
bits<N> An unsigned value exactly N bits wide
clock A clock domain
__onRise(clk) Updates that happen on the rising edge of clk
__unroll(...) Copies of hardware, one per iteration
__memory(read, collision) Timing behavior of a memory

Hardware has no program counter, heap or recursion in the processor sense. Only a subset of C++ can be used inside an __fpga function, and the compiler rejects constructs it cannot express. Do not expect to mark existing software __fpga and get a circuit.

Functions without __fpga are compiled for a processor through Clang and LLVM. They are where you set up boards and communicate with the design.