Fixed return codes for packer, placer and router
This commit is contained in:
parent
54549d36e9
commit
8fac26c2b7
@ -478,10 +478,14 @@ class SAPlacer
|
|||||||
|
|
||||||
bool place_design_sa(Context *ctx)
|
bool place_design_sa(Context *ctx)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
SAPlacer placer(ctx);
|
SAPlacer placer(ctx);
|
||||||
placer.place();
|
placer.place();
|
||||||
log_info("Checksum: 0x%08x\n", ctx->checksum());
|
log_info("Checksum: 0x%08x\n", ctx->checksum());
|
||||||
return true;
|
return true;
|
||||||
|
} catch (log_execution_error_exception) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
@ -395,6 +395,7 @@ NEXTPNR_NAMESPACE_BEGIN
|
|||||||
|
|
||||||
bool route_design(Context *ctx)
|
bool route_design(Context *ctx)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
delay_t ripup_penalty = ctx->getRipupDelayPenalty();
|
delay_t ripup_penalty = ctx->getRipupDelayPenalty();
|
||||||
RipupScoreboard scores;
|
RipupScoreboard scores;
|
||||||
|
|
||||||
@ -441,8 +442,8 @@ bool route_design(Context *ctx)
|
|||||||
if (driver_port_it != net_info->driver.cell->pins.end())
|
if (driver_port_it != net_info->driver.cell->pins.end())
|
||||||
driver_port = driver_port_it->second;
|
driver_port = driver_port_it->second;
|
||||||
|
|
||||||
auto src_wire =
|
auto src_wire = ctx->getWireBelPin(src_bel,
|
||||||
ctx->getWireBelPin(src_bel, ctx->portPinFromId(driver_port));
|
ctx->portPinFromId(driver_port));
|
||||||
|
|
||||||
if (src_wire == WireId())
|
if (src_wire == WireId())
|
||||||
continue;
|
continue;
|
||||||
@ -460,8 +461,8 @@ bool route_design(Context *ctx)
|
|||||||
if (user_port_it != user_it.cell->pins.end())
|
if (user_port_it != user_it.cell->pins.end())
|
||||||
user_port = user_port_it->second;
|
user_port = user_port_it->second;
|
||||||
|
|
||||||
auto dst_wire =
|
auto dst_wire = ctx->getWireBelPin(
|
||||||
ctx->getWireBelPin(dst_bel, ctx->portPinFromId(user_port));
|
dst_bel, ctx->portPinFromId(user_port));
|
||||||
|
|
||||||
if (dst_wire == WireId())
|
if (dst_wire == WireId())
|
||||||
continue;
|
continue;
|
||||||
@ -504,7 +505,8 @@ bool route_design(Context *ctx)
|
|||||||
|
|
||||||
for (auto net_name : netsArray) {
|
for (auto net_name : netsArray) {
|
||||||
if (printNets)
|
if (printNets)
|
||||||
log_info(" routing net %s. (%d users)\n", net_name.c_str(ctx),
|
log_info(" routing net %s. (%d users)\n",
|
||||||
|
net_name.c_str(ctx),
|
||||||
int(ctx->nets.at(net_name)->users.size()));
|
int(ctx->nets.at(net_name)->users.size()));
|
||||||
|
|
||||||
Router router(ctx, scores, net_name, false);
|
Router router(ctx, scores, net_name, false);
|
||||||
@ -515,7 +517,8 @@ bool route_design(Context *ctx)
|
|||||||
|
|
||||||
if (!router.routedOkay) {
|
if (!router.routedOkay) {
|
||||||
if (printNets)
|
if (printNets)
|
||||||
log_info(" failed to route to %s.\n",
|
log_info(
|
||||||
|
" failed to route to %s.\n",
|
||||||
ctx->getWireName(router.failedDest).c_str(ctx));
|
ctx->getWireName(router.failedDest).c_str(ctx));
|
||||||
ripupQueue.insert(net_name);
|
ripupQueue.insert(net_name);
|
||||||
}
|
}
|
||||||
@ -530,8 +533,8 @@ bool route_design(Context *ctx)
|
|||||||
int normalRouteCnt = netCnt - int(ripupQueue.size());
|
int normalRouteCnt = netCnt - int(ripupQueue.size());
|
||||||
|
|
||||||
if ((ctx->verbose || iterCnt == 1) && (netCnt % 100 != 0))
|
if ((ctx->verbose || iterCnt == 1) && (netCnt % 100 != 0))
|
||||||
log_info(" processed %d nets. (%d routed, %d failed)\n", netCnt,
|
log_info(" processed %d nets. (%d routed, %d failed)\n",
|
||||||
normalRouteCnt, int(ripupQueue.size()));
|
netCnt, normalRouteCnt, int(ripupQueue.size()));
|
||||||
|
|
||||||
if (ctx->verbose)
|
if (ctx->verbose)
|
||||||
log_info(" routing pass visited %d PIPs (%.2f%% revisits).\n",
|
log_info(" routing pass visited %d PIPs (%.2f%% revisits).\n",
|
||||||
@ -539,7 +542,8 @@ bool route_design(Context *ctx)
|
|||||||
|
|
||||||
if (!ripupQueue.empty()) {
|
if (!ripupQueue.empty()) {
|
||||||
if (ctx->verbose || iterCnt == 1)
|
if (ctx->verbose || iterCnt == 1)
|
||||||
log_info("failed to route %d nets. re-routing in ripup mode.\n",
|
log_info("failed to route %d nets. re-routing in ripup "
|
||||||
|
"mode.\n",
|
||||||
int(ripupQueue.size()));
|
int(ripupQueue.size()));
|
||||||
|
|
||||||
printNets = ctx->verbose && (ripupQueue.size() < 10);
|
printNets = ctx->verbose && (ripupQueue.size() < 10);
|
||||||
@ -594,10 +598,12 @@ bool route_design(Context *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((ctx->verbose || iterCnt == 1) && (netCnt % 100 != 0))
|
if ((ctx->verbose || iterCnt == 1) && (netCnt % 100 != 0))
|
||||||
log_info(" routed %d nets, ripped %d nets.\n", netCnt, ripCnt);
|
log_info(" routed %d nets, ripped %d nets.\n", netCnt,
|
||||||
|
ripCnt);
|
||||||
|
|
||||||
if (ctx->verbose)
|
if (ctx->verbose)
|
||||||
log_info(" routing pass visited %d PIPs (%.2f%% revisits).\n",
|
log_info(" routing pass visited %d PIPs (%.2f%% "
|
||||||
|
"revisits).\n",
|
||||||
visitCnt, (100.0 * revisitCnt) / visitCnt);
|
visitCnt, (100.0 * revisitCnt) / visitCnt);
|
||||||
|
|
||||||
if (ctx->verbose && !netsQueue.empty())
|
if (ctx->verbose && !netsQueue.empty())
|
||||||
@ -607,18 +613,22 @@ bool route_design(Context *ctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!ctx->verbose)
|
if (!ctx->verbose)
|
||||||
log_info("iteration %d: routed %d nets without ripup, routed %d "
|
log_info(
|
||||||
|
"iteration %d: routed %d nets without ripup, routed %d "
|
||||||
"nets with ripup.\n",
|
"nets with ripup.\n",
|
||||||
iterCnt, normalRouteCnt, int(ripupQueue.size()));
|
iterCnt, normalRouteCnt, int(ripupQueue.size()));
|
||||||
|
|
||||||
if (iterCnt == 8 || iterCnt == 16 || iterCnt == 32 || iterCnt == 64 ||
|
if (iterCnt == 8 || iterCnt == 16 || iterCnt == 32 ||
|
||||||
iterCnt == 128)
|
iterCnt == 64 || iterCnt == 128)
|
||||||
ripup_penalty += ctx->getRipupDelayPenalty();
|
ripup_penalty += ctx->getRipupDelayPenalty();
|
||||||
}
|
}
|
||||||
|
|
||||||
log_info("routing complete after %d iterations.\n", iterCnt);
|
log_info("routing complete after %d iterations.\n", iterCnt);
|
||||||
log_info("Checksum: 0x%08x\n", ctx->checksum());
|
log_info("Checksum: 0x%08x\n", ctx->checksum());
|
||||||
return true;
|
return true;
|
||||||
|
} catch (log_execution_error_exception) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get_actual_route_delay(Context *ctx, WireId src_wire, WireId dst_wire,
|
bool get_actual_route_delay(Context *ctx, WireId src_wire, WireId dst_wire,
|
||||||
|
@ -19,7 +19,7 @@ void Worker::parsejson(const std::string &filename)
|
|||||||
{
|
{
|
||||||
std::string fn = filename;
|
std::string fn = filename;
|
||||||
std::ifstream f(fn);
|
std::ifstream f(fn);
|
||||||
|
try {
|
||||||
parse_json_file(f, fn, ctx);
|
parse_json_file(f, fn, ctx);
|
||||||
if (!pack_design(ctx))
|
if (!pack_design(ctx))
|
||||||
log_error("Packing design failed.\n");
|
log_error("Packing design failed.\n");
|
||||||
@ -31,8 +31,10 @@ void Worker::parsejson(const std::string &filename)
|
|||||||
log_error("Placing design failed.\n");
|
log_error("Placing design failed.\n");
|
||||||
if (!route_design(ctx))
|
if (!route_design(ctx))
|
||||||
log_error("Routing design failed.\n");
|
log_error("Routing design failed.\n");
|
||||||
print_utilisation(ctx);
|
|
||||||
Q_EMIT log("done");
|
Q_EMIT log("done");
|
||||||
|
} catch (log_execution_error_exception) {
|
||||||
|
Q_EMIT log("failed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TaskManager::TaskManager(Context *ctx)
|
TaskManager::TaskManager(Context *ctx)
|
||||||
|
@ -487,6 +487,7 @@ static void promote_globals(Context *ctx)
|
|||||||
// Main pack function
|
// Main pack function
|
||||||
bool pack_design(Context *ctx)
|
bool pack_design(Context *ctx)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
log_break();
|
log_break();
|
||||||
pack_constants(ctx);
|
pack_constants(ctx);
|
||||||
promote_globals(ctx);
|
promote_globals(ctx);
|
||||||
@ -496,6 +497,9 @@ bool pack_design(Context *ctx)
|
|||||||
pack_ram(ctx);
|
pack_ram(ctx);
|
||||||
log_info("Checksum: 0x%08x\n", ctx->checksum());
|
log_info("Checksum: 0x%08x\n", ctx->checksum());
|
||||||
return true;
|
return true;
|
||||||
|
} catch (log_execution_error_exception) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
Loading…
Reference in New Issue
Block a user