From 4617aa8ccd138d80c1f68b35019a8afdbeb30c9f Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Wed, 11 Dec 2019 12:17:01 -0800 Subject: [PATCH] zinit to transform set/reset value of $_DFF_[NP][NP][01]_ --- passes/techmap/zinit.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/passes/techmap/zinit.cc b/passes/techmap/zinit.cc index 5cfc82ac9..f982dbb30 100644 --- a/passes/techmap/zinit.cc +++ b/passes/techmap/zinit.cc @@ -139,6 +139,20 @@ struct ZinitPass : public Pass { cell->setPort(ID::D, sig_d); cell->setPort(ID::Q, initwire); + + /*if (cell->type.in(ID($_DFFSR_NNN_), ID($_DFFSR_NNP_), ID($_DFFSR_NPN_), ID($_DFFSR_NPP_), + ID($_DFFSR_PNN_), ID($_DFFSR_PNP_), ID($_DFFSR_PPN_), ID($_DFFSR_PPP_))) + { + // TODO: I think I need a $_DFFRS_* cell where R has priority over S... + std::swap(cell->connections_.at(ID(R)), cell->connections_.at(ID(S))); + } + else*/ if (cell->type.in(ID($_DFF_NN0_), ID($_DFF_NN1_), ID($_DFF_NP0_), ID($_DFF_NP1_), + ID($_DFF_PN0_), ID($_DFF_PN1_), ID($_DFF_PP0_), ID($_DFF_PP1_))) + { + std::string t = cell->type.str(); + t[8] = (t[8] == '0' ? '1' : '0'); + cell->type = t; + } } if (!design->selected_whole_module(module)) -- 2.30.2