diff options
| -rw-r--r-- | common/placer_heap.cc | 7 | ||||
| -rw-r--r-- | fpga_interchange/arch_place_constr.cc | 16 | ||||
| -rw-r--r-- | fpga_interchange/xdc.cc | 13 | 
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); | 
