Skip to content

Architecture overview

Flux reads a source file with a Clang-based frontend and splits it in two. Functions marked __fpga become Flux Hardware IR. Everything else is control-plane C++, compiled through LLVM for a processor.

  1. Flux sourceC++ with __fpga functions.flux
  2. Hardware IRRegisters, wires and clocked updates--emit=hardware
  3. Circuit and logicFlattened and optimized netlist--emit=optimized-circuit
  4. LUT mappingBoolean logic as look-up tables--emit=lut
  5. Place and routeCells assigned to a device--emit=routed
  6. Configuration imageSupported boards only--emit=fs

Hardware IR is a compiler-owned, target-neutral description. You never write it, but you can print it.

  • state values hold what they had before a rising edge. All next assignments commit together at that edge.
  • Bit widths are explicit: u1, u32 and so on. Arithmetic wraps at the declared width.
  • unroll bounds are compile-time constants, so no run-time loop exists in hardware.
  • A memory declares its element count, read timing and same-address collision behavior.
flux --emit=hardware design.flux
Stage Flag Result
Circuit lowering --emit=circuit Cells and connections
Flattening --emit=flat-circuit Hierarchy removed
Optimization --emit=optimized-circuit Simplified circuit
Boolean logic --emit=logic, --emit=optimized-logic Gate-level network
Hard blocks --emit=hardblocks Block RAM and DSP use
LUT mapping --emit=lut Look-up table netlist
Packing, placement, routing --emit=packed, placed, routed Device assignment
Timing --emit=timed Static report for a generic model
Board image --emit=fs Configuration image

Simulation branches from the same Hardware IR and flattened circuit, then generates a C++ model. See Simulating a design.