blob: 60ca6e1c34049c81e180438e5c4b1e500dac1160 (
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
25
26
27
28
|
// rom:
// Contains instructions of program.
module rom #(
parameter SIZE = 1024,
parameter ROM_FILE = "../../build/rom.hex"
)(
input clk,
input [31:0] addr,
output reg [31:0] rd
);
`include "include/consts.vh"
//(* RAM_STYLE="BLOCK" *)
reg [31:0] mem [0:SIZE-1];
initial begin
$readmemh(ROM_FILE, mem, 0, SIZE-1);
end
always @ (negedge clk) begin
rd <= mem[addr >> 2];
end
endmodule
|