my change

This commit is contained in:
Jun Chen 2017-11-11 16:54:04 +09:00
parent a34a9ecb47
commit 054e4d3c28
2 changed files with 13 additions and 3 deletions

View File

@ -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)

View File

@ -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,