From 8e8ba0293ca81e8ad0acc9117ab439827a380591 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Mon, 6 Aug 2018 08:34:37 -0700 Subject: Fix use of getBudgetOverride in Timing::follow_net() --- common/timing.cc | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'common/timing.cc') diff --git a/common/timing.cc b/common/timing.cc index ae5783cd..493cd040 100644 --- a/common/timing.cc +++ b/common/timing.cc @@ -48,22 +48,26 @@ struct Timing delay_t follow_net(NetInfo *net, int path_length, delay_t slack) { - delay_t net_budget = slack / (path_length + 1); + const delay_t default_budget = slack / (path_length + 1); + delay_t net_budget = default_budget; for (auto &usr : net->users) { + auto delay = net_delays ? ctx->getNetinfoRouteDelay(net, usr) : delay_t(); if (crit_path) current_path.push_back(&usr); - // If budget override is less than existing budget, then do not increment - // path length - int pl = path_length + 1; - auto budget = ctx->getBudgetOverride(net, usr, net_budget); - if (budget < net_budget) { - net_budget = budget; - pl = std::max(1, path_length); + // If budget override exists, use that value and do not increment path_length + auto budget = default_budget; + if (ctx->getBudgetOverride(net, usr, budget)) { + if (update) + usr.budget = std::min(usr.budget, budget); + budget = follow_user_port(usr, path_length, slack - budget); + net_budget = std::min(net_budget, budget); + } + else { + budget = follow_user_port(usr, path_length + 1, slack - delay); + net_budget = std::min(net_budget, budget); + if (update) + usr.budget = std::min(usr.budget, delay + budget); } - auto delay = net_delays ? ctx->getNetinfoRouteDelay(net, usr) : delay_t(); - net_budget = std::min(net_budget, follow_user_port(usr, pl, slack - delay)); - if (update) - usr.budget = std::min(usr.budget, delay + net_budget); if (crit_path) current_path.pop_back(); } -- cgit v1.2.3