diff --git a/.cirrus.yml b/.cirrus.yml index d947b559..a493b04f 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -14,3 +14,4 @@ task: smoketest_generic_script: export NEXTPNR=$(pwd)/build/nextpnr-generic && cd generic/examples && ./simple.sh && ./simtest.sh regressiontest_ice40_script: make -j $(nproc) -C tests/ice40/regressions NPNR=$(pwd)/build/nextpnr-ice40 regressiontest_ecp5_script: make -j $(nproc) -C tests/ecp5/regressions NPNR=$(pwd)/build/nextpnr-ecp5 + archcheck_script: BUILD_DIR=$(pwd)/build ./.cirrus/archcheck.sh diff --git a/.cirrus/Dockerfile.ubuntu16.04 b/.cirrus/Dockerfile.ubuntu16.04 index 2dd5b360..d98bb014 100644 --- a/.cirrus/Dockerfile.ubuntu16.04 +++ b/.cirrus/Dockerfile.ubuntu16.04 @@ -26,9 +26,9 @@ RUN set -e -x ;\ RUN set -e -x ;\ mkdir -p /usr/local/src ;\ cd /usr/local/src ;\ - git clone --recursive https://github.com/cliffordwolf/icestorm.git ;\ + git clone --recursive https://github.com/YosysHQ/icestorm.git ;\ cd icestorm ;\ - git reset --hard 3a2bfee5cbc0558641668114260d3f644d6b7c83 ;\ + git reset --hard 4bc68c9620e6be20f8fe10d20f84681d80beac23 ;\ make -j $(nproc) ;\ make install @@ -47,7 +47,7 @@ RUN set -e -x ;\ cd /usr/local/src ;\ git clone --recursive https://github.com/YosysHQ/prjtrellis.git ;\ cd prjtrellis ;\ - git reset --hard 668ce3492cbe1566c61760f06bdf676f6fb265c3 ;\ + git reset --hard f93243b000c52b755c70829768d2ae6bcf7bb91a ;\ cd libtrellis ;\ cmake . ;\ make -j $(nproc) ;\ diff --git a/.cirrus/archcheck.sh b/.cirrus/archcheck.sh new file mode 100755 index 00000000..fde19216 --- /dev/null +++ b/.cirrus/archcheck.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -ex +echo "Running archcheck!" +${BUILD_DIR}/nextpnr-ice40 --hx8k --package ct256 --test +${BUILD_DIR}/nextpnr-ice40 --up5k --package sg48 --test +${BUILD_DIR}/nextpnr-ecp5 --um5g-25k --package CABGA381 --test diff --git a/common/archcheck.cc b/common/archcheck.cc index 3d9e4e76..7b727e9b 100644 --- a/common/archcheck.cc +++ b/common/archcheck.cc @@ -47,14 +47,14 @@ void archcheck_names(const Context *ctx) WireId wire2 = ctx->getWireByName(name); log_assert(wire == wire2); } - +#ifndef ARCH_ECP5 log_info("Checking pip names..\n"); for (PipId pip : ctx->getPips()) { IdString name = ctx->getPipName(pip); PipId pip2 = ctx->getPipByName(name); log_assert(pip == pip2); } - +#endif log_break(); } diff --git a/ecp5/arch.h b/ecp5/arch.h index 0f351319..8c7e13e4 100644 --- a/ecp5/arch.h +++ b/ecp5/arch.h @@ -496,9 +496,11 @@ struct Arch : BaseCtx // ------------------------------------------------- + static const int max_loc_bels = 20; + int getGridDimX() const { return chip_info->width; }; int getGridDimY() const { return chip_info->height; }; - int getTileBelDimZ(int, int) const { return 4; }; + int getTileBelDimZ(int, int) const { return max_loc_bels; }; int getTilePipDimZ(int, int) const { return 1; }; // ------------------------------------------------- @@ -520,7 +522,6 @@ struct Arch : BaseCtx uint32_t getBelChecksum(BelId bel) const { return bel.index; } - const int max_loc_bels = 20; int getBelFlatIndex(BelId bel) const { return (bel.location.y * chip_info->width + bel.location.x) * max_loc_bels + bel.index; 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)