diff options
author | Eddie Hung <eddie@fpgeh.com> | 2019-12-20 13:00:04 -0800 |
---|---|---|
committer | Eddie Hung <eddie@fpgeh.com> | 2019-12-20 13:00:04 -0800 |
commit | f5e0a07ad679696b0d3077ef877941d4c1f864d7 (patch) | |
tree | a90fe8fba027549c81bf904ad3a30119f5402c55 /passes/opt/opt_merge.cc | |
parent | d038cea3c7c5dd9f147c4da0e44de0e664df089f (diff) | |
download | yosys-f5e0a07ad679696b0d3077ef877941d4c1f864d7.tar.gz yosys-f5e0a07ad679696b0d3077ef877941d4c1f864d7.tar.bz2 yosys-f5e0a07ad679696b0d3077ef877941d4c1f864d7.zip |
Add $_FF_ and $_SR* courtesy of @mwkmwkmwk
Diffstat (limited to 'passes/opt/opt_merge.cc')
-rw-r--r-- | passes/opt/opt_merge.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/passes/opt/opt_merge.cc b/passes/opt/opt_merge.cc index 8dd238bc7..8823a9061 100644 --- a/passes/opt/opt_merge.cc +++ b/passes/opt/opt_merge.cc @@ -222,8 +222,9 @@ struct OptMergeWorker return true; } - if (conn1.count(ID(Q)) != 0 && (cell1->type.begins_with("$dff") || cell1->type.begins_with("$dlatch") || cell1->type.in("$adff", "$sr", "$ff") || - cell1->type.begins_with("$_DFF") || cell1->type.begins_with("$_DLATCH"))) { + if (conn1.count(ID(Q)) != 0 && (cell1->type.begins_with("$dff") || cell1->type.begins_with("$dlatch") || + cell1->type.begins_with("$_DFF") || cell1->type.begins_with("$_DLATCH") || cell1->type.begins_with("$_SR_") || + cell1->type.in("$adff", "$sr", "$ff", "$_FF_"))) { std::vector<RTLIL::SigBit> q1 = dff_init_map(cell1->getPort(ID(Q))).to_sigbit_vector(); std::vector<RTLIL::SigBit> q2 = dff_init_map(cell2->getPort(ID(Q))).to_sigbit_vector(); for (size_t i = 0; i < q1.size(); i++) @@ -325,8 +326,9 @@ struct OptMergeWorker module->connect(RTLIL::SigSig(it.second, other_sig)); assign_map.add(it.second, other_sig); - if (it.first == ID(Q) && (cell->type.begins_with("$dff") || cell->type.begins_with("$dlatch") || cell->type.in("$adff", "$sr", "$ff") || - cell->type.begins_with("$_DFF") || cell->type.begins_with("$_DLATCH"))) { + if (it.first == ID(Q) && (cell->type.begins_with("$dff") || cell->type.begins_with("$dlatch") || + cell->type.begins_with("$_DFF") || cell->type.begins_with("$_DLATCH") || cell->type.begins_with("$_SR_") || + cell->type.in("$adff", "$sr", "$ff", "$_FF_"))) { for (auto c : it.second.chunks()) { auto jt = c.wire->attributes.find(ID(init)); if (jt == c.wire->attributes.end()) |