From 3a177c72c6f3b00c86861e896d4d90ac7cf8462e Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Tue, 21 Aug 2018 22:24:14 -0700 Subject: [PATCH] Preserve packed LUT name as LUT_NAME parameter --- xc7/cells.cc | 1 + xc7/xdl.cc | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/xc7/cells.cc b/xc7/cells.cc index 34829f97..01109b96 100644 --- a/xc7/cells.cc +++ b/xc7/cells.cc @@ -274,6 +274,7 @@ void lut_to_lc(const Context *ctx, CellInfo *lut, CellInfo *lc, bool no_dff) replace_port(lut, id_O, lc, id_O); lc->params[ctx->id("DFF_ENABLE")] = "0"; } + lc->params[ctx->id("LUT_NAME")] = lut->name.str(ctx); } void dff_to_lc(const Context *ctx, CellInfo *dff, CellInfo *lc, bool pass_thru_lut) diff --git a/xc7/xdl.cc b/xc7/xdl.cc index 04238747..7ed9fd5d 100644 --- a/xc7/xdl.cc +++ b/xc7/xdl.cc @@ -125,16 +125,21 @@ void write_xdl(const Context *ctx, std::ostream &out) } } - auto O = get_net_or_empty(cell.second.get(), id_O); - if (O) { - name = O->name.str(ctx); - instPtr->setConfig(lut + "USED", "", "0"); - } + auto it = cell.second->params.find(ctx->id("LUT_NAME")); + if (it != cell.second->params.end()) + name = it->second; else name = cell.second->name.str(ctx); boost::replace_all(name, ":", "\\:"); instPtr->setConfig(setting, name, value); + auto O = get_net_or_empty(cell.second.get(), id_O); + if (O) { + setting = lut; + setting += name; + instPtr->setConfig(setting, "", "0"); + } + auto OQ = get_net_or_empty(cell.second.get(), id_OQ); if (OQ) { setting = lut;