Merge pull request #3450 from jix/write_aiger_nonff

write_aiger: Fix non-$_FF_ FFs
This commit is contained in:
Jannis Harder 2022-08-18 16:50:56 +02:00 committed by GitHub
commit f1c9399b66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -202,7 +202,7 @@ struct AigerWriter
ff_map[Q] = D;
if (cell->type != ID($_FF_)) {
auto sig_clk = sigmap(cell->getPort(ID::CLK).as_bit());
auto sig_clk = sigmap(cell->getPort(ID::C).as_bit());
ywmap_clocks[sig_clk] |= cell->type == ID($_DFF_N_) ? 2 : 1;
}
continue;

View File

@ -0,0 +1,7 @@
read_verilog -icells <<EOT
module top(input clk, d, output q);
\$_DFF_N_ dffn(.C(clk), .D(d), .Q(q));
endmodule
EOT
write_aiger -zinit -ywmap aiger_dff.out /dev/null
!grep -qF negedge aiger_dff.out