mirror of https://github.com/YosysHQ/nextpnr.git
gatemate: Reserve one level further uphill if needed
Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
parent
c6eca2405b
commit
3e8ddf3a77
|
|
@ -74,16 +74,33 @@ void GateMateImpl::route_clock()
|
||||||
|
|
||||||
auto reserve = [&](WireId wire, NetInfo *net) {
|
auto reserve = [&](WireId wire, NetInfo *net) {
|
||||||
for (auto pip : ctx->getPipsUphill(wire)) {
|
for (auto pip : ctx->getPipsUphill(wire)) {
|
||||||
wire = ctx->getPipSrcWire(pip);
|
WireId src = ctx->getPipSrcWire(pip);
|
||||||
break;
|
|
||||||
|
if (ctx->debug) {
|
||||||
|
auto wire_name = "(uninitialized)";
|
||||||
|
if (src != WireId())
|
||||||
|
wire_name = ctx->nameOfWire(src);
|
||||||
|
log_info(" reserving wire %s\n", wire_name);
|
||||||
|
}
|
||||||
|
reserved_wires.insert({src, net->name});
|
||||||
|
|
||||||
|
int next_count = 0;
|
||||||
|
for (auto pip : ctx->getPipsUphill(src)) {
|
||||||
|
src = ctx->getPipSrcWire(pip);
|
||||||
|
++next_count;
|
||||||
|
}
|
||||||
|
if (next_count == 1) {
|
||||||
|
// If one layer above we still only have one choice of pip, reserve it too
|
||||||
|
if (ctx->debug) {
|
||||||
|
auto wire_name = "(uninitialized)";
|
||||||
|
if (src != WireId())
|
||||||
|
wire_name = ctx->nameOfWire(src);
|
||||||
|
log_info(" reserving wire %s\n", wire_name);
|
||||||
|
}
|
||||||
|
reserved_wires.insert({src, net->name});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (ctx->debug) {
|
|
||||||
auto wire_name = "(uninitialized)";
|
|
||||||
if (wire != WireId())
|
|
||||||
wire_name = ctx->nameOfWire(wire);
|
|
||||||
log_info(" reserving wire %s\n", wire_name);
|
|
||||||
}
|
|
||||||
reserved_wires.insert({wire, net->name});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto &net_pair : ctx->nets) {
|
for (auto &net_pair : ctx->nets) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue