summaryrefslogtreecommitdiff
path: root/passes/techmap/techmap.cc
diff options
context:
space:
mode:
Diffstat (limited to 'passes/techmap/techmap.cc')
-rw-r--r--passes/techmap/techmap.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/passes/techmap/techmap.cc b/passes/techmap/techmap.cc
index f3b1a0ef..8d7b21e0 100644
--- a/passes/techmap/techmap.cc
+++ b/passes/techmap/techmap.cc
@@ -41,14 +41,15 @@ static void apply_prefix(std::string prefix, std::string &id)
static void apply_prefix(std::string prefix, RTLIL::SigSpec &sig, RTLIL::Module *module)
{
- for (size_t i = 0; i < sig.chunks().size(); i++) {
- if (sig.chunks()[i].wire == NULL)
- continue;
- std::string wire_name = sig.chunks()[i].wire->name;
- apply_prefix(prefix, wire_name);
- assert(module->wires.count(wire_name) > 0);
- sig.chunks_rw()[i].wire = module->wires[wire_name];
- }
+ std::vector<RTLIL::SigChunk> chunks = sig;
+ for (auto &chunk : chunks)
+ if (chunk.wire != NULL) {
+ std::string wire_name = chunk.wire->name;
+ apply_prefix(prefix, wire_name);
+ assert(module->wires.count(wire_name) > 0);
+ chunk.wire = module->wires[wire_name];
+ }
+ sig = chunks;
}
struct TechmapWorker