mirror of
https://github.com/YosysHQ/yosys
synced 2025-07-24 21:27:00 +00:00
hashlib: redo interface for flexibility
This commit is contained in:
parent
7a362f1f74
commit
d071489ab1
35 changed files with 542 additions and 386 deletions
|
@ -176,7 +176,7 @@ struct coverdb_t
|
|||
|
||||
struct mutate_queue_t
|
||||
{
|
||||
pool<mutate_t*, hash_ptr_ops> db;
|
||||
pool<mutate_t*> db;
|
||||
|
||||
mutate_t *pick(xs128_t &rng, coverdb_t &coverdb, const mutate_opts_t &opts) {
|
||||
mutate_t *m = nullptr;
|
||||
|
|
|
@ -46,9 +46,11 @@ struct IdBit {
|
|||
|
||||
bool operator==(const IdBit &other) const { return name == other.name && bit == other.bit; };
|
||||
bool operator!=(const IdBit &other) const { return name != other.name || bit != other.bit; };
|
||||
unsigned hash() const
|
||||
Hasher hash_acc(Hasher h) const
|
||||
{
|
||||
return mkhash_add(name.hash(), bit);
|
||||
h.acc(name);
|
||||
h.acc(bit);
|
||||
return h;
|
||||
}
|
||||
|
||||
IdString name;
|
||||
|
@ -62,9 +64,11 @@ struct InvBit {
|
|||
|
||||
bool operator==(const InvBit &other) const { return bit == other.bit && inverted == other.inverted; };
|
||||
bool operator!=(const InvBit &other) const { return bit != other.bit || inverted != other.inverted; };
|
||||
unsigned hash() const
|
||||
Hasher hash_acc(Hasher h) const
|
||||
{
|
||||
return mkhash(bit.hash(), inverted);
|
||||
h.acc(bit);
|
||||
h.acc(inverted);
|
||||
return h;
|
||||
}
|
||||
|
||||
IdBit bit;
|
||||
|
|
|
@ -161,7 +161,7 @@ struct SimInstance
|
|||
pool<SigBit> dirty_bits;
|
||||
pool<Cell*> dirty_cells;
|
||||
pool<IdString> dirty_memories;
|
||||
pool<SimInstance*, hash_ptr_ops> dirty_children;
|
||||
pool<SimInstance*> dirty_children;
|
||||
|
||||
struct ff_state_t
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue