summaryrefslogtreecommitdiff
path: root/sim/urom.sv
diff options
context:
space:
mode:
authorJulian Blake Kongslie2021-07-06 09:44:36 -0700
committerJulian Blake Kongslie2021-07-06 09:44:36 -0700
commit60e1775b874015a3451e4bde10a8eb30701b1165 (patch)
tree477a2835c0f7e616bdeeabe6aee85f8af8b79650 /sim/urom.sv
downloadbreadboarding-60e1775b874015a3451e4bde10a8eb30701b1165.tar.xz
Initial commit.
Diffstat (limited to 'sim/urom.sv')
-rw-r--r--sim/urom.sv19
1 files changed, 19 insertions, 0 deletions
diff --git a/sim/urom.sv b/sim/urom.sv
new file mode 100644
index 0000000..e88f6d7
--- /dev/null
+++ b/sim/urom.sv
@@ -0,0 +1,19 @@
1module urom
2 #( parameter UROM = "<no file specified>"
3 , parameter ADDR_BITS = 15
4 , parameter DATA_BITS = 8
5 )
6 ( input bit [ADDR_BITS-1:0] addr
7 , output bit [DATA_BITS-1:0] data
8 );
9
10bit [DATA_BITS-1:0] storage [0:(1<<ADDR_BITS)-1];
11initial begin
12 automatic int fh;
13 fh = $fopen(UROM, "rb");
14 $fread(storage, fh);
15end
16
17assign data = storage[addr];
18
19endmodule