Preserve packed LUT name as LUT_NAME parameter

This commit is contained in:
Eddie Hung 2018-08-21 22:24:14 -07:00
parent b658a39d73
commit 3a177c72c6
2 changed files with 11 additions and 5 deletions

View File

@ -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)

View File

@ -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;