Files
hdl-projects/rom/rom.v
Jose Luis Montañes Ojados 42811f868b add rom
2026-03-01 03:44:57 +01:00

21 lines
385 B
Verilog

/*
ROM
*/
module rom #(
parameter DEPTH = 256,
parameter W = 16,
parameter FILE = ""
) (
input clk,
input [$clog2(DEPTH)-1:0] addr,
output reg [W-1:0] rd_data
);
reg [W-1:0] mem [0:DEPTH-1];
initial $readmemh(FILE, mem);
always @(posedge clk) begin
rd_data <= mem[addr];
end
endmodule