From c359bbf42ab42907134853214da020a3a7ff7433 Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Wed, 13 Feb 2019 17:01:26 -0800 Subject: [PATCH] Fix deprecation warnings in regex by converting to raw strings. Add error if unable to find DRC errors in Magic. --- compiler/verify/calibre.py | 10 +++++----- compiler/verify/magic.py | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/compiler/verify/calibre.py b/compiler/verify/calibre.py index a1bbbc3e..dde7ea5a 100644 --- a/compiler/verify/calibre.py +++ b/compiler/verify/calibre.py @@ -126,9 +126,9 @@ def run_drc(cell_name, gds_name, extract=False, final_verification=False): f.close() # those lines should be the last 3 results = results[-3:] - geometries = int(re.split("\W+", results[0])[5]) - rulechecks = int(re.split("\W+", results[1])[4]) - errors = int(re.split("\W+", results[2])[5]) + geometries = int(re.split(r'\W+', results[0])[5]) + rulechecks = int(re.split(r'\W+', results[1])[4]) +n errors = int(re.split(r'\W+', results[2])[5]) # always display this summary if errors > 0: @@ -227,7 +227,7 @@ def run_lvs(cell_name, gds_name, sp_name, final_verification=False): incorrect = list(filter(test.search, results)) # Errors begin with "Error:" - test = re.compile("\s+Error:") + test = re.compile(r'\s+Error:') errors = list(filter(test.search, results)) for e in errors: debug.error(e.strip("\n")) @@ -363,7 +363,7 @@ def correct_port(name, output_file_name, ref_file_name): pex_file.seek(match_index_start) rest_text = pex_file.read() # locate the end of circuit definition line - match = re.search("\* \n", rest_text) + match = re.search(r'\* \n', rest_text) match_index_end = match.start() # store the unchanged part of pex file in memory pex_file.seek(0) diff --git a/compiler/verify/magic.py b/compiler/verify/magic.py index 490a09a1..0af8e5ef 100644 --- a/compiler/verify/magic.py +++ b/compiler/verify/magic.py @@ -140,11 +140,15 @@ def run_drc(cell_name, gds_name, extract=True, final_verification=False): debug.error("Unable to retrieve DRC results file. Is magic set up?",1) results = f.readlines() f.close() + errors=1 # those lines should be the last 3 for line in results: if "Total DRC errors found:" in line: errors = int(re.split(": ", line)[1]) break + else: + debug.error("Unable to find the total error line in Magic output.",1) + # always display this summary if errors > 0: