From e598d26df9fc92e619b0d4c543b2f4145ed88b9b Mon Sep 17 00:00:00 2001 From: Mike Inouye Date: Wed, 20 Nov 2024 23:06:55 +0000 Subject: [PATCH 1/3] Report fmax and actual clock period if SDC differs from bazel parameter. Signed-off-by: Mike Inouye --- place_and_route/private/benchmark.bzl | 6 +++++- synthesis/power_performance_area.proto | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/place_and_route/private/benchmark.bzl b/place_and_route/private/benchmark.bzl index d08ef01f..f597e72e 100644 --- a/place_and_route/private/benchmark.bzl +++ b/place_and_route/private/benchmark.bzl @@ -43,6 +43,7 @@ def benchmark(ctx, open_road_info): "report_design_area", "report_cell_usage", "report_clock_min_period", + "report_clock_properties", ] cmd_outputs = [] @@ -83,7 +84,9 @@ def benchmark(ctx, open_road_info): "inverters_area=$(cat {log} | awk '/Inverter/ {{ print $2 }}');", "wns=$(cat {log} | awk '/wns/ {{ print $2 }}');", "tns=$(cat {log} | awk '/tns/ {{ print $2 }}');", + "period=$(cat {log} | awk '/clk / {{ period=$2; exit }} END {{ print period }}');", "cpl=$(cat {log} | awk '/period_min/ {{ cpl=$4; exit }} END {{ print cpl }}');", + "fmax=$(cat {log} | awk '/fmax/ {{ fmax=$7; exit }} END {{ print fmax }}');", "tot_pow=$(cat {log} | awk '/^Total / {{ total_power=$5 }} END {{ print total_power }}');", "int_pow=$(cat {log} | awk '/^Total / {{ intern_power=$2 }} END {{ print intern_power }}');", "leak_pow=$(cat {log} | awk '/^Total / {{ leak_power=$4 }} END {{ print leak_power }}');", @@ -109,8 +112,9 @@ def benchmark(ctx, open_road_info): num_inverters = "${inverters:=0}", ), performance = struct( - clock_period_ps = ctx.attr.clock_period if ctx.attr.clock_period else 0, + clock_period_ps = "$(printf %.0f $(bc<<<$period*1000))", critical_path_ps = "$(printf %.0f $(bc<<<$cpl*1000))", + fmax_ghz = "${fmax:=0}", setup_wns_ps = "$(printf %.0f $(bc<<<$wns*1000))", setup_tns_ps = "$(printf %.0f $(bc<<<$tns*1000))", ), diff --git a/synthesis/power_performance_area.proto b/synthesis/power_performance_area.proto index ba4065ce..715b1c5e 100644 --- a/synthesis/power_performance_area.proto +++ b/synthesis/power_performance_area.proto @@ -107,6 +107,10 @@ message Performance { // Longest path in picoseconds. optional int32 critical_path_ps = 2; + // The highest achievable clock frequency (reciprocal of `critical_path_ps`). + // Unit is gigahertz (1*10^9/s). + optional int32 fmax_ghz = 2; + // == Slack == // Abbreviations // wns = worst negative slack (worst negative slack observed in all paths) From fec9bf84e784f33c9d680c66f512b9e8c429e6e8 Mon Sep 17 00:00:00 2001 From: Mike Inouye Date: Wed, 20 Nov 2024 23:09:21 +0000 Subject: [PATCH 2/3] Use unique proto ID. Signed-off-by: Mike Inouye --- synthesis/power_performance_area.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/synthesis/power_performance_area.proto b/synthesis/power_performance_area.proto index 715b1c5e..be8e28a8 100644 --- a/synthesis/power_performance_area.proto +++ b/synthesis/power_performance_area.proto @@ -109,7 +109,7 @@ message Performance { // The highest achievable clock frequency (reciprocal of `critical_path_ps`). // Unit is gigahertz (1*10^9/s). - optional int32 fmax_ghz = 2; + optional float fmax_ghz = 8; // == Slack == // Abbreviations @@ -155,7 +155,7 @@ message Performance { // How far off the clock is between two different parts of the chip. optional sint32 clock_skew_ps = 7; - // Leaving out proto tags 8..9 for later use. + // Leaving out proto tag 9 for later use. optional int32 num_setup_violations = 10; optional int32 num_hold_violations = 11; From 2c8a03de9a057eba93242bad4bce0328f3aa9e26 Mon Sep 17 00:00:00 2001 From: Mike Inouye Date: Wed, 20 Nov 2024 23:10:41 +0000 Subject: [PATCH 3/3] Use a more straightforward scientific notation. Signed-off-by: Mike Inouye --- synthesis/power_performance_area.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthesis/power_performance_area.proto b/synthesis/power_performance_area.proto index be8e28a8..08c8b22b 100644 --- a/synthesis/power_performance_area.proto +++ b/synthesis/power_performance_area.proto @@ -108,7 +108,7 @@ message Performance { optional int32 critical_path_ps = 2; // The highest achievable clock frequency (reciprocal of `critical_path_ps`). - // Unit is gigahertz (1*10^9/s). + // Unit is gigahertz (1e^9/s). optional float fmax_ghz = 8; // == Slack ==