aboutsummaryrefslogtreecommitdiffstats
path: root/passes/opt/opt_merge.cc
diff options
context:
space:
mode:
authorMarcelina Koƛcielnicka <mwk@0x04.net>2020-04-08 17:36:12 +0200
committerMarcelina Koƛcielnicka <mwk@0x04.net>2020-04-09 18:05:06 +0200
commit516857f3ba662f467d56df562eeca9ed214ac702 (patch)
treee584ce2b09eab5dce19e941da9e48ac0def550ac /passes/opt/opt_merge.cc
parent7f33d43e3b8c7d362203cdc2b10eb5f3caf5cdbe (diff)
downloadyosys-516857f3ba662f467d56df562eeca9ed214ac702.tar.gz
yosys-516857f3ba662f467d56df562eeca9ed214ac702.tar.bz2
yosys-516857f3ba662f467d56df562eeca9ed214ac702.zip
[NFCI] Deduplicate builtin FF cell types list
A few passes included the same list of FF cell types. Make it a global const instead. The zinit pass also seems to include a list like that, but given that it seems to be completely broken at the time (see #1568 discussion), I'm going to pretend I didn't see that.
Diffstat (limited to 'passes/opt/opt_merge.cc')
-rw-r--r--passes/opt/opt_merge.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/passes/opt/opt_merge.cc b/passes/opt/opt_merge.cc
index a861bd7a4..d845926fc 100644
--- a/passes/opt/opt_merge.cc
+++ b/passes/opt/opt_merge.cc
@@ -118,9 +118,7 @@ struct OptMergeWorker
for (auto &it : *conn) {
RTLIL::SigSpec sig;
if (cell->output(it.first)) {
- 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(ID($adff), ID($sr), ID($ff), ID($_FF_)))) {
+ if (it.first == ID::Q && RTLIL::builtin_ff_cell_types().count(cell->type)) {
// For the 'Q' output of state elements,
// use its (* init *) attribute value
for (const auto &b : dff_init_map(it.second))