From 396cae51188a08e6f2909ae42f0be1650918f6a1 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 9 Aug 2018 20:53:33 -0700 Subject: [PATCH] Make containers static --- ice40/arch_place.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ice40/arch_place.cc b/ice40/arch_place.cc index bbddb7ee..2e2b9556 100644 --- a/ice40/arch_place.cc +++ b/ice40/arch_place.cc @@ -71,12 +71,13 @@ bool Arch::logicCellsCompatible(const std::vector &cells) cons bool Arch::isBelLocationValid(BelId bel) const { if (getBelType(bel) == id_ICESTORM_LC) { - std::vector bel_cells; + static std::vector bel_cells; + bel_cells.clear(); Loc bel_loc = getBelLocation(bel); for (auto bel_other : getBelsByTile(bel_loc.x, bel_loc.y)) { CellInfo *ci_other = getBoundBelCell(bel_other); if (ci_other != nullptr) { - bel_cells.push_back(ci_other); + bel_cells.emplace_back(ci_other); } } return logicCellsCompatible(bel_cells); @@ -94,16 +95,17 @@ bool Arch::isValidBelForCell(CellInfo *cell, BelId bel) const if (cell->type == id_ICESTORM_LC) { NPNR_ASSERT(getBelType(bel) == id_ICESTORM_LC); - std::vector bel_cells; + static std::vector bel_cells; + bel_cells.clear(); Loc bel_loc = getBelLocation(bel); for (auto bel_other : getBelsByTile(bel_loc.x, bel_loc.y)) { CellInfo *ci_other = getBoundBelCell(bel_other); if (ci_other != nullptr && bel_other != bel) { - bel_cells.push_back(ci_other); + bel_cells.emplace_back(ci_other); } } - bel_cells.push_back(cell); + bel_cells.emplace_back(cell); return logicCellsCompatible(bel_cells); } else if (cell->type == id_SB_IO) { // Do not allow placement of input SB_IOs on blocks where there a PLL is outputting to.