summaryrefslogtreecommitdiff
path: root/tests/simple/mem2reg.v
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2013-01-05 11:13:26 +0100
committerClifford Wolf <clifford@clifford.at>2013-01-05 11:13:26 +0100
commit7764d0ba1dcf064ae487ee985c43083a0909e7f4 (patch)
tree18c05b8729df381af71b707748ce1d605e0df764 /tests/simple/mem2reg.v
initial import
Diffstat (limited to 'tests/simple/mem2reg.v')
-rw-r--r--tests/simple/mem2reg.v17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/simple/mem2reg.v b/tests/simple/mem2reg.v
new file mode 100644
index 00000000..7be32b0b
--- /dev/null
+++ b/tests/simple/mem2reg.v
@@ -0,0 +1,17 @@
+module test1(in_addr, in_data, out_addr, out_data);
+
+input [1:0] in_addr, out_addr;
+input [3:0] in_data;
+output reg [3:0] out_data;
+
+reg [3:0] array [2:0];
+
+always @* begin
+ array[0] = 0;
+ array[1] = 23;
+ array[2] = 42;
+ array[in_addr] = in_data;
+ out_data = array[out_addr];
+end
+
+endmodule