diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-10-28 00:39:53 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-10-28 00:39:53 +0100 |
commit | e69efec588ddfa65b7a2d6970bab7a3bcfa77b04 (patch) | |
tree | 04fcec893a9dbd4d50a979e2a4c15a2c901fa0db /kernel | |
parent | 0c202a254963846626eef492059723bc2aa70dd0 (diff) |
Improvements in new SigMap
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sigtools.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/kernel/sigtools.h b/kernel/sigtools.h index 3e19ac8c..3ef87199 100644 --- a/kernel/sigtools.h +++ b/kernel/sigtools.h @@ -253,18 +253,29 @@ struct SigMap for (int i = 0; i < GetSize(from); i++) { - RTLIL::SigBit &bf = from[i]; - RTLIL::SigBit &bt = to[i]; + RTLIL::SigBit bf = database.find(from[i]); + RTLIL::SigBit bt = database.find(to[i]); - if (bf.wire != nullptr) + if (bf.wire || bt.wire) + { database.merge(bf, bt); + + if (bf.wire == nullptr) + database.promote(bf); + + if (bt.wire == nullptr) + database.promote(bt); + } } } void add(RTLIL::SigSpec sig) { - for (auto &bit : sig) - database.promote(bit); + for (auto &bit : sig) { + RTLIL::SigBit b = database.find(bit); + if (b.wire != nullptr) + database.promote(bit); + } } void apply(RTLIL::SigBit &bit) const |