mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-05 02:40:25 +00:00
Added test cases for sat command
This commit is contained in:
parent
6891fd79a3
commit
7a66b38c3e
7 changed files with 127 additions and 0 deletions
87
tests/sat/asserts_seq.v
Normal file
87
tests/sat/asserts_seq.v
Normal file
|
@ -0,0 +1,87 @@
|
|||
module test_001(clk, a, a_old, b);
|
||||
// test case taken from:
|
||||
// http://www.reddit.com/r/yosys/comments/1wvpj6/trouble_with_assertions_and_sat_solver/
|
||||
|
||||
input wire clk;
|
||||
input wire a;
|
||||
|
||||
output reg a_old = 0;
|
||||
output reg b = 1;
|
||||
wire assertion = (a_old != b);
|
||||
|
||||
always @(posedge clk) begin
|
||||
a_old <= a;
|
||||
b <= !a;
|
||||
|
||||
assert(a_old != b);
|
||||
end
|
||||
endmodule
|
||||
|
||||
module test_002(clk, a, a_old, b);
|
||||
// copy from test_001 with modifications
|
||||
|
||||
input wire clk;
|
||||
input wire a;
|
||||
|
||||
output reg a_old = 0;
|
||||
output reg b = 0; // <-- this will fail
|
||||
wire assertion = (a_old != b);
|
||||
|
||||
always @(posedge clk) begin
|
||||
a_old <= a;
|
||||
b <= !a;
|
||||
assert(a_old != b);
|
||||
end
|
||||
endmodule
|
||||
|
||||
module test_003(clk, a, a_old, b);
|
||||
// copy from test_001 with modifications
|
||||
|
||||
input wire clk;
|
||||
input wire a;
|
||||
|
||||
output reg a_old = 0;
|
||||
output reg b; // <-- this will fail
|
||||
wire assertion = (a_old != b);
|
||||
|
||||
always @(posedge clk) begin
|
||||
a_old <= a;
|
||||
b <= !a;
|
||||
assert(a_old != b);
|
||||
end
|
||||
endmodule
|
||||
|
||||
module test_004(clk, a, a_old, b);
|
||||
// copy from test_001 with modifications
|
||||
|
||||
input wire clk;
|
||||
input wire a;
|
||||
|
||||
output reg a_old = 0;
|
||||
output reg b = 1;
|
||||
wire assertion = (a_old != b);
|
||||
|
||||
always @(posedge clk) begin
|
||||
a_old <= a;
|
||||
b <= !a;
|
||||
assert(a_old == b); // <-- this will fail
|
||||
end
|
||||
endmodule
|
||||
|
||||
module test_005(clk, a, a_old, b);
|
||||
// copy from test_001 with modifications
|
||||
|
||||
input wire clk;
|
||||
input wire a;
|
||||
|
||||
output reg a_old = 1; // <-- inverted, no problem
|
||||
output reg b = 0;
|
||||
wire assertion = (a_old != b);
|
||||
|
||||
always @(posedge clk) begin
|
||||
a_old <= a;
|
||||
b <= !a;
|
||||
assert(a_old != b);
|
||||
end
|
||||
endmodule
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue