mirror of
https://github.com/YosysHQ/yosys
synced 2026-07-19 21:55:48 +00:00
Bump Yosys to latest
This commit is contained in:
commit
77be4d7be7
153 changed files with 3391 additions and 588 deletions
|
|
@ -452,16 +452,21 @@ class dict {
|
|||
return 1;
|
||||
}
|
||||
|
||||
int do_lookup(const K &key, Hasher::hash_t &hash) const
|
||||
int do_lookup(const K &key, Hasher::hash_t &hash)
|
||||
{
|
||||
if (hashtable.empty())
|
||||
return -1;
|
||||
|
||||
if (entries.size() * hashtable_size_trigger > hashtable.size()) {
|
||||
((dict*)this)->do_rehash();
|
||||
do_rehash();
|
||||
hash = do_hash(key);
|
||||
}
|
||||
|
||||
return do_lookup_internal(key, hash);
|
||||
}
|
||||
|
||||
int do_lookup_internal(const K &key, Hasher::hash_t hash) const
|
||||
{
|
||||
int index = hashtable[hash];
|
||||
|
||||
while (index >= 0 && !ops.cmp(entries[index].udata.first, key)) {
|
||||
|
|
@ -472,6 +477,14 @@ class dict {
|
|||
return index;
|
||||
}
|
||||
|
||||
int do_lookup_no_rehash(const K &key, Hasher::hash_t hash) const
|
||||
{
|
||||
if (hashtable.empty())
|
||||
return -1;
|
||||
|
||||
return do_lookup_internal(key, hash);
|
||||
}
|
||||
|
||||
int do_insert(const K &key, Hasher::hash_t &hash)
|
||||
{
|
||||
if (hashtable.empty()) {
|
||||
|
|
@ -695,14 +708,14 @@ public:
|
|||
int count(const K &key) const
|
||||
{
|
||||
Hasher::hash_t hash = do_hash(key);
|
||||
int i = do_lookup(key, hash);
|
||||
int i = do_lookup_no_rehash(key, hash);
|
||||
return i < 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
int count(const K &key, const_iterator it) const
|
||||
{
|
||||
Hasher::hash_t hash = do_hash(key);
|
||||
int i = do_lookup(key, hash);
|
||||
int i = do_lookup_no_rehash(key, hash);
|
||||
return i < 0 || i > it.index ? 0 : 1;
|
||||
}
|
||||
|
||||
|
|
@ -718,7 +731,7 @@ public:
|
|||
const_iterator find(const K &key) const
|
||||
{
|
||||
Hasher::hash_t hash = do_hash(key);
|
||||
int i = do_lookup(key, hash);
|
||||
int i = do_lookup_no_rehash(key, hash);
|
||||
if (i < 0)
|
||||
return end();
|
||||
return const_iterator(this, i);
|
||||
|
|
@ -736,7 +749,7 @@ public:
|
|||
const T& at(const K &key) const
|
||||
{
|
||||
Hasher::hash_t hash = do_hash(key);
|
||||
int i = do_lookup(key, hash);
|
||||
int i = do_lookup_no_rehash(key, hash);
|
||||
if (i < 0)
|
||||
throw std::out_of_range("dict::at()");
|
||||
return entries[i].udata.second;
|
||||
|
|
@ -745,7 +758,7 @@ public:
|
|||
const T& at(const K &key, const T &defval) const
|
||||
{
|
||||
Hasher::hash_t hash = do_hash(key);
|
||||
int i = do_lookup(key, hash);
|
||||
int i = do_lookup_no_rehash(key, hash);
|
||||
if (i < 0)
|
||||
return defval;
|
||||
return entries[i].udata.second;
|
||||
|
|
@ -907,16 +920,21 @@ protected:
|
|||
return 1;
|
||||
}
|
||||
|
||||
int do_lookup(const K &key, Hasher::hash_t &hash) const
|
||||
int do_lookup(const K &key, Hasher::hash_t &hash)
|
||||
{
|
||||
if (hashtable.empty())
|
||||
return -1;
|
||||
|
||||
if (entries.size() * hashtable_size_trigger > hashtable.size()) {
|
||||
((pool*)this)->do_rehash();
|
||||
do_rehash();
|
||||
hash = do_hash(key);
|
||||
}
|
||||
|
||||
return do_lookup_internal(key, hash);
|
||||
}
|
||||
|
||||
int do_lookup_internal(const K &key, Hasher::hash_t hash) const
|
||||
{
|
||||
int index = hashtable[hash];
|
||||
|
||||
while (index >= 0 && !ops.cmp(entries[index].udata, key)) {
|
||||
|
|
@ -927,6 +945,14 @@ protected:
|
|||
return index;
|
||||
}
|
||||
|
||||
int do_lookup_no_rehash(const K &key, Hasher::hash_t hash) const
|
||||
{
|
||||
if (hashtable.empty())
|
||||
return -1;
|
||||
|
||||
return do_lookup_internal(key, hash);
|
||||
}
|
||||
|
||||
int do_insert(const K &value, Hasher::hash_t &hash)
|
||||
{
|
||||
if (hashtable.empty()) {
|
||||
|
|
@ -1093,14 +1119,14 @@ public:
|
|||
int count(const K &key) const
|
||||
{
|
||||
Hasher::hash_t hash = do_hash(key);
|
||||
int i = do_lookup(key, hash);
|
||||
int i = do_lookup_no_rehash(key, hash);
|
||||
return i < 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
int count(const K &key, const_iterator it) const
|
||||
{
|
||||
Hasher::hash_t hash = do_hash(key);
|
||||
int i = do_lookup(key, hash);
|
||||
int i = do_lookup_no_rehash(key, hash);
|
||||
return i < 0 || i > it.index ? 0 : 1;
|
||||
}
|
||||
|
||||
|
|
@ -1116,7 +1142,7 @@ public:
|
|||
const_iterator find(const K &key) const
|
||||
{
|
||||
Hasher::hash_t hash = do_hash(key);
|
||||
int i = do_lookup(key, hash);
|
||||
int i = do_lookup_no_rehash(key, hash);
|
||||
if (i < 0)
|
||||
return end();
|
||||
return const_iterator(this, i);
|
||||
|
|
@ -1228,7 +1254,7 @@ public:
|
|||
int at(const K &key) const
|
||||
{
|
||||
Hasher::hash_t hash = database.do_hash(key);
|
||||
int i = database.do_lookup(key, hash);
|
||||
int i = database.do_lookup_no_rehash(key, hash);
|
||||
if (i < 0)
|
||||
throw std::out_of_range("idict::at()");
|
||||
return i + offset;
|
||||
|
|
@ -1237,7 +1263,7 @@ public:
|
|||
int at(const K &key, int defval) const
|
||||
{
|
||||
Hasher::hash_t hash = database.do_hash(key);
|
||||
int i = database.do_lookup(key, hash);
|
||||
int i = database.do_lookup_no_rehash(key, hash);
|
||||
if (i < 0)
|
||||
return defval;
|
||||
return i + offset;
|
||||
|
|
@ -1246,7 +1272,7 @@ public:
|
|||
int count(const K &key) const
|
||||
{
|
||||
Hasher::hash_t hash = database.do_hash(key);
|
||||
int i = database.do_lookup(key, hash);
|
||||
int i = database.do_lookup_no_rehash(key, hash);
|
||||
return i < 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue