aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-27 12:18:52 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-27 12:18:52 +0200
commitb0b16a344a951c7144783f799232a1b9d85ddc8a (patch)
tree350df2d246c261be1fe36ad5573edad1fe2f4286 /ice40
parent87a5b7212667daa55a72f62c35cc248bdce2c744 (diff)
downloadnextpnr-b0b16a344a951c7144783f799232a1b9d85ddc8a.tar.gz
nextpnr-b0b16a344a951c7144783f799232a1b9d85ddc8a.tar.bz2
nextpnr-b0b16a344a951c7144783f799232a1b9d85ddc8a.zip
Improving post-ripup placement in the legaliser
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40')
-rw-r--r--ice40/main.cc2
-rw-r--r--ice40/place_legaliser.cc16
2 files changed, 3 insertions, 15 deletions
diff --git a/ice40/main.cc b/ice40/main.cc
index f1736fab..c975db24 100644
--- a/ice40/main.cc
+++ b/ice40/main.cc
@@ -391,7 +391,7 @@ int main(int argc, char *argv[])
std::vector<std::string> files = vm["run"].as<std::vector<std::string>>();
for (auto filename : files)
execute_python_file(filename.c_str());
-
+
deinit_python();
}
#endif
diff --git a/ice40/place_legaliser.cc b/ice40/place_legaliser.cc
index 4b8a204e..00a57866 100644
--- a/ice40/place_legaliser.cc
+++ b/ice40/place_legaliser.cc
@@ -23,6 +23,7 @@
#include "cells.h"
#include "design_utils.h"
#include "log.h"
+#include "place_common.h"
#include "util.h"
NEXTPNR_NAMESPACE_BEGIN
@@ -379,7 +380,7 @@ class PlacementLegaliser
bool success = true;
for (auto cell : sorted(rippedCells)) {
CellInfo *ci = ctx->cells.at(cell).get();
- bool placed = place_single_cell(ci);
+ bool placed = place_single_cell(ctx, ci, true);
if (!placed) {
if (ctx->force) {
log_warning("failed to place cell '%s' of type '%s'\n", cell.c_str(ctx), ci->type.c_str(ctx));
@@ -392,19 +393,6 @@ class PlacementLegaliser
return success;
}
- // Place a single cell in the first valid location
- bool place_single_cell(CellInfo *cell)
- {
- BelType tgtType = ctx->belTypeFromId(cell->type);
- for (auto bel : ctx->getBels()) {
- if (ctx->getBelType(bel) == tgtType && ctx->checkBelAvail(bel) && ctx->isValidBelForCell(cell, bel)) {
- ctx->bindBel(bel, cell->name, STRENGTH_WEAK);
- return true;
- }
- }
- return false;
- }
-
Context *ctx;
std::unordered_set<IdString> rippedCells;
std::unordered_set<IdString> createdCells;