From c3d4117a219570f0a132ae4f810dec961811311a Mon Sep 17 00:00:00 2001 From: David Shah Date: Mon, 18 Nov 2019 22:03:11 +0000 Subject: [PATCH] ecp5: Fix handling of custom DEL_VALUE Signed-off-by: David Shah --- ecp5/pack.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ecp5/pack.cc b/ecp5/pack.cc index ab80e156..7ec08d20 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -2022,7 +2022,8 @@ class Ecp5Packer iol->params[ctx->id("DELAY.DEL_VALUE")] = lookup_delay(str_or_default(ci->params, ctx->id("DEL_MODE"), "USER_DEFINED")); if (ci->params.count(ctx->id("DEL_VALUE")) && - std::string(ci->params.at(ctx->id("DEL_VALUE")).as_string()).substr(0, 5) != "DELAY") + (!ci->params.at(ctx->id("DEL_VALUE")).is_string || + std::string(ci->params.at(ctx->id("DEL_VALUE")).as_string()).substr(0, 5) != "DELAY")) iol->params[ctx->id("DELAY.DEL_VALUE")] = ci->params.at(ctx->id("DEL_VALUE")); if (ci->ports.count(id_LOADN)) replace_port(ci, id_LOADN, iol, id_LOADN);