From ff72454f8391ab4785fa8314f3efbbea96c30422 Mon Sep 17 00:00:00 2001 From: gatecat Date: Tue, 1 Jun 2021 16:12:57 +0100 Subject: Add hash() member functions Signed-off-by: gatecat --- fpga_interchange/archdefs.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fpga_interchange') 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 #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; -- cgit v1.2.3