Make DRC/LVS scripts use relative paths

This commit is contained in:
mrg 2020-12-11 10:06:00 -08:00
parent d19e4edb98
commit 38bf12771b
3 changed files with 21 additions and 26 deletions

View File

@ -21,8 +21,8 @@ class openram_test(unittest.TestCase):
self.reset()
tempgds = "{0}{1}.gds".format(OPTS.openram_temp, w.name)
w.gds_write(tempgds)
tempgds = "{}.gds".format(w.name)
w.gds_write("{0}{1}".format(OPTS.openram_temp, tempgds))
import verify
result=verify.run_drc(w.name, tempgds, None)
@ -36,13 +36,13 @@ class openram_test(unittest.TestCase):
self.reset()
tempspice = "{0}{1}.sp".format(OPTS.openram_temp, a.name)
tempgds = "{0}{1}.gds".format(OPTS.openram_temp, a.name)
tempspice = "{}.sp".format(a.name)
tempgds = "{}.gds".format(a.name)
a.lvs_write(tempspice)
a.lvs_write("{0}{1}".format(OPTS.openram_temp, tempspice))
# cannot write gds in netlist_only mode
if not OPTS.netlist_only:
a.gds_write(tempgds)
a.gds_write("{0}{1}".format(OPTS.openram_temp, tempgds))
import verify
# Run both DRC and LVS even if DRC might fail
@ -80,15 +80,13 @@ class openram_test(unittest.TestCase):
self.cleanup()
def run_pex(self, a, output=None):
if output == None:
output = OPTS.openram_temp + a.name + ".pex.netlist"
tempspice = "{0}{1}.sp".format(OPTS.openram_temp, a.name)
tempgds = "{0}{1}.gds".format(OPTS.openram_temp, a.name)
tempspice = "{}.sp".format(a.name)
tempgds = "{}.gds".format(a.name)
a.gds_write(tempgds)
a.gds_write("{0}{1}".format(OPTS.openram_temp, tempgds))
import verify
result=verify.run_pex(a.name, tempgds, tempspice, output=output, final_verification=False)
result=verify.run_pex(a.name, tempgds, tempspice, final_verification=False)
if result != 0:
self.fail("PEX ERROR: {}".format(a.name))
return output

View File

@ -63,8 +63,8 @@ def write_drc_script(cell_name, gds_name, extract, final_verification=False, out
run_file = output_path + "run_drc.sh"
f = open(run_file, "w")
f.write("#!/bin/sh\n")
cmd = "{0} -gui -drc {1}drc_runset -batch".format(OPTS.drc_exe[1],
output_path)
cmd = "{0} -gui -drc drc_runset -batch".format(OPTS.drc_exe[1])
f.write(cmd)
f.write("\n")
f.close()
@ -125,8 +125,8 @@ def write_lvs_script(cell_name, gds_name, sp_name, final_verification=False, out
run_file = output_path + "run_lvs.sh"
f = open(run_file, "w")
f.write("#!/bin/sh\n")
cmd = "{0} -gui -lvs {1}lvs_runset -batch".format(OPTS.lvs_exe[1],
output_path)
cmd = "{0} -gui -lvs lvs_runset -batch".format(OPTS.lvs_exe[1])
f.write(cmd)
f.write("\n")
f.close()
@ -178,8 +178,8 @@ def write_pex_script(cell_name, extract, output, final_verification=False, outpu
run_file = output_path + "run_pex.sh"
f = open(run_file, "w")
f.write("#!/bin/sh\n")
cmd = "{0} -gui -pex {1}pex_runset -batch".format(OPTS.pex_exe[1],
OPTS.openram_temp)
cmd = "{0} -gui -pex pex_runset -batch".format(OPTS.pex_exe[1])
f.write(cmd)
f.write("\n")
f.close()
@ -204,13 +204,10 @@ def run_drc(cell_name, gds_name, sp_name, extract=False, final_verification=Fals
else:
# Copy file to local dir if it isn't already
if not os.path.isfile(OPTS.openram_temp + os.path.basename(gds_name)):
shutil.copy(gds_name, OPTS.openram_temp)
shutil.copy(gds_name, OPTS.openram_temp + os.path.basename(gds_name))
drc_runset = write_drc_script(cell_name, gds_name, extract, final_verification, OPTS.openram_temp)
if not os.path.isfile(OPTS.openram_temp + os.path.basename(gds_name)):
shutil.copy(gds_name, OPTS.openram_temp + os.path.basename(gds_name))
(outfile, errfile, resultsfile) = run_script(cell_name, "drc")
# check the result for these lines in the summary:

View File

@ -153,10 +153,10 @@ def write_drc_script(cell_name, gds_name, extract, final_verification, output_pa
from tech import blackbox_cells
except ImportError:
blackbox_cells = []
for cell_name in blackbox_cells:
mag_file = OPTS.openram_tech + "maglef_lib/" + cell_name + ".mag"
for blackbox_cell_name in blackbox_cells:
mag_file = OPTS.openram_tech + "maglef_lib/" + blackbox_cell_name + ".mag"
debug.check(os.path.isfile(mag_file), "Could not find blackbox cell {}".format(mag_file))
f.write('cp {0} {1}\n'.format(mag_file, OPTS.openram_temp))
f.write('cp {0} .\n'.format(mag_file))
f.write('echo "$(date): Starting DRC using Magic {}"\n'.format(OPTS.drc_exe[1]))
f.write('\n')
@ -164,10 +164,10 @@ def write_drc_script(cell_name, gds_name, extract, final_verification, output_pa
f.write("load {} -dereference\n".format(cell_name))
f.write('puts "Finished loading cell {}"\n'.format(cell_name))
f.write("cellname delete \\(UNNAMED\\)\n")
f.write("writeall force\n")
f.write("select top cell\n")
f.write("expand\n")
f.write('puts "Finished expanding"\n')
f.write("drc euclidean on\n")
f.write("drc check\n")
f.write('puts "Finished drc check"\n')
f.write("drc catchup\n")