From 5142fb3b5c6e7ed89fe74fcdff7775d6f09c34f5 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Thu, 18 Aug 2022 13:56:22 +0200 Subject: [PATCH] write_aiger: Fix non-$_FF_ FFs This broke while switching sby's formal flows to always use $_FF_'s. --- backends/aiger/aiger.cc | 2 +- tests/various/aiger_dff.ys | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 tests/various/aiger_dff.ys diff --git a/backends/aiger/aiger.cc b/backends/aiger/aiger.cc index 2ea999dc0..513f9d95a 100644 --- a/backends/aiger/aiger.cc +++ b/backends/aiger/aiger.cc @@ -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; diff --git a/tests/various/aiger_dff.ys b/tests/various/aiger_dff.ys new file mode 100644 index 000000000..057f3d774 --- /dev/null +++ b/tests/various/aiger_dff.ys @@ -0,0 +1,7 @@ +read_verilog -icells <