Merge pull request #463 from YosysHQ/fix-archcheck
Fix arch checks, and add these to CI
This commit is contained in:
commit
137241cfef
@ -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
|
||||
|
@ -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) ;\
|
||||
|
6
.cirrus/archcheck.sh
Executable file
6
.cirrus/archcheck.sh
Executable file
@ -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
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user