aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/archdefs.h
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 /fpga_interchange/archdefs.h
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 'fpga_interchange/archdefs.h')
-rw-r--r--fpga_interchange/archdefs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fpga_interchange/archdefs.h b/fpga_interchange/archdefs.h
index c145b893..aa3f1e6e 100644
--- a/fpga_interchange/archdefs.h
+++ b/fpga_interchange/archdefs.h
@@ -25,6 +25,7 @@
#include <cstdint>
#include "hash_table.h"
+#include "hashlib.h"
#include "luts.h"
#include "nextpnr_namespaces.h"
@@ -48,6 +49,7 @@ struct BelId
{
return tile < other.tile || (tile == other.tile && index < other.index);
}
+ unsigned int hash() const { return mkhash(tile, index); }
};
struct WireId
@@ -62,6 +64,7 @@ struct WireId
{
return tile < other.tile || (tile == other.tile && index < other.index);
}
+ unsigned int hash() const { return mkhash(tile, index); }
};
struct PipId
@@ -75,6 +78,7 @@ struct PipId
{
return tile < other.tile || (tile == other.tile && index < other.index);
}
+ unsigned int hash() const { return mkhash(tile, index); }
};
struct GroupId
@@ -96,6 +100,7 @@ struct BelBucketId
bool operator==(const BelBucketId &other) const { return (name == other.name); }
bool operator!=(const BelBucketId &other) const { return (name != other.name); }
bool operator<(const BelBucketId &other) const { return name < other.name; }
+ unsigned int hash() const { return name.hash(); }
};
typedef IdString ClusterId;