Merge pull request #39 from eddiehung/slack_histogram

Improve slack histogram clarity
This commit is contained in:
David Shah 2018-08-06 21:26:09 +02:00 committed by GitHub
commit 4f79b32c96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,9 +263,11 @@ void timing_analysis(Context *ctx, bool print_histogram, bool print_path)
log_break();
log_info("Slack histogram:\n");
log_info(" legend: * represents %d endpoint(s)\n", max_freq / bar_width);
log_info(" + represents [1,%d) endpoint(s)\n", max_freq / bar_width);
for (unsigned i = 0; i < bins.size(); ++i)
log_info("%6d < ps < %6d |%s\n", min_slack + bin_size * i, min_slack + bin_size * (i + 1),
std::string(bins[i] * bar_width / max_freq, '*').c_str());
log_info("[%6d, %6d) |%s%c\n", min_slack + bin_size * i, min_slack + bin_size * (i + 1),
std::string(bins[i] * bar_width / max_freq, '*').c_str(),
(bins[i] * bar_width) % max_freq > 0 ? '+' : ' ');
}
}