summaryrefslogtreecommitdiff
path: root/passes/fsm/fsm_map.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-16 23:50:36 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-16 23:50:36 +0200
commit7f734ecc098a2a113ced835cefc9d4e1982f08d0 (patch)
tree0e73ad74bd4602da7a6a1a3b264e1842deccac18 /passes/fsm/fsm_map.cc
parentf82c978e08604c596b034fb6e74ac34c78b9364b (diff)
Added module->uniquify()
Diffstat (limited to 'passes/fsm/fsm_map.cc')
-rw-r--r--passes/fsm/fsm_map.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/passes/fsm/fsm_map.cc b/passes/fsm/fsm_map.cc
index 60580eb4..ab6d5671 100644
--- a/passes/fsm/fsm_map.cc
+++ b/passes/fsm/fsm_map.cc
@@ -163,11 +163,7 @@ static void map_fsm(RTLIL::Cell *fsm_cell, RTLIL::Module *module)
// create state register
- std::string state_wire_name = fsm_cell->parameters["\\NAME"].decode_string();
- while (module->count_id(state_wire_name) > 0)
- state_wire_name += "_";
-
- RTLIL::Wire *state_wire = module->addWire(state_wire_name, fsm_data.state_bits);
+ RTLIL::Wire *state_wire = module->addWire(module->uniquify(fsm_cell->parameters["\\NAME"].decode_string()), fsm_data.state_bits);
RTLIL::Wire *next_state_wire = module->addWire(NEW_ID, fsm_data.state_bits);
RTLIL::Cell *state_dff = module->addCell(NEW_ID, "");