mirror of https://github.com/VLSIDA/OpenRAM.git
Create auxiliary run_drc.sh and run_lvs.sh with arguments for calibre
This commit is contained in:
parent
25bc3a66ed
commit
5b828f32cb
|
|
@ -70,13 +70,8 @@ num_drc_runs = 0
|
||||||
num_lvs_runs = 0
|
num_lvs_runs = 0
|
||||||
num_pex_runs = 0
|
num_pex_runs = 0
|
||||||
|
|
||||||
def run_drc(cell_name, gds_name, extract=False, final_verification=False):
|
def write_calibre_drc_script(cell_name, gds_name, extract, final_verification):
|
||||||
"""Run DRC check on a given top-level name which is
|
""" Write a Calibre runset file and script to run DRC """
|
||||||
implemented in gds_name."""
|
|
||||||
|
|
||||||
global num_drc_runs
|
|
||||||
num_drc_runs += 1
|
|
||||||
|
|
||||||
# the runset file contains all the options to run calibre
|
# the runset file contains all the options to run calibre
|
||||||
from tech import drc
|
from tech import drc
|
||||||
drc_rules = drc["drc_rules"]
|
drc_rules = drc["drc_rules"]
|
||||||
|
|
@ -100,57 +95,20 @@ def run_drc(cell_name, gds_name, extract=False, final_verification=False):
|
||||||
f.write("*{0}: {1}\n".format(k, drc_runset[k]))
|
f.write("*{0}: {1}\n".format(k, drc_runset[k]))
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
# run drc
|
# Create an auxiliary script to run calibre with the runset
|
||||||
cwd = os.getcwd()
|
run_file = OPTS.openram_temp + "run_drc.sh"
|
||||||
os.chdir(OPTS.openram_temp)
|
f = open(run_file, "w")
|
||||||
errfile = "{0}{1}.drc.err".format(OPTS.openram_temp, cell_name)
|
f.write("#!/bin/sh\n")
|
||||||
outfile = "{0}{1}.drc.out".format(OPTS.openram_temp, cell_name)
|
cmd = "{0} -gui -drc {1}drc_runset -batch".format(OPTS.drc_exe[1],
|
||||||
|
OPTS.openram_temp)
|
||||||
cmd = "{0} -gui -drc {1}drc_runset -batch 2> {2} 1> {3}".format(OPTS.drc_exe[1],
|
f.write(cmd)
|
||||||
OPTS.openram_temp,
|
f.write("\n")
|
||||||
errfile,
|
|
||||||
outfile)
|
|
||||||
debug.info(2, cmd)
|
|
||||||
os.system(cmd)
|
|
||||||
os.chdir(cwd)
|
|
||||||
|
|
||||||
# check the result for these lines in the summary:
|
|
||||||
# TOTAL Original Layer Geometries: 106 (157)
|
|
||||||
# TOTAL DRC RuleChecks Executed: 156
|
|
||||||
# TOTAL DRC Results Generated: 0 (0)
|
|
||||||
try:
|
|
||||||
f = open(drc_runset['drcSummaryFile'], "r")
|
|
||||||
except:
|
|
||||||
debug.error("Unable to retrieve DRC results file. Is calibre set up?",1)
|
|
||||||
results = f.readlines()
|
|
||||||
f.close()
|
f.close()
|
||||||
# those lines should be the last 3
|
os.system("chmod u+x {}".format(run_file))
|
||||||
results = results[-3:]
|
return drc_runset
|
||||||
geometries = int(re.split(r'\W+', results[0])[5])
|
|
||||||
rulechecks = int(re.split(r'\W+', results[1])[4])
|
|
||||||
errors = int(re.split(r'\W+', results[2])[5])
|
|
||||||
|
|
||||||
# always display this summary
|
def write_calibre_lvs_script(cell_name, gds_name, sp_name, final_verification):
|
||||||
if errors > 0:
|
""" Write a Calibre runset file and script to run LVS """
|
||||||
debug.error("{0}\tGeometries: {1}\tChecks: {2}\tErrors: {3}".format(cell_name,
|
|
||||||
geometries,
|
|
||||||
rulechecks,
|
|
||||||
errors))
|
|
||||||
else:
|
|
||||||
debug.info(1, "{0}\tGeometries: {1}\tChecks: {2}\tErrors: {3}".format(cell_name,
|
|
||||||
geometries,
|
|
||||||
rulechecks,
|
|
||||||
errors))
|
|
||||||
return errors
|
|
||||||
|
|
||||||
|
|
||||||
def run_lvs(cell_name, gds_name, sp_name, final_verification=False):
|
|
||||||
"""Run LVS check on a given top-level name which is
|
|
||||||
implemented in gds_name and sp_name. Final verification will
|
|
||||||
ensure that there are no remaining virtual conections. """
|
|
||||||
|
|
||||||
global num_lvs_runs
|
|
||||||
num_lvs_runs += 1
|
|
||||||
|
|
||||||
from tech import drc
|
from tech import drc
|
||||||
lvs_rules = drc["lvs_rules"]
|
lvs_rules = drc["lvs_rules"]
|
||||||
|
|
@ -197,14 +155,91 @@ def run_lvs(cell_name, gds_name, sp_name, final_verification=False):
|
||||||
f.write("*{0}: {1}\n".format(k, lvs_runset[k]))
|
f.write("*{0}: {1}\n".format(k, lvs_runset[k]))
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
# run LVS
|
# Create an auxiliary script to run calibre with the runset
|
||||||
|
run_file = OPTS.openram_temp + "run_lvs.sh"
|
||||||
|
f = open(run_file, "w")
|
||||||
|
f.write("#!/bin/sh\n")
|
||||||
|
PDK_DIR=os.environ.get("PDK_DIR")
|
||||||
|
f.write("export PDK_DIR={}\n".format(PDK_DIR))
|
||||||
|
cmd = "{0} -gui -lvs {1}lvs_runset -batch".format(OPTS.lvs_exe[1],
|
||||||
|
OPTS.openram_temp)
|
||||||
|
f.write(cmd)
|
||||||
|
f.write("\n")
|
||||||
|
f.close()
|
||||||
|
os.system("chmod u+x {}".format(run_file))
|
||||||
|
|
||||||
|
return lvs_runset
|
||||||
|
|
||||||
|
|
||||||
|
def run_drc(cell_name, gds_name, extract=False, final_verification=False):
|
||||||
|
"""Run DRC check on a given top-level name which is
|
||||||
|
implemented in gds_name."""
|
||||||
|
|
||||||
|
global num_drc_runs
|
||||||
|
num_drc_runs += 1
|
||||||
|
|
||||||
|
drc_runset = write_calibre_drc_script(cell_name, gds_name, extract, final_verification)
|
||||||
|
|
||||||
|
# run drc
|
||||||
|
cwd = os.getcwd()
|
||||||
|
os.chdir(OPTS.openram_temp)
|
||||||
|
errfile = "{0}{1}.drc.err".format(OPTS.openram_temp, cell_name)
|
||||||
|
outfile = "{0}{1}.drc.out".format(OPTS.openram_temp, cell_name)
|
||||||
|
|
||||||
|
cmd = "{0}run_drc.sh 2> {1} 1> {2}".format(OPTS.openram_temp,
|
||||||
|
errfile,
|
||||||
|
outfile)
|
||||||
|
debug.info(2, cmd)
|
||||||
|
os.system(cmd)
|
||||||
|
os.chdir(cwd)
|
||||||
|
|
||||||
|
# check the result for these lines in the summary:
|
||||||
|
# TOTAL Original Layer Geometries: 106 (157)
|
||||||
|
# TOTAL DRC RuleChecks Executed: 156
|
||||||
|
# TOTAL DRC Results Generated: 0 (0)
|
||||||
|
try:
|
||||||
|
f = open(drc_runset['drcSummaryFile'], "r")
|
||||||
|
except:
|
||||||
|
debug.error("Unable to retrieve DRC results file. Is calibre set up?",1)
|
||||||
|
results = f.readlines()
|
||||||
|
f.close()
|
||||||
|
# those lines should be the last 3
|
||||||
|
results = results[-3:]
|
||||||
|
geometries = int(re.split(r'\W+', results[0])[5])
|
||||||
|
rulechecks = int(re.split(r'\W+', results[1])[4])
|
||||||
|
errors = int(re.split(r'\W+', results[2])[5])
|
||||||
|
|
||||||
|
# always display this summary
|
||||||
|
if errors > 0:
|
||||||
|
debug.error("{0}\tGeometries: {1}\tChecks: {2}\tErrors: {3}".format(cell_name,
|
||||||
|
geometries,
|
||||||
|
rulechecks,
|
||||||
|
errors))
|
||||||
|
else:
|
||||||
|
debug.info(1, "{0}\tGeometries: {1}\tChecks: {2}\tErrors: {3}".format(cell_name,
|
||||||
|
geometries,
|
||||||
|
rulechecks,
|
||||||
|
errors))
|
||||||
|
return errors
|
||||||
|
|
||||||
|
|
||||||
|
def run_lvs(cell_name, gds_name, sp_name, final_verification=False):
|
||||||
|
"""Run LVS check on a given top-level name which is
|
||||||
|
implemented in gds_name and sp_name. Final verification will
|
||||||
|
ensure that there are no remaining virtual conections. """
|
||||||
|
|
||||||
|
global num_lvs_runs
|
||||||
|
num_lvs_runs += 1
|
||||||
|
|
||||||
|
lvs_runset = write_calibre_lvs_script(cell_name, gds_name, sp_name, final_verification)
|
||||||
|
|
||||||
|
# run lvs
|
||||||
cwd = os.getcwd()
|
cwd = os.getcwd()
|
||||||
os.chdir(OPTS.openram_temp)
|
os.chdir(OPTS.openram_temp)
|
||||||
errfile = "{0}{1}.lvs.err".format(OPTS.openram_temp, cell_name)
|
errfile = "{0}{1}.lvs.err".format(OPTS.openram_temp, cell_name)
|
||||||
outfile = "{0}{1}.lvs.out".format(OPTS.openram_temp, cell_name)
|
outfile = "{0}{1}.lvs.out".format(OPTS.openram_temp, cell_name)
|
||||||
|
|
||||||
cmd = "{0} -gui -lvs {1}lvs_runset -batch 2> {2} 1> {3}".format(OPTS.lvs_exe[1],
|
cmd = "{0}run_lvs.sh 2> {1} 1> {2}".format(OPTS.openram_temp,
|
||||||
OPTS.openram_temp,
|
|
||||||
errfile,
|
errfile,
|
||||||
outfile)
|
outfile)
|
||||||
debug.info(2, cmd)
|
debug.info(2, cmd)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue