aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.cirrus.yml11
-rw-r--r--.cirrus/Dockerfile.ubuntu16.0433
-rw-r--r--ice40/bitstream.cc12
-rw-r--r--ice40/pack.cc18
4 files changed, 65 insertions, 9 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
new file mode 100644
index 00000000..10865c7b
--- /dev/null
+++ b/.cirrus.yml
@@ -0,0 +1,11 @@
+task:
+ name: build-test-ubuntu1604
+ container:
+ cpu: 4
+ memory: 16
+ dockerfile: .cirrus/Dockerfile.ubuntu16.04
+
+ build_script: mkdir build && cd build && cmake .. -DARCH=all -DTRELLIS_ROOT=/usr/local/src/prjtrellis -DBUILD_TESTS=on && make -j $(nproc)
+ test_generic_script: cd build && ./nextpnr-generic-test
+ test_ice40_script: cd build && ./nextpnr-ice40-test
+ test_ecp5_script: cd build && ./nextpnr-ecp5-test
diff --git a/.cirrus/Dockerfile.ubuntu16.04 b/.cirrus/Dockerfile.ubuntu16.04
new file mode 100644
index 00000000..7335292f
--- /dev/null
+++ b/.cirrus/Dockerfile.ubuntu16.04
@@ -0,0 +1,33 @@
+FROM ubuntu:xenial-20181113
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+RUN set -e -x ;\
+ apt-get -y update ;\
+ apt-get -y upgrade ;\
+ apt-get -y install \
+ build-essential cmake clang python3-dev libboost-all-dev qt5-default git
+
+RUN set -e -x ;\
+ apt-get -y install \
+ libftdi-dev pkg-config
+
+RUN set -e -x ;\
+ mkdir -p /usr/local/src ;\
+ cd /usr/local/src ;\
+ git clone --recursive https://github.com/cliffordwolf/icestorm.git ;\
+ cd icestorm ;\
+ git reset --hard 9671b760f84ca4006f0ef101a3e3b201df4eabb5 ;\
+ make -j $(nproc) ;\
+ make install
+
+RUN set -e -x ;\
+ mkdir -p /usr/local/src ;\
+ cd /usr/local/src ;\
+ git clone --recursive https://github.com/SymbiFlow/prjtrellis.git ;\
+ cd prjtrellis ;\
+ git reset --hard de035a6e5e5818804a66b9408f0ad381b10957db ;\
+ cd libtrellis ;\
+ cmake -DCMAKE_INSTALL_PREFIX=/usr . ;\
+ make -j $(nproc) ;\
+ make install
diff --git a/ice40/bitstream.cc b/ice40/bitstream.cc
index 83664169..d1f51676 100644
--- a/ice40/bitstream.cc
+++ b/ice40/bitstream.cc
@@ -156,7 +156,9 @@ void configure_extra_cell(chipconfig_t &config, const Context *ctx, CellInfo *ce
// Lattice's weird string style params, not sure if
// prefixes other than 0b should be supported, only 0b features in docs
std::string raw = get_param_str_or_def(cell, ctx->id(p.first), "0b0");
- assert(raw.substr(0, 2) == "0b");
+ if (raw.substr(0, 2) != "0b")
+ log_error("expected configuration string starting with '0b' for parameter '%s' on cell '%s'\n",
+ p.first.c_str(), cell->name.c_str(ctx));
raw = raw.substr(2);
value.resize(raw.length());
for (int i = 0; i < (int)raw.length(); i++) {
@@ -168,7 +170,13 @@ void configure_extra_cell(chipconfig_t &config, const Context *ctx, CellInfo *ce
}
}
} else {
- int ival = get_param_or_def(cell, ctx->id(p.first), 0);
+ int ival;
+ try {
+ ival = get_param_or_def(cell, ctx->id(p.first), 0);
+ } catch (std::invalid_argument &e) {
+ log_error("expected numeric value for parameter '%s' on cell '%s'\n", p.first.c_str(),
+ cell->name.c_str(ctx));
+ }
for (int i = 0; i < p.second; i++)
value.push_back((ival >> i) & 0x1);
diff --git a/ice40/pack.cc b/ice40/pack.cc
index e71db46f..242f8ceb 100644
--- a/ice40/pack.cc
+++ b/ice40/pack.cc
@@ -1083,13 +1083,17 @@ static void pack_special(Context *ctx)
}
auto feedback_path = packed->params[ctx->id("FEEDBACK_PATH")];
- packed->params[ctx->id("FEEDBACK_PATH")] =
- feedback_path == "DELAY"
- ? "0"
- : feedback_path == "SIMPLE" ? "1"
- : feedback_path == "PHASE_AND_DELAY"
- ? "2"
- : feedback_path == "EXTERNAL" ? "6" : feedback_path;
+ std::string fbp_value = feedback_path == "DELAY"
+ ? "0"
+ : feedback_path == "SIMPLE"
+ ? "1"
+ : feedback_path == "PHASE_AND_DELAY"
+ ? "2"
+ : feedback_path == "EXTERNAL" ? "6" : feedback_path;
+ if (!std::all_of(fbp_value.begin(), fbp_value.end(), isdigit))
+ log_error("PLL '%s' has unsupported FEEDBACK_PATH value '%s'\n", ci->name.c_str(ctx),
+ feedback_path.c_str());
+ packed->params[ctx->id("FEEDBACK_PATH")] = fbp_value;
packed->params[ctx->id("PLLTYPE")] = std::to_string(sb_pll40_type(ctx, ci));
NetInfo *pad_packagepin_net = nullptr;