From 49e945382038e71f35619bf94a24f0008164e57b Mon Sep 17 00:00:00 2001 From: David Shah Date: Wed, 13 Feb 2019 09:37:47 +0000 Subject: ecp5: Add TSHX2DQSA support Signed-off-by: David Shah --- ecp5/pack.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ecp5/pack.cc') diff --git a/ecp5/pack.cc b/ecp5/pack.cc index 03ad258f..17b0ea3b 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -1887,10 +1887,10 @@ class Ecp5Packer process_dqs_port(ci, pio, iol, id_WRPNTR1); process_dqs_port(ci, pio, iol, id_WRPNTR0); packed_cells.insert(cell.first); - } else if (ci->type == ctx->id("TSHX2DQA")) { + } else if (ci->type == ctx->id("TSHX2DQA") || ci->type == ctx->id("TSHX2DQSA")) { CellInfo *pio = net_only_drives(ctx, ci->ports.at(ctx->id("Q")).net, is_trellis_io, id_T, true); if (pio == nullptr) - log_error("TSHX2DQA '%s' Q output must be connected only to a top level tristate\n", + log_error("%s '%s' Q output must be connected only to a top level tristate\n", ci->type.c_str(ctx), ci->name.c_str(ctx)); CellInfo *iol; if (pio_iologic.count(pio->name)) @@ -1909,10 +1909,11 @@ class Ecp5Packer set_iologic_lsr(iol, ci, ctx->id("RST"), false); replace_port(ci, ctx->id("T0"), iol, id_TSDATA0); replace_port(ci, ctx->id("T1"), iol, id_TSDATA1); - process_dqs_port(ci, pio, iol, id_DQSW270); + process_dqs_port(ci, pio, iol, ci->type == ctx->id("TSHX2DQSA") ? id_DQSW : id_DQSW270); iol->params[ctx->id("GSR")] = str_or_default(ci->params, ctx->id("GSR"), "DISABLED"); iol->params[ctx->id("MTDDRX.MODE")] = "MTSHX2"; - iol->params[ctx->id("MIDDRX_MODDRX.WRCLKMUX")] = "DQSW270"; + iol->params[ctx->id("MTDDRX.DQSW_INVERT")] = ci->type == ctx->id("TSHX2DQSA") ? "ENABLED" : "DISABLED"; + iol->params[ctx->id("MIDDRX_MODDRX.WRCLKMUX")] = ci->type == ctx->id("TSHX2DQSA") ? "DQSW" : "DQSW270"; iol->params[ctx->id("IOLTOMUX")] = "TDDR"; packed_cells.insert(cell.first); } -- cgit v1.2.3