libfpga — the library

An MIT-licensed, vendor-neutral library of FPGA building blocks, developed in the open at github.com/libfpga/libfpga. Plain Verilog-2005 that synthesizes on Vivado, Quartus and the open Yosys flow — with a quality bar most libraries only claim.

Every module is verified

CI enforces three gates on the fully open toolchain: a self-checking testbench (Icarus Verilog), lint-clean under Verilator -Wall, and a Yosys synthesis check with honest LUT/FF resource stats. If it's in the library, it passed all three.

Documented like a textbook

Each module's header explains what it is, when to use it, and its gotchas — and pairs with this site's course, glossary and playground, where you can simulate library code in your browser.

Modules — v0.1.0

ModuleWhat it isCost*
CDC
lfpga_sync_bitN-flop synchronizer for one async level bit2 FF
lfpga_sync_pulseToggle-based pulse crossing, either direction2 LUT4 + 4 FF
lfpga_reset_syncReset: async assert, sync deassert2 FF
FIFOs & streams
lfpga_fifo_syncSynchronous show-ahead FIFO with count154 LUT4 + 145 FF
lfpga_fifo_asyncDual-clock FIFO, gray pointers (Cummings)154 LUT4 + 168 FF
lfpga_skid_buffervalid/ready register slice, full throughput16 LUT4 + 18 FF
lfpga_arbiter_rrRound-robin arbiter, one-hot grant18 LUT4 + 4 FF
Serial
lfpga_uart_txUART transmitter, 8N1, valid/ready48 LUT4 + 24 FF
lfpga_uart_rxUART receiver, mid-bit sampling, glitch reject63 LUT4 + 32 FF
lfpga_spi_masterSPI master, mode 0, full duplex32 LUT4 + 27 FF
Math & bus
lfpga_crcParallel CRC, any polynomial, word/clock17 LUT4 + 16 FF
lfpga_lfsrMaximal-length LFSR (XAPP052 taps)1 LUT4 + 16 FF
lfpga_grayBinary ↔ Gray converters3 LUT4
lfpga_axil_bridgeAXI4-Lite slave → simple register bus5 LUT4 + 80 FF

*Generic Yosys synth -lut 4 mapping at default parameters — the same estimate the playground's synth button gives you. All sources on GitHubv0.1.0 release.

Roadmap

Want a module prioritized? Open an issue or drop a line in the tool request box — the roadmap is ranked by real requests.

libfpga on GitHub →