aboutsummaryrefslogtreecommitdiffstats
path: root/nexus
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-12-12 13:02:39 +0000
committergatecat <gatecat@ds0.me>2021-12-12 13:02:39 +0000
commit35feb7ebbaa23e159d1ea5ca15da61e78aadaf57 (patch)
tree904b7b937e116f6b3cce5d956f740ccb55a11d33 /nexus
parent3c8af04ca587aa8056bbc583e1ecd0fae49e6276 (diff)
downloadnextpnr-35feb7ebbaa23e159d1ea5ca15da61e78aadaf57.tar.gz
nextpnr-35feb7ebbaa23e159d1ea5ca15da61e78aadaf57.tar.bz2
nextpnr-35feb7ebbaa23e159d1ea5ca15da61e78aadaf57.zip
clangformat
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'nexus')
-rw-r--r--nexus/main.cc3
-rw-r--r--nexus/pack.cc26
2 files changed, 13 insertions, 16 deletions
diff --git a/nexus/main.cc b/nexus/main.cc
index 667b6d80..9fec8d5e 100644
--- a/nexus/main.cc
+++ b/nexus/main.cc
@@ -52,7 +52,8 @@ po::options_description NexusCommandHandler::getArchOptions()
specific.add_options()("pdc", po::value<std::string>(), "physical constraints file");
specific.add_options()("no-post-place-opt", "disable post-place repacking (debugging use only)");
specific.add_options()("no-pack-lutff", "disable packing (clustering) LUTs and FFs together");
- specific.add_options()("carry-lutff-ratio", po::value<float>(), "ratio of FFs to be added to carry-chain LUT clusters");
+ specific.add_options()("carry-lutff-ratio", po::value<float>(),
+ "ratio of FFs to be added to carry-chain LUT clusters");
return specific;
}
diff --git a/nexus/pack.cc b/nexus/pack.cc
index 0c771e82..c3d9cba2 100644
--- a/nexus/pack.cc
+++ b/nexus/pack.cc
@@ -2304,7 +2304,8 @@ struct NexusPacker
}
}
- FFControlSet gather_ff_settings(CellInfo* cell) {
+ FFControlSet gather_ff_settings(CellInfo *cell)
+ {
NPNR_ASSERT(cell->type == id_OXIDE_FF);
FFControlSet ctrlset;
@@ -2321,7 +2322,8 @@ struct NexusPacker
return ctrlset;
}
- void pack_lutffs () {
+ void pack_lutffs()
+ {
log_info("Inferring LUT+FF pairs...\n");
float carry_ratio = 1.0f;
@@ -2336,7 +2338,7 @@ struct NexusPacker
dict<IdString, FFControlSet> cluster_ffinfo;
size_t num_comb = 0;
- size_t num_ff = 0;
+ size_t num_ff = 0;
size_t num_pair = 0;
size_t num_glue = 0;
@@ -2361,13 +2363,11 @@ struct NexusPacker
}
// Check if the driver is a LUT and the direct connection is from F
- CellInfo* lut = di->driver.cell;
+ CellInfo *lut = di->driver.cell;
if (lut->type != id_OXIDE_COMB) {
continue;
}
- if (di->driver.port != id_F &&
- di->driver.port != id_OFX)
- {
+ if (di->driver.port != id_F && di->driver.port != id_OFX) {
continue;
}
@@ -2422,7 +2422,7 @@ struct NexusPacker
// No order not to make too large carry clusters pack only the
// given fraction of FFs there.
- if(str_or_default(lut->params, id_MODE, "LOGIC") == "CCU2") {
+ if (str_or_default(lut->params, id_MODE, "LOGIC") == "CCU2") {
float r = (float)(ctx->rng() % 1000) * 1e-3f;
if (r > carry_ratio) {
continue;
@@ -2430,7 +2430,7 @@ struct NexusPacker
}
// Get the cluster root
- CellInfo* root = ctx->cells.at(lut->cluster).get();
+ CellInfo *root = ctx->cells.at(lut->cluster).get();
// Constrain the FF relative to the LUT
ff->cluster = root->cluster;
@@ -2462,12 +2462,8 @@ struct NexusPacker
}
// Print statistics
- log_info(" Created %zu LUT+FF pairs and extended %zu clusters using total %zu FFs and %zu LUTs\n",
- num_pair,
- num_glue,
- num_ff,
- num_comb
- );
+ log_info(" Created %zu LUT+FF pairs and extended %zu clusters using total %zu FFs and %zu LUTs\n", num_pair,
+ num_glue, num_ff, num_comb);
}
explicit NexusPacker(Context *ctx) : ctx(ctx) {}