// rom.sv // ROM initialised from a hex file with $readmemh, synchronous read. // Synthesis tools read the file at compile time and store the contents // in block RAM (or LUTs for small tables). // sine_q15.hex: one full sine cycle in 64 samples, Q1.15 two's complement, // entry k = round(32767 * sin(2*pi*k/64)) as 16-bit hex. The data file holds // only the 64 words, no comments (UG901 does not allow comments in it). `timescale 1ns/1ps module rom #( parameter int DW = 16, parameter int AW = 6, parameter string INIT_FILE = "sine_q15.hex" ) ( input logic clk, input logic [AW-1:0] addr, output logic [DW-1:0] dout ); logic [DW-1:0] mem [0:(1<