mirror of
https://github.com/TinyTapeout/tt-support-tools.git
synced 2026-11-03 04:36:09 +01:00
fix(orfs): fail if violations remain after detailed routing
This commit is contained in:
+26
-20
@@ -606,6 +606,32 @@ class Project:
|
|||||||
logging.error("harden failed")
|
logging.error("harden failed")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
# Collect metrics
|
||||||
|
if self.args.orfs:
|
||||||
|
metrics = {}
|
||||||
|
metrics_inputs = glob.glob(
|
||||||
|
os.path.join(
|
||||||
|
self.local_dir,
|
||||||
|
"runs/wokwi/logs/ihp-sg13g2/tt-submission/base/*.json",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
for metrics_input in metrics_inputs:
|
||||||
|
with open(metrics_input) as mf:
|
||||||
|
metrics.update(json.load(mf))
|
||||||
|
metrics_output = (
|
||||||
|
"runs/wokwi/results/ihp-sg13g2/tt-submission/base/metrics.csv"
|
||||||
|
)
|
||||||
|
with open(metrics_output, "w") as mf:
|
||||||
|
wr = csv.writer(mf)
|
||||||
|
wr.writerow(("Metric", "Value"))
|
||||||
|
wr.writerows(metrics.items())
|
||||||
|
|
||||||
|
# Fail if violations remain after detailed routing
|
||||||
|
if self.args.orfs:
|
||||||
|
if metrics["detailedroute__route__drc_errors"] > 0:
|
||||||
|
logging.error("error: detailed routing couldn't resolve all violations")
|
||||||
|
exit(1)
|
||||||
|
|
||||||
# DRC & LVS aren't included in the default ORFS flow
|
# DRC & LVS aren't included in the default ORFS flow
|
||||||
if self.args.orfs:
|
if self.args.orfs:
|
||||||
self.run_drc()
|
self.run_drc()
|
||||||
@@ -633,26 +659,6 @@ class Project:
|
|||||||
)
|
)
|
||||||
f.write("\n")
|
f.write("\n")
|
||||||
|
|
||||||
# Collect metrics
|
|
||||||
if self.args.orfs:
|
|
||||||
metrics = {}
|
|
||||||
metrics_inputs = glob.glob(
|
|
||||||
os.path.join(
|
|
||||||
self.local_dir,
|
|
||||||
"runs/wokwi/logs/ihp-sg13g2/tt-submission/base/*.json",
|
|
||||||
)
|
|
||||||
)
|
|
||||||
for metrics_input in metrics_inputs:
|
|
||||||
with open(metrics_input) as mf:
|
|
||||||
metrics.update(json.load(mf))
|
|
||||||
metrics_output = (
|
|
||||||
"runs/wokwi/results/ihp-sg13g2/tt-submission/base/metrics.csv"
|
|
||||||
)
|
|
||||||
with open(metrics_output, "w") as mf:
|
|
||||||
wr = csv.writer(mf)
|
|
||||||
wr.writerow(("Metric", "Value"))
|
|
||||||
wr.writerows(metrics.items())
|
|
||||||
|
|
||||||
if self.args.orfs:
|
if self.args.orfs:
|
||||||
tool_queries = [
|
tool_queries = [
|
||||||
("yosys", "shell", "yosys -V"),
|
("yosys", "shell", "yosys -V"),
|
||||||
|
|||||||
Reference in New Issue
Block a user