diff options
Diffstat (limited to 'ecp5/globals.cc')
-rw-r--r-- | ecp5/globals.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/ecp5/globals.cc b/ecp5/globals.cc index e5627b66..364e4bca 100644 --- a/ecp5/globals.cc +++ b/ecp5/globals.cc @@ -302,6 +302,14 @@ class Ecp5GlobalRouter ctx->nets[glbnet->name] = std::move(glbnet); return glbptr; } + + int global_route_priority(const PortRef &load) + { + if (load.port == id_WCK || load.port == id_WRE) + return 90; + return 99; + } + Context *ctx; public: @@ -333,7 +341,13 @@ class Ecp5GlobalRouter NetInfo *global = insert_dcc(clock); bool routed = route_onto_global(global, glbid); NPNR_ASSERT(routed); - for (const auto &user : global->users) { + + // WCK must have routing priority + auto sorted_users = global->users; + std::sort(sorted_users.begin(), sorted_users.end(), [this](const PortRef &a, const PortRef &b) { + return global_route_priority(a) < global_route_priority(b); + }); + for (const auto &user : sorted_users) { route_logic_tile_global(global, glbid, user); } } |