diff --git a/common/kernel/array2d.h b/common/kernel/array2d.h index bb1a150d..513dabae 100644 --- a/common/kernel/array2d.h +++ b/common/kernel/array2d.h @@ -35,7 +35,7 @@ NEXTPNR_NAMESPACE_BEGIN template class array2d { public: - array2d() : m_width(0), m_height(0), m_size(0), data(nullptr){}; + array2d() : m_width(0), m_height(0), m_size(0), data(nullptr) {}; array2d(int width, int height) : m_width(width), m_height(height), m_size(width * height) { data = new T[m_width * m_height](); @@ -88,7 +88,7 @@ template class array2d ~array2d() { delete[] data; } struct entry { - entry(int x, int y, T &value) : x(x), y(y), value(value){}; + entry(int x, int y, T &value) : x(x), y(y), value(value) {}; int x, y; T &value; }; @@ -119,7 +119,7 @@ template class array2d inline bool operator==(const iterator &other) const { return other.x == x && other.y == y; } private: - iterator(int x, int y, array2d &base) : x(x), y(y), base(&base){}; + iterator(int x, int y, array2d &base) : x(x), y(y), base(&base) {}; int x, y; array2d *base; friend class array2d; diff --git a/common/kernel/base_arch.h b/common/kernel/base_arch.h index 5aa655a5..708636a0 100644 --- a/common/kernel/base_arch.h +++ b/common/kernel/base_arch.h @@ -443,7 +443,7 @@ template struct BaseArch : ArchAPI } // Flow methods - virtual void assignArchInfo() override{}; + virtual void assignArchInfo() override {}; // -------------------------------------------------------------- // These structures are used to provide default implementations of bel/wire/pip binding. Arches might want to diff --git a/common/kernel/context.cc b/common/kernel/context.cc index b194675d..b845365c 100644 --- a/common/kernel/context.cc +++ b/common/kernel/context.cc @@ -417,7 +417,7 @@ void Context::check() const namespace { struct FixupHierarchyWorker { - FixupHierarchyWorker(Context *ctx) : ctx(ctx){}; + FixupHierarchyWorker(Context *ctx) : ctx(ctx) {}; Context *ctx; void run() { diff --git a/common/kernel/indexed_store.h b/common/kernel/indexed_store.h index df607c13..f15f66db 100644 --- a/common/kernel/indexed_store.h +++ b/common/kernel/indexed_store.h @@ -34,7 +34,7 @@ template struct store_index { int32_t m_index = -1; store_index() = default; - explicit store_index(int32_t index) : m_index(index){}; + explicit store_index(int32_t index) : m_index(index) {}; int32_t idx() const { return m_index; } void set(int32_t index) { m_index = index; } bool empty() const { return m_index == -1; } @@ -64,7 +64,7 @@ template class indexed_store friend class indexed_store; public: - slot() : next_free(std::numeric_limits::max()), active(false){}; + slot() : next_free(std::numeric_limits::max()), active(false) {}; slot(slot &&other) : next_free(other.next_free), active(other.active) { if (active) @@ -180,7 +180,7 @@ template class indexed_store int32_t index = 0; public: - iterator(indexed_store *base, int32_t index) : base(base), index(index){}; + iterator(indexed_store *base, int32_t index) : base(base), index(index) {}; inline bool operator!=(const iterator &other) const { return other.index != index; } inline bool operator==(const iterator &other) const { return other.index == index; } inline iterator operator++() @@ -217,7 +217,7 @@ template class indexed_store int32_t index = 0; public: - const_iterator(const indexed_store *base, int32_t index) : base(base), index(index){}; + const_iterator(const indexed_store *base, int32_t index) : base(base), index(index) {}; inline bool operator!=(const const_iterator &other) const { return other.index != index; } inline bool operator==(const const_iterator &other) const { return other.index == index; } inline const_iterator operator++() @@ -249,7 +249,7 @@ template class indexed_store template struct enumerated_item { - enumerated_item(int32_t index, T &value) : index(index), value(value){}; + enumerated_item(int32_t index, T &value) : index(index), value(value) {}; store_index> index; S &value; }; @@ -260,7 +260,7 @@ template class indexed_store It base; public: - enumerated_iterator(const It &base) : base(base){}; + enumerated_iterator(const It &base) : base(base) {}; inline bool operator!=(const enumerated_iterator &other) const { return other.base != base; } inline bool operator==(const enumerated_iterator &other) const { return other.base == base; } inline enumerated_iterator operator++() @@ -279,7 +279,7 @@ template class indexed_store template struct enumerated_range { - enumerated_range(const It &begin, const It &end) : m_begin(begin), m_end(end){}; + enumerated_range(const It &begin, const It &end) : m_begin(begin), m_end(end) {}; enumerated_iterator m_begin, m_end; enumerated_iterator begin() { return m_begin; } enumerated_iterator end() { return m_end; } diff --git a/common/kernel/nextpnr_base_types.h b/common/kernel/nextpnr_base_types.h index 80a0e24e..ad5a295c 100644 --- a/common/kernel/nextpnr_base_types.h +++ b/common/kernel/nextpnr_base_types.h @@ -78,9 +78,9 @@ struct GraphicElement float x1 = 0, y1 = 0, x2 = 0, y2 = 0, z = 0; std::string text; - GraphicElement(){}; + GraphicElement() {}; GraphicElement(type_t type, style_t style, float x1, float y1, float x2, float y2, float z) - : type(type), style(style), x1(x1), y1(y1), x2(x2), y2(y2), z(z){}; + : type(type), style(style), x1(x1), y1(y1), x2(x2), y2(y2), z(z) {}; }; struct Loc @@ -100,7 +100,7 @@ struct BoundingBox int x0 = -1, y0 = -1, x1 = -1, y1 = -1; BoundingBox() {} - BoundingBox(int x0, int y0, int x1, int y1) : x0(x0), y0(y0), x1(x1), y1(y1){}; + 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/kernel/nextpnr_types.h b/common/kernel/nextpnr_types.h index e23cd16a..fbe16daf 100644 --- a/common/kernel/nextpnr_types.h +++ b/common/kernel/nextpnr_types.h @@ -90,7 +90,7 @@ inline bool is_zero_delay(delay_t delay) // minimum and maximum delay struct DelayPair { - DelayPair() : min_delay(0), max_delay(0){}; + DelayPair() : min_delay(0), max_delay(0) {}; explicit DelayPair(delay_t delay) : min_delay(delay), max_delay(delay) {} DelayPair(delay_t min_delay, delay_t max_delay) : min_delay(min_delay), max_delay(max_delay) {} delay_t minDelay() const { return min_delay; } @@ -287,7 +287,7 @@ struct PseudoCell virtual bool getDelay(IdString fromPort, IdString toPort, DelayQuad &delay) const = 0; virtual TimingPortClass getPortTimingClass(IdString port, int &clockInfoCount) const = 0; virtual TimingClockingInfo getPortClockingInfo(IdString port, int index) const = 0; - virtual ~PseudoCell(){}; + virtual ~PseudoCell() {}; }; struct RegionPlug : PseudoCell diff --git a/common/kernel/pycontainers.h b/common/kernel/pycontainers.h index d79508b9..175d2608 100644 --- a/common/kernel/pycontainers.h +++ b/common/kernel/pycontainers.h @@ -76,8 +76,8 @@ A pair that doesn't automatically become a tuple */ template struct iter_pair { - iter_pair(){}; - iter_pair(const Ta &first, const Tb &second) : first(first), second(second){}; + iter_pair() {}; + iter_pair(const Ta &first, const Tb &second) : first(first), second(second) {}; Ta first; Tb second; }; diff --git a/common/kernel/sso_array.h b/common/kernel/sso_array.h index 80e7d1c1..f2b8dfde 100644 --- a/common/kernel/sso_array.h +++ b/common/kernel/sso_array.h @@ -56,7 +56,7 @@ template class SSOArray const T *begin() const { return data(); } const T *end() const { return data() + m_size; } - SSOArray() : m_size(0){}; + SSOArray() : m_size(0) {}; SSOArray(std::size_t size, const T &init = T()) : m_size(size) { diff --git a/common/kernel/svg.cc b/common/kernel/svg.cc index c5e2ea36..4fef53b7 100644 --- a/common/kernel/svg.cc +++ b/common/kernel/svg.cc @@ -31,7 +31,7 @@ struct SVGWriter std::ostream &out; float scale = 500.0; bool hide_inactive = false; - SVGWriter(const Context *ctx, std::ostream &out) : ctx(ctx), out(out){}; + SVGWriter(const Context *ctx, std::ostream &out) : ctx(ctx), out(out) {}; const char *get_stroke_colour(GraphicElement::style_t style) { switch (style) { diff --git a/common/kernel/timing.h b/common/kernel/timing.h index f82a1b6d..4fe42866 100644 --- a/common/kernel/timing.h +++ b/common/kernel/timing.h @@ -27,8 +27,8 @@ NEXTPNR_NAMESPACE_BEGIN struct CellPortKey { - CellPortKey(){}; - CellPortKey(IdString cell, IdString port) : cell(cell), port(port){}; + CellPortKey() {}; + CellPortKey(IdString cell, IdString port) : cell(cell), port(port) {}; explicit CellPortKey(const PortRef &pr) { NPNR_ASSERT(pr.cell != nullptr); @@ -49,7 +49,7 @@ struct ClockDomainKey { IdString clock; ClockEdge edge; - ClockDomainKey(IdString clock_net, ClockEdge edge) : clock(clock_net), edge(edge){}; + ClockDomainKey(IdString clock_net, ClockEdge edge) : clock(clock_net), edge(edge) {}; // probably also need something here to deal with constraints inline bool is_async() const { return clock == IdString(); } @@ -63,7 +63,7 @@ typedef int domain_id_t; struct ClockDomainPairKey { domain_id_t launch, capture; - ClockDomainPairKey(domain_id_t launch, domain_id_t capture) : launch(launch), capture(capture){}; + ClockDomainPairKey(domain_id_t launch, domain_id_t capture) : launch(launch), capture(capture) {}; inline bool operator==(const ClockDomainPairKey &other) const { return (launch == other.launch) && (capture == other.capture); @@ -183,9 +183,9 @@ struct TimingAnalyser ClockEdge edge; CellArc(ArcType type, IdString other_port, DelayQuad value) - : type(type), other_port(other_port), value(value), edge(RISING_EDGE){}; + : type(type), other_port(other_port), value(value), edge(RISING_EDGE) {}; CellArc(ArcType type, IdString other_port, DelayQuad value, ClockEdge edge) - : type(type), other_port(other_port), value(value), edge(edge){}; + : type(type), other_port(other_port), value(value), edge(edge) {}; }; // Timing data for every cell port @@ -209,7 +209,7 @@ struct TimingAnalyser struct PerDomain { - PerDomain(ClockDomainKey key) : key(key){}; + PerDomain(ClockDomainKey key) : key(key) {}; ClockDomainKey key; // these are pairs (signal port; clock port) std::vector> startpoints, endpoints; @@ -217,7 +217,7 @@ struct TimingAnalyser struct PerDomainPair { - PerDomainPair(ClockDomainPairKey key) : key(key){}; + PerDomainPair(ClockDomainPairKey key) : key(key) {}; ClockDomainPairKey key; DelayPair period{0}; delay_t worst_setup_slack, worst_hold_slack; diff --git a/common/kernel/util.h b/common/kernel/util.h index 0223470a..2f7f80b1 100644 --- a/common/kernel/util.h +++ b/common/kernel/util.h @@ -112,10 +112,10 @@ bool boolstr_or_default(const dict &ct, const KeyType &key, b return def; if (!found->second.is_string) bool(found->second.as_int64()); - const char* str = found->second.as_string().c_str(); - if(!strcmp(str, "0") || !strcasecmp(str, "false")) + const char *str = found->second.as_string().c_str(); + if (!strcmp(str, "0") || !strcasecmp(str, "false")) return false; - else if(!strcmp(str, "1") || !strcasecmp(str, "true")) + else if (!strcmp(str, "1") || !strcasecmp(str, "true")) return true; else log_error("Expecting bool-compatible value but got '%s'.\n", found->second.as_string().c_str()); @@ -125,20 +125,18 @@ bool boolstr_or_default(const dict &ct, const KeyType &key, b // Get a vector of bool from a map-style container, returning default if value is not found // Also tolerate string representation of vector for interoperability purposes template -bool boolvec_populate(const dict &ct, const KeyType &key, std::vector& vec) +bool boolvec_populate(const dict &ct, const KeyType &key, std::vector &vec) { auto found = ct.find(key); if (found == ct.end()) return false; - if (!found->second.is_string) - { + if (!found->second.is_string) { size_t val = found->second.as_int64(); - for (size_t i = 0; i < vec.size(); ++i, val>>=1) { + for (size_t i = 0; i < vec.size(); ++i, val >>= 1) { vec[i] = (val & 0x1) != 0; } - } - else { - const std::string& str = found->second.as_string(); + } else { + const std::string &str = found->second.as_string(); size_t i = 0; for (auto it = str.crbegin(); it != str.crend() && i < vec.size(); ++i, ++it) { vec[i] = *it == '1'; @@ -255,7 +253,7 @@ template > struct TopoSort template struct reversed_range_t { T &obj; - explicit reversed_range_t(T &obj) : obj(obj){}; + explicit reversed_range_t(T &obj) : obj(obj) {}; auto begin() { return obj.rbegin(); } auto end() { return obj.rend(); } }; diff --git a/common/place/detail_place_core.h b/common/place/detail_place_core.h index aaca82f9..1d57001f 100644 --- a/common/place/detail_place_core.h +++ b/common/place/detail_place_core.h @@ -85,7 +85,7 @@ struct NetBB struct DetailPlacerState { explicit DetailPlacerState(Context *ctx, DetailPlaceCfg &cfg) - : ctx(ctx), base_cfg(cfg), bels(ctx, false, 64), tmg(ctx){}; + : ctx(ctx), base_cfg(cfg), bels(ctx, false, 64), tmg(ctx) {}; Context *ctx; DetailPlaceCfg &base_cfg; FastBels bels; @@ -196,7 +196,7 @@ struct DetailPlacerThreadState std::vector>> timing_changed_arcs; std::vector new_timing_costs; - DetailPlacerThreadState(Context *ctx, DetailPlacerState &g, int idx) : ctx(ctx), g(g), idx(idx){}; + DetailPlacerThreadState(Context *ctx, DetailPlacerState &g, int idx) : ctx(ctx), g(g), idx(idx) {}; void set_partition(const PlacePartition &part); void setup_initial_state(); bool bounds_check(BelId bel); diff --git a/common/place/parallel_refine.cc b/common/place/parallel_refine.cc index 57124629..24591ce1 100644 --- a/common/place/parallel_refine.cc +++ b/common/place/parallel_refine.cc @@ -37,7 +37,7 @@ namespace { struct GlobalState : DetailPlacerState { - explicit GlobalState(Context *ctx, ParallelRefineCfg cfg) : DetailPlacerState(ctx, this->cfg), cfg(cfg){}; + explicit GlobalState(Context *ctx, ParallelRefineCfg cfg) : DetailPlacerState(ctx, this->cfg), cfg(cfg) {}; dict> cluster2cells; @@ -49,7 +49,7 @@ struct GlobalState : DetailPlacerState struct ThreadState : DetailPlacerThreadState { - ThreadState(Context *ctx, GlobalState &g, int idx) : DetailPlacerThreadState(ctx, g, idx), g(g){}; + ThreadState(Context *ctx, GlobalState &g, int idx) : DetailPlacerThreadState(ctx, g, idx), g(g) {}; // Total made and accepted moved GlobalState &g; int n_move = 0, n_accept = 0; diff --git a/common/place/place_common.cc b/common/place/place_common.cc index c044e7e7..2ddbcb60 100644 --- a/common/place/place_common.cc +++ b/common/place/place_common.cc @@ -115,9 +115,9 @@ class ConstraintLegaliseWorker class IncreasingDiameterSearch { public: - IncreasingDiameterSearch() : start(0), min(0), max(-1){}; - IncreasingDiameterSearch(int x) : start(x), min(x), max(x){}; - IncreasingDiameterSearch(int start, int min, int max) : start(start), min(min), max(max){}; + IncreasingDiameterSearch() : start(0), min(0), max(-1) {}; + IncreasingDiameterSearch(int x) : start(x), min(x), max(x) {}; + IncreasingDiameterSearch(int start, int min, int max) : start(start), min(min), max(max) {}; bool done() const { return (diameter > (max - min)); }; int get() const { diff --git a/common/place/placer_heap.cc b/common/place/placer_heap.cc index 132da8b9..b2ae6dbe 100644 --- a/common/place/placer_heap.cc +++ b/common/place/placer_heap.cc @@ -319,20 +319,20 @@ class HeAPPlacer ctx->bindBel(bel, cell, strength); } - // Find and display all errors to help in finding the root cause of issues + // Find and display all errors to help in finding the root cause of issues unsigned num_errors = 0; for (auto &cell : ctx->cells) { if (cell.second->isPseudo()) continue; if (cell.second->bel == BelId()) { - log_nonfatal_error("Found unbound cell '%s' of type '%s'\n", cell.first.c_str(ctx), cell.second->type.c_str(ctx)); + log_nonfatal_error("Found unbound cell '%s' of type '%s'\n", cell.first.c_str(ctx), + cell.second->type.c_str(ctx)); num_errors++; - } - else if (ctx->getBoundBelCell(cell.second->bel) != cell.second.get()) { - log_nonfatal_error("Found mismatched binding for '%s' or type '%s'\n", cell.first.c_str(ctx), cell.second->type.c_str(ctx)); + } else if (ctx->getBoundBelCell(cell.second->bel) != cell.second.get()) { + log_nonfatal_error("Found mismatched binding for '%s' or type '%s'\n", cell.first.c_str(ctx), + cell.second->type.c_str(ctx)); num_errors++; - } - else if (ctx->debug) + } else if (ctx->debug) log_info("AP soln: %s -> %s\n", cell.first.c_str(ctx), ctx->nameOfBel(cell.second->bel)); } if (num_errors > 0) { @@ -899,7 +899,8 @@ class HeAPPlacer while (!placed) { if (cfg.cell_placement_timeout > 0 && total_iters_for_cell > cfg.cell_placement_timeout) - log_error("Unable to find legal placement for cell '%s' of type '%s' after %d attempts, check constraints and " + log_error("Unable to find legal placement for cell '%s' of type '%s' after %d attempts, check " + "constraints and " "utilisation. Use `--placer-heap-cell-placement-timeout` to change the number of " "attempts.\n", ctx->nameOf(ci), ci->type.c_str(ctx), total_iters_for_cell); diff --git a/common/place/placer_static.cc b/common/place/placer_static.cc index e75ccfb8..9b20af30 100644 --- a/common/place/placer_static.cc +++ b/common/place/placer_static.cc @@ -105,7 +105,7 @@ struct ConcreteCell struct ClusterGroupKey { - ClusterGroupKey(int dx = 0, int dy = 0, int group = -1) : dx(dx), dy(dy), group(group){}; + ClusterGroupKey(int dx = 0, int dy = 0, int group = -1) : dx(dx), dy(dy), group(group) {}; bool operator==(const ClusterGroupKey &other) const { return dx == other.dx && dy == other.dy && group == other.group; @@ -155,7 +155,7 @@ struct PlacerNet #ifdef NPNR_DISABLE_THREADS struct ThreadPool { - ThreadPool(int){}; + ThreadPool(int) {}; void run(int N, std::function func) { diff --git a/common/place/placer_static.h b/common/place/placer_static.h index ac43920d..1f7097de 100644 --- a/common/place/placer_static.h +++ b/common/place/placer_static.h @@ -27,8 +27,8 @@ NEXTPNR_NAMESPACE_BEGIN struct StaticRect { - StaticRect() : w(0), h(0){}; - StaticRect(float w, float h) : w(w), h(h){}; + StaticRect() : w(0), h(0) {}; + StaticRect(float w, float h) : w(w), h(h) {}; float w, h; float area() const { return w * h; } }; diff --git a/common/place/static_util.h b/common/place/static_util.h index a3dc5c93..bbaa3d9b 100644 --- a/common/place/static_util.h +++ b/common/place/static_util.h @@ -36,9 +36,9 @@ enum class Axis struct RealPair { - RealPair() : x(0), y(0){}; - RealPair(float x, float y) : x(x), y(y){}; - explicit RealPair(Loc l, float bias = 0.0f) : x(l.x + bias), y(l.y + bias){}; + RealPair() : x(0), y(0) {}; + RealPair(float x, float y) : x(x), y(y) {}; + explicit RealPair(Loc l, float bias = 0.0f) : x(l.x + bias), y(l.y + bias) {}; float x, y; RealPair &operator+=(const RealPair &other) { diff --git a/common/place/timing_opt.cc b/common/place/timing_opt.cc index f9246292..5d59b9c1 100644 --- a/common/place/timing_opt.cc +++ b/common/place/timing_opt.cc @@ -40,7 +40,7 @@ NEXTPNR_NAMESPACE_BEGIN class TimingOptimiser { public: - TimingOptimiser(Context *ctx, TimingOptCfg cfg) : ctx(ctx), cfg(cfg), tmg(ctx){}; + TimingOptimiser(Context *ctx, TimingOptCfg cfg) : ctx(ctx), cfg(cfg), tmg(ctx) {}; bool optimise() { log_info("Running timing-driven placement optimisation...\n"); diff --git a/common/route/router2.cc b/common/route/router2.cc index 53596c24..a19046a6 100644 --- a/common/route/router2.cc +++ b/common/route/router2.cc @@ -241,7 +241,7 @@ struct Router2 { explicit QueuedWire(int wire = -1, WireScore score = WireScore{}, int randtag = 0) - : wire(wire), score(score), randtag(randtag){}; + : wire(wire), score(score), randtag(randtag) {}; int wire; WireScore score; diff --git a/ecp5/archdefs.h b/ecp5/archdefs.h index b7d892c5..95c36939 100644 --- a/ecp5/archdefs.h +++ b/ecp5/archdefs.h @@ -55,9 +55,9 @@ NPNR_PACKED_STRUCT(struct LocationPOD { int16_t x, y; }); struct Location { int16_t x = -1, y = -1; - Location() : x(-1), y(-1){}; - Location(int16_t x, int16_t y) : x(x), y(y){}; - Location(const LocationPOD &pod) : x(pod.x), y(pod.y){}; + Location() : x(-1), y(-1) {}; + Location(int16_t x, int16_t y) : x(x), y(y) {}; + Location(const LocationPOD &pod) : x(pod.x), y(pod.y) {}; bool operator==(const Location &other) const { return x == other.x && y == other.y; } bool operator!=(const Location &other) const { return x != other.x || y != other.y; } diff --git a/ecp5/bitstream.cc b/ecp5/bitstream.cc index 32f5bd3d..31b5041d 100644 --- a/ecp5/bitstream.cc +++ b/ecp5/bitstream.cc @@ -49,7 +49,7 @@ void config_empty_lfe5um5g_85f(ChipConfig &cc); namespace { struct ECP5Bitgen { - explicit ECP5Bitgen(Context *ctx) : ctx(ctx){}; + explicit ECP5Bitgen(Context *ctx) : ctx(ctx) {}; Context *ctx; ChipConfig cc; std::string get_trellis_wirename(Location loc, WireId wire) diff --git a/ecp5/pack.cc b/ecp5/pack.cc index 7d7c044c..ad6d9bf8 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -53,7 +53,7 @@ static bool net_is_constant(const Context *ctx, NetInfo *net, bool &value) class Ecp5Packer { public: - Ecp5Packer(Context *ctx) : ctx(ctx){}; + Ecp5Packer(Context *ctx) : ctx(ctx) {}; private: // Process the contents of packed_cells and new_cells diff --git a/frontend/json_frontend.cc b/frontend/json_frontend.cc index f2fb3ac0..6004ee17 100644 --- a/frontend/json_frontend.cc +++ b/frontend/json_frontend.cc @@ -32,7 +32,7 @@ using namespace json11; struct JsonFrontendImpl { // See specification in frontend_base.h - JsonFrontendImpl(Json &root) : root(root){}; + JsonFrontendImpl(Json &root) : root(root) {}; Json &root; typedef const Json &ModuleDataType; typedef const Json &ModulePortDataType; diff --git a/generic/arch.h b/generic/arch.h index f4977e1e..1bf1f0b6 100644 --- a/generic/arch.h +++ b/generic/arch.h @@ -115,14 +115,14 @@ template struct linear_range { struct iterator { - explicit iterator(int32_t index) : index(index){}; + explicit iterator(int32_t index) : index(index) {}; int32_t index; bool operator==(const iterator &other) const { return index == other.index; } bool operator!=(const iterator &other) const { return index != other.index; } void operator++() { ++index; } TId operator*() const { return TId(index); } }; - explicit linear_range(int32_t size) : size(size){}; + explicit linear_range(int32_t size) : size(size) {}; int32_t size; iterator begin() const { return iterator(0); } iterator end() const { return iterator(size); } diff --git a/generic/archdefs.h b/generic/archdefs.h index 374ddeb0..dd4377cc 100644 --- a/generic/archdefs.h +++ b/generic/archdefs.h @@ -30,8 +30,8 @@ typedef float delay_t; struct BelId { - BelId() : index(-1){}; - explicit BelId(int32_t index) : index(index){}; + BelId() : index(-1) {}; + explicit BelId(int32_t index) : index(index) {}; int32_t index = -1; bool operator==(const BelId &other) const { return index == other.index; } @@ -42,8 +42,8 @@ struct BelId struct WireId { - WireId() : index(-1){}; - explicit WireId(int32_t index) : index(index){}; + WireId() : index(-1) {}; + explicit WireId(int32_t index) : index(index) {}; int32_t index = -1; bool operator==(const WireId &other) const { return index == other.index; } @@ -54,8 +54,8 @@ struct WireId struct PipId { - PipId() : index(-1){}; - explicit PipId(int32_t index) : index(index){}; + PipId() : index(-1) {}; + explicit PipId(int32_t index) : index(index) {}; int32_t index = -1; bool operator==(const PipId &other) const { return index == other.index; } @@ -68,8 +68,8 @@ struct DecalId { IdStringList name; bool active = false; - DecalId() : name(), active(false){}; - DecalId(IdStringList name, bool active) : name(name), active(active){}; + DecalId() : name(), active(false) {}; + DecalId(IdStringList name, bool active) : name(name), active(active) {}; bool operator==(const DecalId &other) const { return name == other.name && active == other.active; } bool operator!=(const DecalId &other) const { return name != other.name || active != other.active; } unsigned int hash() const { return mkhash(name.hash(), active); } diff --git a/generic/main.cc b/generic/main.cc index 7aece569..f1ce373b 100644 --- a/generic/main.cc +++ b/generic/main.cc @@ -31,9 +31,9 @@ class GenericCommandHandler : public CommandHandler { public: GenericCommandHandler(int argc, char **argv); - virtual ~GenericCommandHandler(){}; + virtual ~GenericCommandHandler() {}; std::unique_ptr createContext(dict &values) override; - void setupArchContext(Context *ctx) override{}; + void setupArchContext(Context *ctx) override {}; void customBitstream(Context *ctx) override; protected: diff --git a/generic/viaduct/example/example.cc b/generic/viaduct/example/example.cc index 7de0404b..bf3a98d8 100644 --- a/generic/viaduct/example/example.cc +++ b/generic/viaduct/example/example.cc @@ -32,7 +32,7 @@ NEXTPNR_NAMESPACE_BEGIN namespace { struct ExampleImpl : ViaductAPI { - ~ExampleImpl(){}; + ~ExampleImpl() {}; void init(Context *ctx) override { init_uarch_constids(ctx); @@ -321,7 +321,7 @@ struct ExampleImpl : ViaductAPI struct ExampleArch : ViaductArch { - ExampleArch() : ViaductArch("example"){}; + ExampleArch() : ViaductArch("example") {}; std::unique_ptr create(const dict &args) { return std::make_unique(); diff --git a/generic/viaduct/fabulous/fabric_parsing.h b/generic/viaduct/fabulous/fabric_parsing.h index 841b2465..a66220f4 100644 --- a/generic/viaduct/fabulous/fabric_parsing.h +++ b/generic/viaduct/fabulous/fabric_parsing.h @@ -36,9 +36,9 @@ struct parser_view { char *m_ptr; size_t m_length; - parser_view() : m_ptr(nullptr), m_length(0){}; - explicit parser_view(std::string &str) : m_ptr(&(str[0])), m_length(str.size()){}; - parser_view(char *ptr, size_t length) : m_ptr(ptr), m_length(length){}; + parser_view() : m_ptr(nullptr), m_length(0) {}; + explicit parser_view(std::string &str) : m_ptr(&(str[0])), m_length(str.size()) {}; + parser_view(char *ptr, size_t length) : m_ptr(ptr), m_length(length) {}; static constexpr size_t npos = std::numeric_limits::max(); char operator[](size_t idx) @@ -151,7 +151,7 @@ struct parser_view struct CsvParser { - explicit CsvParser(std::istream &in) : in(in){}; + explicit CsvParser(std::istream &in) : in(in) {}; std::istream ∈ std::string buf; parser_view view; diff --git a/generic/viaduct/fabulous/fabulous.cc b/generic/viaduct/fabulous/fabulous.cc index ed528b0b..6160ff72 100644 --- a/generic/viaduct/fabulous/fabulous.cc +++ b/generic/viaduct/fabulous/fabulous.cc @@ -55,7 +55,7 @@ struct FabulousImpl : ViaductAPI } } - ~FabulousImpl(){}; + ~FabulousImpl() {}; void init(Context *ctx) override { init_uarch_constids(ctx); @@ -666,7 +666,7 @@ struct FabulousImpl : ViaductAPI struct FabulousArch : ViaductArch { - FabulousArch() : ViaductArch("fabulous"){}; + FabulousArch() : ViaductArch("fabulous") {}; std::unique_ptr create(const dict &args) { return std::make_unique(args); diff --git a/generic/viaduct/fabulous/validity_check.h b/generic/viaduct/fabulous/validity_check.h index 1f21e07b..bb74de59 100644 --- a/generic/viaduct/fabulous/validity_check.h +++ b/generic/viaduct/fabulous/validity_check.h @@ -33,8 +33,8 @@ NEXTPNR_NAMESPACE_BEGIN // validity checking code struct ControlSig { - ControlSig() : net(), invert(false){}; - ControlSig(IdString net, bool invert) : net(net), invert(invert){}; + ControlSig() : net(), invert(false) {}; + ControlSig(IdString net, bool invert) : net(net), invert(invert) {}; IdString net; bool invert; bool operator==(const ControlSig &other) const { return net == other.net && invert == other.invert; } @@ -110,7 +110,7 @@ struct BlockTracker const FabricConfig &cfg; std::vector bel_data; - BlockTracker(Context *ctx, const FabricConfig &cfg) : ctx(ctx), cfg(cfg){}; + BlockTracker(Context *ctx, const FabricConfig &cfg) : ctx(ctx), cfg(cfg) {}; void set_bel_type(BelId bel, BelFlags::BlockType block, BelFlags::FuncType func, uint8_t index); void update_bel(BelId bel, CellInfo *old_cell, CellInfo *new_cell); struct TileData diff --git a/generic/viaduct/okami/okami.cc b/generic/viaduct/okami/okami.cc index 4ff97cb3..12aa96a4 100644 --- a/generic/viaduct/okami/okami.cc +++ b/generic/viaduct/okami/okami.cc @@ -33,7 +33,7 @@ NEXTPNR_NAMESPACE_BEGIN namespace { struct OkamiImpl : ViaductAPI { - ~OkamiImpl(){}; + ~OkamiImpl() {}; void init(Context *ctx) override { init_uarch_constids(ctx); @@ -534,7 +534,7 @@ struct OkamiImpl : ViaductAPI struct OkamiArch : ViaductArch { - OkamiArch() : ViaductArch("okami"){}; + OkamiArch() : ViaductArch("okami") {}; std::unique_ptr create(const dict &args) { return std::make_unique(); diff --git a/generic/viaduct_api.h b/generic/viaduct_api.h index 6d6423b6..03cf801e 100644 --- a/generic/viaduct_api.h +++ b/generic/viaduct_api.h @@ -86,14 +86,14 @@ struct ViaductAPI virtual BoundingBox getRouteBoundingBox(WireId src, WireId dst) const; // --- Flow hooks --- - virtual void pack(){}; // replaces the pack function + virtual void pack() {}; // replaces the pack function // Called before and after main placement and routing - virtual void prePlace(){}; - virtual void postPlace(){}; - virtual void preRoute(){}; - virtual void postRoute(){}; + virtual void prePlace() {}; + virtual void postPlace() {}; + virtual void preRoute() {}; + virtual void postRoute() {}; - virtual ~ViaductAPI(){}; + virtual ~ViaductAPI() {}; }; struct ViaductArch @@ -103,7 +103,7 @@ struct ViaductArch std::string name; ViaductArch(const std::string &name); - ~ViaductArch(){}; + ~ViaductArch() {}; virtual std::unique_ptr create(const dict &args) = 0; static std::string list(); diff --git a/generic/viaduct_helpers.h b/generic/viaduct_helpers.h index 213995db..78fef4ea 100644 --- a/generic/viaduct_helpers.h +++ b/generic/viaduct_helpers.h @@ -36,10 +36,10 @@ viaduct_helpers provides some features for building up arches using the viaduct // Used to configure various generic pack functions struct CellTypePort { - CellTypePort() : cell_type(), port(){}; - CellTypePort(IdString cell_type, IdString port) : cell_type(cell_type), port(port){}; + CellTypePort() : cell_type(), port() {}; + CellTypePort(IdString cell_type, IdString port) : cell_type(cell_type), port(port) {}; explicit CellTypePort(const PortRef &net_port) - : cell_type(net_port.cell ? net_port.cell->type : IdString()), port(net_port.port){}; + : cell_type(net_port.cell ? net_port.cell->type : IdString()), port(net_port.port) {}; inline bool operator==(const CellTypePort &other) const { return cell_type == other.cell_type && port == other.port; @@ -54,7 +54,7 @@ struct CellTypePort struct ViaductHelpers { - ViaductHelpers(){}; + ViaductHelpers() {}; Context *ctx; void init(Context *ctx) { this->ctx = ctx; } // IdStringList components for x and y locations diff --git a/gowin/main.cc b/gowin/main.cc index 15b1914d..13f16fa7 100644 --- a/gowin/main.cc +++ b/gowin/main.cc @@ -34,9 +34,9 @@ class GowinCommandHandler : public CommandHandler { public: GowinCommandHandler(int argc, char **argv); - virtual ~GowinCommandHandler(){}; + virtual ~GowinCommandHandler() {}; std::unique_ptr createContext(dict &values) override; - void setupArchContext(Context *ctx) override{}; + void setupArchContext(Context *ctx) override {}; void customAfterLoad(Context *ctx) override; protected: diff --git a/gui/basewindow.h b/gui/basewindow.h index 00b8f45c..5c11f9d2 100644 --- a/gui/basewindow.h +++ b/gui/basewindow.h @@ -58,8 +58,8 @@ class BaseMainWindow : public QMainWindow void disableActions(); void enableDisableDecals(); - virtual void onDisableActions(){}; - virtual void onUpdateActions(){}; + virtual void onDisableActions() {}; + virtual void onUpdateActions() {}; protected Q_SLOTS: void writeInfo(std::string text); diff --git a/gui/quadtree.h b/gui/quadtree.h index f240f345..26769535 100644 --- a/gui/quadtree.h +++ b/gui/quadtree.h @@ -264,20 +264,20 @@ template class QuadTreeNode splitx_ = (bound_.x1_ - bound_.x0_) / 2 + bound_.x0_; splity_ = (bound_.y1_ - bound_.y0_) / 2 + bound_.y0_; // Create the new children. - children_ = decltype(children_)(new QuadTreeNode[4] { - // Note: not using [NW] = QuadTreeNode because that seems to - // crash g++ 7.3.0. - /* NW */ QuadTreeNode(BoundingBox(bound_.x0_, bound_.y0_, splitx_, splity_), - depth_ + 1, max_elems_), - /* NE */ - QuadTreeNode(BoundingBox(splitx_, bound_.y0_, bound_.x1_, splity_), - depth_ + 1, max_elems_), - /* SW */ - QuadTreeNode(BoundingBox(bound_.x0_, splity_, splitx_, bound_.y1_), - depth_ + 1, max_elems_), - /* SE */ - QuadTreeNode(BoundingBox(splitx_, splity_, bound_.x1_, bound_.y1_), - depth_ + 1, max_elems_), + children_ = decltype(children_)(new QuadTreeNode[4]{ + // Note: not using [NW] = QuadTreeNode because that seems to + // crash g++ 7.3.0. + /* NW */ QuadTreeNode(BoundingBox(bound_.x0_, bound_.y0_, splitx_, splity_), + depth_ + 1, max_elems_), + /* NE */ + QuadTreeNode(BoundingBox(splitx_, bound_.y0_, bound_.x1_, splity_), + depth_ + 1, max_elems_), + /* SW */ + QuadTreeNode(BoundingBox(bound_.x0_, splity_, splitx_, bound_.y1_), + depth_ + 1, max_elems_), + /* SE */ + QuadTreeNode(BoundingBox(splitx_, splity_, bound_.x1_, bound_.y1_), + depth_ + 1, max_elems_), }); // Move all elements to where they belong. auto it = elems_.begin(); diff --git a/himbaechel/arch.cc b/himbaechel/arch.cc index 09d6d04b..de314151 100644 --- a/himbaechel/arch.cc +++ b/himbaechel/arch.cc @@ -387,13 +387,12 @@ bool Arch::lookup_cell_delay(int type_idx, IdString from_port, IdString to_port, { NPNR_ASSERT(type_idx != -1); const auto &ct = speed_grade->cell_types[type_idx]; - int to_pin_idx = db_binary_search( - ct.pins, [](const CellPinTimingPOD &pd) { return pd.pin; }, to_port.index); + int to_pin_idx = db_binary_search(ct.pins, [](const CellPinTimingPOD &pd) { return pd.pin; }, to_port.index); if (to_pin_idx == -1) return false; const auto &tp = ct.pins[to_pin_idx]; - int arc_idx = db_binary_search( - tp.comb_arcs, [](const CellPinCombArcPOD &arc) { return arc.input; }, from_port.index); + int arc_idx = + db_binary_search(tp.comb_arcs, [](const CellPinCombArcPOD &arc) { return arc.input; }, from_port.index); if (arc_idx == -1) return false; delay = DelayQuad(tp.comb_arcs[arc_idx].delay.fast_min, tp.comb_arcs[arc_idx].delay.slow_max); @@ -404,8 +403,7 @@ const RelSlice *Arch::lookup_cell_seq_timings(int type_idx, Id { NPNR_ASSERT(type_idx != -1); const auto &ct = speed_grade->cell_types[type_idx]; - int pin_idx = db_binary_search( - ct.pins, [](const CellPinTimingPOD &pd) { return pd.pin; }, port.index); + int pin_idx = db_binary_search(ct.pins, [](const CellPinTimingPOD &pd) { return pd.pin; }, port.index); if (pin_idx == -1) return nullptr; return &ct.pins[pin_idx].reg_arcs; @@ -416,8 +414,7 @@ TimingPortClass Arch::lookup_port_tmg_type(int type_idx, IdString port, PortType NPNR_ASSERT(type_idx != -1); const auto &ct = speed_grade->cell_types[type_idx]; - int pin_idx = db_binary_search( - ct.pins, [](const CellPinTimingPOD &pd) { return pd.pin; }, port.index); + int pin_idx = db_binary_search(ct.pins, [](const CellPinTimingPOD &pd) { return pd.pin; }, port.index); if (pin_idx == -1) return (dir == PORT_OUT) ? TMG_IGNORE : TMG_COMB_INPUT; auto &pin = ct.pins[pin_idx]; diff --git a/himbaechel/arch.h b/himbaechel/arch.h index 548d6764..80765da3 100644 --- a/himbaechel/arch.h +++ b/himbaechel/arch.h @@ -178,7 +178,7 @@ struct TileWireIterator int cursor; TileWireIterator(const ChipInfoPOD *chip, WireId base, int node_shape, int cursor) - : chip(chip), base(base), node_shape(node_shape), cursor(cursor){}; + : chip(chip), base(base), node_shape(node_shape), cursor(cursor) {}; void operator++() { cursor++; } bool operator!=(const TileWireIterator &other) const { return cursor != other.cursor; } @@ -210,7 +210,7 @@ struct TileWireRange }; // is not nodal - explicit TileWireRange(WireId w) : b(nullptr, w, -1, 0), e(nullptr, w, -1, 1){}; + explicit TileWireRange(WireId w) : b(nullptr, w, -1, 0), e(nullptr, w, -1, 1) {}; TileWireIterator b, e; TileWireIterator begin() const { return b; } @@ -223,7 +223,7 @@ struct WireIterator int cursor_tile = 0; int cursor_index = -1; - WireIterator(const ChipInfoPOD *chip, int tile, int index) : chip(chip), cursor_tile(tile), cursor_index(index){}; + WireIterator(const ChipInfoPOD *chip, int tile, int index) : chip(chip), cursor_tile(tile), cursor_index(index) {}; WireIterator operator++() { @@ -287,7 +287,7 @@ template TileWireDataPOD::*ptr> struct UpdownhillPipIterator int cursor = -1; UpdownhillPipIterator(const ChipInfoPOD *chip, TileWireIterator twi, TileWireIterator twi_end, int cursor) - : chip(chip), twi(twi), twi_end(twi_end), cursor(cursor){}; + : chip(chip), twi(twi), twi_end(twi_end), cursor(cursor) {}; void operator++() { @@ -339,7 +339,7 @@ struct BelPinIterator int cursor = -1; BelPinIterator(const ChipInfoPOD *chip, TileWireIterator twi, TileWireIterator twi_end, int cursor) - : chip(chip), twi(twi), twi_end(twi_end), cursor(cursor){}; + : chip(chip), twi(twi), twi_end(twi_end), cursor(cursor) {}; void operator++() { @@ -418,7 +418,7 @@ struct Arch : BaseArch { ArchArgs args; Arch(ArchArgs args); - ~Arch(){}; + ~Arch() {}; void load_chipdb(const std::string &path); void set_speed_grade(const std::string &speed); diff --git a/himbaechel/archdefs.h b/himbaechel/archdefs.h index 14c4b11f..d4b8d621 100644 --- a/himbaechel/archdefs.h +++ b/himbaechel/archdefs.h @@ -39,7 +39,7 @@ struct BelId int32_t index = -1; BelId() = default; - BelId(int32_t tile, int32_t index) : tile(tile), index(index){}; + BelId(int32_t tile, int32_t index) : tile(tile), index(index) {}; bool operator==(const BelId &other) const { return tile == other.tile && index == other.index; } bool operator!=(const BelId &other) const { return tile != other.tile || index != other.index; } @@ -56,7 +56,7 @@ struct WireId int32_t index = -1; WireId() = default; - WireId(int32_t tile, int32_t index) : tile(tile), index(index){}; + WireId(int32_t tile, int32_t index) : tile(tile), index(index) {}; bool operator==(const WireId &other) const { return tile == other.tile && index == other.index; } bool operator!=(const WireId &other) const { return tile != other.tile || index != other.index; } @@ -74,7 +74,7 @@ struct PipId int32_t index = -1; PipId() = default; - PipId(int32_t tile, int32_t index) : tile(tile), index(index){}; + PipId(int32_t tile, int32_t index) : tile(tile), index(index) {}; bool operator==(const PipId &other) const { return tile == other.tile && index == other.index; } bool operator!=(const PipId &other) const { return tile != other.tile || index != other.index; } diff --git a/himbaechel/himbaechel_api.h b/himbaechel/himbaechel_api.h index 21275cfb..e795e4d5 100644 --- a/himbaechel/himbaechel_api.h +++ b/himbaechel/himbaechel_api.h @@ -106,17 +106,17 @@ struct HimbaechelAPI virtual bool getClusterPlacement(ClusterId cluster, BelId root_bel, std::vector> &placement) const; // --- Flow hooks --- - virtual void pack(){}; // replaces the pack function + virtual void pack() {}; // replaces the pack function // Called before and after main placement and routing - virtual void prePlace(){}; - virtual void postPlace(){}; - virtual void preRoute(){}; - virtual void postRoute(){}; + virtual void prePlace() {}; + virtual void postPlace() {}; + virtual void preRoute() {}; + virtual void postRoute() {}; // For custom placer configuration - virtual void configurePlacerHeap(PlacerHeapCfg &cfg){}; + virtual void configurePlacerHeap(PlacerHeapCfg &cfg) {}; - virtual ~HimbaechelAPI(){}; + virtual ~HimbaechelAPI() {}; }; struct HimbaechelArch @@ -126,7 +126,7 @@ struct HimbaechelArch std::string name; HimbaechelArch(const std::string &name); - ~HimbaechelArch(){}; + ~HimbaechelArch() {}; virtual bool match_device(const std::string &device) = 0; virtual std::unique_ptr create(const std::string &device, const dict &args) = 0; diff --git a/himbaechel/himbaechel_helpers.h b/himbaechel/himbaechel_helpers.h index 369f41dc..d622a41c 100644 --- a/himbaechel/himbaechel_helpers.h +++ b/himbaechel/himbaechel_helpers.h @@ -36,10 +36,10 @@ himbaechel_helpers provides some features for building up arches using the himb // Used to configure various generic pack functions struct CellTypePort { - CellTypePort() : cell_type(), port(){}; - CellTypePort(IdString cell_type, IdString port) : cell_type(cell_type), port(port){}; + CellTypePort() : cell_type(), port() {}; + CellTypePort(IdString cell_type, IdString port) : cell_type(cell_type), port(port) {}; explicit CellTypePort(const PortRef &net_port) - : cell_type(net_port.cell ? net_port.cell->type : IdString()), port(net_port.port){}; + : cell_type(net_port.cell ? net_port.cell->type : IdString()), port(net_port.port) {}; inline bool operator==(const CellTypePort &other) const { return cell_type == other.cell_type && port == other.port; @@ -54,7 +54,7 @@ struct CellTypePort struct HimbaechelHelpers { - HimbaechelHelpers(){}; + HimbaechelHelpers() {}; Context *ctx; void init(Context *ctx) { this->ctx = ctx; } // Common packing functions diff --git a/himbaechel/main.cc b/himbaechel/main.cc index dccad722..8e25f114 100644 --- a/himbaechel/main.cc +++ b/himbaechel/main.cc @@ -31,7 +31,7 @@ class HimbaechelCommandHandler : public CommandHandler { public: HimbaechelCommandHandler(int argc, char **argv); - virtual ~HimbaechelCommandHandler(){}; + virtual ~HimbaechelCommandHandler() {}; std::unique_ptr createContext(dict &values) override; void setupArchContext(Context *ctx) override; void customBitstream(Context *ctx) override; diff --git a/himbaechel/uarch/example/example.cc b/himbaechel/uarch/example/example.cc index 5172d5cf..391a8ca4 100644 --- a/himbaechel/uarch/example/example.cc +++ b/himbaechel/uarch/example/example.cc @@ -36,7 +36,7 @@ struct ExampleImpl : HimbaechelAPI static constexpr int K = 4; - ~ExampleImpl(){}; + ~ExampleImpl() {}; void init_database(Arch *arch) override { init_uarch_constids(arch); @@ -139,7 +139,7 @@ struct ExampleImpl : HimbaechelAPI struct ExampleArch : HimbaechelArch { - ExampleArch() : HimbaechelArch("example"){}; + ExampleArch() : HimbaechelArch("example") {}; bool match_device(const std::string &device) override { return device == "EXAMPLE"; } std::unique_ptr create(const std::string &device, const dict &args) { diff --git a/himbaechel/uarch/gowin/cst.cc b/himbaechel/uarch/gowin/cst.cc index 310e1406..a933cc19 100644 --- a/himbaechel/uarch/gowin/cst.cc +++ b/himbaechel/uarch/gowin/cst.cc @@ -20,7 +20,7 @@ struct GowinCstReader Context *ctx; std::istream ∈ - GowinCstReader(Context *ctx, std::istream &in) : ctx(ctx), in(in){}; + GowinCstReader(Context *ctx, std::istream &in) : ctx(ctx), in(in) {}; const PadInfoPOD *pinLookup(const PadInfoPOD *list, const size_t len, const IdString idx) { diff --git a/himbaechel/uarch/gowin/globals.cc b/himbaechel/uarch/gowin/globals.cc index 4e1f8f71..aa5490a4 100644 --- a/himbaechel/uarch/gowin/globals.cc +++ b/himbaechel/uarch/gowin/globals.cc @@ -340,8 +340,7 @@ struct GowinGlobalRouter src = ctx->getBelPinWire(driver.cell->bel, driver.port); } - RouteResult route_result = route_direct_net( - net, [&](PipId pip) { return global_DQCE_pip_filter(pip); }, src); + RouteResult route_result = route_direct_net(net, [&](PipId pip) { return global_DQCE_pip_filter(pip); }, src); if (route_result == NOT_ROUTED) { log_error("Can't route the %s network.\n", ctx->nameOf(net)); } @@ -418,8 +417,7 @@ struct GowinGlobalRouter src = ctx->getBelPinWire(driver.cell->bel, driver.port); } - RouteResult route_result = route_direct_net( - net, [&](PipId pip) { return global_DCS_pip_filter(pip); }, src); + RouteResult route_result = route_direct_net(net, [&](PipId pip) { return global_DCS_pip_filter(pip); }, src); if (route_result == NOT_ROUTED) { log_error("Can't route the %s network.\n", ctx->nameOf(net)); } @@ -506,8 +504,7 @@ struct GowinGlobalRouter WireId src = ctx->getBelPinWire(driver.cell->bel, port); std::vector path; - RouteResult route_result = route_direct_net( - net, [&](PipId pip) { return global_pip_filter(pip); }, src, &path); + RouteResult route_result = route_direct_net(net, [&](PipId pip) { return global_pip_filter(pip); }, src, &path); if (route_result == NOT_ROUTED) { log_error("Can't route the %s network.\n", ctx->nameOf(net)); } @@ -571,8 +568,7 @@ struct GowinGlobalRouter NetInfo *net_before_buf = buf_ci->getPort(id_I); NPNR_ASSERT(net_before_buf != nullptr); - RouteResult route_result = route_direct_net( - net, [&](PipId pip) { return global_pip_filter(pip); }, src); + RouteResult route_result = route_direct_net(net, [&](PipId pip) { return global_pip_filter(pip); }, src); if (route_result == NOT_ROUTED || route_result == ROUTED_PARTIALLY) { log_error("Can't route the %s net. It might be worth removing the BUFG buffer flag.\n", ctx->nameOf(net)); } diff --git a/himbaechel/uarch/gowin/gowin.cc b/himbaechel/uarch/gowin/gowin.cc index 968d2eca..1199ee45 100644 --- a/himbaechel/uarch/gowin/gowin.cc +++ b/himbaechel/uarch/gowin/gowin.cc @@ -21,7 +21,7 @@ namespace { struct GowinImpl : HimbaechelAPI { - ~GowinImpl(){}; + ~GowinImpl() {}; void init_database(Arch *arch) override; void init(Context *ctx) override; @@ -102,7 +102,7 @@ struct GowinImpl : HimbaechelAPI struct GowinArch : HimbaechelArch { - GowinArch() : HimbaechelArch("gowin"){}; + GowinArch() : HimbaechelArch("gowin") {}; bool match_device(const std::string &device) override { return device.size() > 2 && device.substr(0, 2) == "GW"; } diff --git a/ice40/chains.cc b/ice40/chains.cc index 20edafaa..f6e236a7 100644 --- a/ice40/chains.cc +++ b/ice40/chains.cc @@ -270,7 +270,7 @@ class ChainConstrainer } public: - ChainConstrainer(Context *ctx) : ctx(ctx){}; + ChainConstrainer(Context *ctx) : ctx(ctx) {}; void constrain_chains() { process_carries(); } }; diff --git a/ice40/main.cc b/ice40/main.cc index 224b0275..f16ba83d 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -34,7 +34,7 @@ class Ice40CommandHandler : public CommandHandler { public: Ice40CommandHandler(int argc, char **argv); - virtual ~Ice40CommandHandler(){}; + virtual ~Ice40CommandHandler() {}; std::unique_ptr createContext(dict &values) override; void setupArchContext(Context *ctx) override; void validate() override; diff --git a/machxo2/archdefs.h b/machxo2/archdefs.h index 3a4ed21e..e5e30ba9 100644 --- a/machxo2/archdefs.h +++ b/machxo2/archdefs.h @@ -55,9 +55,9 @@ NPNR_PACKED_STRUCT(struct LocationPOD { int16_t x, y; }); struct Location { int16_t x = -1, y = -1; - Location() : x(-1), y(-1){}; - Location(int16_t x, int16_t y) : x(x), y(y){}; - Location(const LocationPOD &pod) : x(pod.x), y(pod.y){}; + Location() : x(-1), y(-1) {}; + Location(int16_t x, int16_t y) : x(x), y(y) {}; + Location(const LocationPOD &pod) : x(pod.x), y(pod.y) {}; bool operator==(const Location &other) const { return x == other.x && y == other.y; } bool operator!=(const Location &other) const { return x != other.x || y != other.y; } diff --git a/machxo2/bitstream.cc b/machxo2/bitstream.cc index 6ad03541..c4b016c1 100644 --- a/machxo2/bitstream.cc +++ b/machxo2/bitstream.cc @@ -52,7 +52,7 @@ void config_empty_lcmxo3_9400(ChipConfig &cc); namespace { struct MachXO2Bitgen { - explicit MachXO2Bitgen(Context *ctx) : ctx(ctx){}; + explicit MachXO2Bitgen(Context *ctx) : ctx(ctx) {}; Context *ctx; ChipConfig cc; // Convert an absolute wire name to a relative Trellis one diff --git a/machxo2/globals.cc b/machxo2/globals.cc index bef4628d..cabc9d58 100644 --- a/machxo2/globals.cc +++ b/machxo2/globals.cc @@ -30,7 +30,7 @@ struct MachxoGlobalRouter { Context *ctx; - MachxoGlobalRouter(Context *ctx) : ctx(ctx){}; + MachxoGlobalRouter(Context *ctx) : ctx(ctx) {}; // When routing globals; we allow global->local for some tricky cases but never local->local bool global_pip_filter(PipId pip) const diff --git a/machxo2/main.cc b/machxo2/main.cc index ff72ace3..54a226da 100644 --- a/machxo2/main.cc +++ b/machxo2/main.cc @@ -33,9 +33,9 @@ class MachXO2CommandHandler : public CommandHandler { public: MachXO2CommandHandler(int argc, char **argv); - virtual ~MachXO2CommandHandler(){}; + virtual ~MachXO2CommandHandler() {}; std::unique_ptr createContext(dict &values) override; - void setupArchContext(Context *ctx) override{}; + void setupArchContext(Context *ctx) override {}; void customAfterLoad(Context *ctx) override; void customBitstream(Context *ctx) override; diff --git a/machxo2/pack.cc b/machxo2/pack.cc index 51c0dae1..62f72ecb 100644 --- a/machxo2/pack.cc +++ b/machxo2/pack.cc @@ -38,7 +38,7 @@ static bool is_nextpnr_iob(Context *ctx, CellInfo *cell) class MachXO2Packer { public: - MachXO2Packer(Context *ctx) : ctx(ctx){}; + MachXO2Packer(Context *ctx) : ctx(ctx) {}; private: // Process the contents of packed_cells and new_cells diff --git a/mistral/arch.h b/mistral/arch.h index bc950566..f2de793d 100644 --- a/mistral/arch.h +++ b/mistral/arch.h @@ -133,7 +133,7 @@ struct UpDownhillPipIterator bool is_uphill; UpDownhillPipIterator(WireVecIterator base, WireId other_wire, bool is_uphill) - : base(base), other_wire(other_wire), is_uphill(is_uphill){}; + : base(base), other_wire(other_wire), is_uphill(is_uphill) {}; bool operator!=(const UpDownhillPipIterator &other) { return base != other.base; } UpDownhillPipIterator operator++() @@ -155,7 +155,7 @@ struct UpDownhillPipRange UpDownhillPipIterator b, e; UpDownhillPipRange(const std::vector &v, WireId other_wire, bool is_uphill) - : b(v.begin(), other_wire, is_uphill), e(v.end(), other_wire, is_uphill){}; + : b(v.begin(), other_wire, is_uphill), e(v.end(), other_wire, is_uphill) {}; UpDownhillPipIterator begin() const { return b; } UpDownhillPipIterator end() const { return e; } @@ -170,7 +170,7 @@ struct AllPipIterator int uphill_idx; AllPipIterator(WireMapIterator base, WireMapIterator end, int uphill_idx) - : base(base), end(end), uphill_idx(uphill_idx){}; + : base(base), end(end), uphill_idx(uphill_idx) {}; bool operator!=(const AllPipIterator &other) { return base != other.base || uphill_idx != other.uphill_idx; } AllPipIterator operator++() @@ -212,12 +212,12 @@ struct AllPipRange // This transforms a map to a range of keys, used as the wire iterator template struct key_range { - key_range(const T &t) : b(t.begin()), e(t.end()){}; + key_range(const T &t) : b(t.begin()), e(t.end()) {}; typename T::const_iterator b, e; struct xformed_iterator : public T::const_iterator { - explicit xformed_iterator(typename T::const_iterator base) : T::const_iterator(base){}; + explicit xformed_iterator(typename T::const_iterator base) : T::const_iterator(base) {}; typename T::key_type operator*() { return this->T::const_iterator::operator*().first; } }; diff --git a/mistral/archdefs.h b/mistral/archdefs.h index f4040398..b42f0e95 100644 --- a/mistral/archdefs.h +++ b/mistral/archdefs.h @@ -93,7 +93,7 @@ static constexpr auto invalid_rnode = std::numeric_limits::ma struct WireId { WireId() = default; - explicit WireId(CycloneV::rnode_t node) : node(node){}; + explicit WireId(CycloneV::rnode_t node) : node(node) {}; CycloneV::rnode_t node = invalid_rnode; // Wires created by nextpnr have rnode type >= 128 @@ -112,7 +112,7 @@ struct WireId struct PipId { PipId() = default; - PipId(CycloneV::rnode_t src, CycloneV::rnode_t dst) : src(src), dst(dst){}; + PipId(CycloneV::rnode_t src, CycloneV::rnode_t dst) : src(src), dst(dst) {}; CycloneV::rnode_t src = invalid_rnode, dst = invalid_rnode; bool operator==(const PipId &other) const { return src == other.src && dst == other.dst; } diff --git a/mistral/bitstream.cc b/mistral/bitstream.cc index e3268810..b46a9f6b 100644 --- a/mistral/bitstream.cc +++ b/mistral/bitstream.cc @@ -26,7 +26,7 @@ NEXTPNR_NAMESPACE_BEGIN namespace { struct MistralBitgen { - MistralBitgen(Context *ctx) : ctx(ctx), cv(ctx->cyclonev){}; + MistralBitgen(Context *ctx) : ctx(ctx), cv(ctx->cyclonev) {}; Context *ctx; CycloneV *cv; diff --git a/mistral/globals.cc b/mistral/globals.cc index cb00b635..0d971335 100644 --- a/mistral/globals.cc +++ b/mistral/globals.cc @@ -66,7 +66,7 @@ struct MistralGlobalRouter { Context *ctx; - MistralGlobalRouter(Context *ctx) : ctx(ctx){}; + MistralGlobalRouter(Context *ctx) : ctx(ctx) {}; // When routing globals; we allow global->local for some tricky cases but never local->local bool global_pip_filter(PipId pip) const diff --git a/mistral/main.cc b/mistral/main.cc index 34bf759e..a2df7fd9 100644 --- a/mistral/main.cc +++ b/mistral/main.cc @@ -32,9 +32,9 @@ class MistralCommandHandler : public CommandHandler { public: MistralCommandHandler(int argc, char **argv); - virtual ~MistralCommandHandler(){}; + virtual ~MistralCommandHandler() {}; std::unique_ptr createContext(dict &values) override; - void setupArchContext(Context *ctx) override{}; + void setupArchContext(Context *ctx) override {}; void customBitstream(Context *ctx) override; void customAfterLoad(Context *ctx) override; diff --git a/mistral/pack.cc b/mistral/pack.cc index a298c5d6..5dae4034 100644 --- a/mistral/pack.cc +++ b/mistral/pack.cc @@ -26,7 +26,7 @@ NEXTPNR_NAMESPACE_BEGIN namespace { struct MistralPacker { - MistralPacker(Context *ctx) : ctx(ctx){}; + MistralPacker(Context *ctx) : ctx(ctx) {}; Context *ctx; NetInfo *gnd_net, *vcc_net; diff --git a/mistral/qsf.cc b/mistral/qsf.cc index 88f51b1b..ccf9a5ec 100644 --- a/mistral/qsf.cc +++ b/mistral/qsf.cc @@ -78,7 +78,7 @@ struct QsfParser int lineno = 0; Context *ctx; - QsfParser(const std::string &buf, Context *ctx) : buf(buf), ctx(ctx){}; + QsfParser(const std::string &buf, Context *ctx) : buf(buf), ctx(ctx) {}; inline bool eof() const { return pos == int(buf.size()); } diff --git a/nexus/archdefs.h b/nexus/archdefs.h index f12206f0..4d091105 100644 --- a/nexus/archdefs.h +++ b/nexus/archdefs.h @@ -52,7 +52,7 @@ struct BelId int32_t index = -1; BelId() = default; - inline BelId(int32_t tile, int32_t index) : tile(tile), index(index){}; + inline BelId(int32_t tile, int32_t index) : tile(tile), index(index) {}; bool operator==(const BelId &other) const { return tile == other.tile && index == other.index; } bool operator!=(const BelId &other) const { return tile != other.tile || index != other.index; } @@ -71,7 +71,7 @@ struct WireId int32_t index = -1; WireId() = default; - inline WireId(int32_t tile, int32_t index) : tile(tile), index(index){}; + inline WireId(int32_t tile, int32_t index) : tile(tile), index(index) {}; bool operator==(const WireId &other) const { return tile == other.tile && index == other.index; } bool operator!=(const WireId &other) const { return tile != other.tile || index != other.index; } @@ -89,7 +89,7 @@ struct PipId int32_t index = -1; PipId() = default; - inline PipId(int32_t tile, int32_t index) : tile(tile), index(index){}; + inline PipId(int32_t tile, int32_t index) : tile(tile), index(index) {}; bool operator==(const PipId &other) const { return tile == other.tile && index == other.index; } bool operator!=(const PipId &other) const { return tile != other.tile || index != other.index; } diff --git a/nexus/global.cc b/nexus/global.cc index ec6f66a2..9b5fd9fd 100644 --- a/nexus/global.cc +++ b/nexus/global.cc @@ -42,7 +42,7 @@ struct NexusGlobalRouter { Context *ctx; - NexusGlobalRouter(Context *ctx) : ctx(ctx){}; + NexusGlobalRouter(Context *ctx) : ctx(ctx) {}; // When routing globals; we allow global->local for some tricky cases but never local->local bool global_pip_filter(PipId pip) const diff --git a/nexus/main.cc b/nexus/main.cc index cfa06b74..208b25d7 100644 --- a/nexus/main.cc +++ b/nexus/main.cc @@ -32,9 +32,9 @@ class NexusCommandHandler : public CommandHandler { public: NexusCommandHandler(int argc, char **argv); - virtual ~NexusCommandHandler(){}; + virtual ~NexusCommandHandler() {}; std::unique_ptr createContext(dict &values) override; - void setupArchContext(Context *ctx) override{}; + void setupArchContext(Context *ctx) override {}; void customBitstream(Context *ctx) override; void customAfterLoad(Context *ctx) override; diff --git a/nexus/pdc.cc b/nexus/pdc.cc index af622158..0ec50b7e 100644 --- a/nexus/pdc.cc +++ b/nexus/pdc.cc @@ -87,8 +87,8 @@ struct TCLEntity struct TCLValue { - TCLValue(const std::string &s) : is_string(true), str(s){}; - TCLValue(const std::vector &l) : is_string(false), list(l){}; + TCLValue(const std::string &s) : is_string(true), str(s) {}; + TCLValue(const std::vector &l) : is_string(false), list(l) {}; bool is_string; std::string str; // simple string value @@ -102,7 +102,7 @@ struct PDCParser int lineno = 1; Context *ctx; - PDCParser(const std::string &buf, Context *ctx) : buf(buf), ctx(ctx){}; + PDCParser(const std::string &buf, Context *ctx) : buf(buf), ctx(ctx) {}; inline bool eof() const { return pos == int(buf.size()); } diff --git a/nexus/post_place.cc b/nexus/post_place.cc index 289f82b2..8b615dd7 100644 --- a/nexus/post_place.cc +++ b/nexus/post_place.cc @@ -30,7 +30,7 @@ struct NexusPostPlaceOpt Context *ctx; TimingAnalyser tmg; - NexusPostPlaceOpt(Context *ctx) : ctx(ctx), tmg(ctx){}; + NexusPostPlaceOpt(Context *ctx) : ctx(ctx), tmg(ctx) {}; inline bool is_constrained(CellInfo *cell) { return cell->cluster != ClusterId(); }