router2: debugging
Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
parent
17256c680a
commit
37543ad003
@ -609,9 +609,10 @@ class SAPlacer
|
|||||||
std::vector<std::pair<CellInfo *, BelId>> dest_bels;
|
std::vector<std::pair<CellInfo *, BelId>> dest_bels;
|
||||||
double delta = 0;
|
double delta = 0;
|
||||||
moveChange.reset(this);
|
moveChange.reset(this);
|
||||||
|
#if 0
|
||||||
if (ctx->debug)
|
if (ctx->debug)
|
||||||
log_info("finding cells for chain swap %s\n", cell->name.c_str(ctx));
|
log_info("finding cells for chain swap %s\n", cell->name.c_str(ctx));
|
||||||
|
#endif
|
||||||
Loc baseLoc = ctx->getBelLocation(cell->bel);
|
Loc baseLoc = ctx->getBelLocation(cell->bel);
|
||||||
discover_chain(baseLoc, cell, cell_rel);
|
discover_chain(baseLoc, cell, cell_rel);
|
||||||
Loc newBaseLoc = ctx->getBelLocation(newBase);
|
Loc newBaseLoc = ctx->getBelLocation(newBase);
|
||||||
@ -634,8 +635,10 @@ class SAPlacer
|
|||||||
return false;
|
return false;
|
||||||
dest_bels.emplace_back(std::make_pair(cr.first, targetBel));
|
dest_bels.emplace_back(std::make_pair(cr.first, targetBel));
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
if (ctx->debug)
|
if (ctx->debug)
|
||||||
log_info("trying chain swap %s\n", cell->name.c_str(ctx));
|
log_info("trying chain swap %s\n", cell->name.c_str(ctx));
|
||||||
|
#endif
|
||||||
// <cell, oldBel>
|
// <cell, oldBel>
|
||||||
for (const auto &db : dest_bels) {
|
for (const auto &db : dest_bels) {
|
||||||
BelId oldBel = swap_cell_bels(db.first, db.second);
|
BelId oldBel = swap_cell_bels(db.first, db.second);
|
||||||
@ -661,8 +664,10 @@ class SAPlacer
|
|||||||
// SA acceptance criterea
|
// SA acceptance criterea
|
||||||
if (delta < 0 || (temp > 1e-9 && (ctx->rng() / float(0x3fffffff)) <= std::exp(-delta / temp))) {
|
if (delta < 0 || (temp > 1e-9 && (ctx->rng() / float(0x3fffffff)) <= std::exp(-delta / temp))) {
|
||||||
n_accept++;
|
n_accept++;
|
||||||
|
#if 0
|
||||||
if (ctx->debug)
|
if (ctx->debug)
|
||||||
log_info("accepted chain swap %s\n", cell->name.c_str(ctx));
|
log_info("accepted chain swap %s\n", cell->name.c_str(ctx));
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
goto swap_fail;
|
goto swap_fail;
|
||||||
}
|
}
|
||||||
|
@ -521,6 +521,9 @@ struct Router2
|
|||||||
int toexplore = 25000 * std::max(1, (ad.bb.x1 - ad.bb.x0) + (ad.bb.y1 - ad.bb.y0));
|
int toexplore = 25000 * std::max(1, (ad.bb.x1 - ad.bb.x0) + (ad.bb.y1 - ad.bb.y0));
|
||||||
int iter = 0;
|
int iter = 0;
|
||||||
int explored = 1;
|
int explored = 1;
|
||||||
|
bool debug_arc = /*usr.cell->type.str(ctx).find("RAMB") != std::string::npos && (usr.port ==
|
||||||
|
ctx->id("ADDRATIEHIGH0") || usr.port == ctx->id("ADDRARDADDRL0"))*/
|
||||||
|
false;
|
||||||
while (!t.queue.empty() && (!is_bb || iter < toexplore)) {
|
while (!t.queue.empty() && (!is_bb || iter < toexplore)) {
|
||||||
auto curr = t.queue.top();
|
auto curr = t.queue.top();
|
||||||
t.queue.pop();
|
t.queue.pop();
|
||||||
@ -546,8 +549,9 @@ struct Router2
|
|||||||
#endif
|
#endif
|
||||||
// Evaluate score of next wire
|
// Evaluate score of next wire
|
||||||
WireId next = ctx->getPipDstWire(dh);
|
WireId next = ctx->getPipDstWire(dh);
|
||||||
#if 0
|
#if 1
|
||||||
ROUTE_LOG_DBG(" src wire %s\n", ctx->nameOfWire(next));
|
if (debug_arc)
|
||||||
|
ROUTE_LOG_DBG(" src wire %s\n", ctx->nameOfWire(next));
|
||||||
#endif
|
#endif
|
||||||
auto &nwd = wires.at(next);
|
auto &nwd = wires.at(next);
|
||||||
if (nwd.unavailable)
|
if (nwd.unavailable)
|
||||||
|
Loading…
Reference in New Issue
Block a user