Skip to content

Commit

Permalink
Merge pull request #369 from hdl/benchmark
Browse files Browse the repository at this point in the history
Report fmax and actual clock period if SDC differs from bazel parameter
  • Loading branch information
QuantamHD authored Nov 21, 2024
2 parents ad802c7 + 2c8a03d commit 5eeb393
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion place_and_route/private/benchmark.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -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 }}');",
Expand All @@ -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))",
),
Expand Down
6 changes: 5 additions & 1 deletion synthesis/power_performance_area.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 (1e^9/s).
optional float fmax_ghz = 8;

// == Slack ==
// Abbreviations
// wns = worst negative slack (worst negative slack observed in all paths)
Expand Down Expand Up @@ -151,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;
Expand Down

0 comments on commit 5eeb393

Please sign in to comment.