aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-06-01 16:12:57 +0100
committergatecat <gatecat@ds0.me>2021-06-02 14:27:56 +0100
commitff72454f8391ab4785fa8314f3efbbea96c30422 (patch)
treeec1606d83a643de5fab75998ecf086229376f92d /ice40
parent76ef7688643ae777f670b2bb2fbab2ddbeed9196 (diff)
downloadnextpnr-ff72454f8391ab4785fa8314f3efbbea96c30422.tar.gz
nextpnr-ff72454f8391ab4785fa8314f3efbbea96c30422.tar.bz2
nextpnr-ff72454f8391ab4785fa8314f3efbbea96c30422.zip
Add hash() member functions
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'ice40')
-rw-r--r--ice40/archdefs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/ice40/archdefs.h b/ice40/archdefs.h
index c2b7019c..2d962851 100644
--- a/ice40/archdefs.h
+++ b/ice40/archdefs.h
@@ -23,6 +23,7 @@
#include <boost/functional/hash.hpp>
#include "base_clusterinfo.h"
+#include "hashlib.h"
#include "idstring.h"
#include "nextpnr_namespaces.h"
@@ -55,6 +56,7 @@ struct BelId
bool operator==(const BelId &other) const { return index == other.index; }
bool operator!=(const BelId &other) const { return index != other.index; }
bool operator<(const BelId &other) const { return index < other.index; }
+ unsigned int hash() const { return index; }
};
struct WireId
@@ -64,6 +66,7 @@ struct WireId
bool operator==(const WireId &other) const { return index == other.index; }
bool operator!=(const WireId &other) const { return index != other.index; }
bool operator<(const WireId &other) const { return index < other.index; }
+ unsigned int hash() const { return index; }
};
struct PipId
@@ -73,6 +76,7 @@ struct PipId
bool operator==(const PipId &other) const { return index == other.index; }
bool operator!=(const PipId &other) const { return index != other.index; }
bool operator<(const PipId &other) const { return index < other.index; }
+ unsigned int hash() const { return index; }
};
struct GroupId
@@ -96,6 +100,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
@@ -113,6 +118,7 @@ struct DecalId
bool operator==(const DecalId &other) const { return (type == other.type) && (index == other.index); }
bool operator!=(const DecalId &other) const { return (type != other.type) || (index != other.index); }
+ unsigned int hash() const { return mkhash(index, int(type)); }
};
struct ArchNetInfo