What you can do with Flux today

A command-line compiler and C++ libraries. No graphical app yet.

Describe hardware

Available

Exact bit widths, clocks, memories and modules.

Language introduction
full_adder.flux
__fpga void halfAdder(bits<1> a, bits<1> b, bits<1>& sum, bits<1>& carry) {
    sum = a ^ b;
    carry = a & b;
}

__fpga void fullAdder(bits<1> a, bits<1> b, bits<1> cin,
                      bits<1>& sum, bits<1>& cout) {
    bits<1> partial;
    bits<1> carry0;
    bits<1> carry1;
    halfAdder(a, b, partial, carry0);
    halfAdder(partial, cin, sum, carry1);
    cout = carry0 | carry1;
}

Test it

Available

Write testbenches in C++. No waveforms yet.

Simulating a design
counter_test.flux (testbench)
int main() {
    using namespace std::chrono_literals;

    flux::sim::Simulator sim;
    const auto clk = sim.createClock("clk", 10ns);
    const auto dut = sim.instantiate(counter, {{"clk", clk}});

    sim.setInput(dut, "reset", true);
    sim.runFor(10ns);
    sim.setInput(dut, "reset", false);
    sim.runFor(50ns);

    const auto count = sim.getOutput<std::uint8_t>(dut, "count");
    std::cout << "count = " << unsigned(count) << '\n';
    assert(count == 5);
}

See what the compiler understood

Available

Print any compiler stage, or export Verilog.

Command-line reference
flux --emit=hardware blink.flux
module @blink [sequential] {
    clock %clk
    output %led : u1
    state %divider : u25 [init=u25 0]
    state %ledState : u1 [init=u1 1]
    on_rise %clk {
        if equal<bit> %divider, i32 13500000 {
            next %divider = u25 0
            next %ledState = xor<i32> %ledState, i32 1
        }
        else {
            next %divider = add<i32> %divider, i32 1
        }
    }
    drive %led = %ledState
}

Build for a board

Coverage varies by board

Offline-checked is not the same as hardware-tested.

Device programming
Boards known to Flux 0.1.0
BoardFPGAFlux outputPhysical testing
Sipeed Tang Nano 20K
tang-nano-20k
Gowin GW2AR-18CNative .fs imageBasic I/O, registers and serial loopback observed
Sipeed Tang Nano 9K
tang-nano-9k
Gowin GW1NR-9CNative .fs image, combinational designs onlyNot tested on hardware
1BitSquared iCEBreaker V1.1b
icebreaker
Lattice iCE40UP5KNative .bin image, scalar designs onlyNot tested on hardware
Radiona ULX3S 85F
ulx3s
Lattice ECP5 LFE5U-85FNative .bit imageNot tested on hardware
Digilent Basys 3
basys3
AMD Artix-7 XC7A35TExperimental .bit imageNot tested on hardware
Digilent Arty A7-100T
arty-a7-100t
AMD Artix-7 XC7A100TExperimental .bit imageNot tested on hardware
Terasic DE10-Nano
de10-nano
Intel Cyclone VQuartus project export; no native imageNot tested on hardware

Not built yet

PlannedFull roadmap