mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 14:13:23 +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
|
@ -151,7 +151,7 @@ namespace Functional {
|
|||
// returns the data width of a bitvector sort, errors out for other sorts
|
||||
int data_width() const { return std::get<1>(_v).second; }
|
||||
bool operator==(Sort const& other) const { return _v == other._v; }
|
||||
unsigned int hash() const { return mkhash(_v); }
|
||||
Hasher hash_acc(Hasher h) const { h.acc(_v); return h; }
|
||||
};
|
||||
class IR;
|
||||
class Factory;
|
||||
|
@ -225,8 +225,10 @@ namespace Functional {
|
|||
const RTLIL::Const &as_const() const { return std::get<RTLIL::Const>(_extra); }
|
||||
std::pair<IdString, IdString> as_idstring_pair() const { return std::get<std::pair<IdString, IdString>>(_extra); }
|
||||
int as_int() const { return std::get<int>(_extra); }
|
||||
int hash() const {
|
||||
return mkhash((unsigned int) _fn, mkhash(_extra));
|
||||
Hasher hash_acc(Hasher h) const {
|
||||
h.acc((unsigned int) _fn);
|
||||
h.acc(_extra);
|
||||
return h;
|
||||
}
|
||||
bool operator==(NodeData const &other) const {
|
||||
return _fn == other._fn && _extra == other._extra;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue