This commit is contained in:
Miodrag Milanovic 2024-07-01 13:08:31 +02:00
parent 8df830d21c
commit 97ad92537e

View File

@ -1473,13 +1473,37 @@ void NgUltraPacker::insert_wfb(CellInfo *cell, IdString port)
CellInfo *wfg = net_only_drives(ctx, net, is_wfg, id_ZI, true); CellInfo *wfg = net_only_drives(ctx, net, is_wfg, id_ZI, true);
if (wfg) return; if (wfg) return;
bool in_fabric = false;
bool in_ring = false;
for (const auto &usr : net->users) {
if (is_fabric_clock_sink(usr))
in_fabric = true;
else
in_ring = true;
}
// If all in ring and none in fabric no need for WFB
if (in_ring && !in_fabric) return;
log_info(" Inserting WFB for cell '%s' port '%s'\n", cell->name.c_str(ctx), port.c_str(ctx)); log_info(" Inserting WFB for cell '%s' port '%s'\n", cell->name.c_str(ctx), port.c_str(ctx));
CellInfo *wfb = create_cell_ptr(id_WFB, ctx->id(std::string(cell->name.c_str(ctx)) + "$" + port.c_str(ctx))); CellInfo *wfb = create_cell_ptr(id_WFB, ctx->id(std::string(cell->name.c_str(ctx)) + "$" + port.c_str(ctx)));
cell->disconnectPort(port); if (in_ring && in_fabric) {
wfb->connectPort(id_ZO, net); // If both in ring and in fabric create new signal
NetInfo *new_out = ctx->createNet(ctx->id(net->name.str(ctx) + "$" + port.c_str(ctx))); wfb->connectPort(id_ZI, net);
cell->connectPort(port, new_out); NetInfo *net_zo = ctx->createNet(ctx->id(net->name.str(ctx) + "$ZO"));
wfb->connectPort(id_ZI, new_out); wfb->connectPort(id_ZO, net_zo);
for (const auto &usr : net->users) {
if (is_fabric_clock_sink(usr)) {
usr.cell->disconnectPort(usr.port);
usr.cell->connectPort(usr.port, net_zo);
}
}
} else {
// Only in fabric, reconnect wire directly to WFB
cell->disconnectPort(port);
wfb->connectPort(id_ZO, net);
NetInfo *new_out = ctx->createNet(ctx->id(net->name.str(ctx) + "$" + port.c_str(ctx)));
cell->connectPort(port, new_out);
wfb->connectPort(id_ZI, new_out);
}
} }
void NgUltraPacker::constrain_location(CellInfo *cell) void NgUltraPacker::constrain_location(CellInfo *cell)
@ -1576,7 +1600,6 @@ void NgUltraPacker::pack_gcks(void)
} }
} }
void NgUltraPacker::pack_rams(void) void NgUltraPacker::pack_rams(void)
{ {
log_info("Packing RAMs..\n"); log_info("Packing RAMs..\n");