- Documentation
- Introduction
- Architecture overview
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.
- Flux sourceC++ with __fpga functions
.flux - Hardware IRRegisters, wires and clocked updates
--emit=hardware - Circuit and logicFlattened and optimized netlist
--emit=optimized-circuit - LUT mappingBoolean logic as look-up tables
--emit=lut - Place and routeCells assigned to a device
--emit=routed - Configuration imageSupported boards only
--emit=fs
Flux Hardware IR
Section titled “Flux Hardware IR”Hardware IR is a compiler-owned, target-neutral description. You never write it, but you can print it.
statevalues hold what they had before a rising edge. Allnextassignments commit together at that edge.- Bit widths are explicit:
u1,u32and so on. Arithmetic wraps at the declared width. unrollbounds 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.fluxAfter Hardware IR
Section titled “After Hardware IR”| 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.