From 567166aeceefc513c498c542873c1533bd73dfbe Mon Sep 17 00:00:00 2001 From: David Shah Date: Thu, 26 Nov 2020 14:20:14 +0000 Subject: nexus: Fix db integrity check Signed-off-by: David Shah --- nexus/arch.cc | 23 ++++++----------------- nexus/arch.h | 2 +- 2 files changed, 7 insertions(+), 18 deletions(-) (limited to 'nexus') diff --git a/nexus/arch.cc b/nexus/arch.cc index f5edaeb9..f222a5ad 100644 --- a/nexus/arch.cc +++ b/nexus/arch.cc @@ -202,24 +202,13 @@ BelId Arch::getBelByName(IdString name) const return BelId(); } -BelRange Arch::getBelsByTile(int x, int y) const +std::vector Arch::getBelsByTile(int x, int y) const { - BelRange br; - NPNR_ASSERT(x >= 0 && x < chip_info->width); - NPNR_ASSERT(y >= 0 && y < chip_info->height); - br.b.cursor_tile = y * chip_info->width + x; - br.e.cursor_tile = y * chip_info->width + x; - br.b.cursor_index = 0; - br.e.cursor_index = db->loctypes[chip_info->grid[br.b.cursor_tile].loc_type].num_bels; - br.b.chip = chip_info; - br.b.db = db; - br.e.chip = chip_info; - br.e.db = db; - if (br.e.cursor_index == -1) - ++br.e.cursor_index; - else - ++br.e; - return br; + std::vector bels; + for (auto bel : tileStatus.at(y * chip_info->width + x).bels_by_z) + if (bel != BelId()) + bels.push_back(bel); + return bels; } WireId Arch::getBelPinWire(BelId bel, IdString pin) const diff --git a/nexus/arch.h b/nexus/arch.h index 1d0d38b5..d4d4799e 100644 --- a/nexus/arch.h +++ b/nexus/arch.h @@ -1050,7 +1050,7 @@ struct Arch : BaseCtx return t.bels_by_z.at(loc.z); } - BelRange getBelsByTile(int x, int y) const; + std::vector getBelsByTile(int x, int y) const; bool getBelGlobalBuf(BelId bel) const { return false; } -- cgit v1.2.3