Initialize Memory in Verilog
t’s common for a simulation or firmware to need data loading into a memory array, ram, or rom. Fortunately, Verilog provides the $readmemh and $readmemb functions for this very purpose. Unfortunately, there is a dearth of good Verilog documentation online, so using them can be harder than it should be. This how to explains the syntax and provides plenty of examples, including how to do this in Yosys and Xilinx Vivado. This post was last updated in July 2021.
If you want to learn more about FPGA memory itself, see FPGA Memory Types.
Get in touch: GitHub Issues, 1BitSquared Discord,