aboutsummaryrefslogtreecommitdiffstats
path: root/examples/smtbmc/demo3.v
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2016-08-24 23:18:29 +0200
committerClifford Wolf <clifford@clifford.at>2016-08-24 23:18:29 +0200
commitad56ad44c3bdd3d075a32879785a04e3e30491eb (patch)
treecf6fed0b983356ef46dbbdcc6f92e13ac08801ce /examples/smtbmc/demo3.v
parentee3e7a0e45e764c2655391b0e444e4379c97fe3c (diff)
downloadyosys-ad56ad44c3bdd3d075a32879785a04e3e30491eb.tar.gz
yosys-ad56ad44c3bdd3d075a32879785a04e3e30491eb.tar.bz2
yosys-ad56ad44c3bdd3d075a32879785a04e3e30491eb.zip
More yosys-smtbmc smtc features
Diffstat (limited to 'examples/smtbmc/demo3.v')
-rw-r--r--examples/smtbmc/demo3.v18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/smtbmc/demo3.v b/examples/smtbmc/demo3.v
new file mode 100644
index 000000000..13b3a1970
--- /dev/null
+++ b/examples/smtbmc/demo3.v
@@ -0,0 +1,18 @@
+// Whatever the initial content of this memory is at reset, it will never change
+// see demo3.smtc for assumptions and assertions
+
+module demo3(input clk, rst, input [15:0] addr, output reg [31:0] data);
+ reg [31:0] mem [0:2**16-1];
+ reg [15:0] addr_q;
+
+ always @(posedge clk) begin
+ if (rst) begin
+ data <= mem[0] ^ 123456789;
+ addr_q <= 0;
+ end else begin
+ mem[addr_q] <= data ^ 123456789;
+ data <= mem[addr] ^ 123456789;
+ addr_q <= addr;
+ end
+ end
+endmodule