aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-07-02 13:32:30 +0100
committerGitHub <noreply@github.com>2020-07-02 13:32:30 +0100
commit137241cfef385a68d2ce732a5b3283458790543d (patch)
treebff5c42b4c43f89281a6ce967411785a17db3d25 /ice40
parent4a2964c91568c63928f1d916aef1a1b84a9e608d (diff)
parent72786e249a2c099b3434a270840d007f7178105c (diff)
downloadnextpnr-137241cfef385a68d2ce732a5b3283458790543d.tar.gz
nextpnr-137241cfef385a68d2ce732a5b3283458790543d.tar.bz2
nextpnr-137241cfef385a68d2ce732a5b3283458790543d.zip
Merge pull request #463 from YosysHQ/fix-archcheck
Fix arch checks, and add these to CI
Diffstat (limited to 'ice40')
-rw-r--r--ice40/arch.cc6
-rw-r--r--ice40/chipdb.py2
2 files changed, 6 insertions, 2 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index 52246001..be346fd7 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -192,7 +192,11 @@ BelRange Arch::getBelsByTile(int x, int y) const
// are used
BelRange br;
- br.b.cursor = Arch::getBelByLocation(Loc(x, y, 0)).index;
+ for (int i = 0; i < 4; i++) {
+ br.b.cursor = Arch::getBelByLocation(Loc(x, y, i)).index;
+ if (br.b.cursor != -1)
+ break;
+ }
br.e.cursor = br.b.cursor;
if (br.e.cursor != -1) {
diff --git a/ice40/chipdb.py b/ice40/chipdb.py
index 7b3ad999..efdde1a1 100644
--- a/ice40/chipdb.py
+++ b/ice40/chipdb.py
@@ -1060,7 +1060,7 @@ for tile_xy, tile_type in sorted(tiles.items()):
if ec[1] == tile_xy[0] and ec[2] == tile_xy[1]:
add_bel_ec(ec)
-for ec in sorted(extra_cells.keys()):
+for ec in sorted(extra_cells.keys(), key=lambda ec: (ec[1], ec[2], ec[3], ec[0])):
if ec[1] in (0, dev_width - 1) and ec[2] in (0, dev_height - 1):
add_bel_ec(ec)