aboutsummaryrefslogtreecommitdiffstats
path: root/common/route.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-12 14:43:56 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-12 14:43:56 +0200
commit592a627e0c99ddf2cf06c286813a2d08962d8cd9 (patch)
tree5da4e6d6c4bfdb3d5a600b365ed9cb856c307de9 /common/route.cc
parent5a9ff4aea15fca7bcf8c86eaa1f92eb51f551e5b (diff)
parentc8b815361e2435bf12786705638908aa891df44f (diff)
downloadnextpnr-592a627e0c99ddf2cf06c286813a2d08962d8cd9.tar.gz
nextpnr-592a627e0c99ddf2cf06c286813a2d08962d8cd9.tar.bz2
nextpnr-592a627e0c99ddf2cf06c286813a2d08962d8cd9.zip
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr
Diffstat (limited to 'common/route.cc')
-rw-r--r--common/route.cc23
1 files changed, 13 insertions, 10 deletions
diff --git a/common/route.cc b/common/route.cc
index b98db259..ca76024f 100644
--- a/common/route.cc
+++ b/common/route.cc
@@ -22,22 +22,23 @@
#include "log.h"
#include "route.h"
+NEXTPNR_NAMESPACE_BEGIN
+
struct QueuedWire
{
WireId wire;
PipId pip;
DelayInfo delay;
-};
-namespace std {
-template <> struct greater<QueuedWire>
-{
- bool operator()(const QueuedWire &lhs, const QueuedWire &rhs) const noexcept
+ struct Greater
{
- return lhs.delay.avgDelay() > rhs.delay.avgDelay();
- }
+ bool operator()(const QueuedWire &lhs, const QueuedWire &rhs) const
+ noexcept
+ {
+ return lhs.delay.avgDelay() > rhs.delay.avgDelay();
+ }
+ };
};
-} // namespace std
void route_design(Design *design)
{
@@ -99,7 +100,7 @@ void route_design(Design *design)
std::unordered_map<WireId, QueuedWire> visited;
std::priority_queue<QueuedWire, std::vector<QueuedWire>,
- std::greater<QueuedWire>>
+ QueuedWire::Greater>
queue;
for (auto &it : src_wires) {
@@ -135,7 +136,7 @@ void route_design(Design *design)
if (next_qw.wire == dst_wire) {
std::priority_queue<QueuedWire, std::vector<QueuedWire>,
- std::greater<QueuedWire>>
+ QueuedWire::Greater>
empty_queue;
std::swap(queue, empty_queue);
break;
@@ -169,3 +170,5 @@ void route_design(Design *design)
}
}
}
+
+NEXTPNR_NAMESPACE_END