From 4981ebb69836048fbde8a6bb1700cc6cd5a5af89 Mon Sep 17 00:00:00 2001 From: YRabbit Date: Sun, 11 Feb 2024 10:52:05 +1000 Subject: [PATCH] gowin: Himbaechel. Improve the global router A small improvement - do not waste time analyzing already processed networks in the previous step (and possibly steps). Signed-off-by: YRabbit --- himbaechel/uarch/gowin/globals.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/himbaechel/uarch/gowin/globals.cc b/himbaechel/uarch/gowin/globals.cc index 881b036f..86c3c63c 100644 --- a/himbaechel/uarch/gowin/globals.cc +++ b/himbaechel/uarch/gowin/globals.cc @@ -286,12 +286,14 @@ struct GowinGlobalRouter void run(void) { log_info("Routing globals...\n"); + + std::vector routed_nets; // buffered nets first for (auto &net : ctx->nets) { NetInfo *ni = net.second.get(); CellInfo *drv = ni->driver.cell; if (drv == nullptr || ni->users.empty()) { - if (ctx->verbose) { + if (ctx->debug) { log_info("skip empty or driverless net:%s\n", ctx->nameOf(ni)); } continue; @@ -301,14 +303,21 @@ struct GowinGlobalRouter log_info("route buffered net '%s'\n", ctx->nameOf(ni)); } route_buffered_net(ni); + routed_nets.push_back(net.first); continue; } } for (auto &net : ctx->nets) { + if (std::find(routed_nets.begin(), routed_nets.end(), net.first) != routed_nets.end()) { + if (ctx->debug) { + log_info("skip already routed net:%s\n", net.first.c_str(ctx)); + } + continue; + } NetInfo *ni = net.second.get(); CellInfo *drv = ni->driver.cell; if (drv == nullptr || ni->users.empty()) { - if (ctx->verbose) { + if (ctx->debug) { log_info("skip empty or driverless net:%s\n", ctx->nameOf(ni)); } continue;