Describe hardware
AvailableExact bit widths, clocks, memories and modules.
Language introductionA command-line compiler and C++ libraries. No graphical app yet.
__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;
}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);
}Print any compiler stage, or export Verilog.
Command-line referencemodule @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
}Offline-checked is not the same as hardware-tested.
Device programming| Board | FPGA | Flux output | Physical testing |
|---|---|---|---|
Sipeed Tang Nano 20Ktang-nano-20k | Gowin GW2AR-18C | Native .fs image | Basic I/O, registers and serial loopback observed |
Sipeed Tang Nano 9Ktang-nano-9k | Gowin GW1NR-9C | Native .fs image, combinational designs only | Not tested on hardware |
1BitSquared iCEBreaker V1.1bicebreaker | Lattice iCE40UP5K | Native .bin image, scalar designs only | Not tested on hardware |
Radiona ULX3S 85Fulx3s | Lattice ECP5 LFE5U-85F | Native .bit image | Not tested on hardware |
Digilent Basys 3basys3 | AMD Artix-7 XC7A35T | Experimental .bit image | Not tested on hardware |
Digilent Arty A7-100Tarty-a7-100t | AMD Artix-7 XC7A100T | Experimental .bit image | Not tested on hardware |
Terasic DE10-Nanode10-nano | Intel Cyclone V | Quartus project export; no native image | Not tested on hardware |
A native editor and workspace.
Editing and analysis.
Signals over time.
Analog circuit analysis.