aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/arch.cc24
-rw-r--r--generic/arch.h2
2 files changed, 26 insertions, 0 deletions
diff --git a/generic/arch.cc b/generic/arch.cc
index 5d60d9c6..6979673a 100644
--- a/generic/arch.cc
+++ b/generic/arch.cc
@@ -515,6 +515,30 @@ delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const
bool Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay_t &budget) const { return false; }
+ArcBounds Arch::getRouteBoundingBox(WireId src, WireId dst) const
+{
+ ArcBounds bb;
+
+ int src_x = wires.at(src).x;
+ int src_y = wires.at(src).y;
+ int dst_x = wires.at(dst).x;
+ int dst_y = wires.at(dst).y;
+
+ bb.x0 = src_x;
+ bb.y0 = src_y;
+ bb.x1 = src_x;
+ bb.y1 = src_y;
+
+ auto extend = [&](int x, int y) {
+ bb.x0 = std::min(bb.x0, x);
+ bb.x1 = std::max(bb.x1, x);
+ bb.y0 = std::min(bb.y0, y);
+ bb.y1 = std::max(bb.y1, y);
+ };
+ extend(dst_x, dst_y);
+ return bb;
+}
+
// ---------------------------------------------------------------
bool Arch::place()
diff --git a/generic/arch.h b/generic/arch.h
index 21e78e9a..cbfb943d 100644
--- a/generic/arch.h
+++ b/generic/arch.h
@@ -267,6 +267,8 @@ struct Arch : BaseCtx
uint32_t getDelayChecksum(delay_t v) const { return 0; }
bool getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay_t &budget) const;
+ ArcBounds getRouteBoundingBox(WireId src, WireId dst) const;
+
bool pack();
bool place();
bool route();