aboutsummaryrefslogtreecommitdiff
path: root/src/rom.v
blob: aa8c359cc1261dc63b016cdd84bc63cd8a0760b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module rom #(
  parameter N = 32, 
  parameter SIZE = 1024
)(
    input clk,
    input [log2(SIZE)-1:0] addr,
    output reg [N-1:0] data_read
);

`include "include/log2.vh"

reg [7:0] memory [SIZE-1:0];

initial begin
  $readmemh("rom/rom.hex", memory, 0, SIZE-1);
end

always @(posedge clk) begin
  data_read = memory[addr];
end



endmodule