mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-05 10:50:25 +00:00
smt2: Add smtlib2_comb_expr attribute to allow user-selected smtlib2 expressions
This commit is contained in:
parent
1eb1bc441b
commit
cd57c5adb3
6 changed files with 186 additions and 6 deletions
33
tests/various/smtlib2_module.v
Normal file
33
tests/various/smtlib2_module.v
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue