diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-12-20 12:34:34 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-12-20 12:34:34 +0100 |
commit | eaf7d9675de7e54ef55b5cd45784c2ea7556e8cf (patch) | |
tree | eaea1a4e09fa42155a527b835fc4baacc30c8288 /passes | |
parent | 404bcc2d1ed64dffa92b9891d930c6c53c192c1c (diff) | |
download | yosys-eaf7d9675de7e54ef55b5cd45784c2ea7556e8cf.tar.gz yosys-eaf7d9675de7e54ef55b5cd45784c2ea7556e8cf.tar.bz2 yosys-eaf7d9675de7e54ef55b5cd45784c2ea7556e8cf.zip |
Further improved dfflibmap cellmap exploration
Diffstat (limited to 'passes')
-rw-r--r-- | passes/techmap/dfflibmap.cc | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/passes/techmap/dfflibmap.cc b/passes/techmap/dfflibmap.cc index c35a09c26..a38ec66b2 100644 --- a/passes/techmap/dfflibmap.cc +++ b/passes/techmap/dfflibmap.cc @@ -473,20 +473,24 @@ struct DfflibmapPass : public Pass { find_cell_sr(libparser.ast, "$_DFFSR_PPN_", true, true, false); find_cell_sr(libparser.ast, "$_DFFSR_PPP_", true, true, true); - bool keep_running; - do { - keep_running = false; - keep_running |= expand_cellmap("$_DFF_?*?_", "R"); - keep_running |= expand_cellmap("$_DFF_??*_", "DQ"); - keep_running |= expand_cellmap("$_DFFSR_?*?_", "S"); - keep_running |= expand_cellmap("$_DFFSR_??*_", "R"); - } while (keep_running); - do { - keep_running = false; - keep_running |= expand_cellmap("$_DFF_*_", "C"); - keep_running |= expand_cellmap("$_DFF_*??_", "C"); - keep_running |= expand_cellmap("$_DFFSR_*??_", "C"); - } while (keep_running); + int level = 0; + while (level < 3) { + bool did_something = false; + switch (level) { + case 2: + did_something |= expand_cellmap("$_DFF_*_", "C"); + did_something |= expand_cellmap("$_DFF_*??_", "C"); + did_something |= expand_cellmap("$_DFFSR_*??_", "C"); + case 1: + did_something |= expand_cellmap("$_DFF_??*_", "DQ"); + case 0: + did_something |= expand_cellmap("$_DFF_?*?_", "R"); + did_something |= expand_cellmap("$_DFFSR_?*?_", "S"); + 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_NN1_"); |