aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-11-16 13:22:52 +0000
committerDavid Shah <dave@ds0.me>2020-11-30 08:45:28 +0000
commit160045a058dc6f5dea278f133f227697532f8cbb (patch)
tree45df66ef71da848707424894816cda35f631b139
parentd8e748bc5864f7937cf087cf08d7497bff0d4f6d (diff)
downloadnextpnr-160045a058dc6f5dea278f133f227697532f8cbb.tar.gz
nextpnr-160045a058dc6f5dea278f133f227697532f8cbb.tar.bz2
nextpnr-160045a058dc6f5dea278f133f227697532f8cbb.zip
nexus: Fix validity checking when DSPs are used
Signed-off-by: David Shah <dave@ds0.me>
-rw-r--r--nexus/arch.h11
-rw-r--r--nexus/arch_place.cc2
2 files changed, 10 insertions, 3 deletions
diff --git a/nexus/arch.h b/nexus/arch.h
index 9b75a09e..f7299cb7 100644
--- a/nexus/arch.h
+++ b/nexus/arch.h
@@ -979,7 +979,7 @@ struct Arch : BaseCtx
cell->belStrength = strength;
refreshUiBel(bel);
- if (tile_is(bel, LOC_LOGIC))
+ if (bel_tile_is(bel, LOC_LOGIC))
update_logic_bel(bel, cell);
}
@@ -988,7 +988,7 @@ struct Arch : BaseCtx
NPNR_ASSERT(bel != BelId());
NPNR_ASSERT(tileStatus[bel.tile].boundcells[bel.index] != nullptr);
- if (tile_is(bel, LOC_LOGIC))
+ if (bel_tile_is(bel, LOC_LOGIC))
update_logic_bel(bel, nullptr);
tileStatus[bel.tile].boundcells[bel.index]->bel = BelId();
@@ -1492,6 +1492,13 @@ struct Arch : BaseCtx
template <typename TId> bool tile_is(TId id, LocFlags lf) const { return tile_loc_flags(id) & lf; }
+ bool bel_tile_is(BelId bel, LocFlags lf) const
+ {
+ int32_t tile;
+ NPNR_ASSERT(rel_tile(bel.tile, bel_data(bel).rel_x, bel_data(bel).rel_y, tile));
+ return chip_info->grid[tile].loc_flags & lf;
+ }
+
// -------------------------------------------------
enum LogicBelZ
diff --git a/nexus/arch_place.cc b/nexus/arch_place.cc
index 35b14caf..0d141013 100644
--- a/nexus/arch_place.cc
+++ b/nexus/arch_place.cc
@@ -104,7 +104,7 @@ bool Arch::isValidBelForCell(CellInfo *cell, BelId bel) const
bool Arch::isBelLocationValid(BelId bel) const
{
- if (tile_is(bel, LOC_LOGIC)) {
+ if (bel_tile_is(bel, LOC_LOGIC)) {
LogicTileStatus *lts = tileStatus[bel.tile].lts;
if (lts == nullptr)
return true;