diff options
Diffstat (limited to 'ice40/pack.cc')
-rw-r--r-- | ice40/pack.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ice40/pack.cc b/ice40/pack.cc index 91dcf846..08f66369 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -607,12 +607,25 @@ static void pack_special(Context *ctx) packed_cells.insert(ci->name); replace_port(ci, ctx->id("CLKLFEN"), packed.get(), ctx->id("CLKLFEN")); replace_port(ci, ctx->id("CLKLFPU"), packed.get(), ctx->id("CLKLFPU")); - if (bool_or_default(ci->attrs, ctx->id("ROUTE_THROUGH_FABRIC"))) { + if (/*bool_or_default(ci->attrs, ctx->id("ROUTE_THROUGH_FABRIC"))*/ true) { // FIXME replace_port(ci, ctx->id("CLKLF"), packed.get(), ctx->id("CLKLF_FABRIC")); } else { replace_port(ci, ctx->id("CLKLF"), packed.get(), ctx->id("CLKLF")); } new_cells.push_back(std::move(packed)); + } else if (is_sb_hfosc(ctx, ci)) { + std::unique_ptr<CellInfo> packed = + create_ice_cell(ctx, ctx->id("ICESTORM_HFOSC"), ci->name.str(ctx) + "_OSC"); + packed_cells.insert(ci->name); + packed->params[ctx->id("CLKHF_DIV")] = str_or_default(ci->params, ctx->id("CLKHF_DIV"), "0b00"); + replace_port(ci, ctx->id("CLKHFEN"), packed.get(), ctx->id("CLKHFEN")); + replace_port(ci, ctx->id("CLKHFPU"), packed.get(), ctx->id("CLKHFPU")); + if (/*bool_or_default(ci->attrs, ctx->id("ROUTE_THROUGH_FABRIC"))*/ true) { // FIXME + replace_port(ci, ctx->id("CLKHF"), packed.get(), ctx->id("CLKHF_FABRIC")); + } else { + replace_port(ci, ctx->id("CLKHF"), packed.get(), ctx->id("CLKHF")); + } + new_cells.push_back(std::move(packed)); } else if (is_sb_spram(ctx, ci)) { std::unique_ptr<CellInfo> packed = create_ice_cell(ctx, ctx->id("ICESTORM_SPRAM"), ci->name.str(ctx) + "_RAM"); |