3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-07 09:55:20 +00:00

Further improved dfflibmap cellmap exploration

This commit is contained in:
Clifford Wolf 2013-12-20 12:34:34 +01:00
parent 404bcc2d1e
commit eaf7d9675d

View file

@ -473,20 +473,24 @@ struct DfflibmapPass : public Pass {
find_cell_sr(libparser.ast, "$_DFFSR_PPN_", true, true, false); find_cell_sr(libparser.ast, "$_DFFSR_PPN_", true, true, false);
find_cell_sr(libparser.ast, "$_DFFSR_PPP_", true, true, true); find_cell_sr(libparser.ast, "$_DFFSR_PPP_", true, true, true);
bool keep_running; int level = 0;
do { while (level < 3) {
keep_running = false; bool did_something = false;
keep_running |= expand_cellmap("$_DFF_?*?_", "R"); switch (level) {
keep_running |= expand_cellmap("$_DFF_??*_", "DQ"); case 2:
keep_running |= expand_cellmap("$_DFFSR_?*?_", "S"); did_something |= expand_cellmap("$_DFF_*_", "C");
keep_running |= expand_cellmap("$_DFFSR_??*_", "R"); did_something |= expand_cellmap("$_DFF_*??_", "C");
} while (keep_running); did_something |= expand_cellmap("$_DFFSR_*??_", "C");
do { case 1:
keep_running = false; did_something |= expand_cellmap("$_DFF_??*_", "DQ");
keep_running |= expand_cellmap("$_DFF_*_", "C"); case 0:
keep_running |= expand_cellmap("$_DFF_*??_", "C"); did_something |= expand_cellmap("$_DFF_?*?_", "R");
keep_running |= expand_cellmap("$_DFFSR_*??_", "C"); did_something |= expand_cellmap("$_DFFSR_?*?_", "S");
} while (keep_running); did_something |= expand_cellmap("$_DFFSR_??*_", "R");
}
if (!did_something)
level++;
}
map_sr_to_arst("$_DFFSR_NNN_", "$_DFF_NN0_"); map_sr_to_arst("$_DFFSR_NNN_", "$_DFF_NN0_");
map_sr_to_arst("$_DFFSR_NNN_", "$_DFF_NN1_"); map_sr_to_arst("$_DFFSR_NNN_", "$_DFF_NN1_");