aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/pack.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-08-01 09:45:08 +0200
committerDavid Shah <davey1576@gmail.com>2018-08-01 09:45:08 +0200
commit0414c93403a75c8d5d14feb70f3ccf7a9a127c47 (patch)
tree395cbec1e66410fa39b7ea771843a6b2ac5c1b93 /ice40/pack.cc
parentbbd2ecf558f8b60bbe3fc836b64819b5c4af51fe (diff)
downloadnextpnr-0414c93403a75c8d5d14feb70f3ccf7a9a127c47.tar.gz
nextpnr-0414c93403a75c8d5d14feb70f3ccf7a9a127c47.tar.bz2
nextpnr-0414c93403a75c8d5d14feb70f3ccf7a9a127c47.zip
ice40: Add HFOSC support, force fabric routing on oscillators for now
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/pack.cc')
-rw-r--r--ice40/pack.cc15
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");