mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-23 00:55:32 +00:00
opt_merge: Add -keepdc
option required for formal verification
The `-keepdc` option prevents merging flipflops with dont-care bits in their initial value, as, in general, this is not a valid transform for formal verification. The keepdc option of `opt` is passed along to `opt_merge` now.
This commit is contained in:
parent
2ec4af56e6
commit
ca5b910296
3 changed files with 71 additions and 2 deletions
|
@ -75,3 +75,53 @@ EOT
|
|||
|
||||
opt_merge
|
||||
select -assert-count 2 t:$dff
|
||||
|
||||
design -reset
|
||||
read_verilog -icells <<EOT
|
||||
module top(input clk, i, (* init = 1'b0 *) output o, p);
|
||||
\$dff #(
|
||||
.CLK_POLARITY(1'h1),
|
||||
.WIDTH(32'd1)
|
||||
) ffo (
|
||||
.CLK(clk),
|
||||
.D(i),
|
||||
.Q(o)
|
||||
);
|
||||
\$dff #(
|
||||
.CLK_POLARITY(1'h1),
|
||||
.WIDTH(32'd1)
|
||||
) ffp (
|
||||
.CLK(clk),
|
||||
.D(i),
|
||||
.Q(p)
|
||||
);
|
||||
endmodule
|
||||
EOT
|
||||
|
||||
opt_merge -keepdc
|
||||
select -assert-count 1 t:$dff
|
||||
|
||||
design -reset
|
||||
read_verilog -icells <<EOT
|
||||
module top(input clk, i, output o, p);
|
||||
\$dff #(
|
||||
.CLK_POLARITY(1'h1),
|
||||
.WIDTH(32'd1)
|
||||
) ffo (
|
||||
.CLK(clk),
|
||||
.D(i),
|
||||
.Q(o)
|
||||
);
|
||||
\$dff #(
|
||||
.CLK_POLARITY(1'h1),
|
||||
.WIDTH(32'd1)
|
||||
) ffp (
|
||||
.CLK(clk),
|
||||
.D(i),
|
||||
.Q(p)
|
||||
);
|
||||
endmodule
|
||||
EOT
|
||||
|
||||
opt_merge -keepdc
|
||||
select -assert-count 2 t:$dff
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue