From 08020400b379a0c2d7069bbd62f43782d438598b Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Thu, 21 Jun 2018 14:16:07 +0200 Subject: [PATCH] Fix build of "dummy" architexture Signed-off-by: Clifford Wolf --- common/route.cc | 60 +++++++++++++++++++++---------------------------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/common/route.cc b/common/route.cc index bdb2f5b5..bf11b7d2 100644 --- a/common/route.cc +++ b/common/route.cc @@ -23,42 +23,33 @@ #include "log.h" #include "route.h" -namespace std { -template <> -struct hash> -{ - std::size_t - operator()(const pair &arg) const noexcept - { - std::size_t seed = hash()(arg.first); - seed ^= hash()(arg.second) + - 0x9e3779b9 + (seed << 6) + (seed >> 2); - return seed; - } -}; - -template <> -struct hash< - pair> -{ - std::size_t - operator()(const pair &arg) const noexcept - { - std::size_t seed = hash()(arg.first); - seed ^= hash()(arg.second) + - 0x9e3779b9 + (seed << 6) + (seed >> 2); - return seed; - } -}; -} // namespace std - namespace { USING_NEXTPNR_NAMESPACE +struct hash_id_wire +{ + std::size_t operator()(const std::pair &arg) const + noexcept + { + std::size_t seed = std::hash()(arg.first); + seed ^= std::hash()(arg.second) + 0x9e3779b9 + (seed << 6) + + (seed >> 2); + return seed; + } +}; + +struct hash_id_pip +{ + std::size_t operator()(const std::pair &arg) const noexcept + { + std::size_t seed = std::hash()(arg.first); + seed ^= std::hash()(arg.second) + 0x9e3779b9 + (seed << 6) + + (seed >> 2); + return seed; + } +}; + struct QueuedWire { WireId wire; @@ -80,8 +71,9 @@ struct QueuedWire struct RipupScoreboard { - std::unordered_map, int> wireScores; - std::unordered_map, int> pipScores; + std::unordered_map, int, hash_id_wire> + wireScores; + std::unordered_map, int, hash_id_pip> pipScores; }; void ripup_net(Context *ctx, IdString net_name)