diff options
author | gatecat <gatecat@ds0.me> | 2021-08-15 16:18:57 +0100 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-08-15 16:22:03 +0100 |
commit | f207068ee2ee31d6bf3642cb6fc6bfdeffb2897f (patch) | |
tree | c1c7c98159334034099e252f1cb2cb05ec7aadff /common/timing.cc | |
parent | 42522c492cd7da25ee5b1ace941a93e01fe94038 (diff) | |
download | nextpnr-f207068ee2ee31d6bf3642cb6fc6bfdeffb2897f.tar.gz nextpnr-f207068ee2ee31d6bf3642cb6fc6bfdeffb2897f.tar.bz2 nextpnr-f207068ee2ee31d6bf3642cb6fc6bfdeffb2897f.zip |
router2: Add experimental timing-driven ripup option
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common/timing.cc')
-rw-r--r-- | common/timing.cc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/common/timing.cc b/common/timing.cc index 0cdb5be2..161769dc 100644 --- a/common/timing.cc +++ b/common/timing.cc @@ -269,6 +269,22 @@ void TimingAnalyser::setup_port_domains() // If there are loops, repeat the process until a fixed point is reached, as there might be unusual ways to // visit points, which would result in a missing domain key and therefore crash later on } while (have_loops && updated_domains); + for (auto &dp : domain_pairs) { + auto &launch_data = domains.at(dp.key.launch); + auto &capture_data = domains.at(dp.key.capture); + if (launch_data.key.clock != capture_data.key.clock) + continue; + IdString clk = launch_data.key.clock; + if (!ctx->nets.count(clk)) + continue; + NetInfo *clk_net = ctx->nets.at(clk).get(); + if (!clk_net->clkconstr) + continue; + delay_t period = clk_net->clkconstr->period.minDelay(); + if (launch_data.key.edge != capture_data.key.edge) + period /= 2; + dp.period = DelayPair(period); + } } void TimingAnalyser::reset_times() @@ -457,11 +473,12 @@ void TimingAnalyser::compute_slack() auto &dp = domain_pairs.at(pdp.first); auto &arr = pd.arrival.at(dp.key.launch); auto &req = pd.required.at(dp.key.capture); - pdp.second.setup_slack = dp.period.minDelay() - (arr.value.maxDelay() - req.value.minDelay()); + pdp.second.setup_slack = 0 - (arr.value.maxDelay() - req.value.minDelay()); if (!setup_only) pdp.second.hold_slack = arr.value.minDelay() - req.value.maxDelay(); pdp.second.max_path_length = arr.path_length + req.path_length; - pd.worst_setup_slack = std::min(pd.worst_setup_slack, pdp.second.setup_slack); + if (dp.key.launch == dp.key.capture) + pd.worst_setup_slack = std::min(pd.worst_setup_slack, dp.period.minDelay() + pdp.second.setup_slack); dp.worst_setup_slack = std::min(dp.worst_setup_slack, pdp.second.setup_slack); if (!setup_only) { pd.worst_hold_slack = std::min(pd.worst_hold_slack, pdp.second.hold_slack); |