3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-11 00:23:26 +00:00

hashlib: acc -> eat

This commit is contained in:
Emil J. Tywoniak 2024-11-11 15:45:11 +01:00
parent 79acc141d5
commit 4e29ec1854
25 changed files with 200 additions and 200 deletions

View file

@ -74,7 +74,7 @@ struct DriveBitWire
return offset < other.offset;
}
Hasher hash_acc(Hasher h) const;
Hasher hash_eat(Hasher h) const;
operator SigBit() const
@ -105,7 +105,7 @@ struct DriveBitPort
return offset < other.offset;
}
Hasher hash_acc(Hasher h) const;
Hasher hash_eat(Hasher h) const;
};
@ -129,7 +129,7 @@ struct DriveBitMarker
return offset < other.offset;
}
Hasher hash_acc(Hasher h) const;
Hasher hash_eat(Hasher h) const;
};
@ -164,7 +164,7 @@ public:
return multiple_ == other.multiple_;
}
Hasher hash_acc(Hasher h) const;
Hasher hash_eat(Hasher h) const;
};
struct DriveBit
@ -352,7 +352,7 @@ public:
return *this;
}
Hasher hash_acc(Hasher h) const;
Hasher hash_eat(Hasher h) const;
bool operator==(const DriveBit &other) const
{
@ -473,7 +473,7 @@ struct DriveChunkWire
return offset < other.offset;
}
Hasher hash_acc(Hasher h) const;
Hasher hash_eat(Hasher h) const;
explicit operator SigChunk() const
{
@ -531,7 +531,7 @@ struct DriveChunkPort
return offset < other.offset;
}
Hasher hash_acc(Hasher h) const;
Hasher hash_eat(Hasher h) const;
};
@ -572,7 +572,7 @@ struct DriveChunkMarker
return offset < other.offset;
}
Hasher hash_acc(Hasher h) const;
Hasher hash_eat(Hasher h) const;
};
struct DriveChunkMultiple
@ -612,7 +612,7 @@ public:
return false; // TODO implement, canonicalize order
}
Hasher hash_acc(Hasher h) const;
Hasher hash_eat(Hasher h) const;
};
struct DriveChunk
@ -863,7 +863,7 @@ public:
bool try_append(DriveBit const &bit);
bool try_append(DriveChunk const &chunk);
Hasher hash_acc(Hasher h) const;
Hasher hash_eat(Hasher h) const;
bool operator==(const DriveChunk &other) const
{
@ -1073,7 +1073,7 @@ public:
that->hash_ |= (that->hash_ == 0);
}
Hasher hash_acc(Hasher h) const;
Hasher hash_eat(Hasher h) const;
bool operator==(DriveSpec const &other) const {
updhash();
@ -1112,7 +1112,7 @@ private:
bool operator!=(const DriveBitId &other) const { return id != other.id; }
bool operator<(const DriveBitId &other) const { return id < other.id; }
// unsigned int hash() const { return id; }
Hasher hash_acc(Hasher h) const;
Hasher hash_eat(Hasher h) const;
};
// Essentially a dict<DriveBitId, pool<DriveBitId>> but using less memory
// and fewer allocations
@ -1258,130 +1258,130 @@ private:
}
};
inline Hasher DriveBitWire::hash_acc(Hasher h) const
inline Hasher DriveBitWire::hash_eat(Hasher h) const
{
h.acc(wire->name);
h.acc(offset);
h.eat(wire->name);
h.eat(offset);
return h;
}
inline Hasher DriveBitPort::hash_acc(Hasher h) const
inline Hasher DriveBitPort::hash_eat(Hasher h) const
{
h.acc(cell->name);
h.acc(port);
h.acc(offset);
h.eat(cell->name);
h.eat(port);
h.eat(offset);
return h;
}
inline Hasher DriveBitMarker::hash_acc(Hasher h) const
inline Hasher DriveBitMarker::hash_eat(Hasher h) const
{
h.acc(marker);
h.acc(offset);
h.eat(marker);
h.eat(offset);
return h;
}
inline Hasher DriveBitMultiple::hash_acc(Hasher h) const
inline Hasher DriveBitMultiple::hash_eat(Hasher h) const
{
h.acc(multiple_);
h.eat(multiple_);
return h;
}
inline Hasher DriveBit::hash_acc(Hasher h) const
inline Hasher DriveBit::hash_eat(Hasher h) const
{
switch (type_) {
case DriveType::NONE:
h.acc(0);
h.eat(0);
break;
case DriveType::CONSTANT:
h.acc(constant_);
h.eat(constant_);
break;
case DriveType::WIRE:
h.acc(wire_);
h.eat(wire_);
break;
case DriveType::PORT:
h.acc(port_);
h.eat(port_);
break;
case DriveType::MARKER:
h.acc(marker_);
h.eat(marker_);
break;
case DriveType::MULTIPLE:
h.acc(multiple_);
h.eat(multiple_);
break;
}
h.acc(type_);
h.eat(type_);
return h;
}
inline Hasher DriveChunkWire::hash_acc(Hasher h) const
inline Hasher DriveChunkWire::hash_eat(Hasher h) const
{
h.acc(wire->name);
h.acc(width);
h.acc(offset);
h.eat(wire->name);
h.eat(width);
h.eat(offset);
return h;
}
inline Hasher DriveChunkPort::hash_acc(Hasher h) const
inline Hasher DriveChunkPort::hash_eat(Hasher h) const
{
h.acc(cell->name);
h.acc(port);
h.acc(width);
h.acc(offset);
h.eat(cell->name);
h.eat(port);
h.eat(width);
h.eat(offset);
return h;
}
inline Hasher DriveChunkMarker::hash_acc(Hasher h) const
inline Hasher DriveChunkMarker::hash_eat(Hasher h) const
{
h.acc(marker);
h.acc(width);
h.acc(offset);
h.eat(marker);
h.eat(width);
h.eat(offset);
return h;
}
inline Hasher DriveChunkMultiple::hash_acc(Hasher h) const
inline Hasher DriveChunkMultiple::hash_eat(Hasher h) const
{
h.acc(width_);
h.acc(multiple_);
h.eat(width_);
h.eat(multiple_);
return h;
}
inline Hasher DriveChunk::hash_acc(Hasher h) const
inline Hasher DriveChunk::hash_eat(Hasher h) const
{
switch (type_) {
case DriveType::NONE:
h.acc(0);
h.eat(0);
break;
case DriveType::CONSTANT:
h.acc(constant_);
h.eat(constant_);
break;
case DriveType::WIRE:
h.acc(wire_);
h.eat(wire_);
break;
case DriveType::PORT:
h.acc(port_);
h.eat(port_);
break;
case DriveType::MARKER:
h.acc(marker_);
h.eat(marker_);
break;
case DriveType::MULTIPLE:
h.acc(multiple_);
h.eat(multiple_);
break;
}
h.acc(type_);
h.eat(type_);
return h;
}
inline Hasher DriveSpec::hash_acc(Hasher h) const
inline Hasher DriveSpec::hash_eat(Hasher h) const
{
if (hash_ == 0)
updhash();
h.acc(hash_);
h.eat(hash_);
return h;
}
inline Hasher DriverMap::DriveBitId::hash_acc(Hasher h) const
inline Hasher DriverMap::DriveBitId::hash_eat(Hasher h) const
{
h.acc(id);
h.eat(id);
return h;
}