diff options
Diffstat (limited to 'ecp5')
-rw-r--r-- | ecp5/arch.h | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/ecp5/arch.h b/ecp5/arch.h index b19e008f..2e86988a 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -448,25 +448,28 @@ struct ArchArgs } speed = SPEED_6; }; -struct DelayKey { +struct DelayKey +{ IdString celltype, from, to; - inline bool operator==(const DelayKey &other) const { + inline bool operator==(const DelayKey &other) const + { return celltype == other.celltype && from == other.from && to == other.to; } }; NEXTPNR_NAMESPACE_END namespace std { - template<> - struct hash<NEXTPNR_NAMESPACE_PREFIX DelayKey> { - std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DelayKey &dk) const noexcept { - std::size_t seed = std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.celltype); - seed ^= std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.from) + 0x9e3779b9 + (seed << 6) + (seed >> 2); - seed ^= std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.to) + 0x9e3779b9 + (seed << 6) + (seed >> 2); - return seed; - } - }; -} +template <> struct hash<NEXTPNR_NAMESPACE_PREFIX DelayKey> +{ + std::size_t operator()(const NEXTPNR_NAMESPACE_PREFIX DelayKey &dk) const noexcept + { + std::size_t seed = std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.celltype); + seed ^= std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.from) + 0x9e3779b9 + (seed << 6) + (seed >> 2); + seed ^= std::hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(dk.to) + 0x9e3779b9 + (seed << 6) + (seed >> 2); + return seed; + } +}; +} // namespace std NEXTPNR_NAMESPACE_BEGIN struct Arch : BaseCtx |