aboutsummaryrefslogtreecommitdiffstats
path: root/tests/various/smtlib2_module.v
diff options
context:
space:
mode:
authorJannis Harder <me@jix.one>2022-06-07 16:47:10 +0200
committerGitHub <noreply@github.com>2022-06-07 16:47:10 +0200
commit5f9a97d2342f1d3956f07c88c619bc88b43c8a1f (patch)
treee649a6909a65496e9cd67838aafcfbb83cc8f1de /tests/various/smtlib2_module.v
parentfe048a48b3e9507b119def1a88a952c94ad600c7 (diff)
parent0b0123e00378fefb9efb0c586f6b8a1d33ca0063 (diff)
downloadyosys-5f9a97d2342f1d3956f07c88c619bc88b43c8a1f.tar.gz
yosys-5f9a97d2342f1d3956f07c88c619bc88b43c8a1f.tar.bz2
yosys-5f9a97d2342f1d3956f07c88c619bc88b43c8a1f.zip
Merge pull request #3319 from programmerjake/smtlib2-expr-support
add smtlib2_comb_expr
Diffstat (limited to 'tests/various/smtlib2_module.v')
-rw-r--r--tests/various/smtlib2_module.v33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/various/smtlib2_module.v b/tests/various/smtlib2_module.v
new file mode 100644
index 000000000..4aad86905
--- /dev/null
+++ b/tests/various/smtlib2_module.v
@@ -0,0 +1,33 @@
+(* smtlib2_module *)
+module smtlib2(a, b, add, sub, eq);
+ input [7:0] a, b;
+ (* smtlib2_comb_expr = "(bvadd a b)" *)
+ output [7:0] add;
+ (* smtlib2_comb_expr = "(bvadd a (bvneg b))" *)
+ output [7:0] sub;
+ (* smtlib2_comb_expr = "(= a b)" *)
+ output eq;
+endmodule
+
+(* top *)
+module uut;
+ wire [7:0] a = $anyconst, b = $anyconst, add, sub, add2, sub2;
+ wire eq;
+
+ assign add2 = a + b;
+ assign sub2 = a - b;
+
+ smtlib2 s (
+ .a(a),
+ .b(b),
+ .add(add),
+ .sub(sub),
+ .eq(eq)
+ );
+
+ always @* begin
+ assert(add == add2);
+ assert(sub == sub2);
+ assert(eq == (a == b));
+ end
+endmodule