diff options
Diffstat (limited to 'common')
| -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 | ||||
| -rw-r--r-- | common/place/placer_heap.cc | 6 | ||||
| -rw-r--r-- | common/route/router2.cc | 30 | 
5 files changed, 23 insertions, 29 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      { diff --git a/common/place/placer_heap.cc b/common/place/placer_heap.cc index bd8cd37d..8da4ee2e 100644 --- a/common/place/placer_heap.cc +++ b/common/place/placer_heap.cc @@ -377,12 +377,6 @@ class HeAPPlacer      TimingAnalyser tmg; -    struct BoundingBox -    { -        // Actual bounding box -        int x0 = 0, x1 = 0, y0 = 0, y1 = 0; -    }; -      dict<IdString, BoundingBox> constraint_region_bounds;      // In some cases, we can't use bindBel because we allow overlap in the earlier stages. So we use this custom diff --git a/common/route/router2.cc b/common/route/router2.cc index ed1a6fe0..cdd98b6e 100644 --- a/common/route/router2.cc +++ b/common/route/router2.cc @@ -51,7 +51,7 @@ struct Router2      struct PerArcData      {          WireId sink_wire; -        ArcBounds bb; +        BoundingBox bb;          bool routed = false;      }; @@ -62,7 +62,7 @@ struct Router2          WireId src_wire;          dict<WireId, std::pair<PipId, int>> wires;          std::vector<std::vector<PerArcData>> arcs; -        ArcBounds bb; +        BoundingBox bb;          // Coordinates of the center of the net, used for the weight-to-average          int cx, cy, hpwl;          int total_route_us = 0; @@ -206,7 +206,7 @@ struct Router2                  }              } -            ArcBounds wire_loc = ctx->getRouteBoundingBox(wire, wire); +            BoundingBox wire_loc = ctx->getRouteBoundingBox(wire, wire);              pwd.x = (wire_loc.x0 + wire_loc.x1) / 2;              pwd.y = (wire_loc.y0 + wire_loc.y1) / 2; @@ -249,7 +249,7 @@ struct Router2          };      }; -    bool hit_test_pip(ArcBounds &bb, Loc l) { return l.x >= bb.x0 && l.x <= bb.x1 && l.y >= bb.y0 && l.y <= bb.y1; } +    bool hit_test_pip(BoundingBox &bb, Loc l) { return l.x >= bb.x0 && l.x <= bb.x1 && l.y >= bb.y0 && l.y <= bb.y1; }      double curr_cong_weight, hist_cong_weight, estimate_weight; @@ -269,7 +269,7 @@ struct Router2          std::vector<int> dirty_wires;          // Thread bounding box -        ArcBounds bb; +        BoundingBox bb;          DeterministicRNG rng; @@ -1217,7 +1217,7 @@ struct Router2          if (route_queue.size() < 200) {              ThreadContext st;              st.rng.rngseed(ctx->rng64()); -            st.bb = ArcBounds(0, 0, std::numeric_limits<int>::max(), std::numeric_limits<int>::max()); +            st.bb = BoundingBox(0, 0, std::numeric_limits<int>::max(), std::numeric_limits<int>::max());              for (size_t j = 0; j < route_queue.size(); j++) {                  route_net(st, nets_by_udata[route_queue[j]], false);              } @@ -1234,19 +1234,19 @@ struct Router2          int le_y = mid_y;          int rs_y = mid_y;          // Set up thread bounding boxes -        tcs.at(0).bb = ArcBounds(0, 0, mid_x, mid_y); -        tcs.at(1).bb = ArcBounds(mid_x + 1, 0, std::numeric_limits<int>::max(), le_y); -        tcs.at(2).bb = ArcBounds(0, mid_y + 1, mid_x, std::numeric_limits<int>::max()); +        tcs.at(0).bb = BoundingBox(0, 0, mid_x, mid_y); +        tcs.at(1).bb = BoundingBox(mid_x + 1, 0, std::numeric_limits<int>::max(), le_y); +        tcs.at(2).bb = BoundingBox(0, mid_y + 1, mid_x, std::numeric_limits<int>::max());          tcs.at(3).bb = -                ArcBounds(mid_x + 1, mid_y + 1, std::numeric_limits<int>::max(), std::numeric_limits<int>::max()); +                BoundingBox(mid_x + 1, mid_y + 1, std::numeric_limits<int>::max(), std::numeric_limits<int>::max()); -        tcs.at(4).bb = ArcBounds(0, 0, std::numeric_limits<int>::max(), mid_y); -        tcs.at(5).bb = ArcBounds(0, mid_y + 1, std::numeric_limits<int>::max(), std::numeric_limits<int>::max()); +        tcs.at(4).bb = BoundingBox(0, 0, std::numeric_limits<int>::max(), mid_y); +        tcs.at(5).bb = BoundingBox(0, mid_y + 1, std::numeric_limits<int>::max(), std::numeric_limits<int>::max()); -        tcs.at(6).bb = ArcBounds(0, 0, mid_x, std::numeric_limits<int>::max()); -        tcs.at(7).bb = ArcBounds(mid_x + 1, 0, std::numeric_limits<int>::max(), std::numeric_limits<int>::max()); +        tcs.at(6).bb = BoundingBox(0, 0, mid_x, std::numeric_limits<int>::max()); +        tcs.at(7).bb = BoundingBox(mid_x + 1, 0, std::numeric_limits<int>::max(), std::numeric_limits<int>::max()); -        tcs.at(8).bb = ArcBounds(0, 0, std::numeric_limits<int>::max(), std::numeric_limits<int>::max()); +        tcs.at(8).bb = BoundingBox(0, 0, std::numeric_limits<int>::max(), std::numeric_limits<int>::max());          for (auto n : route_queue) {              auto &nd = nets.at(n); | 
