diff --git a/common/kernel/base_arch.h b/common/kernel/base_arch.h index 94f88af7..fa852a7c 100644 --- a/common/kernel/base_arch.h +++ b/common/kernel/base_arch.h @@ -143,8 +143,8 @@ template struct BaseArch : ArchAPI // Basic config virtual IdString archId() const override { return this->id(NPNR_STRINGIFY(ARCHNAME)); } - virtual IdString archArgsToId(typename R::ArchArgsT args) const override { return IdString(); } - virtual int getTilePipDimZ(int x, int y) const override { return 1; } + virtual IdString archArgsToId(typename R::ArchArgsT /*args*/) const override { return IdString(); } + virtual int getTilePipDimZ(int /*x*/, int /*y*/) const override { return 1; } virtual char getNameDelimiter() const override { return ' '; } // Bel methods @@ -170,9 +170,9 @@ template struct BaseArch : ArchAPI this->refreshUiBel(bel); } - virtual bool getBelHidden(BelId bel) const override { return false; } + virtual bool getBelHidden(BelId /*bel*/) const override { return false; } - virtual bool getBelGlobalBuf(BelId bel) const override { return false; } + virtual bool getBelGlobalBuf(BelId /*bel*/) const override { return false; } virtual bool checkBelAvail(BelId bel) const override { return getBoundBelCell(bel) == nullptr; }; virtual CellInfo *getBoundBelCell(BelId bel) const override { @@ -180,18 +180,18 @@ template struct BaseArch : ArchAPI return fnd == base_bel2cell.end() ? nullptr : fnd->second; } virtual CellInfo *getConflictingBelCell(BelId bel) const override { return getBoundBelCell(bel); } - virtual typename R::BelAttrsRangeT getBelAttrs(BelId bel) const override + virtual typename R::BelAttrsRangeT getBelAttrs(BelId /*bel*/) const override { return empty_if_possible(); } - virtual typename R::CellBelPinRangeT getBelPinsForCellPin(const CellInfo *cell_info, IdString pin) const override + virtual typename R::CellBelPinRangeT getBelPinsForCellPin(const CellInfo * /*cell_info*/, IdString pin) const override { return return_if_match, typename R::CellBelPinRangeT>({pin}); } // Wire methods - virtual IdString getWireType(WireId wire) const override { return IdString(); } + virtual IdString getWireType(WireId /*wire*/) const override { return IdString(); } virtual typename R::WireAttrsRangeT getWireAttrs(WireId) const override { return empty_if_possible(); @@ -237,10 +237,10 @@ template struct BaseArch : ArchAPI } virtual WireId getConflictingWireWire(WireId wire) const override { return wire; }; virtual NetInfo *getConflictingWireNet(WireId wire) const override { return getBoundWireNet(wire); } - virtual IdString getWireConstantValue(WireId wire) const override { return {}; } + virtual IdString getWireConstantValue(WireId /*wire*/) const override { return {}; } // Pip methods - virtual IdString getPipType(PipId pip) const override { return IdString(); } + virtual IdString getPipType(PipId /*pip*/) const override { return IdString(); } virtual typename R::PipAttrsRangeT getPipAttrs(PipId) const override { return empty_if_possible(); @@ -285,60 +285,60 @@ template struct BaseArch : ArchAPI auto fnd = base_pip2net.find(pip); return fnd == base_pip2net.end() ? nullptr : fnd->second; } - virtual WireId getConflictingPipWire(PipId pip) const override { return WireId(); } + virtual WireId getConflictingPipWire(PipId /*pip*/) const override { return WireId(); } virtual NetInfo *getConflictingPipNet(PipId pip) const override { return getBoundPipNet(pip); } // Group methods - virtual GroupId getGroupByName(IdStringList name) const override { return GroupId(); }; - virtual IdStringList getGroupName(GroupId group) const override { return IdStringList(); }; + virtual GroupId getGroupByName(IdStringList /*name*/) const override { return GroupId(); }; + virtual IdStringList getGroupName(GroupId /*group*/) const override { return IdStringList(); }; virtual typename R::AllGroupsRangeT getGroups() const override { return empty_if_possible(); } // Default implementation of these assumes no groups so never called - virtual typename R::GroupBelsRangeT getGroupBels(GroupId group) const override + virtual typename R::GroupBelsRangeT getGroupBels(GroupId /*group*/) const override { NPNR_ASSERT_FALSE("unreachable"); }; - virtual typename R::GroupWiresRangeT getGroupWires(GroupId group) const override + virtual typename R::GroupWiresRangeT getGroupWires(GroupId /*group*/) const override { NPNR_ASSERT_FALSE("unreachable"); }; - virtual typename R::GroupPipsRangeT getGroupPips(GroupId group) const override + virtual typename R::GroupPipsRangeT getGroupPips(GroupId /*group*/) const override { NPNR_ASSERT_FALSE("unreachable"); }; - virtual typename R::GroupGroupsRangeT getGroupGroups(GroupId group) const override + virtual typename R::GroupGroupsRangeT getGroupGroups(GroupId /*group*/) const override { NPNR_ASSERT_FALSE("unreachable"); }; // Delay methods - virtual bool getArcDelayOverride(const NetInfo *net_info, const PortRef &sink, DelayQuad &delay) const override + virtual bool getArcDelayOverride(const NetInfo * /*net_info*/, const PortRef &/*sink*/, DelayQuad &/*delay*/) const override { return false; } // Decal methods - virtual typename R::DecalGfxRangeT getDecalGraphics(DecalId decal) const override + virtual typename R::DecalGfxRangeT getDecalGraphics(DecalId /*decal*/) const override { return empty_if_possible(); }; - virtual DecalXY getBelDecal(BelId bel) const override { return DecalXY(); } - virtual DecalXY getWireDecal(WireId wire) const override { return DecalXY(); } - virtual DecalXY getPipDecal(PipId pip) const override { return DecalXY(); } - virtual DecalXY getGroupDecal(GroupId group) const override { return DecalXY(); } + virtual DecalXY getBelDecal(BelId /*bel*/) const override { return DecalXY(); } + virtual DecalXY getWireDecal(WireId /*wire*/) const override { return DecalXY(); } + virtual DecalXY getPipDecal(PipId /*pip*/) const override { return DecalXY(); } + virtual DecalXY getGroupDecal(GroupId /*group*/) const override { return DecalXY(); } // Cell timing methods - virtual bool getCellDelay(const CellInfo *cell, IdString fromPort, IdString toPort, DelayQuad &delay) const override + virtual bool getCellDelay(const CellInfo * /*cell*/, IdString /*fromPort*/, IdString /*toPort*/, DelayQuad &/*delay*/) const override { return false; } - virtual TimingPortClass getPortTimingClass(const CellInfo *cell, IdString port, int &clockInfoCount) const override + virtual TimingPortClass getPortTimingClass(const CellInfo * /*cell*/, IdString /*port*/, int &/*clockInfoCount*/) const override { return TMG_IGNORE; } - virtual TimingClockingInfo getPortClockingInfo(const CellInfo *cell, IdString port, int index) const override + virtual TimingClockingInfo getPortClockingInfo(const CellInfo * /*cell*/, IdString /*port*/, int /*index*/) const override { NPNR_ASSERT_FALSE("unreachable"); } @@ -358,7 +358,7 @@ template struct BaseArch : ArchAPI { return getBelBucketByName(cell_type); }; - virtual bool isBelLocationValid(BelId bel, bool explain_invalid = false) const override { return true; } + virtual bool isBelLocationValid(BelId /*bel*/, bool /*explain_invalid*/ = false) const override { return true; } virtual typename R::CellTypeRangeT getCellTypes() const override { NPNR_ASSERT(cell_types_initialised); @@ -400,7 +400,7 @@ template struct BaseArch : ArchAPI [](const BaseClusterInfo *c) { return Loc(c->constr_x, c->constr_y, 0); }); } - virtual bool isClusterStrict(const CellInfo *cell) const override { return true; } + virtual bool isClusterStrict(const CellInfo * /*cell*/) const override { return true; } virtual bool getClusterPlacement(ClusterId cluster, BelId root_bel, std::vector> &placement) const override diff --git a/common/kernel/command.h b/common/kernel/command.h index 8e0e886d..5f173e55 100644 --- a/common/kernel/command.h +++ b/common/kernel/command.h @@ -34,7 +34,7 @@ class CommandHandler { public: CommandHandler(int argc, char **argv); - virtual ~CommandHandler(){}; + virtual ~CommandHandler() { } int exec(); void load_json(Context *ctx, std::string filename); @@ -45,9 +45,9 @@ class CommandHandler virtual void setupArchContext(Context *ctx) = 0; virtual std::unique_ptr createContext(dict &values) = 0; virtual po::options_description getArchOptions() = 0; - virtual void validate(){}; - virtual void customAfterLoad(Context *ctx){}; - virtual void customBitstream(Context *ctx){}; + virtual void validate() { } + virtual void customAfterLoad(Context * /*ctx*/) { } + virtual void customBitstream(Context * /*ctx*/) { } void conflicting_options(const boost::program_options::variables_map &vm, const char *opt1, const char *opt2); private: diff --git a/common/kernel/idstringlist.h b/common/kernel/idstringlist.h index 5e462d0e..b8e37966 100644 --- a/common/kernel/idstringlist.h +++ b/common/kernel/idstringlist.h @@ -35,10 +35,10 @@ struct IdStringList { SSOArray ids; - IdStringList() : ids(1, IdString()){}; - explicit IdStringList(size_t n) : ids(n, IdString()){}; - explicit IdStringList(IdString id) : ids(1, id){}; - template explicit IdStringList(const Tlist &list) : ids(list){}; + IdStringList() : ids(1, IdString()) { } + explicit IdStringList(size_t n) : ids(n, IdString()) { } + explicit IdStringList(IdString id) : ids(1, id) { } + template explicit IdStringList(const Tlist &list) : ids(list) { } static IdStringList parse(Context *ctx, const std::string &str); void build_str(const Context *ctx, std::string &str) const; diff --git a/common/kernel/nextpnr_types.h b/common/kernel/nextpnr_types.h index 4c9dba60..5a239ca1 100644 --- a/common/kernel/nextpnr_types.h +++ b/common/kernel/nextpnr_types.h @@ -81,10 +81,10 @@ struct PortRef struct DelayPair { DelayPair(){}; - 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; }; - delay_t maxDelay() const { return max_delay; }; + 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; } + delay_t maxDelay() const { return max_delay; } delay_t min_delay, max_delay; DelayPair operator+(const DelayPair &other) const { @@ -100,21 +100,21 @@ struct DelayPair struct DelayQuad { DelayPair rise, fall; - DelayQuad(){}; - explicit DelayQuad(delay_t delay) : rise(delay), fall(delay){}; - DelayQuad(delay_t min_delay, delay_t max_delay) : rise(min_delay, max_delay), fall(min_delay, max_delay){}; - DelayQuad(DelayPair rise, DelayPair fall) : rise(rise), fall(fall){}; + DelayQuad() { } + explicit DelayQuad(delay_t delay) : rise(delay), fall(delay) { } + DelayQuad(delay_t min_delay, delay_t max_delay) : rise(min_delay, max_delay), fall(min_delay, max_delay) { } + DelayQuad(DelayPair rise, DelayPair fall) : rise(rise), fall(fall) { } DelayQuad(delay_t min_rise, delay_t max_rise, delay_t min_fall, delay_t max_fall) - : rise(min_rise, max_rise), fall(min_fall, max_fall){}; + : rise(min_rise, max_rise), fall(min_fall, max_fall) { } - delay_t minRiseDelay() const { return rise.minDelay(); }; - delay_t maxRiseDelay() const { return rise.maxDelay(); }; - delay_t minFallDelay() const { return fall.minDelay(); }; - delay_t maxFallDelay() const { return fall.maxDelay(); }; - delay_t minDelay() const { return std::min(rise.minDelay(), fall.minDelay()); }; - delay_t maxDelay() const { return std::max(rise.maxDelay(), fall.maxDelay()); }; + delay_t minRiseDelay() const { return rise.minDelay(); } + delay_t maxRiseDelay() const { return rise.maxDelay(); } + delay_t minFallDelay() const { return fall.minDelay(); } + delay_t maxFallDelay() const { return fall.maxDelay(); } + delay_t minDelay() const { return std::min(rise.minDelay(), fall.minDelay()); } + delay_t maxDelay() const { return std::max(rise.maxDelay(), fall.maxDelay()); } - DelayPair delayPair() const { return DelayPair(minDelay(), maxDelay()); }; + DelayPair delayPair() const { return DelayPair(minDelay(), maxDelay()); } DelayQuad operator+(const DelayQuad &other) const { return {rise + other.rise, fall + other.fall}; } DelayQuad operator-(const DelayQuad &other) const { return {rise - other.rise, fall - other.fall}; } @@ -124,7 +124,7 @@ struct ClockConstraint; struct NetInfo : ArchNetInfo { - explicit NetInfo(IdString name) : name(name){}; + explicit NetInfo(IdString name) : name(name) { } IdString name, hierpath; int32_t udata = 0; @@ -203,14 +203,14 @@ struct PseudoCell struct RegionPlug : PseudoCell { - RegionPlug(Loc loc) : loc(loc){}; // 'loc' is a notional location for the placer only + RegionPlug(Loc loc) : loc(loc) { } // 'loc' is a notional location for the placer only Loc getLocation() const override { return loc; } WireId getPortWire(IdString port) const override { return port_wires.at(port); } // TODO: partial reconfiguration region timing - bool getDelay(IdString fromPort, IdString toPort, DelayQuad &delay) const override { return false; } - TimingPortClass getPortTimingClass(IdString port, int &clockInfoCount) const override { return TMG_IGNORE; } - TimingClockingInfo getPortClockingInfo(IdString port, int index) const override { return TimingClockingInfo{}; } + bool getDelay(IdString /*fromPort*/, IdString /*toPort*/, DelayQuad &/*delay*/) const override { return false; } + TimingPortClass getPortTimingClass(IdString /*port*/, int &/*clockInfoCount*/) const override { return TMG_IGNORE; } + TimingClockingInfo getPortClockingInfo(IdString /*port*/, int /*index*/) const override { return TimingClockingInfo{}; } dict port_wires; Loc loc; @@ -218,7 +218,7 @@ struct RegionPlug : PseudoCell struct CellInfo : ArchCellInfo { - CellInfo(Context *ctx, IdString name, IdString type) : ctx(ctx), name(name), type(type){}; + CellInfo(Context *ctx, IdString name, IdString type) : ctx(ctx), name(name), type(type) { } Context *ctx = nullptr; IdString name, type, hierpath; diff --git a/common/kernel/pycontainers.h b/common/kernel/pycontainers.h index ff49c34c..626849ce 100644 --- a/common/kernel/pycontainers.h +++ b/common/kernel/pycontainers.h @@ -290,7 +290,7 @@ template struct pair_wrapper x.second = val.cast(); } - static int len(T &x) { return 2; } + static int len(T &/*x*/) { return 2; } static iter_pair iter(T &x) { return iter_pair(boost::ref(x), 0); }; @@ -348,7 +348,7 @@ template struct map_pair_wrapper x.base.first)); } - static int len(wrapped_pair &x) { return 2; } + static int len(wrapped_pair &/*x*/) { return 2; } static iter_pair iter(wrapped_pair &x) { @@ -469,14 +469,14 @@ template struct map_pair_wrapper_uptr static py::object get(wrapped_pair &x, int i) { - if ((i >= 2) || (i < 0)) + if (i >= 2 || i < 0) KeyError(); - return (i == 1) ? py::cast(PythonConversion::ContextualWrapper(x.ctx, *x.base.second.get())) + return i == 1 ? py::cast(PythonConversion::ContextualWrapper(x.ctx, *x.base.second.get())) : py::cast(PythonConversion::string_converter().to_str(x.ctx, x.base.first)); } - static int len(wrapped_pair &x) { return 2; } + static int len(wrapped_pair &/*x*/) { return 2; } static iter_pair iter(wrapped_pair &x) { diff --git a/common/kernel/pywrappers.h b/common/kernel/pywrappers.h index 60ef65be..69b94197 100644 --- a/common/kernel/pywrappers.h +++ b/common/kernel/pywrappers.h @@ -35,9 +35,9 @@ template struct ContextualWrapper Context *ctx; T base; - inline ContextualWrapper(Context *c, T x) : ctx(c), base(x){}; + inline ContextualWrapper(Context *c, T x) : ctx(c), base(x) { } - inline operator T() { return base; }; + inline operator T() { return base; } typedef T base_type; }; @@ -83,7 +83,7 @@ class bad_wrap // Action options template struct pass_through { - inline T operator()(Context *ctx, T x) { return x; } + inline T operator()(Context * /*ctx*/, T x) { return x; } using ret_type = T; using arg_type = T; @@ -99,7 +99,7 @@ template struct wrap_context template struct unwrap_context { - inline T operator()(Context *ctx, ContextualWrapper x) { return x.base; } + inline T operator()(Context * /*ctx*/, ContextualWrapper x) { return x.base; } using ret_type = T; using arg_type = ContextualWrapper; @@ -136,7 +136,7 @@ template struct deref_and_wrap template struct addr_and_unwrap { - inline T *operator()(Context *ctx, ContextualWrapper x) { return &(x.base); } + inline T *operator()(Context * /*ctx*/, ContextualWrapper x) { return &(x.base); } using arg_type = ContextualWrapper; using ret_type = T *; diff --git a/common/place/timing_opt.h b/common/place/timing_opt.h index 8f8bc709..e5d0fd38 100644 --- a/common/place/timing_opt.h +++ b/common/place/timing_opt.h @@ -24,7 +24,7 @@ NEXTPNR_NAMESPACE_BEGIN struct TimingOptCfg { - TimingOptCfg(Context *ctx) {} + TimingOptCfg(Context * /*ctx*/) { } // The timing optimiser will *only* optimise cells of these types // Normally these would only be logic cells (or tiles if applicable), the algorithm makes little sense