From 3cfe74cefbd4a5f5fcc3efed54a92e3d10f1fe02 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Wed, 28 Nov 2018 16:55:04 -0800 Subject: [PATCH] Functional simulation uses threshold for high and low noise margins --- compiler/characterizer/functional.py | 9 +++++---- compiler/characterizer/simulation.py | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/compiler/characterizer/functional.py b/compiler/characterizer/functional.py index b99e644c..5255621b 100644 --- a/compiler/characterizer/functional.py +++ b/compiler/characterizer/functional.py @@ -29,6 +29,7 @@ class functional(simulation): self.set_spice_constants() self.set_stimulus_variables() self.create_signal_names() + # Number of checks can be changed self.num_cycles = 2 @@ -141,17 +142,17 @@ class functional(simulation): sp_read_value = "" for bit in range(self.word_size): value = parse_spice_list("timing", "v{0}.{1}ck{2}".format(dout_port.lower(),bit,check)) - if value > 0.88 * self.vdd_voltage: + if value > self.v_high: sp_read_value = "1" + sp_read_value - elif value < 0.12 * self.vdd_voltage: + elif value < self.v_low: sp_read_value = "0" + sp_read_value else: error ="FAILED: {0}_{1} value {2} at time {3}n does not fall within noise margins <{4} or >{5}.".format(dout_port, bit, value, eo_period, - 0.12*self.vdd_voltage, - 0.88*self.vdd_voltage) + self.v_low, + self.v_high) return (0, error) self.read_check.append([sp_read_value, dout_port, eo_period, check]) diff --git a/compiler/characterizer/simulation.py b/compiler/characterizer/simulation.py index 46bd6c57..beca0502 100644 --- a/compiler/characterizer/simulation.py +++ b/compiler/characterizer/simulation.py @@ -37,6 +37,9 @@ class simulation(): self.period = tech.spice["feasible_period"] self.slew = tech.spice["rise_time"]*2 self.load = tech.spice["msflop_in_cap"]*4 + + self.v_high = self.vdd_voltage - tech.spice["v_threshold_typical"] + self.v_low = tech.spice["v_threshold_typical"] self.gnd_voltage = 0 def set_stimulus_variables(self):