From 08020400b379a0c2d7069bbd62f43782d438598b Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Thu, 21 Jun 2018 14:16:07 +0200 Subject: Fix build of "dummy" architexture Signed-off-by: Clifford Wolf --- common/route.cc | 44 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) (limited to 'common/route.cc') diff --git a/common/route.cc b/common/route.cc index bdb2f5b5..bf11b7d2 100644 --- a/common/route.cc +++ b/common/route.cc @@ -23,41 +23,32 @@ #include "log.h" #include "route.h" -namespace std { -template <> -struct hash> +namespace { + +USING_NEXTPNR_NAMESPACE + +struct hash_id_wire { - std::size_t - operator()(const pair &arg) const noexcept + std::size_t operator()(const std::pair &arg) const + noexcept { - std::size_t seed = hash()(arg.first); - seed ^= hash()(arg.second) + - 0x9e3779b9 + (seed << 6) + (seed >> 2); + std::size_t seed = std::hash()(arg.first); + seed ^= std::hash()(arg.second) + 0x9e3779b9 + (seed << 6) + + (seed >> 2); return seed; } }; -template <> -struct hash< - pair> +struct hash_id_pip { - std::size_t - operator()(const pair &arg) const noexcept + std::size_t operator()(const std::pair &arg) const noexcept { - std::size_t seed = hash()(arg.first); - seed ^= hash()(arg.second) + - 0x9e3779b9 + (seed << 6) + (seed >> 2); + std::size_t seed = std::hash()(arg.first); + seed ^= std::hash()(arg.second) + 0x9e3779b9 + (seed << 6) + + (seed >> 2); return seed; } }; -} // namespace std - -namespace { - -USING_NEXTPNR_NAMESPACE struct QueuedWire { @@ -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) -- cgit v1.2.3