Skip to content

Commit 226a2df

Browse files
committed
clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
1 parent 77a6df1 commit 226a2df

File tree

15 files changed

+53
-53
lines changed

15 files changed

+53
-53
lines changed

common/kernel/command.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
#include <boost/algorithm/string/join.hpp>
3131
#include <boost/filesystem/path.hpp>
3232
#include <boost/program_options.hpp>
33+
#include <cinttypes>
3334
#include <fstream>
3435
#include <iostream>
3536
#include <random>
3637
#include <set>
37-
#include <cinttypes>
3838

3939
#include "command.h"
4040
#include "design_utils.h"

common/kernel/pybindings.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,7 @@ void init_python(const char *executable)
319319
python_sighandler = signal(SIGINT, SIG_DFL);
320320
}
321321

322-
void deinit_python()
323-
{
324-
py::finalize_interpreter();
325-
}
322+
void deinit_python() { py::finalize_interpreter(); }
326323

327324
void execute_python_file(const char *python_file)
328325
{

common/route/router2.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,8 @@ struct Router2
11931193

11941194
void write_congestion_by_coordinate_heatmap(std::ostream &out)
11951195
{
1196-
auto util_by_coord = std::vector<std::vector<int>>(ctx->getGridDimX() + 1, std::vector<int>(ctx->getGridDimY() + 1, 0));
1196+
auto util_by_coord =
1197+
std::vector<std::vector<int>>(ctx->getGridDimX() + 1, std::vector<int>(ctx->getGridDimY() + 1, 0));
11971198
for (auto &wd : flat_wires)
11981199
if (wd.curr_cong > 1)
11991200
util_by_coord[wd.x][wd.y] += wd.curr_cong;
@@ -1484,7 +1485,8 @@ struct Router2
14841485
std::string filename(cfg.heatmap + "_congestion_by_coordinate_" + std::to_string(iter) + ".csv");
14851486
std::ofstream cong_map(filename);
14861487
if (!cong_map)
1487-
log_error("Failed to open congestion-by-coordinate heatmap %s for writing.\n", filename.c_str());
1488+
log_error("Failed to open congestion-by-coordinate heatmap %s for writing.\n",
1489+
filename.c_str());
14881490
write_congestion_by_coordinate_heatmap(cong_map);
14891491
log_info(" wrote congestion-by-coordinate heatmap to %s.\n", filename.c_str());
14901492
}

ecp5/pack.cc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,28 +2877,28 @@ class Ecp5Packer
28772877
vco_freq, ci->name.c_str(ctx));
28782878

28792879
if (str_or_default(ci->params, id_OUTDIVIDER_MUXA, "DIVA") == "REFCLK")
2880-
copy_constraint(ci, id_CLKI, id_CLKOP, 1);
2880+
copy_constraint(ci, id_CLKI, id_CLKOP, 1);
28812881
else
2882-
set_constraint(ci, id_CLKOP,
2883-
simple_clk_contraint(vco_period * int_or_default(ci->params, id_CLKOP_DIV, 1)));
2882+
set_constraint(ci, id_CLKOP,
2883+
simple_clk_contraint(vco_period * int_or_default(ci->params, id_CLKOP_DIV, 1)));
28842884

28852885
if (str_or_default(ci->params, id_OUTDIVIDER_MUXB, "DIVB") == "REFCLK")
2886-
copy_constraint(ci, id_CLKI, id_CLKOS, 1);
2886+
copy_constraint(ci, id_CLKI, id_CLKOS, 1);
28872887
else
2888-
set_constraint(ci, id_CLKOS,
2889-
simple_clk_contraint(vco_period * int_or_default(ci->params, id_CLKOS_DIV, 1)));
2888+
set_constraint(ci, id_CLKOS,
2889+
simple_clk_contraint(vco_period * int_or_default(ci->params, id_CLKOS_DIV, 1)));
28902890

28912891
if (str_or_default(ci->params, id_OUTDIVIDER_MUXC, "DIVC") == "REFCLK")
2892-
copy_constraint(ci, id_CLKI, id_CLKOS2, 1);
2892+
copy_constraint(ci, id_CLKI, id_CLKOS2, 1);
28932893
else
2894-
set_constraint(ci, id_CLKOS2,
2895-
simple_clk_contraint(vco_period * int_or_default(ci->params, id_CLKOS2_DIV, 1)));
2894+
set_constraint(ci, id_CLKOS2,
2895+
simple_clk_contraint(vco_period * int_or_default(ci->params, id_CLKOS2_DIV, 1)));
28962896

28972897
if (str_or_default(ci->params, id_OUTDIVIDER_MUXD, "DIVD") == "REFCLK")
2898-
copy_constraint(ci, id_CLKI, id_CLKOS3, 1);
2898+
copy_constraint(ci, id_CLKI, id_CLKOS3, 1);
28992899
else
2900-
set_constraint(ci, id_CLKOS3,
2901-
simple_clk_contraint(vco_period * int_or_default(ci->params, id_CLKOS3_DIV, 1)));
2900+
set_constraint(ci, id_CLKOS3,
2901+
simple_clk_contraint(vco_period * int_or_default(ci->params, id_CLKOS3_DIV, 1)));
29022902
} else if (ci->type == id_OSCG) {
29032903
int div = int_or_default(ci->params, id_DIV, 128);
29042904
set_constraint(ci, id_OSC, simple_clk_contraint(delay_t((1.0e6 / (2.0 * 155)) * div)));

frontend/frontend_base.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,9 @@ template <typename FrontendType> struct GenericFrontend
539539
auto type = impl.get_cell_type(cd);
540540
import_module(submod, name, type, mod_refs.at(type));
541541
// Add current cell attributes to the imported module
542-
impl.foreach_attr( cd, [&](const std::string &name, const Property &value)
543-
{ ctx->hierarchy[submod.path].attrs[ctx->id(name)] = value; } );
542+
impl.foreach_attr(cd, [&](const std::string &name, const Property &value) {
543+
ctx->hierarchy[submod.path].attrs[ctx->id(name)] = value;
544+
});
544545
}
545546

546547
// Import the cells section of a module

generic/arch.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,8 @@ BelId Arch::getBelByLocation(Loc loc) const
296296
return BelId();
297297
}
298298

299-
const std::vector<BelId> &Arch::getBelsByTile(int x, int y) const {
299+
const std::vector<BelId> &Arch::getBelsByTile(int x, int y) const
300+
{
300301
static const std::vector<BelId> empty_list;
301302
return y < int(bels_by_tile.at(x).size()) ? bels_by_tile.at(x).at(y) : empty_list;
302303
}

generic/viaduct/fabulous/fabric_parsing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ struct parser_view
151151

152152
struct CsvParser
153153
{
154-
explicit CsvParser(std::istream &in) : in(in) {};
154+
explicit CsvParser(std::istream &in) : in(in){};
155155
std::istream &in;
156156
std::string buf;
157157
parser_view view;

himbaechel/arch.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ PipId Arch::getPipByName(IdStringList name) const
293293
IdString(tdata.wires[tdata.pips[pip].src_wire].name) == name[2]) {
294294

295295
const auto tmp_pip = PipId(tile, pip);
296-
if ((name.size() == 3 && !isPipInverting(tmp_pip)) ||
297-
(name.size() == 4 && isPipInverting(tmp_pip))) {
296+
if ((name.size() == 3 && !isPipInverting(tmp_pip)) || (name.size() == 4 && isPipInverting(tmp_pip))) {
298297
return tmp_pip;
299298
}
300299
}
@@ -307,8 +306,8 @@ IdStringList Arch::getPipName(PipId pip) const
307306
const auto &tdata = chip_tile_info(chip_info, pip.tile);
308307
const auto &pdata = tdata.pips[pip.index];
309308
const auto name = IdStringList::concat(tile_name.at(pip.tile),
310-
IdStringList::concat(IdString(tdata.wires[pdata.dst_wire].name),
311-
IdString(tdata.wires[pdata.src_wire].name)));
309+
IdStringList::concat(IdString(tdata.wires[pdata.dst_wire].name),
310+
IdString(tdata.wires[pdata.src_wire].name)));
312311
if (isPipInverting(pip))
313312
return IdStringList::concat(name, id("INV"));
314313
return name;

himbaechel/arch.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -662,9 +662,7 @@ struct Arch : BaseArch<ArchRanges>
662662
uarch->notifyPipChange(pip, nullptr);
663663
BaseArch::unbindPip(pip);
664664
}
665-
bool isPipInverting(PipId pip) const override {
666-
return uarch->isPipInverting(pip);
667-
}
665+
bool isPipInverting(PipId pip) const override { return uarch->isPipInverting(pip); }
668666

669667
// -------------------------------------------------
670668

himbaechel/uarch/example/example.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,8 @@ struct ExampleArch : HimbaechelArch
329329
{
330330
ExampleArch() : HimbaechelArch("example") {};
331331
bool match_device(const std::string &device) override { return device == "EXAMPLE"; }
332-
std::unique_ptr<HimbaechelAPI> create(const std::string &device, const dict<std::string, std::string> &args) override
332+
std::unique_ptr<HimbaechelAPI> create(const std::string &device,
333+
const dict<std::string, std::string> &args) override
333334
{
334335
return std::make_unique<ExampleImpl>();
335336
}

himbaechel/uarch/gowin/cst.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct GowinCstReader
2020
Context *ctx;
2121
std::istream &in;
2222

23-
GowinCstReader(Context *ctx, std::istream &in) : ctx(ctx), in(in) {};
23+
GowinCstReader(Context *ctx, std::istream &in) : ctx(ctx), in(in){};
2424

2525
const PadInfoPOD *pinLookup(const PadInfoPOD *list, const size_t len, const IdString idx)
2626
{

himbaechel/uarch/ng-ultra/ng_ultra.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,8 @@ struct NgUltraArch : HimbaechelArch
10601060
{
10611061
NgUltraArch() : HimbaechelArch("ng-ultra") {};
10621062
bool match_device(const std::string &device) override { return device == "NG-ULTRA"; }
1063-
std::unique_ptr<HimbaechelAPI> create(const std::string &device, const dict<std::string, std::string> &args) override
1063+
std::unique_ptr<HimbaechelAPI> create(const std::string &device,
1064+
const dict<std::string, std::string> &args) override
10641065
{
10651066
return std::make_unique<NgUltraImpl>();
10661067
}

himbaechel/uarch/xilinx/xdc.cc

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ void XilinxImpl::parse_xdc(const std::string &filename)
161161
log_nonfatal_error("expected at least four arguments to 'set_property' (on line %d)\n", lineno);
162162
num_errors++;
163163
goto nextline;
164-
}
165-
else if (arguments.at(1) == "-dict") {
164+
} else if (arguments.at(1) == "-dict") {
166165
std::vector<std::string> dict_args = split_to_args(strip_quotes(arguments.at(2)), false);
167166
if ((dict_args.size() % 2) != 0) {
168167
log_nonfatal_error("expected an even number of argument for dictionary (on line %d)\n", lineno);
@@ -190,16 +189,19 @@ void XilinxImpl::parse_xdc(const std::string &filename)
190189
for (int cursor = 3; cursor < int(arguments.size()); cursor++) {
191190
std::vector<CellInfo *> dest_loc = get_cells(arguments.at(cursor));
192191
if (dest_loc.empty())
193-
log_warning("found set_property with no cells matching '%s' (on line %d)\n", arguments.at(cursor).c_str(), lineno);
192+
log_warning("found set_property with no cells matching '%s' (on line %d)\n",
193+
arguments.at(cursor).c_str(), lineno);
194194
dest.insert(dest.end(), dest_loc.begin(), dest_loc.end());
195195
}
196196
for (auto c : dest) {
197197
for (const auto &pair : arg_pairs) {
198198
IdString id_prop = ctx->id(pair.first);
199199
if (ctx->debug)
200-
log_info("applying property '%s' = '%s' to cell '%s' (on line %d)\n", pair.first.c_str(), pair.second.c_str(), c->name.c_str(ctx), lineno);
201-
if(c->attrs.find(id_prop) != c->attrs.end()) {
202-
log_nonfatal_error("found multiple properties '%s' for cell '%s' (on line %d)\n", pair.first.c_str(), c->name.c_str(ctx), lineno);
200+
log_info("applying property '%s' = '%s' to cell '%s' (on line %d)\n", pair.first.c_str(),
201+
pair.second.c_str(), c->name.c_str(ctx), lineno);
202+
if (c->attrs.find(id_prop) != c->attrs.end()) {
203+
log_nonfatal_error("found multiple properties '%s' for cell '%s' (on line %d)\n",
204+
pair.first.c_str(), c->name.c_str(ctx), lineno);
203205
num_errors++;
204206
}
205207
c->attrs[id_prop] = std::string(pair.second);
@@ -213,17 +215,14 @@ void XilinxImpl::parse_xdc(const std::string &filename)
213215
std::string opt = arguments.at(cursor);
214216
if (opt == "-add") {
215217
log_warning("ignoring unsupported XDC option '%s' (on line %d)\n", opt.c_str(), lineno);
216-
}
217-
else if (opt == "-name" || opt == "-waveform") {
218+
} else if (opt == "-name" || opt == "-waveform") {
218219
log_warning("ignoring unsupported XDC option '%s' (on line %d)\n", opt.c_str(), lineno);
219220
cursor++;
220-
}
221-
else if (opt == "-period") {
221+
} else if (opt == "-period") {
222222
cursor++;
223223
period = std::stod(arguments.at(cursor));
224224
got_period = true;
225-
}
226-
else
225+
} else
227226
break;
228227
}
229228
if (!got_period) {
@@ -235,17 +234,19 @@ void XilinxImpl::parse_xdc(const std::string &filename)
235234
std::vector<NetInfo *> dest;
236235
if (cursor >= int(arguments.size()))
237236
log_warning("found create_clock without designated nets (on line %d)\n", lineno);
238-
for ( ; cursor < (int)arguments.size(); cursor++) {
237+
for (; cursor < (int)arguments.size(); cursor++) {
239238
std::vector<NetInfo *> dest_loc = get_nets(arguments.at(cursor));
240239
if (dest_loc.empty())
241-
log_warning("found create_clock with no nets matching '%s' (on line %d)\n", arguments.at(cursor).c_str(), lineno);
240+
log_warning("found create_clock with no nets matching '%s' (on line %d)\n",
241+
arguments.at(cursor).c_str(), lineno);
242242
dest.insert(dest.end(), dest_loc.begin(), dest_loc.end());
243243
}
244244
for (auto n : dest) {
245245
if (ctx->debug)
246246
log_info("applying clock period constraint on net '%s' (on line %d)\n", n->name.c_str(ctx), lineno);
247247
if (n->clkconstr.get() != nullptr) {
248-
log_nonfatal_error("found multiple clock constraints on net '%s' (on line %d)\n", n->name.c_str(ctx), lineno);
248+
log_nonfatal_error("found multiple clock constraints on net '%s' (on line %d)\n",
249+
n->name.c_str(ctx), lineno);
249250
num_errors++;
250251
}
251252
n->clkconstr = std::unique_ptr<ClockConstraint>(new ClockConstraint);
@@ -257,8 +258,7 @@ void XilinxImpl::parse_xdc(const std::string &filename)
257258
log_warning("ignoring unsupported XDC command '%s' (on line %d)\n", cmd.c_str(), lineno);
258259
}
259260

260-
nextline:
261-
; // Phony statement to have something legal after the label
261+
nextline:; // Phony statement to have something legal after the label
262262
}
263263
if (!isempty(linebuf)) {
264264
log_nonfatal_error("unexpected end of XDC file\n");

himbaechel/uarch/xilinx/xilinx.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,8 @@ struct XilinxArch : HimbaechelArch
569569
{
570570
XilinxArch() : HimbaechelArch("xilinx") {};
571571
bool match_device(const std::string &device) override { return device.size() > 3 && device.substr(0, 3) == "xc7"; }
572-
std::unique_ptr<HimbaechelAPI> create(const std::string &device, const dict<std::string, std::string> &args) override
572+
std::unique_ptr<HimbaechelAPI> create(const std::string &device,
573+
const dict<std::string, std::string> &args) override
573574
{
574575
return std::make_unique<XilinxImpl>();
575576
}

rust/rust.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ static inline PipId unwrap_pip(const uint64_t pip) noexcept { return unwrap<PipI
5555
static inline WireId unwrap_wire(const uint64_t wire) noexcept { return unwrap<WireId>(wire); }
5656
} // namespace
5757

58-
template<typename T>
59-
struct IterWrapper
58+
template <typename T> struct IterWrapper
6059
{
6160
T current;
6261
T end;

0 commit comments

Comments
 (0)