aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sigtools.h
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-12-26 22:08:44 +0100
committerClifford Wolf <clifford@clifford.at>2014-12-26 22:08:44 +0100
commit6ce6689b639785f3d526c73faad6faba811beaf8 (patch)
tree30869c2caff12d84c5c21c1a585e8f8fd0d11371 /kernel/sigtools.h
parentec4751e55c11d7287dacd39fb61ad936995fc963 (diff)
downloadyosys-6ce6689b639785f3d526c73faad6faba811beaf8.tar.gz
yosys-6ce6689b639785f3d526c73faad6faba811beaf8.tar.bz2
yosys-6ce6689b639785f3d526c73faad6faba811beaf8.zip
Using Yosys::dict and Yosys::pool in sigtools.h
Diffstat (limited to 'kernel/sigtools.h')
-rw-r--r--kernel/sigtools.h11
1 files changed, 7 insertions, 4 deletions
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<RTLIL::Wire*, int> {
bitDef_t() : std::pair<RTLIL::Wire*, int>(NULL, 0) { }
bitDef_t(const RTLIL::SigBit &bit) : std::pair<RTLIL::Wire*, int>(bit.wire, bit.offset) { }
+ unsigned int hash() const { return first->name.hash() + second; }
};
- std::set<bitDef_t> bits;
+ pool<bitDef_t> bits;
void clear()
{
@@ -122,7 +123,7 @@ struct SigPool
RTLIL::SigSpec export_all()
{
- std::set<RTLIL::SigBit> sig;
+ pool<RTLIL::SigBit> 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<RTLIL::Wire*, int> {
bitDef_t() : std::pair<RTLIL::Wire*, int>(NULL, 0) { }
bitDef_t(const RTLIL::SigBit &bit) : std::pair<RTLIL::Wire*, int>(bit.wire, bit.offset) { }
+ unsigned int hash() const { return first->name.hash() + second; }
};
- std::map<bitDef_t, std::set<T, Compare>> bits;
+ dict<bitDef_t, std::set<T, Compare>> bits;
void clear()
{
@@ -214,6 +216,7 @@ struct SigMap
struct bitDef_t : public std::pair<RTLIL::Wire*, int> {
bitDef_t() : std::pair<RTLIL::Wire*, int>(NULL, 0) { }
bitDef_t(const RTLIL::SigBit &bit) : std::pair<RTLIL::Wire*, int>(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<bitDef_t> bits;
};
- std::map<bitDef_t, shared_bit_data_t*> bits;
+ dict<bitDef_t, shared_bit_data_t*> bits;
SigMap(RTLIL::Module *module = NULL)
{