aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/cells.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-12-01 14:03:23 +0000
committerDavid Shah <dave@ds0.me>2019-12-27 10:44:30 +0000
commitfe40094216d0007797c51ff8894127b37a4ff045 (patch)
tree3ade1df159a81ea4a363d56f6c7f662266853c60 /ice40/cells.cc
parentb1000870244dbb1a73198e23a859825865938b4c (diff)
downloadnextpnr-fe40094216d0007797c51ff8894127b37a4ff045.tar.gz
nextpnr-fe40094216d0007797c51ff8894127b37a4ff045.tar.bz2
nextpnr-fe40094216d0007797c51ff8894127b37a4ff045.zip
Preserve hierarchy through packing
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'ice40/cells.cc')
-rw-r--r--ice40/cells.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/ice40/cells.cc b/ice40/cells.cc
index 3def82bf..f1901c43 100644
--- a/ice40/cells.cc
+++ b/ice40/cells.cc
@@ -346,6 +346,8 @@ std::unique_ptr<CellInfo> create_ice_cell(Context *ctx, IdString type, std::stri
void lut_to_lc(const Context *ctx, CellInfo *lut, CellInfo *lc, bool no_dff)
{
+ if (lc->hierpath == IdString())
+ lc->hierpath = lut->hierpath;
lc->params[ctx->id("LUT_INIT")] = lut->params[ctx->id("LUT_INIT")].extract(0, 16, Property::State::S0);
replace_port(lut, ctx->id("I0"), lc, ctx->id("I0"));
replace_port(lut, ctx->id("I1"), lc, ctx->id("I1"));
@@ -359,6 +361,8 @@ void lut_to_lc(const Context *ctx, CellInfo *lut, CellInfo *lc, bool no_dff)
void dff_to_lc(const Context *ctx, CellInfo *dff, CellInfo *lc, bool pass_thru_lut)
{
+ if (lc->hierpath == IdString())
+ lc->hierpath = dff->hierpath;
lc->params[ctx->id("DFF_ENABLE")] = Property::State::S1;
std::string config = dff->type.str(ctx).substr(6);
auto citer = config.begin();