Skip to content

Commit

Permalink
timing: Make hold violations an error
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanG077 committed Sep 13, 2024
1 parent 1aee4ac commit 3209b67
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions common/kernel/timing_log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*
*/

#include <algorithm>
#include "log.h"
#include "nextpnr.h"
#include "util.h"
Expand Down Expand Up @@ -170,16 +171,23 @@ static void log_crit_paths(const Context *ctx, TimingResult &result)
}

// Min delay violated paths
for (auto &report : result.min_delay_violations) {
// Show maximum of 10
auto num_min_violations = result.min_delay_violations.size();
if (num_min_violations > 0) {
log_break();
std::string start = clock_event_name(ctx, report.clock_pair.start);
std::string end = clock_event_name(ctx, report.clock_pair.end);
if (report.clock_pair.start == report.clock_pair.end) {
log_info("Hold time violations for clock '%s':\n", start.c_str());
} else {
log_info("Hold time violations for path '%s' -> '%s':\n", start.c_str(), end.c_str());
log_info("Hold time violations:\n");
for (size_t i = 0; i < std::min((size_t)10, num_min_violations); ++i) {
auto &report = result.min_delay_violations.at(i);
log_break();
std::string start = clock_event_name(ctx, report.clock_pair.start);
std::string end = clock_event_name(ctx, report.clock_pair.end);
if (report.clock_pair.start == report.clock_pair.end) {
log_nonfatal_error("Hold time violations for clock '%s':\n", start.c_str());
} else {
log_nonfatal_error("Hold time violations for path '%s' -> '%s':\n", start.c_str(), end.c_str());
}
print_path_report(report);
}
print_path_report(report);
}
}

Expand Down

0 comments on commit 3209b67

Please sign in to comment.