summaryrefslogtreecommitdiff
path: root/passes/techmap/techmap.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-07-23 15:36:09 +0200
committerClifford Wolf <clifford@clifford.at>2014-07-23 15:36:09 +0200
commit4e802eb7f6fe5858f8657be7cd3e6638cc0f2ece (patch)
tree917ce7eece77475cfc632f3d41f5fb8aadef64d2 /passes/techmap/techmap.cc
parent85db102e13bbd6decda3f99ef640d0991ee24b33 (diff)
Fixed all users of SigSpec::chunks_rw() and removed it
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