Skip to content

Commit

Permalink
standardise exception raise by errors found in magic log file
Browse files Browse the repository at this point in the history
  • Loading branch information
kareefardi committed Oct 26, 2023
1 parent 4521072 commit e0ed815
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions openlane/steps/magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,20 @@ def run(self, state_in: State, **kwargs) -> Tuple[ViewsUpdate, MetricsUpdate]:
r"Error while reading cell.*",
]

error_found = False
for line in open(self.get_log_path(), encoding="utf8"):
if "Calma output error" in line:
raise StepError(
f"Magic GDS was written with errors. Check log file of {self.id}"
)
error_found = True
elif "is an abstract view" in line:
raise StepError(
f"Missing GDS view for a macro. Check log file of {self.id}."
)
error_found = True
for pattern in error_patterns:
if re.match(pattern, line):
raise StepError(
f"Error encountered during running Magic.\nError: {line}Check the log file of {self.id}."
)
error_found = True
break
if error_found is True:
raise StepError(
f"Error encountered during running Magic.\nError: {line}Check the log file of {self.id}."
)

return views_updates, metrics_updates

Expand Down

0 comments on commit e0ed815

Please sign in to comment.