This commit is contained in:
Jose Luis Montañes Ojados
2026-03-01 03:44:57 +01:00
parent b3d11de769
commit 42811f868b
4 changed files with 71 additions and 1 deletions

21
rom/rom.v Normal file
View File

@@ -0,0 +1,21 @@
/*
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