aboutsummaryrefslogtreecommitdiffstats
path: root/nexus
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-11-26 14:20:14 +0000
committerDavid Shah <dave@ds0.me>2020-11-30 08:45:28 +0000
commit567166aeceefc513c498c542873c1533bd73dfbe (patch)
treeb37d0bb06e77cd72e5875696b68ecb5c6ee8d511 /nexus
parentbb50b54d80c407854a2553b76e231bc5513b6295 (diff)
downloadnextpnr-567166aeceefc513c498c542873c1533bd73dfbe.tar.gz
nextpnr-567166aeceefc513c498c542873c1533bd73dfbe.tar.bz2
nextpnr-567166aeceefc513c498c542873c1533bd73dfbe.zip
nexus: Fix db integrity check
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'nexus')
-rw-r--r--nexus/arch.cc23
-rw-r--r--nexus/arch.h2
2 files changed, 7 insertions, 18 deletions
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<BelId> 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<BelId> 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<BelId> getBelsByTile(int x, int y) const;
bool getBelGlobalBuf(BelId bel) const { return false; }