nexus: Initial improvements to edge clock routing

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2026-07-22 13:55:15 +02:00
parent c2cbdc7efa
commit f8097c3127
1 changed files with 30 additions and 0 deletions

View File

@ -185,6 +185,25 @@ struct NexusGlobalRouter
log_info(" routed net '%s' using global resources\n", ctx->nameOf(net));
}
void route_eclk_net(NetInfo *net)
{
for (auto usr : net->users.enumerate())
backwards_bfs_route(net, usr.index, 1000000, true, [&](PipId pip) {
return (is_relaxed_sink(usr.value) || global_pip_filter(pip)) && routeability_pip_filter(pip);
});
log_info(" routed edge clock net '%s' using global resources\n", ctx->nameOf(net));
}
void route_eclk_src(NetInfo *net, store_index<PortRef> user_idx)
{
bool routed =
backwards_bfs_route(net, user_idx, 1000000, false, [&](PipId pip) { return global_pip_filter(pip); });
if (routed)
log_info(" routed edge source '%s' using global resources\n", ctx->nameOf(net));
else
log_warning(" failed to route edge source '%s' using global resources\n", ctx->nameOf(net));
}
void operator()()
{
log_info("Routing globals...\n");
@ -198,6 +217,17 @@ struct NexusGlobalRouter
continue;
}
}
for (auto &cell : ctx->cells) {
CellInfo *ci = cell.second.get();
if (ci->type == id_ECLKSYNC_CORE) {
NetInfo *eclk = ci->getPort(id_ECLKOUT);
if (eclk)
route_eclk_net(eclk);
auto &eclki = ci->ports.at(id_ECLKIN);
if (eclki.net)
route_eclk_src(eclki.net, eclki.user_idx);
}
}
}
};