This is a collection of (mostly) synthesizable Verilog modules for use on FPGAs.
Documentation for each module, including an instantiation template, is included
in a comment at the top of each file. Test benches and Gtkwave layouts are
included for each module (test_*.v and test_*.gtkw). The Makefile is set
up to run all of the tests using iverilog and vvp.
ram_dp.vDual-port RAM, with several implementations:ram_dp_generic.vGeneric verilog, some features might not synthesize.ram_dp_ice40.vUsing Lattice iCE40 primitives.
fifo_sync.vSychronous FIFO queuefifo_async.vAsynchronous FIFO queue
spi_master.vSPI Masterspi_slave.vSPI Slaveuart.vUART with flow control and FIFO interface.exp_golomb.vExponential-Golomb decoder, a universal variable-length code.
functions.vhHandy functions and macros (MIN, MAX, cdiv, clog2)debounce.vButton debouncing, including various glitch-sensitive behaviorspwm.vPulse-width modulation, including a spread-spectrum modesynchronizer.vShift register for synchronizing across clock domainslfsr.vLinear-feedback shift register for pseudorandom bit streams
- test_debounce.v
- is ram_dp_ice40.v necessary?? Does it do anything the synthesis tools don't do automatically?
- report on hardware testing, synthesis info, etc?
- spi_slave.v: figure out how SyncStages changes timing requirements
- Would it make sense to have a tristate io buffer with vendor implementations?
- How would exp_golomb be used with SPI/UART? Need to work on interface.