diff options
author | Alessandro Comodi <acomodi@antmicro.com> | 2021-07-12 17:02:55 +0200 |
---|---|---|
committer | Alessandro Comodi <acomodi@antmicro.com> | 2021-07-12 17:17:57 +0200 |
commit | 7abfeb11c3ff153b5d353404b7c7c6767f3823a9 (patch) | |
tree | 44fdb97d65f7b2e94295153e2d93ae2807c813e5 /fpga_interchange | |
parent | 3de0be7c06400702b37b79380feb82e0c76f8613 (diff) | |
download | nextpnr-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>
Diffstat (limited to 'fpga_interchange')
-rw-r--r-- | fpga_interchange/arch_place_constr.cc | 16 | ||||
-rw-r--r-- | fpga_interchange/xdc.cc | 13 |
2 files changed, 13 insertions, 16 deletions
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); |