From fd40d6f58d10b0435be1f443293e4c9405cfcf05 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Tue, 19 Jun 2018 13:40:35 +0200 Subject: Updates from clangformat Signed-off-by: Clifford Wolf --- ice40/arch.h | 9 +++++++-- ice40/cells.cc | 9 +++++---- ice40/cells.h | 3 +-- ice40/pack.cc | 20 ++++++++++++-------- 4 files changed, 25 insertions(+), 16 deletions(-) (limited to 'ice40') diff --git a/ice40/arch.h b/ice40/arch.h index 0fdacfde..c1256a41 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -279,8 +279,13 @@ template <> struct hash } }; -template <> struct hash : hash {}; -template <> struct hash : hash {}; +template <> struct hash : hash +{ +}; + +template <> struct hash : hash +{ +}; } // namespace std NEXTPNR_NAMESPACE_BEGIN diff --git a/ice40/cells.cc b/ice40/cells.cc index 6a8e7b5e..b6f10f7b 100644 --- a/ice40/cells.cc +++ b/ice40/cells.cc @@ -37,7 +37,7 @@ CellInfo *create_ice_cell(Context *ctx, IdString type, std::string name) CellInfo *new_cell = new CellInfo(); if (name.empty()) { new_cell->name = IdString(ctx, "$nextpnr_" + type.str() + "_" + - std::to_string(auto_idx++)); + std::to_string(auto_idx++)); } else { new_cell->name = ctx->id(name); } @@ -200,8 +200,8 @@ void nxio_to_sb(Context *ctx, CellInfo *nxio, CellInfo *sbio) } NetInfo *donet = sbio->ports.at(ctx->id("D_OUT_0")).net; CellInfo *tbuf = - net_driven_by(ctx, donet, [] - (const Context *ctx, const CellInfo *cell) { + net_driven_by(ctx, donet, + [](const Context *ctx, const CellInfo *cell) { return cell->type == ctx->id("$_TBUF_"); }, "Y"); @@ -251,7 +251,8 @@ bool is_enable_port(const Context *ctx, const PortRef &port) bool is_global_net(const Context *ctx, const NetInfo *net) { - return bool(net_driven_by(ctx, net, is_gbuf, ctx->id("GLOBAL_BUFFER_OUTPUT"))); + return bool( + net_driven_by(ctx, net, is_gbuf, ctx->id("GLOBAL_BUFFER_OUTPUT"))); } NEXTPNR_NAMESPACE_END diff --git a/ice40/cells.h b/ice40/cells.h index cc1fa1cb..19568ed0 100644 --- a/ice40/cells.h +++ b/ice40/cells.h @@ -27,8 +27,7 @@ NEXTPNR_NAMESPACE_BEGIN // Create a standard iCE40 cell and return it // Name will be automatically assigned if not specified -CellInfo *create_ice_cell(Context *ctx, IdString type, - std::string name = ""); +CellInfo *create_ice_cell(Context *ctx, IdString type, std::string name = ""); // Return true if a cell is a LUT inline bool is_lut(const Context *ctx, const CellInfo *cell) diff --git a/ice40/pack.cc b/ice40/pack.cc index 60c86a43..92f9a369 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -39,8 +39,8 @@ static void pack_lut_lutffs(Context *ctx) log_info("cell '%s' is of type '%s'\n", ci->name.c_str(ctx), ci->type.c_str(ctx)); if (is_lut(ctx, ci)) { - CellInfo *packed = - create_ice_cell(ctx, "ICESTORM_LC", ci->name.str(ctx) + "_LC"); + CellInfo *packed = create_ice_cell(ctx, "ICESTORM_LC", + ci->name.str(ctx) + "_LC"); std::copy(ci->attrs.begin(), ci->attrs.end(), std::inserter(packed->attrs, packed->attrs.begin())); packed_cells.insert(ci->name); @@ -168,7 +168,8 @@ static void set_net_constant(const Context *ctx, NetInfo *orig, for (auto user : orig->users) { if (user.cell != nullptr) { CellInfo *uc = user.cell; - log_info("%s user %s\n", orig->name.c_str(ctx), uc->name.c_str(ctx)); + log_info("%s user %s\n", orig->name.c_str(ctx), + uc->name.c_str(ctx)); if (is_lut(ctx, uc) && (user.port.str(ctx).at(0) == 'I') && !constval) { uc->ports[user.port].net = nullptr; @@ -204,7 +205,8 @@ static void pack_constants(Context *ctx) for (auto net : ctx->nets) { NetInfo *ni = net.second; - if (ni->driver.cell != nullptr && ni->driver.cell->type == ctx->id("GND")) { + if (ni->driver.cell != nullptr && + ni->driver.cell->type == ctx->id("GND")) { set_net_constant(ctx, ni, gnd_net, false); ctx->cells[gnd_cell->name] = gnd_cell; ctx->nets[gnd_net->name] = gnd_net; @@ -224,7 +226,8 @@ static void pack_constants(Context *ctx) static bool is_nextpnr_iob(Context *ctx, CellInfo *cell) { - return cell->type == ctx->id("$nextpnr_ibuf") || cell->type == ctx->id("$nextpnr_obuf") || + return cell->type == ctx->id("$nextpnr_ibuf") || + cell->type == ctx->id("$nextpnr_obuf") || cell->type == ctx->id("$nextpnr_iobuf"); } @@ -240,7 +243,8 @@ static void pack_io(Context *ctx) CellInfo *ci = cell.second; if (is_nextpnr_iob(ctx, ci)) { CellInfo *sb = nullptr; - if (ci->type == ctx->id("$nextpnr_ibuf") || ci->type == ctx->id("$nextpnr_iobuf")) { + if (ci->type == ctx->id("$nextpnr_ibuf") || + ci->type == ctx->id("$nextpnr_iobuf")) { sb = net_only_drives(ctx, ci->ports.at("O").net, is_sb_io, "PACKAGE_PIN", true, ci); @@ -252,8 +256,8 @@ static void pack_io(Context *ctx) // Trivial case, SB_IO used. Just destroy the net and the // iobuf log_info("%s feeds SB_IO %s, removing %s %s.\n", - ci->name.c_str(ctx), sb->name.c_str(ctx), ci->type.c_str(ctx), - ci->name.c_str(ctx)); + ci->name.c_str(ctx), sb->name.c_str(ctx), + ci->type.c_str(ctx), ci->name.c_str(ctx)); NetInfo *net = sb->ports.at("PACKAGE_PIN").net; if (net != nullptr) { ctx->nets.erase(net->name); -- cgit v1.2.3