From 90cb9f581f0f7d85f8aa4943dcbae239e8c0cc0e Mon Sep 17 00:00:00 2001 From: mrg Date: Tue, 2 Mar 2021 09:28:41 -0800 Subject: [PATCH] Fixes to get hspice delay test to pass. --- compiler/characterizer/delay.py | 6 +++--- compiler/characterizer/stimuli.py | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/compiler/characterizer/delay.py b/compiler/characterizer/delay.py index 296027c2..f491d8b0 100644 --- a/compiler/characterizer/delay.py +++ b/compiler/characterizer/delay.py @@ -418,9 +418,9 @@ class delay(simulation): t_rise=self.slew, t_fall=self.slew) - self.load_all_measure_nets() + # self.load_all_measure_nets() self.write_delay_measures() - self.write_simulation_saves() + # self.write_simulation_saves() # run until the end of the cycle time self.stim.write_control(self.cycle_times[-1] + self.period) @@ -616,7 +616,7 @@ class delay(simulation): def load_all_measure_nets(self): measurement_nets = set() - for port, meas in zip(self.targ_read_ports*len(self.read_meas_lists) + + for port, meas in zip(self.targ_read_ports * len(self.read_meas_lists) + self.targ_write_ports * len(self.write_meas_lists), self.read_meas_lists + self.write_meas_lists): for measurement in meas: diff --git a/compiler/characterizer/stimuli.py b/compiler/characterizer/stimuli.py index c6ef0fa5..4eee9e5c 100644 --- a/compiler/characterizer/stimuli.py +++ b/compiler/characterizer/stimuli.py @@ -246,15 +246,14 @@ class stimuli(): reltol = 0.001 # 0.1% timestep = 10 # ps, was 5ps but ngspice was complaining the timestep was too small in certain tests. - # UIC is needed for ngspice to converge - self.sf.write(".TEMP {}\n".format(self.temperature)) if OPTS.spice_name == "ngspice": + # UIC is needed for ngspice to converge + self.sf.write(".TRAN {0}p {1}n UIC\n".format(timestep, end_time)) # ngspice sometimes has convergence problems if not using gear method # which is more accurate, but slower than the default trapezoid method # Do not remove this or it may not converge due to some "pa_00" nodes # unless you figure out what these are. - self.sf.write(".TRAN {0}p {1}n UIC\n".format(timestep, end_time)) self.sf.write(".OPTIONS POST=1 RELTOL={0} PROBE method=gear\n".format(reltol)) elif OPTS.spice_name == "spectre": self.sf.write("simulator lang=spectre\n") @@ -275,7 +274,7 @@ class stimuli(): ' annotate=status maxiters=5 \n'.format("5p", end_time)) self.sf.write("simulator lang=spice\n") else: - self.sf.write(".TRAN 5p {0}n \n".format(end_time)) + self.sf.write(".TRAN {0}p {1}n UIC\n".format(timestep, end_time)) self.sf.write(".OPTIONS POST=1 RUNLVL={0} PROBE\n".format(runlvl)) if OPTS.spice_name == "hspice": # for cadence plots self.sf.write(".OPTIONS PSF=1 \n") @@ -350,7 +349,7 @@ class stimuli(): valid_retcode = 0 elif OPTS.spice_name == "hspice": # TODO: Should make multithreading parameter a configuration option - cmd = "{0} -d -mt {1} -i {2} -o {3}timing".format(OPTS.spice_exe, + cmd = "{0} -mt {1} -i {2} -o {3}timing".format(OPTS.spice_exe, OPTS.num_sim_threads, temp_stim, OPTS.openram_temp)