Skip to content

Commit

Permalink
added magic DRC warning at the end of the log
Browse files Browse the repository at this point in the history
  • Loading branch information
marwaneltoukhy committed Oct 10, 2024
1 parent 0941bdc commit 6854aa1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mpw_precheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ def log_info(precheck_config, project_config):
logging.error(f"MPW Precheck failed to retreive {precheck_config['pdk_path'].name.upper()} PDK & Open PDKs commits: {e}")


def check_log_for_magic_drc(path):
try:
with open(path, 'r') as log_file:
for line in log_file:
if "{{MAGIC DRC CHECK FAILED}}" in line:
return True
except FileNotFoundError:
logging.error(f"Error: The file at '{path}' does not exist.")
except Exception as e:
logging.error(f"An error occurred: {e}")
return False


def run_precheck_sequence(precheck_config, project_config):
results = {}
logging.info(f"{{{{START}}}} Precheck Started, the full log '{precheck_config['log_path'].name}' will be located in '{precheck_config['log_path'].parent}'")
Expand All @@ -68,6 +81,8 @@ def run_precheck_sequence(precheck_config, project_config):
results[check.__surname__] = check.run()

logging.info(f"{{{{FINISH}}}} Executing Finished, the full log '{precheck_config['log_path'].name}' can be found in '{precheck_config['log_path'].parent}'")
if check_log_for_magic_drc(precheck_config['log_path']):
logging.warn("{{WARNING}} Magic DRC failed !")
if False not in list(results.values()):
logging.info("{{SUCCESS}} All Checks Passed !!!")
else:
Expand Down

0 comments on commit 6854aa1

Please sign in to comment.