diff options
author | David Shah <dave@ds0.me> | 2018-12-06 11:29:33 +0000 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2018-12-06 11:29:33 +0000 |
commit | 144363693db2649d6c9bcd3a73e6e4f381c67b22 (patch) | |
tree | 6438f9afe3d475894a8180d9b2e336976a0256fd | |
parent | e7fc42ac84d70b2ac09f4e0f8666504f75de89e2 (diff) | |
download | nextpnr-144363693db2649d6c9bcd3a73e6e4f381c67b22.tar.gz nextpnr-144363693db2649d6c9bcd3a73e6e4f381c67b22.tar.bz2 nextpnr-144363693db2649d6c9bcd3a73e6e4f381c67b22.zip |
ice40: Report error for unsupported PLL FEEDBACK_PATH values
Signed-off-by: David Shah <dave@ds0.me>
-rw-r--r-- | ice40/pack.cc | 18 |
1 files changed, 11 insertions, 7 deletions
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; |