Updates from clangformat

Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
Clifford Wolf 2018-06-18 14:07:18 +02:00
parent 8ee149f4fc
commit 58e3104796
5 changed files with 12 additions and 22 deletions

View File

@ -21,14 +21,8 @@
NEXTPNR_NAMESPACE_BEGIN NEXTPNR_NAMESPACE_BEGIN
bool isValidBelForCell(Context *ctx, CellInfo *cell, BelId bel) bool isValidBelForCell(Context *ctx, CellInfo *cell, BelId bel) { return true; }
{
return true;
}
bool isBelLocationValid(Context *ctx, BelId bel) bool isBelLocationValid(Context *ctx, BelId bel) { return true; }
{
return true;
}
NEXTPNR_NAMESPACE_END NEXTPNR_NAMESPACE_END

View File

@ -547,8 +547,8 @@ void json_import_cell(Context *ctx, string modname,
for (int paramid = 0; paramid < GetSize(param_node->data_dict_keys); for (int paramid = 0; paramid < GetSize(param_node->data_dict_keys);
paramid++) { paramid++) {
json_import_cell_params(ctx, modname, cell, param_node, json_import_cell_params(ctx, modname, cell, param_node, &cell->params,
&cell->params, paramid); paramid);
} }
attr_node = cell_node->data_dict.at("attributes"); attr_node = cell_node->data_dict.at("attributes");
@ -741,10 +741,9 @@ void json_import(Context *ctx, string modname, JsonNode *node)
netnames.resize(netid + 1); netnames.resize(netid + 1);
netnames.at(netid) = netnames.at(netid) =
basename + basename +
(num_bits == 1 (num_bits == 1 ? "" : std::string("[") +
? "" std::to_string(i) +
: std::string("[") + std::to_string(i) + std::string("]"));
std::string("]"));
} }
} }
} }
@ -793,8 +792,7 @@ struct JsonFrontend
// JsonFrontend() : Frontend("json", "read JSON file") { } // JsonFrontend() : Frontend("json", "read JSON file") { }
JsonFrontend(void) {} JsonFrontend(void) {}
virtual void help() {} virtual void help() {}
virtual void execute(std::istream *&f, std::string &filename, virtual void execute(std::istream *&f, std::string &filename, Context *ctx)
Context *ctx)
{ {
// log_header(ctx, "Executing JSON frontend.\n"); // log_header(ctx, "Executing JSON frontend.\n");

View File

@ -747,8 +747,7 @@ NEXTPNR_NAMESPACE_END
namespace std { namespace std {
template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelType> template <> struct hash<NEXTPNR_NAMESPACE_PREFIX BelType>
{ {
std::size_t operator()(NEXTPNR_NAMESPACE_PREFIX BelType bt) const std::size_t operator()(NEXTPNR_NAMESPACE_PREFIX BelType bt) const noexcept
noexcept
{ {
return std::hash<int>()(int(bt)); return std::hash<int>()(int(bt));
} }

View File

@ -39,8 +39,8 @@ static void pack_lut_lutffs(Context *ctx)
log_info("cell '%s' is of type '%s'\n", ci->name.c_str(), log_info("cell '%s' is of type '%s'\n", ci->name.c_str(),
ci->type.c_str()); ci->type.c_str());
if (is_lut(ci)) { if (is_lut(ci)) {
CellInfo *packed = create_ice_cell(ctx, "ICESTORM_LC", CellInfo *packed =
ci->name.str() + "_LC"); create_ice_cell(ctx, "ICESTORM_LC", ci->name.str() + "_LC");
std::copy(ci->attrs.begin(), ci->attrs.end(), std::copy(ci->attrs.begin(), ci->attrs.end(),
std::inserter(packed->attrs, packed->attrs.begin())); std::inserter(packed->attrs, packed->attrs.begin()));
packed_cells.insert(ci->name); packed_cells.insert(ci->name);

View File

@ -58,8 +58,7 @@ void apply_pcf(Context *ctx, std::istream &in)
if (pin_bel == BelId()) if (pin_bel == BelId())
log_error("package does not have a pin named %s\n", log_error("package does not have a pin named %s\n",
pin.c_str()); pin.c_str());
fnd_cell->second->attrs["BEL"] = fnd_cell->second->attrs["BEL"] = ctx->getBelName(pin_bel).str();
ctx->getBelName(pin_bel).str();
log_info("constrained '%s' to bel '%s'\n", cell.c_str(), log_info("constrained '%s' to bel '%s'\n", cell.c_str(),
fnd_cell->second->attrs["BEL"].c_str()); fnd_cell->second->attrs["BEL"].c_str());
} }