mirror of
https://github.com/YosysHQ/yosys
synced 2025-07-03 03:15:42 +00:00
failed trick with tag_dict to track which dict of consts takes up space
This commit is contained in:
parent
74a1dd99ac
commit
7532334875
2 changed files with 35 additions and 1 deletions
|
@ -211,6 +211,7 @@ inline int hashtable_size(int min_size)
|
||||||
throw std::length_error("hash table exceeded maximum size.");
|
throw std::length_error("hash table exceeded maximum size.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename K, typename T, typename OPS = hash_ops<K>> class tag_dict;
|
||||||
template<typename K, typename T, typename OPS = hash_ops<K>> class dict;
|
template<typename K, typename T, typename OPS = hash_ops<K>> class dict;
|
||||||
template<typename K, int offset = 0, typename OPS = hash_ops<K>> class idict;
|
template<typename K, int offset = 0, typename OPS = hash_ops<K>> class idict;
|
||||||
template<typename K, typename OPS = hash_ops<K>> class pool;
|
template<typename K, typename OPS = hash_ops<K>> class pool;
|
||||||
|
@ -671,6 +672,39 @@ public:
|
||||||
const_iterator end() const { return const_iterator(nullptr, -1); }
|
const_iterator end() const { return const_iterator(nullptr, -1); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename K, typename T, typename OPS>
|
||||||
|
class tag_dict : public dict<K, T, OPS> {
|
||||||
|
public:
|
||||||
|
tag_dict& operator = (const tag_dict& rhs) {
|
||||||
|
dict<K, T, OPS>::operator =(rhs);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
tag_dict& operator = (tag_dict&& rhs) {
|
||||||
|
dict<K, T, OPS>::operator =(rhs);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
constexpr tag_dict() : dict<K, T, OPS>()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
tag_dict(const dict<K, T, OPS> &other) : dict<K, T, OPS>(other) { }
|
||||||
|
tag_dict(const tag_dict &other) : dict<K, T, OPS>(other) { }
|
||||||
|
// tag_dict(const tag_dict &other)
|
||||||
|
// {
|
||||||
|
// dict<K, T, OPS>(other);
|
||||||
|
// // entries = other.entries;
|
||||||
|
// // do_rehash();
|
||||||
|
// }
|
||||||
|
|
||||||
|
tag_dict(dict<K, T, OPS> &&other) : dict<K, T, OPS>(other) { }
|
||||||
|
tag_dict(tag_dict &&other) : dict<K, T, OPS>(other) { }
|
||||||
|
// tag_dict(tag_dict &&other)
|
||||||
|
// {
|
||||||
|
// dict<K, T, OPS>(other);
|
||||||
|
// // swap(other);
|
||||||
|
// }
|
||||||
|
};
|
||||||
|
|
||||||
template<typename K, typename OPS>
|
template<typename K, typename OPS>
|
||||||
class pool
|
class pool
|
||||||
{
|
{
|
||||||
|
|
|
@ -1565,7 +1565,7 @@ public:
|
||||||
RTLIL::IdString name;
|
RTLIL::IdString name;
|
||||||
RTLIL::IdString type;
|
RTLIL::IdString type;
|
||||||
dict<RTLIL::IdString, RTLIL::SigSpec> connections_;
|
dict<RTLIL::IdString, RTLIL::SigSpec> connections_;
|
||||||
dict<RTLIL::IdString, RTLIL::Const> parameters;
|
hashlib::tag_dict<RTLIL::IdString, RTLIL::Const> parameters;
|
||||||
|
|
||||||
// access cell ports
|
// access cell ports
|
||||||
bool hasPort(const RTLIL::IdString &portname) const;
|
bool hasPort(const RTLIL::IdString &portname) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue