From 054e4d3c2809c6c0deda1f2d722b5c1aa8d73436 Mon Sep 17 00:00:00 2001 From: Jun Chen Date: Sat, 11 Nov 2017 16:54:04 +0900 Subject: [PATCH] my change --- compiler/characterizer/charutils.py | 10 ++++++++-- compiler/characterizer/stimuli.py | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/compiler/characterizer/charutils.py b/compiler/characterizer/charutils.py index 4f958a13..27e1b9a4 100644 --- a/compiler/characterizer/charutils.py +++ b/compiler/characterizer/charutils.py @@ -12,13 +12,19 @@ def relative_compare(value1,value2,error_tolerance=0.001): def parse_output(filename, key): """Parses a hspice output.lis file for a key value""" - full_filename="{0}{1}.lis".format(OPTS.openram_temp, filename) + if OPTS.spice_version == "xa" : + full_filename="{0}xa.meas".format(OPTS.openram_temp) + else : + full_filename="{0}{1}.lis".format(OPTS.openram_temp, filename) + try: f = open(full_filename, "r") except IOError: debug.error("Unable to open spice output file: {0}".format(full_filename),1) contents = f.read() - val = re.search(r"{0}\s*=\s*(-?\d+.?\d*\S*)\s+.*".format(key), contents) + # val = re.search(r"{0}\s*=\s*(-?\d+.?\d*\S*)\s+.*".format(key), contents) + val = re.search(r"{0}\s*=\s*(-?\d+.?\d*[e]?[-+]?[0-9]*\S*)\s+.*".format(key), contents) + if val != None: debug.info(3, "Key = " + key + " Val = " + val.group(1)) return val.group(1) diff --git a/compiler/characterizer/stimuli.py b/compiler/characterizer/stimuli.py index 62e62b0c..a33e587c 100644 --- a/compiler/characterizer/stimuli.py +++ b/compiler/characterizer/stimuli.py @@ -277,7 +277,11 @@ def run_sim(): """Run hspice in batch mode and output rawfile to parse.""" temp_stim = "{0}stim.sp".format(OPTS.openram_temp) - if OPTS.spice_version == "hspice": + + if OPTS.spice_version == "xa": + cmd = "{0} {1} -o {2}xa -mt 20".format(OPTS.spice_exe,temp_stim,OPTS.openram_temp) + valid_retcode=0 + elif OPTS.spice_version == "hspice": # TODO: Should make multithreading parameter a configuration option cmd = "{0} -mt 2 -i {1} -o {2}timing".format(OPTS.spice_exe, temp_stim,