diff options
Diffstat (limited to 'ecp5/archdefs.h')
-rw-r--r-- | ecp5/archdefs.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ecp5/archdefs.h b/ecp5/archdefs.h index 79b20619..797db5f7 100644 --- a/ecp5/archdefs.h +++ b/ecp5/archdefs.h @@ -105,11 +105,22 @@ struct PipId bool operator!=(const PipId &other) const { return index != other.index || location != other.location; } }; +struct GroupId +{ + int32_t index = -1; + + bool operator==(const GroupId &other) const { return index == other.index; } + bool operator!=(const GroupId &other) const { return index != other.index; } +}; + struct DecalId { char type = 0; // Bel/Wire/Pip/Frame (b/w/p/f) Location location; uint32_t z = 0; + + bool operator==(const DecalId &other) const { return type == other.type && location == other.location && z == other.z; } + bool operator!=(const DecalId &other) const { return type != other.type || location != other.location || z != other.z; } }; NEXTPNR_NAMESPACE_END @@ -155,6 +166,14 @@ template <> struct hash<NEXTPNR_NAMESPACE_PREFIX PipId> } }; +template <> struct hash<NEXTPNR_NAMESPACE_PREFIX GroupId> +{ + std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX GroupId &group) const noexcept + { + return std::hash<int>()(group.index); + } +}; + template <> struct hash<NEXTPNR_NAMESPACE_PREFIX DecalId> { std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DecalId &decal) const noexcept |