@@ -417,8 +417,14 @@ void print_setup_timing_summary(const tatum::TimingConstraints& constraints,
417417
418418 VTR_LOG (" \n " );
419419
420- check_if_failed_timing_constraints (setup_worst_neg_slack, prefix);
421- check_if_failed_timing_constraints (setup_total_neg_slack, prefix);
420+ /* If the terminate_if_timing fails option is on, this checks if slack is negative and if user wants VPR
421+ * flow to fail if their design doesn't meet timing constraints. If both conditions are true, the function
422+ * adds details about the negative slack to a string that will be printed when VPR throws an error.
423+ */
424+ if (timing_ctx.terminate_if_timing_fails && (setup_worst_neg_slack < 0 || setup_total_neg_slack < 0 ) && prefix == " Final " ) {
425+ std::string msg = " \n Design did not meet timing constraints.\n Timing failed and terminate_if_timing_fails set -- exiting" ;
426+ VPR_FATAL_ERROR (VPR_ERROR_TIMING, msg.c_str ());
427+ }
422428}
423429
424430/*
@@ -597,7 +603,9 @@ std::vector<HistogramBucket> create_hold_slack_histogram(const tatum::HoldTiming
597603}
598604
599605void print_hold_timing_summary (const tatum::TimingConstraints& constraints, const tatum::HoldTimingAnalyzer& hold_analyzer, std::string prefix) {
600- auto hold_worst_neg_slack = sec_to_nanosec (find_hold_worst_negative_slack (hold_analyzer));
606+ auto & timing_ctx = g_vpr_ctx.timing ();
607+
608+ auto hold_worst_neg_slack = sec_to_nanosec (find_hold_worst_negative_slack (hold_analyzer));
601609 auto hold_total_neg_slack = sec_to_nanosec (find_hold_total_negative_slack (hold_analyzer));
602610
603611 VTR_LOG (" %shold Worst Negative Slack (hWNS): %g ns\n " , prefix.c_str (), hold_worst_neg_slack);
@@ -646,8 +654,14 @@ void print_hold_timing_summary(const tatum::TimingConstraints& constraints, cons
646654 }
647655 VTR_LOG (" \n " );
648656
649- check_if_failed_timing_constraints (hold_worst_neg_slack, prefix);
650- check_if_failed_timing_constraints (hold_total_neg_slack, prefix);
657+ /* If the terminate_if_timing fails option is on, this checks if slack is negative and if user wants VPR
658+ * flow to fail if their design doesn't meet timing constraints. If both conditions are true, the function
659+ * adds details about the negative slack to a string that will be printed when VPR throws an error.
660+ */
661+ if (timing_ctx.terminate_if_timing_fails && (hold_worst_neg_slack < 0 || hold_total_neg_slack < 0 ) && prefix == " Final " ) {
662+ std::string msg = " \n Design did not meet timing constraints.\n Timing failed and terminate_if_timing_fails set -- exiting" ;
663+ VPR_FATAL_ERROR (VPR_ERROR_TIMING, msg.c_str ());
664+ }
651665}
652666
653667/*
0 commit comments