diff options
author | Miodrag Milanović <mmicko@gmail.com> | 2019-02-12 18:53:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-12 18:53:20 +0100 |
commit | c52202233a3f1b06d68314dccc7cc12c8fdfe5f2 (patch) | |
tree | 5930a48f9052d020d1b1eacd4cfebcc266737ffe /common | |
parent | 8b0af0e48d22779b5f2e047541e9e037375cb4cd (diff) | |
parent | d24d85a6e4f82845cab51252308a2904db37c302 (diff) | |
download | nextpnr-c52202233a3f1b06d68314dccc7cc12c8fdfe5f2.tar.gz nextpnr-c52202233a3f1b06d68314dccc7cc12c8fdfe5f2.tar.bz2 nextpnr-c52202233a3f1b06d68314dccc7cc12c8fdfe5f2.zip |
Merge branch 'master' into mmaped_chipdb
Diffstat (limited to 'common')
-rw-r--r-- | common/timing.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/common/timing.cc b/common/timing.cc index 13f0e07b..64dcdf71 100644 --- a/common/timing.cc +++ b/common/timing.cc @@ -930,8 +930,7 @@ void timing_analysis(Context *ctx, bool print_histogram, bool print_fmax, bool p unsigned bar_width = 60; auto min_slack = slack_histogram.begin()->first; auto max_slack = slack_histogram.rbegin()->first; - auto bin_size = std::max(1u, (max_slack - min_slack) / num_bins); - num_bins = std::min((max_slack - min_slack) / bin_size, num_bins) + 1; + auto bin_size = std::max<unsigned>(1, ceil((max_slack - min_slack + 1) / float(num_bins))); std::vector<unsigned> bins(num_bins); unsigned max_freq = 0; for (const auto &i : slack_histogram) { |