Skip to content

Commit 5a50af6

Browse files
committed
Moving ctrl var to ctx
1 parent ec7f60f commit 5a50af6

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

vpr/src/base/vpr_context.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ struct TimingContext : public Context {
113113
std::shared_ptr<tatum::TimingConstraints> constraints;
114114

115115
t_timing_analysis_profile_info stats;
116+
117+
/* Represents whether or not VPR should fail if timing constraints aren't met. */
118+
bool terminate_if_timing_fails = false;
119+
116120
};
117121

118122
namespace std {

vpr/src/timing/timing_fail_error.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@
99
#include "timing_util.h"
1010
#include "timing_fail_error.h"
1111

12-
/* Represents whether or not VPR should fail if timing constraints aren't met. */
13-
static bool terminate_if_timing_fails = false;
14-
1512
/* True if negative final slack. */
1613
static bool failed_timing = false;
1714

1815
void set_terminate_if_timing_fails(bool cmd_opt_terminate_if_timing_fails) {
19-
terminate_if_timing_fails = cmd_opt_terminate_if_timing_fails;
16+
auto& timing_ctx = g_vpr_ctx.mutable_timing();
17+
timing_ctx.terminate_if_timing_fails = cmd_opt_terminate_if_timing_fails;
2018
}
2119

2220
/* Checks if slack is negative, if routing is finished, and if user wants VPR flow to fail if their
@@ -25,7 +23,9 @@ void set_terminate_if_timing_fails(bool cmd_opt_terminate_if_timing_fails) {
2523
void check_if_failed_timing_constraints(double& slack, std::string prefix) {
2624
// The error should only be thrown after routing. Checking that prefix == "Final" ensures that
2725
// only negative slacks found after routing are considered.
28-
if (terminate_if_timing_fails && slack < 0 && prefix == "Final ") {
26+
auto& timing_ctx = g_vpr_ctx.timing();
27+
28+
if (timing_ctx.terminate_if_timing_fails && slack < 0 && prefix == "Final ") {
2929
failed_timing = true;
3030
}
3131
return;

0 commit comments

Comments
 (0)