mirror of https://github.com/YosysHQ/nextpnr.git
gatemate: update bounding box (#1548)
This commit is contained in:
parent
0399b8865e
commit
4e4f4ab113
|
|
@ -295,6 +295,33 @@ void GateMateImpl::postRoute()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BoundingBox GateMateImpl::getRouteBoundingBox(WireId src, WireId dst) const
|
||||||
|
{
|
||||||
|
int x0, y0, x1, y1;
|
||||||
|
auto expand = [&](int x, int y) {
|
||||||
|
x0 = std::min(x0, x);
|
||||||
|
x1 = std::max(x1, x);
|
||||||
|
y0 = std::min(y0, y);
|
||||||
|
y1 = std::max(y1, y);
|
||||||
|
};
|
||||||
|
tile_xy(ctx->chip_info, src.tile, x0, y0);
|
||||||
|
x1 = x0;
|
||||||
|
y1 = y0;
|
||||||
|
int dx, dy;
|
||||||
|
tile_xy(ctx->chip_info, dst.tile, dx, dy);
|
||||||
|
expand(dx, dy);
|
||||||
|
|
||||||
|
return {(x0 & 0xfffe), (y0 & 0xfffe), (x1 & 0xfffe) + 1, (y1 & 0xfffe) + 1};
|
||||||
|
}
|
||||||
|
|
||||||
|
void GateMateImpl::expandBoundingBox(BoundingBox &bb) const
|
||||||
|
{
|
||||||
|
bb.x0 = std::max((bb.x0 & 0xfffe) - 4, 0);
|
||||||
|
bb.y0 = std::max((bb.y0 & 0xfffe) - 4, 0);
|
||||||
|
bb.x1 = std::min((bb.x1 & 0xfffe) + 5, ctx->getGridDimX());
|
||||||
|
bb.y1 = std::min((bb.y1 & 0xfffe) + 5, ctx->getGridDimY());
|
||||||
|
}
|
||||||
|
|
||||||
void GateMateImpl::configurePlacerHeap(PlacerHeapCfg &cfg) { cfg.placeAllAtOnce = true; }
|
void GateMateImpl::configurePlacerHeap(PlacerHeapCfg &cfg) { cfg.placeAllAtOnce = true; }
|
||||||
|
|
||||||
int GateMateImpl::get_dff_config(CellInfo *dff) const
|
int GateMateImpl::get_dff_config(CellInfo *dff) const
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,9 @@ struct GateMateImpl : HimbaechelAPI
|
||||||
void preRoute() override;
|
void preRoute() override;
|
||||||
void postRoute() override;
|
void postRoute() override;
|
||||||
|
|
||||||
|
BoundingBox getRouteBoundingBox(WireId src, WireId dst) const override;
|
||||||
|
void expandBoundingBox(BoundingBox &bb) const override;
|
||||||
|
|
||||||
bool isBelLocationValid(BelId bel, bool explain_invalid = false) const override;
|
bool isBelLocationValid(BelId bel, bool explain_invalid = false) const override;
|
||||||
delay_t estimateDelay(WireId src, WireId dst) const override;
|
delay_t estimateDelay(WireId src, WireId dst) const override;
|
||||||
bool getCellDelay(const CellInfo *cell, IdString fromPort, IdString toPort, DelayQuad &delay) const override;
|
bool getCellDelay(const CellInfo *cell, IdString fromPort, IdString toPort, DelayQuad &delay) const override;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue