aboutsummaryrefslogtreecommitdiffstats
path: root/tests/arch/ecp5/rom.v
diff options
context:
space:
mode:
Diffstat (limited to 'tests/arch/ecp5/rom.v')
-rw-r--r--tests/arch/ecp5/rom.v18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/arch/ecp5/rom.v b/tests/arch/ecp5/rom.v
new file mode 100644
index 000000000..0a0f41f37
--- /dev/null
+++ b/tests/arch/ecp5/rom.v
@@ -0,0 +1,18 @@
+/*
+Example from: https://www.latticesemi.com/-/media/LatticeSemi/Documents/UserManuals/EI/iCEcube201701UserGuide.ashx?document_id=52071 [p. 74].
+*/
+module top(data, addr);
+output [3:0] data;
+input [4:0] addr;
+always @(addr) begin
+case (addr)
+0 : data = 'h4;
+1 : data = 'h9;
+2 : data = 'h1;
+15 : data = 'h8;
+16 : data = 'h1;
+17 : data = 'h0;
+default : data = 'h0;
+endcase
+end
+endmodule