From b1383a80cf8b89c7b0a2fa45338b07eb9710cc2b Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Fri, 27 Sep 2024 00:54:05 -0700 Subject: [PATCH] Make renaming nicer for bmuxmap -pmux --- passes/techmap/bmuxmap.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/passes/techmap/bmuxmap.cc b/passes/techmap/bmuxmap.cc index 7aa67d3c0..e043e4083 100644 --- a/passes/techmap/bmuxmap.cc +++ b/passes/techmap/bmuxmap.cc @@ -74,7 +74,9 @@ struct BmuxmapPass : public Pass { { module->addEq(NEW_ID, sel, SigSpec(val, GetSize(sel)), new_s[val]); } - RTLIL::Cell *pmux = module->addPmux(NEW_ID, new_a, data, new_s, new_data); + IdString new_id = IdString("$" + cell->name.str()); + while (module->count_id(new_id) > 0) new_id = IdString("$" + new_id.str()); + RTLIL::Cell *pmux = module->addPmux(new_id, new_a, data, new_s, new_data); pmux->add_strpool_attribute(ID::src, cell->get_strpool_attribute(ID::src)); data = new_data; }