diff options
author | Marcelina KoĆcielnicka <mwk@0x04.net> | 2020-04-08 17:36:12 +0200 |
---|---|---|
committer | Marcelina KoĆcielnicka <mwk@0x04.net> | 2020-04-09 18:05:06 +0200 |
commit | 516857f3ba662f467d56df562eeca9ed214ac702 (patch) | |
tree | e584ce2b09eab5dce19e941da9e48ac0def550ac /passes/cmds/setundef.cc | |
parent | 7f33d43e3b8c7d362203cdc2b10eb5f3caf5cdbe (diff) | |
download | yosys-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/cmds/setundef.cc')
-rw-r--r-- | passes/cmds/setundef.cc | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/passes/cmds/setundef.cc b/passes/cmds/setundef.cc index 5afd40923..2556d188a 100644 --- a/passes/cmds/setundef.cc +++ b/passes/cmds/setundef.cc @@ -359,34 +359,9 @@ struct SetundefPass : public Pass { pool<SigBit> ffbits; pool<Wire*> initwires; - pool<IdString> fftypes; - fftypes.insert(ID($dff)); - fftypes.insert(ID($dffe)); - fftypes.insert(ID($dffsr)); - fftypes.insert(ID($adff)); - - std::vector<char> list_np = {'N', 'P'}, list_01 = {'0', '1'}; - - for (auto c1 : list_np) - fftypes.insert(stringf("$_DFF_%c_", c1)); - - for (auto c1 : list_np) - for (auto c2 : list_np) - fftypes.insert(stringf("$_DFFE_%c%c_", c1, c2)); - - for (auto c1 : list_np) - for (auto c2 : list_np) - for (auto c3 : list_01) - fftypes.insert(stringf("$_DFF_%c%c%c_", c1, c2, c3)); - - for (auto c1 : list_np) - for (auto c2 : list_np) - for (auto c3 : list_np) - fftypes.insert(stringf("$_DFFSR_%c%c%c_", c1, c2, c3)); - for (auto cell : module->cells()) { - if (!fftypes.count(cell->type)) + if (!RTLIL::builtin_ff_cell_types().count(cell->type)) continue; for (auto bit : sigmap(cell->getPort(ID::Q))) |