diff options
author | Eddie Hung <eddieh@ece.ubc.ca> | 2018-07-30 18:14:40 -0700 |
---|---|---|
committer | Eddie Hung <eddieh@ece.ubc.ca> | 2018-07-30 18:14:40 -0700 |
commit | 46b74696527d3b217070ff4820b537e0b989a00f (patch) | |
tree | da95e6dc441eb8608cd77d1eea218ec9cb5f26fb /common | |
parent | 9c45f762c8280b5f7948df15554e54a38a896da2 (diff) | |
parent | 7da64ee167d518641a479cad1b660c608fb3dede (diff) | |
download | nextpnr-46b74696527d3b217070ff4820b537e0b989a00f.tar.gz nextpnr-46b74696527d3b217070ff4820b537e0b989a00f.tar.bz2 nextpnr-46b74696527d3b217070ff4820b537e0b989a00f.zip |
Merge remote-tracking branch 'origin/master' into redist_slack
Diffstat (limited to 'common')
-rw-r--r-- | common/nextpnr.cc | 2 | ||||
-rw-r--r-- | common/timing.cc | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/common/nextpnr.cc b/common/nextpnr.cc index 2c50c9a1..cf1b5982 100644 --- a/common/nextpnr.cc +++ b/common/nextpnr.cc @@ -91,6 +91,8 @@ WireId Context::getNetinfoSinkWire(NetInfo *net_info, int user_idx) const delay_t Context::getNetinfoRouteDelay(NetInfo *net_info, int user_idx) const { WireId src_wire = getNetinfoSourceWire(net_info); + if (src_wire == WireId()) + return 0; WireId cursor = getNetinfoSinkWire(net_info, user_idx); delay_t delay = 0; diff --git a/common/timing.cc b/common/timing.cc index a753708a..78a56ba9 100644 --- a/common/timing.cc +++ b/common/timing.cc @@ -51,13 +51,13 @@ static delay_t follow_user_port(Context *ctx, PortRef &user, int path_length, de // Follow outputs of the user for (auto port : user.cell->ports) { if (port.second.type == PORT_OUT) { - delay_t comb_delay; + DelayInfo comb_delay; // Look up delay through this path bool is_path = ctx->getCellDelay(user.cell, user.port, port.first, comb_delay); if (is_path) { NetInfo *net = port.second.net; if (net) { - delay_t path_budget = follow_net(ctx, net, path_length, slack - comb_delay, update, min_slack, + delay_t path_budget = follow_net(ctx, net, path_length, slack - comb_delay.maxDelay(), update, min_slack, current_path, crit_path); value = std::min(value, path_budget); } @@ -110,9 +110,9 @@ static delay_t walk_paths(Context *ctx, bool update, PortRefList *crit_path) IdString clock_domain = ctx->getPortClock(cell.second.get(), port.first); if (clock_domain != IdString()) { delay_t slack = default_slack; // TODO: clock constraints - delay_t clkToQ; + DelayInfo clkToQ; if (ctx->getCellDelay(cell.second.get(), clock_domain, port.first, clkToQ)) - slack -= clkToQ; + slack -= clkToQ.maxDelay(); if (port.second.net) follow_net(ctx, port.second.net, 0, slack, update, min_slack, ¤t_path, crit_path); } @@ -197,12 +197,12 @@ delay_t timing_analysis(Context *ctx, bool print_fmax, bool print_path) ++i; auto &driver = net->driver; auto driver_cell = driver.cell; - delay_t comb_delay; + DelayInfo comb_delay; ctx->getCellDelay(sink_cell, last_port, driver.port, comb_delay); - total += comb_delay; - log_info("%4d %4d Source %s.%s\n", comb_delay, total, driver_cell->name.c_str(ctx), + 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); |