diff options
author | David Shah <davey1576@gmail.com> | 2019-03-25 16:24:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-25 16:24:02 +0000 |
commit | c67b8259bb8b31ba3f6aa30c431fef222e5f2f65 (patch) | |
tree | 6f427acacd9545150ad82465dda0e6c3d130c1e2 /common/nextpnr.cc | |
parent | 0d064c05f91b548638530e6e159ca9f8aa0fa352 (diff) | |
parent | 25e3350675c091c2fb54e51c9fcb7e79bbe6e279 (diff) | |
download | nextpnr-c67b8259bb8b31ba3f6aa30c431fef222e5f2f65.tar.gz nextpnr-c67b8259bb8b31ba3f6aa30c431fef222e5f2f65.tar.bz2 nextpnr-c67b8259bb8b31ba3f6aa30c431fef222e5f2f65.zip |
Merge pull request #219 from daveshah1/placer_heap
HeAP-based analytical placer
Diffstat (limited to 'common/nextpnr.cc')
-rw-r--r-- | common/nextpnr.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc index bb941d3d..54333b15 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -221,6 +221,9 @@ delay_t Context::getNetinfoRouteDelay(const NetInfo *net_info, const PortRef &us return 0; #endif + if (net_info->wires.empty()) + return predictDelay(net_info, user_info); + WireId src_wire = getNetinfoSourceWire(net_info); if (src_wire == WireId()) return 0; @@ -421,4 +424,25 @@ void BaseCtx::addClock(IdString net, float freq) } } +void BaseCtx::createRectangularRegion(IdString name, int x0, int y0, int x1, int y1) +{ + std::unique_ptr<Region> new_region(new Region()); + new_region->name = name; + new_region->constr_bels = true; + new_region->constr_pips = false; + new_region->constr_wires = false; + for (int x = x0; x <= x1; x++) { + for (int y = y0; y <= y1; y++) { + for (auto bel : getCtx()->getBelsByTile(x, y)) + new_region->bels.insert(bel); + } + } + region[name] = std::move(new_region); +} +void BaseCtx::addBelToRegion(IdString name, BelId bel) { region[name]->bels.insert(bel); } +void BaseCtx::constrainCellToRegion(IdString cell, IdString region_name) +{ + cells[cell]->region = region[region_name].get(); +} + NEXTPNR_NAMESPACE_END |