aboutsummaryrefslogtreecommitdiffstats
path: root/common/timing.cc
diff options
context:
space:
mode:
authorEddie Hung <e.hung@imperial.ac.uk>2018-07-26 21:35:02 -0700
committerEddie Hung <e.hung@imperial.ac.uk>2018-07-26 21:35:02 -0700
commit5622dc04448cadf6ea162b7d54e3d26301b2b05b (patch)
tree93c3187696e0f8e1984eb06f2e6d79400262e852 /common/timing.cc
parentd5c2332ebf5dd9b84e3a6fd2a99e8df70150bd33 (diff)
downloadnextpnr-5622dc04448cadf6ea162b7d54e3d26301b2b05b.tar.gz
nextpnr-5622dc04448cadf6ea162b7d54e3d26301b2b05b.tar.bz2
nextpnr-5622dc04448cadf6ea162b7d54e3d26301b2b05b.zip
Fix budget realloc
Diffstat (limited to 'common/timing.cc')
-rw-r--r--common/timing.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/common/timing.cc b/common/timing.cc
index cefe36f0..5534b1c8 100644
--- a/common/timing.cc
+++ b/common/timing.cc
@@ -180,10 +180,7 @@ void update_budget(Context *ctx)
// If user has not specified a frequency, adjust the frequency dynamically:
if (!ctx->user_freq) {
- if (min_slack < 0)
- ctx->target_freq = 1e12 / (default_slack - 0.99 * min_slack);
- else
- ctx->target_freq = 1e12 / (default_slack - 1.05 * min_slack);
+ ctx->target_freq = 1e12 / (default_slack - min_slack);
if (ctx->verbose)
log_info("minimum slack for this update = %d, target Fmax for next update = %.2f MHz\n", min_slack,
ctx->target_freq / 1e6);
@@ -197,7 +194,7 @@ void update_budget(Context *ctx)
auto it = updates.find(pi);
if (it == updates.end())
continue;
- user.budget = ctx->getNetinfoRouteDelay(net.second.get(), i) + it->second;
+ user.budget = ctx->getNetinfoRouteDelay(net.second.get(), i) - it->second;
// Post-update check
if (ctx->verbose) {
@@ -236,8 +233,8 @@ void compute_fmax(Context *ctx, bool print_fmax, bool print_path)
auto net = port.net;
unsigned i = 0;
for (auto &usr : net->users)
- if (&usr == sink)
- break;
+ if (&usr == sink) break;
+ else ++i;
auto &driver = net->driver;
auto driver_cell = driver.cell;
delay_t comb_delay;