diff options
author | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2024-05-05 15:01:46 +0200 |
---|---|---|
committer | Flavian Kaufmann <flavian@flaviankaufmann.ch> | 2024-05-05 15:01:46 +0200 |
commit | 90a684ff92f68ec818349d1df626fcb06e8de2a1 (patch) | |
tree | d795baf38d56520f807a7f54252ce51b71061f45 /src/rom.v | |
parent | 5392b3d94038963a7121f391ad1b5075a5e32b8e (diff) | |
download | riscv_cpu-90a684ff92f68ec818349d1df626fcb06e8de2a1.tar.gz riscv_cpu-90a684ff92f68ec818349d1df626fcb06e8de2a1.zip |
initialize rom to rom/rom.hex
Diffstat (limited to 'src/rom.v')
-rw-r--r-- | src/rom.v | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -3,11 +3,22 @@ module rom #( parameter SIZE = 1024 )( input clk, - input rst, input [log2(SIZE)-1:0] addr, - output [N-1:0] data_read + 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); +end + +always @(posedge clk) begin + data_read = memory[addr]; +end + + + endmodule |