Skip to content

Commit

Permalink
gowin: Himbaechel. Improve the global router
Browse files Browse the repository at this point in the history
A small improvement - do not waste time analyzing already processed
networks in the previous step (and possibly steps).

Signed-off-by: YRabbit <[email protected]>
  • Loading branch information
yrabbit authored and gatecat committed Mar 13, 2024
1 parent 05ed930 commit 4981ebb
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions himbaechel/uarch/gowin/globals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,14 @@ struct GowinGlobalRouter
void run(void)
{
log_info("Routing globals...\n");

std::vector<IdString> 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;
Expand All @@ -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;
Expand Down

0 comments on commit 4981ebb

Please sign in to comment.