diff --git a/compiler/tests/regress.py b/compiler/tests/regress.py index 93989248..d97def2b 100755 --- a/compiler/tests/regress.py +++ b/compiler/tests/regress.py @@ -30,4 +30,10 @@ suite.addTests(map(load, modules)) test_runner = unittest.TextTestRunner(verbosity=2,stream=sys.stderr) test_result = test_runner.run(suite) + +import verify +verify.print_drc_stats() +verify.print_lvs_stats() +verify.print_pex_stats() + sys.exit(not test_result.wasSuccessful()) diff --git a/compiler/verify/__init__.py b/compiler/verify/__init__.py index a83629b0..2199e765 100644 --- a/compiler/verify/__init__.py +++ b/compiler/verify/__init__.py @@ -13,7 +13,7 @@ import debug from globals import OPTS,find_exe,get_tool import sys -debug.info(2,"Initializing verify...") +debug.info(1,"Initializing verify...") if not OPTS.check_lvsdrc: debug.info(1,"LVS/DRC/PEX disabled.") @@ -21,6 +21,7 @@ if not OPTS.check_lvsdrc: OPTS.lvs_exe = None OPTS.pex_exe = None else: + debug.info(1, "Finding DRC/LVS/PEX tools.") OPTS.drc_exe = get_tool("DRC",["calibre","assura","magic"]) OPTS.lvs_exe = get_tool("LVS",["calibre","assura","netgen"]) OPTS.pex_exe = get_tool("PEX",["calibre","magic"]) @@ -31,22 +32,22 @@ if OPTS.check_lvsdrc and OPTS.tech_name == "freepdk45": if OPTS.drc_exe == None: pass elif "calibre"==OPTS.drc_exe[0]: - from .calibre import run_drc + from .calibre import run_drc,print_drc_stats elif "assura"==OPTS.drc_exe[0]: - from .assura import run_drc + from .assura import run_drc,print_drc_stats elif "magic"==OPTS.drc_exe[0]: - from .magic import run_drc + from .magic import run_drc,print_drc_stats else: debug.warning("Did not find a supported DRC tool.") if OPTS.lvs_exe == None: pass elif "calibre"==OPTS.lvs_exe[0]: - from .calibre import run_lvs + from .calibre import run_lvs,print_lvs_stats elif "assura"==OPTS.lvs_exe[0]: - from .assura import run_lvs + from .assura import run_lvs,print_lvs_stats elif "netgen"==OPTS.lvs_exe[0]: - from .magic import run_lvs + from .magic import run_lvs,print_lvs_stats else: debug.warning("Did not find a supported LVS tool.") @@ -54,9 +55,9 @@ else: if OPTS.pex_exe == None: pass elif "calibre"==OPTS.pex_exe[0]: - from .calibre import run_pex + from .calibre import run_pex,print_pex_stats elif "magic"==OPTS.pex_exe[0]: - from .magic import run_pex + from .magic import run_pex,print_pex_stats else: debug.warning("Did not find a supported PEX tool.") diff --git a/compiler/verify/assura.py b/compiler/verify/assura.py index 27949721..d3c605f3 100644 --- a/compiler/verify/assura.py +++ b/compiler/verify/assura.py @@ -25,10 +25,18 @@ import time import debug from globals import OPTS +# Keep track of statistics +num_drc_runs = 0 +num_lvs_runs = 0 +num_pex_runs = 0 + def run_drc(name, gds_name): """Run DRC check on a given top-level name which is implemented in gds_name.""" + global num_drc_runs + num_drc_runs += 1 + from tech import drc drc_rules = drc["drc_rules"] drc_runset = OPTS.openram_temp + name + ".rsf" @@ -88,6 +96,10 @@ def run_drc(name, gds_name): def run_lvs(name, gds_name, sp_name): """Run LVS check on a given top-level name which is implemented in gds_name and sp_name. """ + + global num_lvs_runs + num_lvs_runs += 1 + from tech import drc lvs_rules = drc["lvs_rules"] lvs_runset = OPTS.openram_temp + name + ".rsf" @@ -170,3 +182,13 @@ def run_pex(name, gds_name, sp_name, output=None): """Run pex on a given top-level name which is implemented in gds_name and sp_name. """ debug.error("PEX extraction not implemented with Assura.",-1) + + global num_pex_runs + num_pex_runs += 1 + +def print_drc_stats(): + debug.info(1,"DRC runs: {0}".format(num_drc_runs)) +def print_lvs_stats(): + debug.info(1,"LVS runs: {0}".format(num_lvs_runs)) +def print_pex_stats(): + debug.info(1,"PEX runs: {0}".format(num_pex_runs)) diff --git a/compiler/verify/calibre.py b/compiler/verify/calibre.py index 38e92a2c..a7cd9290 100644 --- a/compiler/verify/calibre.py +++ b/compiler/verify/calibre.py @@ -65,10 +65,17 @@ import debug from globals import OPTS import subprocess +# Keep track of statistics +num_drc_runs = 0 +num_lvs_runs = 0 +num_pex_runs = 0 def run_drc(cell_name, gds_name): """Run DRC check on a given top-level name which is implemented in gds_name.""" + + global num_drc_runs + num_drc_runs += 1 # the runset file contains all the options to run calibre from tech import drc @@ -141,7 +148,10 @@ 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 lvs_rules = drc["lvs_rules"] lvs_runset = { @@ -258,6 +268,10 @@ def run_lvs(cell_name, gds_name, sp_name, final_verification=False): def run_pex(cell_name, gds_name, sp_name, output=None): """Run pex on a given top-level name which is implemented in gds_name and sp_name. """ + + global num_pex_runs + num_pex_runs += 1 + from tech import drc if output == None: output = name + ".pex.netlist" @@ -354,3 +368,10 @@ def correct_port(name, output_file_name, ref_file_name): output_file.write(circuit_title) output_file.write(part2) output_file.close() + +def print_drc_stats(): + debug.info(1,"DRC runs: {0}".format(num_drc_runs)) +def print_lvs_stats(): + debug.info(1,"LVS runs: {0}".format(num_lvs_runs)) +def print_pex_stats(): + debug.info(1,"PEX runs: {0}".format(num_pex_runs)) diff --git a/compiler/verify/magic.py b/compiler/verify/magic.py index f438bad8..319d159a 100644 --- a/compiler/verify/magic.py +++ b/compiler/verify/magic.py @@ -64,6 +64,11 @@ import debug from globals import OPTS import subprocess +# Keep track of statistics +num_drc_runs = 0 +num_lvs_runs = 0 +num_pex_runs = 0 + def write_magic_script(cell_name, gds_name, extract=False): """ Write a magic script to perform DRC and optionally extraction. """ @@ -148,6 +153,9 @@ def write_netgen_script(cell_name, sp_name): def run_drc(cell_name, gds_name, extract=False): """Run DRC check on a cell which is implemented in gds_name.""" + global num_drc_runs + num_drc_runs += 1 + write_magic_script(cell_name, gds_name, extract) # run drc @@ -198,6 +206,9 @@ def run_lvs(cell_name, gds_name, sp_name, final_verification=False): 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 + run_drc(cell_name, gds_name, extract=True) write_netgen_script(cell_name, sp_name) @@ -270,6 +281,9 @@ def run_pex(name, gds_name, sp_name, output=None): """Run pex on a given top-level name which is implemented in gds_name and sp_name. """ + global num_pex_runs + num_pex_runs += 1 + debug.warning("PEX using magic not implemented.") return 1 @@ -337,3 +351,9 @@ def run_pex(name, gds_name, sp_name, output=None): return out_errors +def print_drc_stats(): + debug.info(1,"DRC runs: {0}".format(num_drc_runs)) +def print_lvs_stats(): + debug.info(1,"LVS runs: {0}".format(num_lvs_runs)) +def print_pex_stats(): + debug.info(1,"PEX runs: {0}".format(num_pex_runs))