From a29a17f8f24158b31a9272d55f48cd46d7db50fa Mon Sep 17 00:00:00 2001 From: gatecat Date: Tue, 18 Jun 2024 13:54:12 +0200 Subject: [PATCH] clangformat Signed-off-by: gatecat --- common/kernel/command.cc | 2 -- common/place/parallel_refine.cc | 18 +++++++++--------- common/place/placer_static.cc | 18 ++++++++++-------- ecp5/bitstream.cc | 2 +- ecp5/gfx.cc | 4 ++-- generic/viaduct/fabulous/fasm.cc | 2 +- gui/lineshader.h | 2 +- himbaechel/arch.cc | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/common/kernel/command.cc b/common/kernel/command.cc index dc178cd2..9b8f8616 100644 --- a/common/kernel/command.cc +++ b/common/kernel/command.cc @@ -391,7 +391,6 @@ po::options_description CommandHandler::getGeneralOptions() general.add_options()("static-dump-density", "write density csv files during placer-static flow"); - #if !defined(NPNR_DISABLE_THREADS) general.add_options()("parallel-refine", "use new experimental parallelised engine for placement refinement"); #endif @@ -549,7 +548,6 @@ void CommandHandler::setupContext(Context *ctx) if (vm.count("static-dump-density")) ctx->settings[ctx->id("static/dump_density")] = true; - // Setting default values if (ctx->settings.find(ctx->id("target_freq")) == ctx->settings.end()) ctx->settings[ctx->id("target_freq")] = std::to_string(12e6); diff --git a/common/place/parallel_refine.cc b/common/place/parallel_refine.cc index 2cf1996b..57124629 100644 --- a/common/place/parallel_refine.cc +++ b/common/place/parallel_refine.cc @@ -71,9 +71,9 @@ struct ThreadState : DetailPlacerThreadState BelId old_bel = cell->bel; CellInfo *bound = nullptr; { - #if !defined(NPNR_DISABLE_THREADS) - std::shared_lock l(g.archapi_mutex); - #endif +#if !defined(NPNR_DISABLE_THREADS) + std::shared_lock l(g.archapi_mutex); +#endif bound = ctx->getBoundBelCell(new_bel); } if (bound && (bound->belStrength > STRENGTH_STRONG || bound->cluster != ClusterId())) @@ -127,9 +127,9 @@ struct ThreadState : DetailPlacerThreadState used_bels.insert(db.second); CellInfo *bound = nullptr; { - #if !defined(NPNR_DISABLE_THREADS) - std::shared_lock l(g.archapi_mutex); - #endif +#if !defined(NPNR_DISABLE_THREADS) + std::shared_lock l(g.archapi_mutex); +#endif bound = ctx->getBoundBelCell(db.second); } if (bound) { @@ -160,9 +160,9 @@ struct ThreadState : DetailPlacerThreadState } else { bool avail = false; { - #if !defined(NPNR_DISABLE_THREADS) - std::shared_lock l(g.archapi_mutex); - #endif +#if !defined(NPNR_DISABLE_THREADS) + std::shared_lock l(g.archapi_mutex); +#endif avail = ctx->checkBelAvail(db.second); } if (!avail) diff --git a/common/place/placer_static.cc b/common/place/placer_static.cc index c307b19c..e75ccfb8 100644 --- a/common/place/placer_static.cc +++ b/common/place/placer_static.cc @@ -420,7 +420,8 @@ class StaticPlacer if (!ctx->isBelLocationValid(bel)) { ctx->unbindBel(bel); } else { - log_info(" placed potpourri cell '%s' at bel '%s'\n", ctx->nameOf(ci), ctx->nameOfBel(bel)); + log_info(" placed potpourri cell '%s' at bel '%s'\n", ctx->nameOf(ci), + ctx->nameOfBel(bel)); break; } } @@ -910,7 +911,7 @@ class StaticPlacer force_sum += std::abs(mc.ref_dens_grad.x) + std::abs(mc.ref_dens_grad.y); } const float eta = 1e-1; - float init_dens_penalty = eta * (wirelen_sum / force_sum); + float init_dens_penalty = eta * (wirelen_sum / force_sum); log_info("initial density penalty: %f\n", init_dens_penalty); dens_penalty.resize(groups.size(), init_dens_penalty); update_potentials(true); // set initial potential @@ -1003,14 +1004,15 @@ class StaticPlacer float penalty_beta = 2.0e3f; float alpha_l = 1.05f, alpha_h = 1.06f; double penalty_incr = alpha_h - 1; - void update_penalties() { + void update_penalties() + { float pot_norm = 0; // compute L2-norm of relative system potential std::vector rel_pot; for (int g = 0; g < int(groups.size()); g++) { auto &group = groups.at(g); if (!group.enabled) - continue; + continue; float phi_hat = group.curr_potential / group.init_potential; rel_pot.push_back(phi_hat); pot_norm += phi_hat * phi_hat; @@ -1019,17 +1021,16 @@ class StaticPlacer log_info("pot_norm: %f\n", pot_norm); // update penalty multiplier (ELFPlace equation 22) double log_term = std::log(penalty_beta * pot_norm + 1); - penalty_incr = penalty_incr * ((log_term / (log_term + 1)) * (alpha_h - alpha_l) + alpha_l); + penalty_incr = penalty_incr * ((log_term / (log_term + 1)) * (alpha_h - alpha_l) + alpha_l); // update density penalties (ELFPlace equation 21) for (int g = 0; g < int(groups.size()); g++) { if (!groups.at(g).enabled) - continue; + continue; float next_penalty = dens_penalty.at(g) + (penalty_incr * (rel_pot.at(g) / pot_norm)); dens_penalty.at(g) = next_penalty; } } - void initialise() { float initial_steplength = 0.01f; @@ -1152,7 +1153,8 @@ class StaticPlacer RealPair drv_loc = cell_loc(ni->driver.cell, false); for (auto usr : ni->users.enumerate()) { RealPair usr_loc = cell_loc(usr.value.cell, false); - delay_t est_delay = cfg.timing_c + cfg.timing_mx * std::abs(drv_loc.x - usr_loc.x) + cfg.timing_my * std::abs(drv_loc.y - usr_loc.y); + delay_t est_delay = cfg.timing_c + cfg.timing_mx * std::abs(drv_loc.x - usr_loc.x) + + cfg.timing_my * std::abs(drv_loc.y - usr_loc.y); tmg.set_route_delay(CellPortKey(usr.value), DelayPair(est_delay)); } } diff --git a/ecp5/bitstream.cc b/ecp5/bitstream.cc index 8987fefb..32f5bd3d 100644 --- a/ecp5/bitstream.cc +++ b/ecp5/bitstream.cc @@ -1548,7 +1548,7 @@ struct ECP5Bitgen cc.tiles[tile].add_enum(eclkb + ".MODE", "ECLKBRIDGECS"); } else if (ci->type == id_DDRDLL) { Loc loc = ctx->getBelLocation(ci->bel); - bool u = loc.y<15, r = loc.x> 15; + bool u = loc.y < 15, r = loc.x > 15; std::string tiletype = fmt_str("DDRDLL_" << (u ? 'U' : 'L') << (r ? 'R' : 'L')); if ((ctx->args.type == ArchArgs::LFE5U_12F || ctx->args.type == ArchArgs::LFE5U_25F || ctx->args.type == ArchArgs::LFE5UM_25F || ctx->args.type == ArchArgs::LFE5UM5G_25F) && diff --git a/ecp5/gfx.cc b/ecp5/gfx.cc index ae1de86a..d4aff492 100644 --- a/ecp5/gfx.cc +++ b/ecp5/gfx.cc @@ -134,9 +134,9 @@ void gfxTileBel(std::vector &g, int x, int y, int z, int w, int } g.push_back(el); } else if (bel_type == id_DCCA) { - el.x1 = x + switchbox_x1 + (z)*0.025; + el.x1 = x + switchbox_x1 + (z) * 0.025; el.y1 = y + 0.14; - el.x2 = x + switchbox_x1 + (z)*0.025 + 0.020; + el.x2 = x + switchbox_x1 + (z) * 0.025 + 0.020; el.y2 = y + 0.18; g.push_back(el); } else if (bel_type.in(id_DP16KD, id_MULT18X18D, id_ALU54B)) { diff --git a/generic/viaduct/fabulous/fasm.cc b/generic/viaduct/fabulous/fasm.cc index 0ec6f02d..0b8a8283 100644 --- a/generic/viaduct/fabulous/fasm.cc +++ b/generic/viaduct/fabulous/fasm.cc @@ -136,7 +136,7 @@ struct FabFasmWriter continue; unsigned pip_data = pip_tags.at(pip.index).data; unsigned from_pin = (pip_data >> 4) & 0xF; - unsigned to_pin = (pip_data)&0xF; + unsigned to_pin = (pip_data) & 0xF; NPNR_ASSERT(to_pin == i); phys_to_log[from_pin].push_back(i); } diff --git a/gui/lineshader.h b/gui/lineshader.h index 784f35a8..9ebe3eb9 100644 --- a/gui/lineshader.h +++ b/gui/lineshader.h @@ -170,7 +170,7 @@ class LineShader public: LineShader(QObject *parent) : parent_(parent), program_(nullptr) {} - ~LineShader() { ((QOpenGLWidget*) parent_)->makeCurrent(); } + ~LineShader() { ((QOpenGLWidget *)parent_)->makeCurrent(); } static constexpr const char *vertexShaderSource_ = "#version 150\n" diff --git a/himbaechel/arch.cc b/himbaechel/arch.cc index 044b1a6c..09d6d04b 100644 --- a/himbaechel/arch.cc +++ b/himbaechel/arch.cc @@ -18,11 +18,11 @@ */ #include "arch.h" +#include #include "archdefs.h" #include "chipdb.h" #include "log.h" #include "nextpnr.h" -#include #include "command.h" #include "placer1.h"