diff --git a/kernel/sigtools.h b/kernel/sigtools.h index c3c6a8db1..5281b7a45 100644 --- a/kernel/sigtools.h +++ b/kernel/sigtools.h @@ -29,9 +29,10 @@ struct SigPool struct bitDef_t : public std::pair { bitDef_t() : std::pair(NULL, 0) { } bitDef_t(const RTLIL::SigBit &bit) : std::pair(bit.wire, bit.offset) { } + unsigned int hash() const { return first->name.hash() + second; } }; - std::set bits; + pool bits; void clear() { @@ -122,7 +123,7 @@ struct SigPool RTLIL::SigSpec export_all() { - std::set sig; + pool sig; for (auto &bit : bits) sig.insert(RTLIL::SigBit(bit.first, bit.second)); return sig; @@ -140,9 +141,10 @@ struct SigSet struct bitDef_t : public std::pair { bitDef_t() : std::pair(NULL, 0) { } bitDef_t(const RTLIL::SigBit &bit) : std::pair(bit.wire, bit.offset) { } + unsigned int hash() const { return first->name.hash() + second; } }; - std::map> bits; + dict> bits; void clear() { @@ -214,6 +216,7 @@ struct SigMap struct bitDef_t : public std::pair { bitDef_t() : std::pair(NULL, 0) { } bitDef_t(const RTLIL::SigBit &bit) : std::pair(bit.wire, bit.offset) { } + unsigned int hash() const { return first->name.hash() + second; } }; struct shared_bit_data_t { @@ -221,7 +224,7 @@ struct SigMap std::set bits; }; - std::map bits; + dict bits; SigMap(RTLIL::Module *module = NULL) {