nexus: Fix slow routing around DSPs

Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
David Shah 2020-11-16 13:31:43 +00:00
parent 160045a058
commit 6b5277638b
2 changed files with 28 additions and 0 deletions

View File

@ -582,6 +582,12 @@ ArcBounds Arch::getRouteBoundingBox(WireId src, WireId dst) const
bb.y0 = std::min(bb.y0, y);
bb.y1 = std::max(bb.y1, y);
};
if (dsp_wires.count(src) || dsp_wires.count(dst)) {
bb.x0 -= 5;
bb.x1 += 5;
}
extend(dst_x, dst_y);
return bb;
@ -617,10 +623,28 @@ bool Arch::place()
return true;
}
void Arch::pre_routing()
{
for (auto cell : sorted(cells)) {
CellInfo *ci = cell.second;
if (ci->type == id_MULT9_CORE || ci->type == id_PREADD9_CORE || ci->type == id_MULT18_CORE ||
ci->type == id_MULT18X36_CORE || ci->type == id_MULT36_CORE || ci->type == id_REG18_CORE ||
ci->type == id_ACC54_CORE) {
for (auto port : sorted_ref(ci->ports)) {
WireId wire = getBelPinWire(ci->bel, port.first);
if (wire != WireId())
dsp_wires.insert(wire);
}
}
}
}
bool Arch::route()
{
assign_budget(getCtx(), true);
pre_routing();
route_globals();
std::string router = str_or_default(settings, id("router"), defaultRouter);

View File

@ -1367,6 +1367,10 @@ struct Arch : BaseCtx
bool getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay_t &budget) const;
ArcBounds getRouteBoundingBox(WireId src, WireId dst) const;
// for better DSP bounding boxes
void pre_routing();
std::unordered_set<WireId> dsp_wires;
// -------------------------------------------------
// Get the delay through a cell from one port to another, returning false