aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Comodi <acomodi@antmicro.com>2021-07-12 17:02:55 +0200
committerAlessandro Comodi <acomodi@antmicro.com>2021-07-12 17:17:57 +0200
commit7abfeb11c3ff153b5d353404b7c7c6767f3823a9 (patch)
tree44fdb97d65f7b2e94295153e2d93ae2807c813e5
parent3de0be7c06400702b37b79380feb82e0c76f8613 (diff)
downloadnextpnr-7abfeb11c3ff153b5d353404b7c7c6767f3823a9.tar.gz
nextpnr-7abfeb11c3ff153b5d353404b7c7c6767f3823a9.tar.bz2
nextpnr-7abfeb11c3ff153b5d353404b7c7c6767f3823a9.zip
interchange: xdc and place constr: address review comments
Signed-off-by: Alessandro Comodi <acomodi@antmicro.com>
-rw-r--r--common/placer_heap.cc7
-rw-r--r--fpga_interchange/arch_place_constr.cc16
-rw-r--r--fpga_interchange/xdc.cc13
3 files changed, 13 insertions, 23 deletions
diff --git a/common/placer_heap.cc b/common/placer_heap.cc
index 27144316..f8385cef 100644
--- a/common/placer_heap.cc
+++ b/common/placer_heap.cc
@@ -402,13 +402,6 @@ class HeAPPlacer
for (auto &cell_entry : ctx->cells) {
CellInfo *cell = cell_entry.second.get();
- if (cell->bel != BelId()) {
- if (ctx->verbose)
- log_error("Cell \'%s\' (%s) has already been constrianed by arch implementation",
- cell->name.c_str(ctx), cell->type.c_str(ctx));
- continue;
- }
-
auto loc = cell->attrs.find(ctx->id("BEL"));
if (loc != cell->attrs.end()) {
std::string loc_name = loc->second.as_string();
diff --git a/fpga_interchange/arch_place_constr.cc b/fpga_interchange/arch_place_constr.cc
index 2a3118bd..3af48656 100644
--- a/fpga_interchange/arch_place_constr.cc
+++ b/fpga_interchange/arch_place_constr.cc
@@ -83,11 +83,8 @@ void Arch::place_constraints()
cell->name.c_str(getCtx()), nameOfBel(bel), bound_cell->name.c_str(getCtx()));
bindBel(bel, cell, STRENGTH_USER);
- if (!isBelLocationValid(bel))
- log_error("Bel \'%s\' is not valid for cell "
- "\'%s\' of type \'%s\'\n",
- nameOfBel(bel), cell->name.c_str(getCtx()), cell->type.c_str(getCtx()));
+ cell->attrs.erase(id("BEL"));
constrained_cells.emplace_back(cell->name, bel);
}
@@ -95,8 +92,15 @@ void Arch::place_constraints()
return;
log_info("Cell placed via user constraints:\n");
- for (auto cell_bel : constrained_cells)
- log_info(" - %s placed at %s\n", cell_bel.first.c_str(getCtx()), nameOfBel(cell_bel.second));
+ for (auto cell_bel : constrained_cells) {
+ IdString cell_name = cell_bel.first;
+ BelId bel = cell_bel.second;
+
+ if (!isBelLocationValid(bel))
+ log_error(" - Bel \'%s\' is not valid for cell \'%s\'\n", nameOfBel(bel), cell_name.c_str(getCtx()));
+
+ log_info(" - %s placed at %s\n", cell_name.c_str(getCtx()), nameOfBel(cell_bel.second));
+ }
}
NEXTPNR_NAMESPACE_END
diff --git a/fpga_interchange/xdc.cc b/fpga_interchange/xdc.cc
index 17a2ed3e..9085615b 100644
--- a/fpga_interchange/xdc.cc
+++ b/fpga_interchange/xdc.cc
@@ -130,15 +130,8 @@ static int get_cells(ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj *CON
const char *arg0 = Tcl_GetString(objv[1]);
IdString cell_name = ctx->id(arg0);
- CellInfo *cell = nullptr;
- for (auto &cell_pair : ctx->cells) {
- if (cell_pair.second.get()->name == cell_name) {
- cell = cell_pair.second.get();
- break;
- }
- }
-
- if (cell == nullptr) {
+ auto iter = ctx->cells.find(cell_name);
+ if (iter == ctx->cells.end()) {
Tcl_SetStringResult(interp, "Could not find cell " + cell_name.str(ctx));
return TCL_ERROR;
}
@@ -146,7 +139,7 @@ static int get_cells(ClientData data, Tcl_Interp *interp, int objc, Tcl_Obj *CON
Tcl_Obj *result = Tcl_NewObj();
result->typePtr = &cell_object;
result->internalRep.twoPtrValue.ptr1 = (void *)(ctx);
- result->internalRep.twoPtrValue.ptr2 = (void *)(cell);
+ result->internalRep.twoPtrValue.ptr2 = (void *)(iter->second.get());
result->bytes = nullptr;
cell_update_string(result);