From c10238de8c6087282ff1d6092929585277cbd17c Mon Sep 17 00:00:00 2001 From: "D. Shah" Date: Wed, 27 Jan 2021 18:34:41 +0000 Subject: ice40: Switch from RelPtr to RelSlice This replaces RelPtrs and a separate length field with a Rust-style slice containing both a pointer and a length; with bounds checking always enforced. Thus iterating over these structures is both cleaner and safer. Signed-off-by: D. Shah --- ice40/pack.cc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'ice40/pack.cc') diff --git a/ice40/pack.cc b/ice40/pack.cc index 9eb7d7c1..bac8e170 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -1357,14 +1357,11 @@ void pack_plls(Context *ctx) auto feedback_path = packed->params[ctx->id("FEEDBACK_PATH")].is_string ? packed->params[ctx->id("FEEDBACK_PATH")].as_string() : std::to_string(packed->params[ctx->id("FEEDBACK_PATH")].as_int64()); - std::string fbp_value = - feedback_path == "DELAY" - ? "0" - : feedback_path == "SIMPLE" - ? "1" - : feedback_path == "PHASE_AND_DELAY" - ? "2" - : feedback_path == "EXTERNAL" ? "6" : std::string(feedback_path); + std::string fbp_value = feedback_path == "DELAY" ? "0" + : feedback_path == "SIMPLE" ? "1" + : feedback_path == "PHASE_AND_DELAY" ? "2" + : feedback_path == "EXTERNAL" ? "6" + : std::string(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()); -- cgit v1.2.3