diff options
author | David Shah <dave@ds0.me> | 2019-12-01 14:03:23 +0000 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2019-12-27 10:44:30 +0000 |
commit | fe40094216d0007797c51ff8894127b37a4ff045 (patch) | |
tree | 3ade1df159a81ea4a363d56f6c7f662266853c60 /ice40 | |
parent | b1000870244dbb1a73198e23a859825865938b4c (diff) | |
download | nextpnr-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')
-rw-r--r-- | ice40/cells.cc | 4 | ||||
-rw-r--r-- | ice40/pack.cc | 1 |
2 files changed, 5 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(); diff --git a/ice40/pack.cc b/ice40/pack.cc index cb430eb9..5b13e9ee 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -1487,6 +1487,7 @@ bool Arch::pack() promote_globals(ctx); ctx->assignArchInfo(); constrain_chains(ctx); + ctx->fixupHierarchy(); ctx->assignArchInfo(); ctx->settings[ctx->id("pack")] = 1; archInfoToAttributes(); |