From c3eac62b8d2704fda5f9b30ea18f912abc5c1447 Mon Sep 17 00:00:00 2001 From: Mohamed Gaber Date: Tue, 21 Nov 2023 16:37:19 +0200 Subject: [PATCH] Fix extraction of `Final_Util` metric ~ Reimplemented extraction to use a new `metrics.json` that is output by the DRT step. --- scripts/openroad/droute.tcl | 2 ++ scripts/report/report.py | 12 +++++------- scripts/tcl_commands/routing.tcl | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/openroad/droute.tcl b/scripts/openroad/droute.tcl index c5d3a084f..2df3e6a7a 100755 --- a/scripts/openroad/droute.tcl +++ b/scripts/openroad/droute.tcl @@ -40,3 +40,5 @@ detailed_route\ -verbose 1 write + +report_design_area_metrics diff --git a/scripts/report/report.py b/scripts/report/report.py index 8d0dd6377..19c2ebda2 100755 --- a/scripts/report/report.py +++ b/scripts/report/report.py @@ -11,13 +11,13 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from collections import defaultdict import os import re import sys +import json import yaml import fnmatch +from collections import defaultdict from typing import Iterable, Optional, Dict sys.path.append(os.path.dirname(os.path.dirname(__file__))) @@ -415,15 +415,13 @@ def re_get_last_capture(rx, string): hpwl = float(match) final_utilization = -1 - # ./reports/signoff/26-rcx_sta.area.rpt final_utilization_report = Artifact( - rp, "reports", "signoff", "rcx_sta.area.rpt" + rp, "reports", "routing", "drt_metrics.json" ) final_utilization_content = final_utilization_report.get_content() if final_utilization_content is not None: - match = re.search(r"\s+([\d]+\.*[\d]*)%", final_utilization_content) - if match is not None: - final_utilization = float(match[1]) + metrics = json.loads(final_utilization_content) + final_utilization = metrics["design__instance__utilization"] * 100 # TritonRoute Logged Info Extraction tr_log = Artifact(rp, "logs", "routing", "detailed.log") diff --git a/scripts/tcl_commands/routing.tcl b/scripts/tcl_commands/routing.tcl index cb1705fdb..a9d9202de 100755 --- a/scripts/tcl_commands/routing.tcl +++ b/scripts/tcl_commands/routing.tcl @@ -66,7 +66,7 @@ proc global_routing_fastroute {args} { set log [index_file $::env(routing_logs)/antenna_route_$iter.log] run_openroad_script $::env(SCRIPTS_DIR)/openroad/repair_antennas.tcl\ -indexed_log $log\ - -save "to=$::env(routing_tmpfiles),name=global_$iter,def,guide,odb"\ + -save "to=$::env(routing_tmpfiles),name=global_$iter,def,guide,odb" set antennae [groute_antenna_extract -from_log $log] @@ -137,7 +137,7 @@ proc detailed_routing_tritonroute {args} { set ::env(_tmp_drt_rpt_prefix) $::env(routing_reports)/drt run_openroad_script $::env(SCRIPTS_DIR)/openroad/droute.tcl\ -indexed_log $log\ - -save "to=$::env(routing_results),noindex,def,odb,netlist,powered_netlist" + -save "to=$::env(routing_results),metrics=[index_file $::env(routing_reports)/drt_metrics.json],noindex,def,odb,netlist,powered_netlist" try_exec python3 $::env(SCRIPTS_DIR)/drc_rosetta.py tr to_klayout \ -o $::env(routing_reports)/drt.klayout.xml \