Skip to content

Commit

Permalink
Merge pull request #98 from siliconcompiler/track-failures
Browse files Browse the repository at this point in the history
track run failures and mark those as failed
  • Loading branch information
gadfort authored Jul 5, 2024
2 parents e65b4f0 + bf14e4c commit 9faa37a
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions scgallery/gallery.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,33 +498,33 @@ def __run_design(self, design):
try:
chip.run()
except Exception:
return chip
return chip, False

return chip

def __finalize(self, design, chip):
if not chip:
return
return chip, True

def __finalize(self, design, chip, succeeded):
report_data = {
"chip": chip,
"platform": chip.get('option', 'pdk'),
"rules": []
}
self.__report_chips.setdefault(design, []).append(report_data)

chip.summary()
if succeeded:
chip.summary()

rules_files = self.__designs[design]['rules']
rules_files = self.__designs[design]['rules']

if rules_files:
chip.logger.info(f"Checking rules in: {', '.join(rules_files)}")
chip.use(asicflow_rules, rules_files=rules_files, skip_rules=self.__skip_rules)
error = not chip.check_checklist('asicflow_rules',
verbose=True,
require_reports=False)
if rules_files:
chip.logger.info(f"Checking rules in: {', '.join(rules_files)}")
chip.use(asicflow_rules, rules_files=rules_files, skip_rules=self.__skip_rules)
error = not chip.check_checklist('asicflow_rules',
verbose=True,
require_reports=False)
else:
error = None
else:
error = None
error = True

self.__status.append({
"design": design,
Expand All @@ -534,7 +534,9 @@ def __finalize(self, design, chip):
"error": error,
"chip": chip
})
if error:
if not succeeded:
chip.logger.error("Run failed")
elif error:
chip.logger.error("Rules mismatch")
elif rules_files:
chip.logger.info("Rules match")
Expand Down Expand Up @@ -648,8 +650,8 @@ def run(self):
def _run_remote(chip, design, job):
if not chip:
return
chip = self.__run_design(job)
self.__finalize(design, chip)
chip, succeeded = self.__run_design(job)
self.__finalize(design, chip, succeeded)

jobs = [threading.Thread(
target=_run_remote,
Expand All @@ -669,8 +671,8 @@ def _run_remote(chip, design, job):
design = job['design']

print(job['print'])
chip = self.__run_design(job)
self.__finalize(design, chip)
chip, succeeded = self.__run_design(job)
self.__finalize(design, chip, succeeded)

self.summary()

Expand Down

0 comments on commit 9faa37a

Please sign in to comment.