diff options
Diffstat (limited to 'ice40/archdefs.h')
-rw-r--r-- | ice40/archdefs.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ice40/archdefs.h b/ice40/archdefs.h index e95953f1..c0a6ac66 100644 --- a/ice40/archdefs.h +++ b/ice40/archdefs.h @@ -170,6 +170,15 @@ struct ArchCellInfo }; }; +struct BelBucketId +{ + IdString name; + + 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; } +}; + NEXTPNR_NAMESPACE_END namespace std { @@ -213,4 +222,15 @@ template <> struct hash<NEXTPNR_NAMESPACE_PREFIX DecalId> return seed; } }; + +template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelBucketId> +{ + std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX BelBucketId &bucket) const noexcept + { + std::size_t seed = 0; + boost::hash_combine(seed, hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(bucket.name)); + return seed; + } +}; + } // namespace std |