aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-11-16 11:04:39 +0000
committerDavid Shah <dave@ds0.me>2020-02-03 11:38:30 +0000
commitabdaa9c8a1953bc1a48fd5d141fc6ce7bf86fdfd (patch)
treeb1b2faf76a1849e604030c36f08356c3ebb1471e /common
parent385380401afb9f2f5cbfef766be30f39c3bbd34b (diff)
downloadnextpnr-abdaa9c8a1953bc1a48fd5d141fc6ce7bf86fdfd.tar.gz
nextpnr-abdaa9c8a1953bc1a48fd5d141fc6ce7bf86fdfd.tar.bz2
nextpnr-abdaa9c8a1953bc1a48fd5d141fc6ce7bf86fdfd.zip
ecp5: Router2 test integration
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common')
-rw-r--r--common/nextpnr.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h
index 61e04415..a786608d 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -199,6 +199,28 @@ struct Loc
bool operator!=(const Loc &other) const { return (x != other.x) || (y != other.y) || (z != other.z); }
};
+struct ArcBounds
+{
+ int x0 = -1, y0 = -1, x1 = -1, y1 = -1;
+
+ ArcBounds() {}
+ ArcBounds(int x0, int y0, int x1, int y1) : x0(x0), y0(y0), x1(x1), y1(y1){};
+
+ int distance(Loc loc) const
+ {
+ int dist = 0;
+ if (loc.x < x0)
+ dist += x0 - loc.x;
+ if (loc.x > x1)
+ dist += loc.x - x1;
+ if (loc.y < y0)
+ dist += y0 - loc.y;
+ if (loc.y > y1)
+ dist += loc.y - y1;
+ return dist;
+ };
+};
+
struct TimingConstrObjectId
{
int32_t index = -1;