diff options
Diffstat (limited to 'ice40')
-rw-r--r-- | ice40/arch.h | 3 | ||||
-rw-r--r-- | ice40/main.cc | 6 | ||||
-rw-r--r-- | ice40/pack.cc | 28 |
3 files changed, 25 insertions, 12 deletions
diff --git a/ice40/arch.h b/ice40/arch.h index 85fb9fc0..4896736b 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -755,7 +755,8 @@ struct Arch : BaseCtx void estimatePosition(BelId bel, int &x, int &y, bool &gb) const; delay_t estimateDelay(WireId src, WireId dst) const; - delay_t getDelayEpsilon() const { return 10; } + delay_t getDelayEpsilon() const { return 20; } + delay_t getRipupDelayPenalty() const { return 200; } float getDelayNS(delay_t v) const { return v * 0.001; } // ------------------------------------------------- diff --git a/ice40/main.cc b/ice40/main.cc index fcf112e6..e86cd5b1 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -69,6 +69,7 @@ int main(int argc, char *argv[]) po::options_description options("Allowed options"); options.add_options()("help,h", "show help"); options.add_options()("verbose,v", "verbose output"); + options.add_options()("debug", "debug output"); options.add_options()("force,f", "keep running after errors"); options.add_options()("gui", "start gui"); options.add_options()("svg", "dump SVG file"); @@ -201,6 +202,11 @@ int main(int argc, char *argv[]) ctx.verbose = true; } + if (vm.count("debug")) { + ctx.verbose = true; + ctx.debug = true; + } + if (vm.count("force")) { ctx.force = true; } diff --git a/ice40/pack.cc b/ice40/pack.cc index 853f510e..8a6f1c45 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -36,8 +36,9 @@ static void pack_lut_lutffs(Context *ctx) std::vector<CellInfo *> new_cells; for (auto cell : ctx->cells) { CellInfo *ci = cell.second; - log_info("cell '%s' is of type '%s'\n", ci->name.c_str(ctx), - ci->type.c_str(ctx)); + if (ctx->verbose) + log_info("cell '%s' is of type '%s'\n", ci->name.c_str(ctx), + ci->type.c_str(ctx)); if (is_lut(ctx, ci)) { CellInfo *packed = create_ice_cell(ctx, "ICESTORM_LC", ci->name.str(ctx) + "_LC"); @@ -45,8 +46,9 @@ static void pack_lut_lutffs(Context *ctx) std::inserter(packed->attrs, packed->attrs.begin())); packed_cells.insert(ci->name); new_cells.push_back(packed); - log_info("packed cell %s into %s\n", ci->name.c_str(ctx), - packed->name.c_str(ctx)); + if (ctx->verbose) + log_info("packed cell %s into %s\n", ci->name.c_str(ctx), + packed->name.c_str(ctx)); // See if we can pack into a DFF // TODO: LUT cascade NetInfo *o = ci->ports.at(ctx->id("O")).net; @@ -54,7 +56,8 @@ static void pack_lut_lutffs(Context *ctx) auto lut_bel = ci->attrs.find(ctx->id("BEL")); bool packed_dff = false; if (dff) { - log_info("found attached dff %s\n", dff->name.c_str(ctx)); + if (ctx->verbose) + log_info("found attached dff %s\n", dff->name.c_str(ctx)); auto dff_bel = dff->attrs.find(ctx->id("BEL")); if (lut_bel != ci->attrs.end() && dff_bel != dff->attrs.end() && lut_bel->second != dff_bel->second) { @@ -66,8 +69,9 @@ static void pack_lut_lutffs(Context *ctx) if (dff_bel != dff->attrs.end()) packed->attrs[ctx->id("BEL")] = dff_bel->second; packed_cells.insert(dff->name); - log_info("packed cell %s into %s\n", dff->name.c_str(ctx), - packed->name.c_str(ctx)); + if (ctx->verbose) + log_info("packed cell %s into %s\n", + dff->name.c_str(ctx), packed->name.c_str(ctx)); packed_dff = true; } } @@ -99,8 +103,9 @@ static void pack_nonlut_ffs(Context *ctx) ci->name.str(ctx) + "_DFFLC"); std::copy(ci->attrs.begin(), ci->attrs.end(), std::inserter(packed->attrs, packed->attrs.begin())); - log_info("packed cell %s into %s\n", ci->name.c_str(ctx), - packed->name.c_str(ctx)); + if (ctx->verbose) + log_info("packed cell %s into %s\n", ci->name.c_str(ctx), + packed->name.c_str(ctx)); packed_cells.insert(ci->name); new_cells.push_back(packed); dff_to_lc(ctx, ci, packed, true); @@ -242,8 +247,9 @@ static void set_net_constant(const Context *ctx, NetInfo *orig, for (auto user : orig->users) { if (user.cell != nullptr) { CellInfo *uc = user.cell; - log_info("%s user %s\n", orig->name.c_str(ctx), - uc->name.c_str(ctx)); + if (ctx->verbose) + log_info("%s user %s\n", orig->name.c_str(ctx), + uc->name.c_str(ctx)); if ((is_lut(ctx, uc) || is_lc(ctx, uc)) && (user.port.str(ctx).at(0) == 'I') && !constval) { uc->ports[user.port].net = nullptr; |