diff options
-rw-r--r-- | ecp5/bitstream.cc | 9 | ||||
-rw-r--r-- | ecp5/docs/primitives.md | 2 | ||||
-rw-r--r-- | ecp5/pack.cc | 10 |
3 files changed, 18 insertions, 3 deletions
diff --git a/ecp5/bitstream.cc b/ecp5/bitstream.cc index fd3de4ab..620add54 100644 --- a/ecp5/bitstream.cc +++ b/ecp5/bitstream.cc @@ -1253,9 +1253,14 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex tg.config.add_enum("FEEDBK_PATH", str_or_default(ci->params, ctx->id("FEEDBK_PATH"), "CLKOP")); tg.config.add_enum("CLKOP_TRIM_POL", str_or_default(ci->params, ctx->id("CLKOP_TRIM_POL"), "RISING")); - tg.config.add_enum("CLKOP_TRIM_DELAY", str_or_default(ci->params, ctx->id("CLKOP_TRIM_DELAY"), "0")); + + tg.config.add_enum("CLKOP_TRIM_DELAY", + intstr_or_default(ci->params, ctx->id("CLKOP_TRIM_DELAY"), "0")); + tg.config.add_enum("CLKOS_TRIM_POL", str_or_default(ci->params, ctx->id("CLKOS_TRIM_POL"), "RISING")); - tg.config.add_enum("CLKOS_TRIM_DELAY", str_or_default(ci->params, ctx->id("CLKOS_TRIM_DELAY"), "0")); + + tg.config.add_enum("CLKOS_TRIM_DELAY", + intstr_or_default(ci->params, ctx->id("CLKOS_TRIM_DELAY"), "0")); tg.config.add_enum("OUTDIVIDER_MUXA", str_or_default(ci->params, ctx->id("OUTDIVIDER_MUXA"), get_net_or_empty(ci, id_CLKOP) ? "DIVA" : "REFCLK")); diff --git a/ecp5/docs/primitives.md b/ecp5/docs/primitives.md index aa37f3e5..f7f97d16 100644 --- a/ecp5/docs/primitives.md +++ b/ecp5/docs/primitives.md @@ -43,5 +43,5 @@ nextpnr-ecp5 currently supports the following primitives: - **TRELLIS_SLICE** - **TSHX2DQA** - **TSHX2DQSA** - - **USRMCLK** (untested) + - **USRMCLK** 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()); |