From f9a76c56f7c9c2b894bfc3e115ca0aa89daf9466 Mon Sep 17 00:00:00 2001 From: David Shah Date: Fri, 3 Apr 2020 09:53:14 +0100 Subject: ecp5: Allow use of IDDRXN and ODDRXN type primitives on the same pin Signed-off-by: David Shah --- ecp5/pack.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ecp5') diff --git a/ecp5/pack.cc b/ecp5/pack.cc index f5e8a544..9c3bb617 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -2038,10 +2038,20 @@ class Ecp5Packer disconnect_port(ctx, prim, port); }; + bool warned_oddrx_iddrx = false; + auto set_iologic_mode = [&](CellInfo *iol, std::string mode) { auto &curr_mode = iol->params[ctx->id("MODE")].str; if (curr_mode != "NONE" && mode == "IREG_OREG") return; + if ((curr_mode == "IDDRXN" && mode == "ODDRXN") || (curr_mode == "ODDRXN" && mode == "IDDRXN")) { + if (!warned_oddrx_iddrx) { + warned_oddrx_iddrx = true; + log_warning("Use of IDDRXN and ODDRXN primitives on the same pin is unofficial and unsupported!\n"); + } + curr_mode = "ODDRXN"; + return; + } if (curr_mode != "NONE" && curr_mode != "IREG_OREG" && curr_mode != mode) log_error("IOLOGIC '%s' has conflicting modes '%s' and '%s'\n", iol->name.c_str(ctx), curr_mode.c_str(), mode.c_str()); -- cgit v1.2.3