diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-06-21 14:16:07 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-06-21 14:16:07 +0200 |
commit | 08020400b379a0c2d7069bbd62f43782d438598b (patch) | |
tree | bb5e63d239bb262fdbff752fe91795a5cc882aa3 | |
parent | 993f6ef7d31ceee5fc71a99fcec19b521694e4f3 (diff) | |
download | nextpnr-08020400b379a0c2d7069bbd62f43782d438598b.tar.gz nextpnr-08020400b379a0c2d7069bbd62f43782d438598b.tar.bz2 nextpnr-08020400b379a0c2d7069bbd62f43782d438598b.zip |
Fix build of "dummy" architexture
Signed-off-by: Clifford Wolf <clifford@clifford.at>
-rw-r--r-- | common/route.cc | 44 |
1 files changed, 18 insertions, 26 deletions
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<pair<NEXTPNR_NAMESPACE_PREFIX IdString, - NEXTPNR_NAMESPACE_PREFIX WireId>> +namespace { + +USING_NEXTPNR_NAMESPACE + +struct hash_id_wire { - std::size_t - operator()(const pair<NEXTPNR_NAMESPACE_PREFIX IdString, - NEXTPNR_NAMESPACE_PREFIX WireId> &arg) const noexcept + std::size_t operator()(const std::pair<IdString, WireId> &arg) const + noexcept { - std::size_t seed = hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(arg.first); - seed ^= hash<NEXTPNR_NAMESPACE_PREFIX WireId>()(arg.second) + - 0x9e3779b9 + (seed << 6) + (seed >> 2); + std::size_t seed = std::hash<IdString>()(arg.first); + seed ^= std::hash<WireId>()(arg.second) + 0x9e3779b9 + (seed << 6) + + (seed >> 2); return seed; } }; -template <> -struct hash< - pair<NEXTPNR_NAMESPACE_PREFIX IdString, NEXTPNR_NAMESPACE_PREFIX PipId>> +struct hash_id_pip { - std::size_t - operator()(const pair<NEXTPNR_NAMESPACE_PREFIX IdString, - NEXTPNR_NAMESPACE_PREFIX PipId> &arg) const noexcept + std::size_t operator()(const std::pair<IdString, PipId> &arg) const noexcept { - std::size_t seed = hash<NEXTPNR_NAMESPACE_PREFIX IdString>()(arg.first); - seed ^= hash<NEXTPNR_NAMESPACE_PREFIX PipId>()(arg.second) + - 0x9e3779b9 + (seed << 6) + (seed >> 2); + std::size_t seed = std::hash<IdString>()(arg.first); + seed ^= std::hash<PipId>()(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<std::pair<IdString, WireId>, int> wireScores; - std::unordered_map<std::pair<IdString, PipId>, int> pipScores; + std::unordered_map<std::pair<IdString, WireId>, int, hash_id_wire> + wireScores; + std::unordered_map<std::pair<IdString, PipId>, int, hash_id_pip> pipScores; }; void ripup_net(Context *ctx, IdString net_name) |