aboutsummaryrefslogtreecommitdiffstats
path: root/nexus/arch.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-11-23 14:41:40 +0000
committerDavid Shah <dave@ds0.me>2020-11-30 08:45:28 +0000
commitca73e14cf9456d96f9cd6b04c0390c5fc5ee0973 (patch)
tree99d6314a7435f7366a3ed0bc5eaa662122bd8eb5 /nexus/arch.cc
parentf84850064fc6747ea13faf41e4bae8b85be0ae5f (diff)
downloadnextpnr-ca73e14cf9456d96f9cd6b04c0390c5fc5ee0973.tar.gz
nextpnr-ca73e14cf9456d96f9cd6b04c0390c5fc5ee0973.tar.bz2
nextpnr-ca73e14cf9456d96f9cd6b04c0390c5fc5ee0973.zip
nexus: Add post-place LUTFF optimisation
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'nexus/arch.cc')
-rw-r--r--nexus/arch.cc28
1 files changed, 23 insertions, 5 deletions
diff --git a/nexus/arch.cc b/nexus/arch.cc
index d5e901eb..f5edaeb9 100644
--- a/nexus/arch.cc
+++ b/nexus/arch.cc
@@ -120,6 +120,21 @@ Arch::Arch(ArchArgs args) : args(args)
for (size_t i = 0; i < chip_info->num_tiles; i++) {
tileStatus[i].boundcells.resize(db->loctypes[chip_info->grid[i].loc_type].num_bels);
}
+ // This structure is needed for a fast getBelByLocation because bels can have an offset
+ for (size_t i = 0; i < chip_info->num_tiles; i++) {
+ auto &loc = db->loctypes[chip_info->grid[i].loc_type];
+ for (unsigned j = 0; j < loc.num_bels; j++) {
+ auto &bel = loc.bels[j];
+ int rel_bel_tile;
+ if (!rel_tile(i, bel.rel_x, bel.rel_y, rel_bel_tile))
+ continue;
+ auto &ts = tileStatus.at(rel_bel_tile);
+ if (int(ts.bels_by_z.size()) <= bel.z)
+ ts.bels_by_z.resize(bel.z + 1);
+ ts.bels_by_z[bel.z].tile = i;
+ ts.bels_by_z[bel.z].index = j;
+ }
+ }
init_cell_pin_data();
// Validate and set up package
package_idx = -1;
@@ -609,13 +624,13 @@ ArcBounds Arch::getRouteBoundingBox(WireId src, WireId dst) const
bb.y1 = std::max(bb.y1, y);
};
+ extend(dst_x, dst_y);
+
if (dsp_wires.count(src) || dsp_wires.count(dst)) {
- bb.x0 -= 5;
- bb.x1 += 5;
+ bb.x0 = std::max<int>(0, bb.x0 - 6);
+ bb.x1 = std::min<int>(chip_info->width, bb.x1 + 6);
}
- extend(dst_x, dst_y);
-
return bb;
}
@@ -634,7 +649,7 @@ bool Arch::place()
cfg.cellGroups.back().insert(id_OXIDE_COMB);
cfg.cellGroups.back().insert(id_OXIDE_FF);
- cfg.beta = 0.6;
+ cfg.beta = 0.5;
cfg.criticalityExponent = 7;
if (!placer_heap(getCtx(), cfg))
return false;
@@ -644,6 +659,9 @@ bool Arch::place()
} else {
log_error("Nexus architecture does not support placer '%s'\n", placer.c_str());
}
+
+ post_place_opt();
+
getCtx()->attrs[getCtx()->id("step")] = std::string("place");
archInfoToAttributes();
return true;