diff options
author | Clifford Wolf <clifford@clifford.at> | 2018-06-20 19:37:16 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2018-06-20 19:37:16 +0200 |
commit | f2ae9a713ba02f8160e64e199ea4203793f6ed90 (patch) | |
tree | a1cda8ed7be2dab7b85087a02a6fe2f9dec8040e /common/timing.cc | |
parent | 9475997a2df199d6dc27375978b56a08908d096e (diff) | |
parent | c515e5da2df1003addc02ffa606f5bda1cf1f475 (diff) | |
download | nextpnr-f2ae9a713ba02f8160e64e199ea4203793f6ed90.tar.gz nextpnr-f2ae9a713ba02f8160e64e199ea4203793f6ed90.tar.bz2 nextpnr-f2ae9a713ba02f8160e64e199ea4203793f6ed90.zip |
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr
Diffstat (limited to 'common/timing.cc')
-rw-r--r-- | common/timing.cc | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/common/timing.cc b/common/timing.cc index 5ffd4ea7..8da26077 100644 --- a/common/timing.cc +++ b/common/timing.cc @@ -79,6 +79,14 @@ static delay_t follow_net(Context *ctx, NetInfo *net, int path_length, void assign_budget(Context *ctx, float default_clock) { log_info("Annotating ports with timing budgets\n"); + // Clear delays to a very high value first + delay_t default_slack = delay_t(1.0e12 / default_clock); + for (auto net : ctx->nets) { + for (auto &usr : net.second->users) { + usr.budget = default_slack; + } + } + // Go through all clocked drivers and set up paths for (auto cell : ctx->cells) { for (auto port : cell.second->ports) { if (port.second.type == PORT_OUT) { @@ -93,6 +101,23 @@ void assign_budget(Context *ctx, float default_clock) } } } + const bool debug = true; + + // Post-allocation check + for (auto net : ctx->nets) { + for (auto user : net.second->users) { + if (user.budget < 0) + log_warning("port %s.%s, connected to net '%s', has negative " + "timing budget of %fns\n", + user.cell->name.c_str(ctx), user.port.c_str(ctx), + net.first.c_str(ctx), ctx->getDelayNS(user.budget)); + if (debug) + log_warning("port %s.%s, connected to net '%s', has " + "timing budget of %fns\n", + user.cell->name.c_str(ctx), user.port.c_str(ctx), + net.first.c_str(ctx), ctx->getDelayNS(user.budget)); + } + } } NEXTPNR_NAMESPACE_END |