fsm_extract: avoid calling log_signal to determine wire name
authorMarcelina Kościelnicka <mwk@0x04.net>
Mon, 8 Jun 2020 01:48:09 +0000 (03:48 +0200)
committerMarcelina Kościelnicka <mwk@0x04.net>
Mon, 8 Jun 2020 01:49:58 +0000 (03:49 +0200)
log_signal can result in a string with spaces (when bit selection is
involved), which breaks the rule of IdString not containing whitespace.
Instead, remove the sigspec from the name entirely — given that the
resulting wire will have no users, it will be removed later anyway,
so its name doesn't really matter.

Fixes #2118

passes/fsm/fsm_extract.cc

index 3840aabc88fbe959c831969facfe8786a87caf2b..6f99886f01f21881c1de138396d8d59de85ce438 100644 (file)
@@ -394,7 +394,7 @@ static void extract_fsm(RTLIL::Wire *wire)
                RTLIL::Cell *cell = module->cells_.at(cellport.first);
                RTLIL::SigSpec port_sig = assign_map(cell->getPort(cellport.second));
                RTLIL::SigSpec unconn_sig = port_sig.extract(ctrl_out);
-               RTLIL::Wire *unconn_wire = module->addWire(stringf("$fsm_unconnect$%s$%d", log_signal(unconn_sig), autoidx++), unconn_sig.size());
+               RTLIL::Wire *unconn_wire = module->addWire(stringf("$fsm_unconnect$%d", autoidx++), unconn_sig.size());
                port_sig.replace(unconn_sig, RTLIL::SigSpec(unconn_wire), &cell->connections_[cellport.second]);
        }
 }