diff options
author | Eddie Hung <eddie@fpgeh.com> | 2020-04-15 08:36:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 08:36:25 -0700 |
commit | 33b0ac92699bdbcd9279913d20700c3eba6c7201 (patch) | |
tree | d5585c21b45a5e37edf3415febd73a7ac9a06d23 /passes/techmap | |
parent | 0b7a5879e5838281a0060ecc09a4d4d877d9620e (diff) | |
parent | 383fe4a4bc9471e5ce93b0661f3a364b8da9f438 (diff) | |
download | yosys-33b0ac92699bdbcd9279913d20700c3eba6c7201.tar.gz yosys-33b0ac92699bdbcd9279913d20700c3eba6c7201.tar.bz2 yosys-33b0ac92699bdbcd9279913d20700c3eba6c7201.zip |
Merge pull request #1933 from YosysHQ/eddie/zinit_more
zinit: handle $__DFFS?E?_[NP][NP][01] too
Diffstat (limited to 'passes/techmap')
-rw-r--r-- | passes/techmap/zinit.cc | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/passes/techmap/zinit.cc b/passes/techmap/zinit.cc index 9eb47ff6d..74604ba3b 100644 --- a/passes/techmap/zinit.cc +++ b/passes/techmap/zinit.cc @@ -96,7 +96,15 @@ struct ZinitPass : public Pass { /*ID($_DFFSR_NNN_), ID($_DFFSR_NNP_), ID($_DFFSR_NPN_), ID($_DFFSR_NPP_), ID($_DFFSR_PNN_), ID($_DFFSR_PNP_), ID($_DFFSR_PPN_), ID($_DFFSR_PPP_),*/ ID($_DFF_N_), ID($_DFF_NN0_), ID($_DFF_NN1_), ID($_DFF_NP0_), ID($_DFF_NP1_), - ID($_DFF_P_), ID($_DFF_PN0_), ID($_DFF_PN1_), ID($_DFF_PP0_), ID($_DFF_PP1_) + ID($_DFF_P_), ID($_DFF_PN0_), ID($_DFF_PN1_), ID($_DFF_PP0_), ID($_DFF_PP1_), + // Async set/reset + ID($__DFFE_NN0), ID($__DFFE_NN1), ID($__DFFE_NP0), ID($__DFFE_NP1), + ID($__DFFE_PN0), ID($__DFFE_PN1), ID($__DFFE_PP0), ID($__DFFE_PP1), + // Sync set/reset + ID($__DFFS_NN0_), ID($__DFFS_NN1_), ID($__DFFS_NP0_), ID($__DFFS_NP1_), + ID($__DFFS_PN0_), ID($__DFFS_PN1_), ID($__DFFS_PP0_), ID($__DFFS_PP1_), + ID($__DFFSE_NN0), ID($__DFFSE_NN1), ID($__DFFSE_NP0), ID($__DFFSE_NP1), + ID($__DFFSE_PN0), ID($__DFFSE_PN1), ID($__DFFSE_PP0), ID($__DFFSE_PP1) }; for (auto cell : module->selected_cells()) @@ -150,14 +158,26 @@ struct ZinitPass : public Pass { val[i] = (val[i] == State::S1 ? State::S0 : State::S1); cell->setParam(ID::ARST_VALUE, std::move(val)); } - 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_))) - { - if (initval == State::S1) { - std::string t = cell->type.str(); + else if (initval == State::S1) { + std::string t = cell->type.str(); + 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_))) + { t[8] = (t[8] == '0' ? '1' : '0'); - cell->type = t; } + else if (cell->type.in(ID($__DFFE_NN0), ID($__DFFE_NN1), ID($__DFFE_NP0), ID($__DFFE_NP1), + ID($__DFFE_PN0), ID($__DFFE_PN1), ID($__DFFE_PP0), ID($__DFFE_PP1), + ID($__DFFS_NN0_), ID($__DFFS_NN1_), ID($__DFFS_NP0_), ID($__DFFS_NP1_), + ID($__DFFS_PN0_), ID($__DFFS_PN1_), ID($__DFFS_PP0_), ID($__DFFS_PP1_))) + { + t[10] = (t[10] == '0' ? '1' : '0'); + } + else if (cell->type.in(ID($__DFFSE_NN0), ID($__DFFSE_NN1), ID($__DFFSE_NP0), ID($__DFFSE_NP1), + ID($__DFFSE_PN0), ID($__DFFSE_PN1), ID($__DFFSE_PP0), ID($__DFFSE_PP1))) + { + t[11] = (t[11] == '0' ? '1' : '0'); + } + cell->type = t; } } } |