diff options
author | David Shah <dave@ds0.me> | 2020-02-04 16:08:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-04 16:08:08 +0000 |
commit | 1ceffbe0bcba4f31a40c58c436df9370899fa4a2 (patch) | |
tree | f3cff1e5f8a067159a4e0fecd870a7acacba57a0 /common/nextpnr.h | |
parent | b4d029a55cd67bafcc9c364d609208a818227204 (diff) | |
parent | a1c902dadc3165fe9abab7c96a75b5f4808836cd (diff) | |
download | nextpnr-1ceffbe0bcba4f31a40c58c436df9370899fa4a2.tar.gz nextpnr-1ceffbe0bcba4f31a40c58c436df9370899fa4a2.tar.bz2 nextpnr-1ceffbe0bcba4f31a40c58c436df9370899fa4a2.zip |
Merge pull request #391 from YosysHQ/router2-upstream
Upstreaming router2
Diffstat (limited to 'common/nextpnr.h')
-rw-r--r-- | common/nextpnr.h | 22 |
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; |