diff options
author | David Shah <dave@ds0.me> | 2019-10-09 11:23:20 +0100 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2019-10-09 11:23:20 +0100 |
commit | 21847a55e047428602faf549e5bf358669153dd5 (patch) | |
tree | 4a3551156962a27ff87eb44a91c04994f79b4839 /ecp5 | |
parent | 9b83e67460ba12f7b48d94253007954e9c50552b (diff) | |
download | nextpnr-21847a55e047428602faf549e5bf358669153dd5.tar.gz nextpnr-21847a55e047428602faf549e5bf358669153dd5.tar.bz2 nextpnr-21847a55e047428602faf549e5bf358669153dd5.zip |
ecp5: Add ODDR71B support
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ecp5')
-rw-r--r-- | ecp5/pack.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/ecp5/pack.cc b/ecp5/pack.cc index 408ff77d..cea66e57 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -2044,10 +2044,10 @@ class Ecp5Packer replace_port(ci, ctx->id("D1"), iol, id_TXDATA1); iol->params[ctx->id("GSR")] = str_or_default(ci->params, ctx->id("GSR"), "DISABLED"); packed_cells.insert(cell.first); - } else if (ci->type == ctx->id("ODDRX2F")) { + } else if (ci->type == ctx->id("ODDRX2F") || ci->type == ctx->id("ODDR71B")) { CellInfo *pio = net_only_drives(ctx, ci->ports.at(ctx->id("Q")).net, is_trellis_io, id_I, true); if (pio == nullptr) - log_error("ODDRX2F '%s' Q output must be connected only to a top level output\n", + log_error("%s '%s' Q output must be connected only to a top level output\n", ci->type.c_str(ctx), ci->name.c_str(ctx)); CellInfo *iol; if (pio_iologic.count(pio->name)) @@ -2070,8 +2070,19 @@ class Ecp5Packer replace_port(ci, ctx->id("D1"), iol, id_TXDATA1); replace_port(ci, ctx->id("D2"), iol, id_TXDATA2); replace_port(ci, ctx->id("D3"), iol, id_TXDATA3); + if (ci->type == ctx->id("ODDR71B")) { + Loc loc = + ctx->getBelLocation(ctx->getBelByName(ctx->id(pio->attrs.at(ctx->id("BEL")).as_string()))); + if (loc.z % 2 == 1) + log_error("ODDR71B '%s' can only be used at 'A' or 'C' locations\n", ci->name.c_str(ctx)); + replace_port(ci, ctx->id("D4"), iol, id_TXDATA4); + replace_port(ci, ctx->id("D5"), iol, id_TXDATA5); + replace_port(ci, ctx->id("D6"), iol, id_TXDATA6); + iol->params[ctx->id("ODDRXN.MODE")] = std::string("ODDR71"); + } else { + iol->params[ctx->id("ODDRXN.MODE")] = std::string("ODDRX2"); + } iol->params[ctx->id("GSR")] = str_or_default(ci->params, ctx->id("GSR"), "DISABLED"); - iol->params[ctx->id("ODDRXN.MODE")] = std::string("ODDRX2"); pio->params[ctx->id("DATAMUX_ODDR")] = std::string("IOLDO"); packed_cells.insert(cell.first); } else if (ci->type == ctx->id("IDDRX2F")) { |