From 7d0d59087912a430f8dcef4b7349cea234c9391c Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Fri, 11 Nov 2016 14:25:46 -0800 Subject: [PATCH] Don't converge only after a successful measurement. --- compiler/characterizer/delay.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/compiler/characterizer/delay.py b/compiler/characterizer/delay.py index 89bf3be6..d737d2c9 100644 --- a/compiler/characterizer/delay.py +++ b/compiler/characterizer/delay.py @@ -345,20 +345,19 @@ class delay(): target_period = 0.5 * (ub_period + lb_period) debug.info(1, "MinPeriod Search: {0}ns (ub: {1} lb: {2})".format(target_period, - ub_period, - lb_period)) + ub_period, + lb_period)) (success, delay_out) = self.try_period(feasible_period, target_period, data_value) if success: - if ch.relative_compare(ub_period, target_period): - # use the two values to compare, but only return the ub since it is guaranteed feasible - (success, delay_out) = self.try_period(feasible_period, ub_period, data_value) - return (ub_period, delay_out) - fail_flag = False ub_period = target_period else: lb_period = target_period + if ch.relative_compare(ub_period, lb_period): + # use the two values to compare, but only return the ub since it is guaranteed feasible + (success, delay_out) = self.try_period(feasible_period, ub_period, data_value) + return (ub_period, delay_out) self.error("Should not reach here.",-1) return (target_period, delay_out)