From e6c4a5d83535339badca16e4339eb7331e29f91c Mon Sep 17 00:00:00 2001 From: Cade Richard Date: Wed, 29 Nov 2023 18:11:18 -0800 Subject: [PATCH] Added default metric reporting. Reports QoR and power metrics for elaborate, generic, map, and opt. --- hammer/synthesis/genus/__init__.py | 9 +++++++++ hammer/synthesis/genus/defaults.yml | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/hammer/synthesis/genus/__init__.py b/hammer/synthesis/genus/__init__.py index 558a08729..b89ea16aa 100644 --- a/hammer/synthesis/genus/__init__.py +++ b/hammer/synthesis/genus/__init__.py @@ -261,6 +261,12 @@ def init_environment(self) -> bool: # TODO: is there a way to track instance paths through the synthesis process? verbose_append("set_db root: .auto_ungroup none") + # Enable metric tracking + verbose_append(f"set_db statistics_log_data {self.get_setting('synthesis.genus.track_qor_metrics')}") + verbose_append(f"set_db statistics_log_data {self.get_setting('synthesis.genus.track_qor_metrics')}") + + verbose_append(f"set_db statistics_enable_power_report {self.get_setting('synthesis.genus.track_power_metrics')}") + # Set "don't use" cells. for l in self.generate_dont_use_commands(): self.append(l) @@ -345,6 +351,9 @@ def generate_reports(self) -> bool: """Generate reports.""" # TODO: extend report generation capabilities self.verbose_append("write_reports -directory reports -tag final") + + self.verbose_append("report_metric -format text -out_file reports/final_metrics.rpt") + return True def write_regs(self) -> bool: diff --git a/hammer/synthesis/genus/defaults.yml b/hammer/synthesis/genus/defaults.yml index a8c79b846..55d75e7f3 100644 --- a/hammer/synthesis/genus/defaults.yml +++ b/hammer/synthesis/genus/defaults.yml @@ -10,3 +10,9 @@ synthesis.genus: # Generate the TCL file but do not run it yet. generate_only: false + + # Track QoR metrics for predefined stages during synthesis: elaborate, syn_generic, syn_map and syn_opt. + track_qor_metrics: true + + # Track power metrics for same stages as above. Runtime intensive. + track_power_metrics: true \ No newline at end of file