diff options
| -rw-r--r-- | common/place_common.cc | 3 | ||||
| -rw-r--r-- | common/placer1.cc | 1 | ||||
| -rw-r--r-- | common/timing.cc | 7 | ||||
| -rw-r--r-- | gui/ice40/worker.cc | 3 | ||||
| -rw-r--r-- | ice40/main.cc | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/common/place_common.cc b/common/place_common.cc index 31f15721..9bc24303 100644 --- a/common/place_common.cc +++ b/common/place_common.cc @@ -39,6 +39,7 @@ wirelen_t get_net_metric(const Context *ctx, const NetInfo *net, MetricType type driver_loc = ctx->getBelLocation(driver_cell->bel); if (driver_gb) return 0; + delay_t negative_slack = 0; delay_t worst_slack = std::numeric_limits<delay_t>::max(); int xmin = driver_loc.x, xmax = driver_loc.x, ymin = driver_loc.y, ymax = driver_loc.y; @@ -66,7 +67,7 @@ wirelen_t get_net_metric(const Context *ctx, const NetInfo *net, MetricType type ymax = std::max(ymax, load_loc.y); } if (ctx->timing_driven && type == MetricType::COST) { - wirelength = wirelen_t((((ymax - ymin) + (xmax - xmin)) * std::min(5.0, (1.0 + std::exp(-worst_slack / 5))))); + wirelength = wirelen_t((((ymax - ymin) + (xmax - xmin)) * std::min(5.0, (1.0 + std::exp(-ctx->getDelayNS(worst_slack) / 5))))); } else { wirelength = wirelen_t((ymax - ymin) + (xmax - xmin)); } diff --git a/common/placer1.cc b/common/placer1.cc index c677a22a..f2777a08 100644 --- a/common/placer1.cc +++ b/common/placer1.cc @@ -138,6 +138,7 @@ class SAPlacer if ((placed_cells - constr_placed_cells) % 500 != 0) log_info(" initial placement placed %d/%d cells\n", int(placed_cells - constr_placed_cells), int(autoplaced.size())); + assign_budget(ctx); ctx->yield(); log_info("Running simulated annealing placer.\n"); diff --git a/common/timing.cc b/common/timing.cc index f33a2ef1..1d69861b 100644 --- a/common/timing.cc +++ b/common/timing.cc @@ -102,8 +102,7 @@ static delay_t walk_paths(Context *ctx, bool update, PortRefList *crit_path) PortRefList current_path; // Go through all clocked drivers and distribute the available path - // slack evenly into the budget of every sink on the path --- - // record this value into the UpdateMap + // slack evenly into the budget of every sink on the path for (auto &cell : ctx->cells) { for (auto port : cell.second->ports) { if (port.second.type == PORT_OUT) { @@ -161,7 +160,7 @@ void assign_budget(Context *ctx, bool quiet) // If user has not specified a frequency, dynamically adjust the target // frequency to be the current maximum if (!ctx->user_freq) { - ctx->target_freq = 1e12 / (default_slack - 1.2 * min_slack); + ctx->target_freq = 1e12 / (default_slack - min_slack); if (ctx->verbose) log_info("minimum slack for this assign = %d, target Fmax for next update = %.2f MHz\n", min_slack, ctx->target_freq / 1e6); @@ -202,7 +201,7 @@ delay_t timing_analysis(Context *ctx, bool print_fmax, bool print_path) total += comb_delay.maxDelay(); log_info("%4d %4d Source %s.%s\n", comb_delay.maxDelay(), total, driver_cell->name.c_str(ctx), driver.port.c_str(ctx)); - delay_t net_delay = ctx->getNetinfoRouteDelay(net, i); + auto net_delay = ctx->getNetinfoRouteDelay(net, i); total += net_delay; auto driver_loc = ctx->getBelLocation(driver_cell->bel); auto sink_loc = ctx->getBelLocation(sink_cell->bel); diff --git a/gui/ice40/worker.cc b/gui/ice40/worker.cc index fd46ecad..09093ec8 100644 --- a/gui/ice40/worker.cc +++ b/gui/ice40/worker.cc @@ -109,6 +109,7 @@ void Worker::budget(double freq) Q_EMIT taskStarted(); try { ctx->target_freq = freq; + assign_budget(ctx); Q_EMIT budget_finish(true); } catch (WorkerInterruptionRequested) { Q_EMIT taskCanceled(); @@ -120,8 +121,6 @@ void Worker::place(bool timing_driven) Q_EMIT taskStarted(); try { ctx->timing_driven = timing_driven; - log_info("Assigned budget %0.2f MHz", ctx->target_freq / 1e6); - assign_budget(ctx); Q_EMIT place_finished(ctx->place()); } catch (WorkerInterruptionRequested) { Q_EMIT taskCanceled(); diff --git a/ice40/main.cc b/ice40/main.cc index 865eea9e..5c9678db 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -411,7 +411,7 @@ int main(int argc, char *argv[]) if (!ctx->pack() && !ctx->force) log_error("Packing design failed.\n"); - assign_budget(ctx.get()); + //assign_budget(ctx.get()); ctx->check(); print_utilisation(ctx.get()); if (!vm.count("pack-only")) { |
