diff options
author | gatecat <gatecat@ds0.me> | 2021-06-01 16:12:57 +0100 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-06-02 14:27:56 +0100 |
commit | ff72454f8391ab4785fa8314f3efbbea96c30422 (patch) | |
tree | ec1606d83a643de5fab75998ecf086229376f92d /nexus/archdefs.h | |
parent | 76ef7688643ae777f670b2bb2fbab2ddbeed9196 (diff) | |
download | nextpnr-ff72454f8391ab4785fa8314f3efbbea96c30422.tar.gz nextpnr-ff72454f8391ab4785fa8314f3efbbea96c30422.tar.bz2 nextpnr-ff72454f8391ab4785fa8314f3efbbea96c30422.zip |
Add hash() member functions
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'nexus/archdefs.h')
-rw-r--r-- | nexus/archdefs.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nexus/archdefs.h b/nexus/archdefs.h index 660f166c..db8a3af4 100644 --- a/nexus/archdefs.h +++ b/nexus/archdefs.h @@ -24,6 +24,7 @@ #include <unordered_map> #include "base_clusterinfo.h" +#include "hashlib.h" #include "idstring.h" #include "nextpnr_namespaces.h" @@ -62,6 +63,7 @@ struct BelId { return tile < other.tile || (tile == other.tile && index < other.index); } + unsigned int hash() const { return mkhash(tile, index); } }; struct WireId @@ -80,6 +82,7 @@ struct WireId { return tile < other.tile || (tile == other.tile && index < other.index); } + unsigned int hash() const { return mkhash(tile, index); } }; struct PipId @@ -97,6 +100,7 @@ struct PipId { return tile < other.tile || (tile == other.tile && index < other.index); } + unsigned int hash() const { return mkhash(tile, index); } }; typedef IdString BelBucketId; @@ -111,6 +115,7 @@ struct GroupId bool operator==(const GroupId &other) const { return (type == other.type) && (x == other.x) && (y == other.y); } bool operator!=(const GroupId &other) const { return (type != other.type) || (x != other.x) || (y == other.y); } + unsigned int hash() const { return mkhash(mkhash(x, y), int(type)); } }; struct DecalId @@ -134,6 +139,7 @@ struct DecalId { return (type != other.type) || (index != other.index) || (active != other.active); } + unsigned int hash() const { return mkhash(index, int(type)); } }; struct ArchNetInfo |