Gowin. Unbreak the segment routing. (#1508)

Use loop enumeration of PIPs instead of direct name construction for the
upper and lower ends of the segment wire.

Also do not allow clock wires for segments.

Signed-off-by: YRabbit <[email protected]>
This commit is contained in:
YRabbit
2025-06-30 10:14:21 +02:00
committed by GitHub
parent e642e21f9b
commit 39f020b033
+12 -5
View File
@@ -782,13 +782,19 @@ struct GowinGlobalRouter
SegmentRouteResult route_segmented_step2(NetInfo *ni, WireId segment_wire, WireId gate_wire,
std::vector<PipId> &bound_pips)
{
IdStringList pip_name = IdStringList::concat(ctx->getWireName(segment_wire), ctx->getWireName(gate_wire)[1]);
PipId pip = ctx->getPipByName(pip_name);
if (ctx->debug) {
log_info(" step 2: %s\n", ctx->nameOfPip(pip));
PipId pip;
for (PipId down_pip : ctx->getPipsDownhill(gate_wire)) {
WireId dst = ctx->getPipDstWire(down_pip);
if (dst == segment_wire) {
pip = down_pip;
break;
}
}
NPNR_ASSERT(pip != PipId());
if (ctx->debug) {
log_info(" step 2: %s\n", ctx->nameOfPip(pip));
}
NetInfo *pip_net = ctx->getBoundPipNet(pip);
if (pip_net == nullptr) {
ctx->bindPip(pip, ni, STRENGTH_LOCKED);
@@ -822,7 +828,8 @@ struct GowinGlobalRouter
}
routed = backwards_bfs_route(
gate_ni, src_wire, gatewire, 1000000, false,
[&](PipId pip, WireId src) { return dcs_input_filter(pip); }, &gate_bound_pips);
[&](PipId pip, WireId src) { return dcs_input_filter(pip) && !gwu.is_global_pip(pip); },
&gate_bound_pips);
if (routed) {
// bind src
if (ctx->checkWireAvail(src_wire)) {