diff options
author | myrtle <gatecat@ds0.me> | 2022-12-07 10:26:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-07 10:26:17 +0100 |
commit | 519011533a3b7582b984226536cb424d462d1599 (patch) | |
tree | 31ee37d2c50481ab5f5a5bec2b07ac46d7d7d9ca /common/kernel | |
parent | a342b96bb0d4370d3e575a0189da2273b94ea765 (diff) | |
parent | d1afd6c0f1f8452d7461bbf33c84dbfd59236d03 (diff) | |
download | nextpnr-519011533a3b7582b984226536cb424d462d1599.tar.gz nextpnr-519011533a3b7582b984226536cb424d462d1599.tar.bz2 nextpnr-519011533a3b7582b984226536cb424d462d1599.zip |
Merge pull request #1058 from YosysHQ/gatecat/bounds-refactor
refactor: rename ArcBounds -> BoundingBox and use this in HeAP
Diffstat (limited to 'common/kernel')
-rw-r--r-- | common/kernel/arch_api.h | 4 | ||||
-rw-r--r-- | common/kernel/base_arch.h | 6 | ||||
-rw-r--r-- | common/kernel/nextpnr_base_types.h | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/common/kernel/arch_api.h b/common/kernel/arch_api.h index 49be489b..94a88338 100644 --- a/common/kernel/arch_api.h +++ b/common/kernel/arch_api.h @@ -118,7 +118,7 @@ template <typename R> struct ArchAPI : BaseCtx virtual uint32_t getDelayChecksum(delay_t v) const = 0; virtual bool getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay_t &budget) const = 0; virtual delay_t estimateDelay(WireId src, WireId dst) const = 0; - virtual ArcBounds getRouteBoundingBox(WireId src, WireId dst) const = 0; + virtual BoundingBox getRouteBoundingBox(WireId src, WireId dst) const = 0; // Decal methods virtual typename R::DecalGfxRangeT getDecalGraphics(DecalId decal) const = 0; virtual DecalXY getBelDecal(BelId bel) const = 0; @@ -141,7 +141,7 @@ template <typename R> struct ArchAPI : BaseCtx virtual typename R::BucketBelRangeT getBelsInBucket(BelBucketId bucket) const = 0; // Cluster methods virtual CellInfo *getClusterRootCell(ClusterId cluster) const = 0; - virtual ArcBounds getClusterBounds(ClusterId cluster) const = 0; + virtual BoundingBox getClusterBounds(ClusterId cluster) const = 0; virtual Loc getClusterOffset(const CellInfo *cell) const = 0; virtual bool isClusterStrict(const CellInfo *cell) const = 0; virtual bool getClusterPlacement(ClusterId cluster, BelId root_bel, diff --git a/common/kernel/base_arch.h b/common/kernel/base_arch.h index 55fcf280..53e28652 100644 --- a/common/kernel/base_arch.h +++ b/common/kernel/base_arch.h @@ -377,10 +377,10 @@ template <typename R> struct BaseArch : ArchAPI<R> // Cluster methods virtual CellInfo *getClusterRootCell(ClusterId cluster) const override { return get_cluster_root(this, cluster); } - virtual ArcBounds getClusterBounds(ClusterId cluster) const override + virtual BoundingBox getClusterBounds(ClusterId cluster) const override { - return if_using_basecluster<ArcBounds>(get_cluster_root(this, cluster), [](const BaseClusterInfo *cluster) { - ArcBounds bounds(0, 0, 0, 0); + return if_using_basecluster<BoundingBox>(get_cluster_root(this, cluster), [](const BaseClusterInfo *cluster) { + BoundingBox bounds(0, 0, 0, 0); for (auto child : cluster->constr_children) { if_using_basecluster<void>(child, [&](const BaseClusterInfo *child) { bounds.x0 = std::min(bounds.x0, child->constr_x); diff --git a/common/kernel/nextpnr_base_types.h b/common/kernel/nextpnr_base_types.h index 944bf0b8..80a0e24e 100644 --- a/common/kernel/nextpnr_base_types.h +++ b/common/kernel/nextpnr_base_types.h @@ -95,12 +95,12 @@ struct Loc unsigned int hash() const { return mkhash(x, mkhash(y, z)); } }; -struct ArcBounds +struct BoundingBox { 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){}; + BoundingBox() {} + BoundingBox(int x0, int y0, int x1, int y1) : x0(x0), y0(y0), x1(x1), y1(y1){}; int distance(Loc loc) const { |