From: Clifford Wolf Date: Fri, 26 Dec 2014 21:08:44 +0000 (+0100) Subject: Using Yosys::dict and Yosys::pool in sigtools.h X-Git-Tag: yosys-0.5~213 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ce6689b639785f3d526c73faad6faba811beaf8;p=yosys.git Using Yosys::dict and Yosys::pool in sigtools.h --- 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) {