clangformat

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2024-09-30 14:51:33 +02:00
parent fcdaf3f86c
commit 9b51c6e337
66 changed files with 192 additions and 200 deletions

View File

@ -35,7 +35,7 @@ NEXTPNR_NAMESPACE_BEGIN
template <typename T> 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 <typename T> 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 <typename T> class array2d
inline bool operator==(const iterator &other) const { return other.x == x && other.y == y; }
private:
iterator(int x, int y, array2d<T> &base) : x(x), y(y), base(&base){};
iterator(int x, int y, array2d<T> &base) : x(x), y(y), base(&base) {};
int x, y;
array2d<T> *base;
friend class array2d;

View File

@ -443,7 +443,7 @@ template <typename R> struct BaseArch : ArchAPI<R>
}
// 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

View File

@ -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()
{

View File

@ -34,7 +34,7 @@ template <typename T> 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 <typename T> class indexed_store
friend class indexed_store<T>;
public:
slot() : next_free(std::numeric_limits<int32_t>::max()), active(false){};
slot() : next_free(std::numeric_limits<int32_t>::max()), active(false) {};
slot(slot &&other) : next_free(other.next_free), active(other.active)
{
if (active)
@ -180,7 +180,7 @@ template <typename T> 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 <typename T> 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 <typename T> class indexed_store
template <typename S> 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<std::remove_cv_t<S>> index;
S &value;
};
@ -260,7 +260,7 @@ template <typename T> 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<It, S> &other) const { return other.base != base; }
inline bool operator==(const enumerated_iterator<It, S> &other) const { return other.base == base; }
inline enumerated_iterator<It, S> operator++()
@ -279,7 +279,7 @@ template <typename T> class indexed_store
template <typename It, typename S> 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<It, S> m_begin, m_end;
enumerated_iterator<It, S> begin() { return m_begin; }
enumerated_iterator<It, S> end() { return m_end; }

View File

@ -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
{

View File

@ -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

View File

@ -76,8 +76,8 @@ A pair that doesn't automatically become a tuple
*/
template <typename Ta, typename Tb> 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;
};

View File

@ -56,7 +56,7 @@ template <typename T, std::size_t N> 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)
{

View File

@ -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) {

View File

@ -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<std::pair<CellPortKey, IdString>> 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;

View File

@ -112,10 +112,10 @@ bool boolstr_or_default(const dict<KeyType, Property> &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<KeyType, Property> &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 <typename KeyType>
bool boolvec_populate(const dict<KeyType, Property> &ct, const KeyType &key, std::vector<bool>& vec)
bool boolvec_populate(const dict<KeyType, Property> &ct, const KeyType &key, std::vector<bool> &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 <typename T, typename C = std::less<T>> struct TopoSort
template <typename T> 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(); }
};

View File

@ -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<std::pair<int, store_index<PortRef>>> timing_changed_arcs;
std::vector<double> 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);

View File

@ -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<ClusterId, std::vector<CellInfo *>> 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;

View File

@ -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
{

View File

@ -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);

View File

@ -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<void(int)> func)
{

View File

@ -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; }
};

View File

@ -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)
{

View File

@ -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");

View File

@ -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;

View File

@ -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; }

View File

@ -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)

View File

@ -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

View File

@ -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;

View File

@ -115,14 +115,14 @@ template <typename TId> 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); }

View File

@ -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); }

View File

@ -31,9 +31,9 @@ class GenericCommandHandler : public CommandHandler
{
public:
GenericCommandHandler(int argc, char **argv);
virtual ~GenericCommandHandler(){};
virtual ~GenericCommandHandler() {};
std::unique_ptr<Context> createContext(dict<std::string, Property> &values) override;
void setupArchContext(Context *ctx) override{};
void setupArchContext(Context *ctx) override {};
void customBitstream(Context *ctx) override;
protected:

View File

@ -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<ViaductAPI> create(const dict<std::string, std::string> &args)
{
return std::make_unique<ExampleImpl>();

View File

@ -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<size_t>::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 &in;
std::string buf;
parser_view view;

View File

@ -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<ViaductAPI> create(const dict<std::string, std::string> &args)
{
return std::make_unique<FabulousImpl>(args);

View File

@ -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<BelFlags> 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

View File

@ -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<ViaductAPI> create(const dict<std::string, std::string> &args)
{
return std::make_unique<OkamiImpl>();

View File

@ -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<ViaductAPI> create(const dict<std::string, std::string> &args) = 0;
static std::string list();

View File

@ -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

View File

@ -34,9 +34,9 @@ class GowinCommandHandler : public CommandHandler
{
public:
GowinCommandHandler(int argc, char **argv);
virtual ~GowinCommandHandler(){};
virtual ~GowinCommandHandler() {};
std::unique_ptr<Context> createContext(dict<std::string, Property> &values) override;
void setupArchContext(Context *ctx) override{};
void setupArchContext(Context *ctx) override {};
void customAfterLoad(Context *ctx) override;
protected:

View File

@ -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);

View File

@ -264,20 +264,20 @@ template <typename CoordinateT, typename ElementT> 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<CoordinateT, ElementT>[4] {
// Note: not using [NW] = QuadTreeNode because that seems to
// crash g++ 7.3.0.
/* NW */ QuadTreeNode<CoordinateT, ElementT>(BoundingBox(bound_.x0_, bound_.y0_, splitx_, splity_),
depth_ + 1, max_elems_),
/* NE */
QuadTreeNode<CoordinateT, ElementT>(BoundingBox(splitx_, bound_.y0_, bound_.x1_, splity_),
depth_ + 1, max_elems_),
/* SW */
QuadTreeNode<CoordinateT, ElementT>(BoundingBox(bound_.x0_, splity_, splitx_, bound_.y1_),
depth_ + 1, max_elems_),
/* SE */
QuadTreeNode<CoordinateT, ElementT>(BoundingBox(splitx_, splity_, bound_.x1_, bound_.y1_),
depth_ + 1, max_elems_),
children_ = decltype(children_)(new QuadTreeNode<CoordinateT, ElementT>[4]{
// Note: not using [NW] = QuadTreeNode because that seems to
// crash g++ 7.3.0.
/* NW */ QuadTreeNode<CoordinateT, ElementT>(BoundingBox(bound_.x0_, bound_.y0_, splitx_, splity_),
depth_ + 1, max_elems_),
/* NE */
QuadTreeNode<CoordinateT, ElementT>(BoundingBox(splitx_, bound_.y0_, bound_.x1_, splity_),
depth_ + 1, max_elems_),
/* SW */
QuadTreeNode<CoordinateT, ElementT>(BoundingBox(bound_.x0_, splity_, splitx_, bound_.y1_),
depth_ + 1, max_elems_),
/* SE */
QuadTreeNode<CoordinateT, ElementT>(BoundingBox(splitx_, splity_, bound_.x1_, bound_.y1_),
depth_ + 1, max_elems_),
});
// Move all elements to where they belong.
auto it = elems_.begin();

View File

@ -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<CellPinRegArcPOD> *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];

View File

@ -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 <RelSlice<int32_t> 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<ArchRanges>
{
ArchArgs args;
Arch(ArchArgs args);
~Arch(){};
~Arch() {};
void load_chipdb(const std::string &path);
void set_speed_grade(const std::string &speed);

View File

@ -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; }

View File

@ -106,17 +106,17 @@ struct HimbaechelAPI
virtual bool getClusterPlacement(ClusterId cluster, BelId root_bel,
std::vector<std::pair<CellInfo *, BelId>> &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<HimbaechelAPI> create(const std::string &device,
const dict<std::string, std::string> &args) = 0;

View File

@ -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

View File

@ -31,7 +31,7 @@ class HimbaechelCommandHandler : public CommandHandler
{
public:
HimbaechelCommandHandler(int argc, char **argv);
virtual ~HimbaechelCommandHandler(){};
virtual ~HimbaechelCommandHandler() {};
std::unique_ptr<Context> createContext(dict<std::string, Property> &values) override;
void setupArchContext(Context *ctx) override;
void customBitstream(Context *ctx) override;

View File

@ -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<HimbaechelAPI> create(const std::string &device, const dict<std::string, std::string> &args)
{

View File

@ -20,7 +20,7 @@ struct GowinCstReader
Context *ctx;
std::istream &in;
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)
{

View File

@ -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<PipId> 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));
}

View File

@ -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"; }

View File

@ -270,7 +270,7 @@ class ChainConstrainer
}
public:
ChainConstrainer(Context *ctx) : ctx(ctx){};
ChainConstrainer(Context *ctx) : ctx(ctx) {};
void constrain_chains() { process_carries(); }
};

View File

@ -34,7 +34,7 @@ class Ice40CommandHandler : public CommandHandler
{
public:
Ice40CommandHandler(int argc, char **argv);
virtual ~Ice40CommandHandler(){};
virtual ~Ice40CommandHandler() {};
std::unique_ptr<Context> createContext(dict<std::string, Property> &values) override;
void setupArchContext(Context *ctx) override;
void validate() override;

View File

@ -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; }

View File

@ -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

View File

@ -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

View File

@ -33,9 +33,9 @@ class MachXO2CommandHandler : public CommandHandler
{
public:
MachXO2CommandHandler(int argc, char **argv);
virtual ~MachXO2CommandHandler(){};
virtual ~MachXO2CommandHandler() {};
std::unique_ptr<Context> createContext(dict<std::string, Property> &values) override;
void setupArchContext(Context *ctx) override{};
void setupArchContext(Context *ctx) override {};
void customAfterLoad(Context *ctx) override;
void customBitstream(Context *ctx) override;

View File

@ -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

View File

@ -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<WireId> &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 <typename T> 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; }
};

View File

@ -93,7 +93,7 @@ static constexpr auto invalid_rnode = std::numeric_limits<CycloneV::rnode_t>::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; }

View File

@ -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;

View File

@ -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

View File

@ -32,9 +32,9 @@ class MistralCommandHandler : public CommandHandler
{
public:
MistralCommandHandler(int argc, char **argv);
virtual ~MistralCommandHandler(){};
virtual ~MistralCommandHandler() {};
std::unique_ptr<Context> createContext(dict<std::string, Property> &values) override;
void setupArchContext(Context *ctx) override{};
void setupArchContext(Context *ctx) override {};
void customBitstream(Context *ctx) override;
void customAfterLoad(Context *ctx) override;

View File

@ -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;

View File

@ -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()); }

View File

@ -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; }

View File

@ -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

View File

@ -32,9 +32,9 @@ class NexusCommandHandler : public CommandHandler
{
public:
NexusCommandHandler(int argc, char **argv);
virtual ~NexusCommandHandler(){};
virtual ~NexusCommandHandler() {};
std::unique_ptr<Context> createContext(dict<std::string, Property> &values) override;
void setupArchContext(Context *ctx) override{};
void setupArchContext(Context *ctx) override {};
void customBitstream(Context *ctx) override;
void customAfterLoad(Context *ctx) override;

View File

@ -87,8 +87,8 @@ struct TCLEntity
struct TCLValue
{
TCLValue(const std::string &s) : is_string(true), str(s){};
TCLValue(const std::vector<TCLEntity> &l) : is_string(false), list(l){};
TCLValue(const std::string &s) : is_string(true), str(s) {};
TCLValue(const std::vector<TCLEntity> &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()); }

View File

@ -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(); }