Skip to content

Commit

Permalink
Align log/benchmark power estimation assumptions and enable user-defi…
Browse files Browse the repository at this point in the history
…ned switching activity.

Signed-off-by: Mike Inouye <[email protected]>
  • Loading branch information
mikesinouye committed Oct 11, 2024
1 parent 1aba858 commit ff21ae2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
4 changes: 4 additions & 0 deletions place_and_route/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ place_and_route = rule(
default = "0.69",
doc = "When performing global placement this is how densely our cells should be packaged on the die parameter is (0-1]",
),
"power_switching_activity": attr.string(
doc = "Assumed input switching activity fraction [0.0-1.0] for probabistic power estimation.",
default = "0.5",
),
"qt_qpa_platform": attr.string(
default = "minimal",
doc = "The qt platform to use with OpenROAD.",
Expand Down
4 changes: 4 additions & 0 deletions place_and_route/private/benchmark.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def benchmark(ctx, open_road_info):

open_road_commands = [
est_parasitic_cmd,
"set_power_activity -input -activity {} -duty 0.5".format(ctx.attr.power_switching_activity),
"report_power",
"report_wns",
"report_tns",
Expand Down Expand Up @@ -85,6 +86,7 @@ def benchmark(ctx, open_road_info):
"cpl=$(cat {log} | awk '/period_min/ {{ cpl=$4; exit }} END {{ print cpl }}');",
"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 }}');",
"swi_pow=$(cat {log} | awk '/^Total / {{ switch_power=$3 }} END {{ print switch_power }}');",
]
cmds.extend([cmd.format(log = command_output.log_file.path) for cmd in awk_cmds])
Expand Down Expand Up @@ -115,7 +117,9 @@ def benchmark(ctx, open_road_info):
total = struct(
internal_watts = "$int_pow",
switching_watts = "$swi_pow",
leakage_watts = "$leak_pow",
total_watts = "$tot_pow",
estimation_method = "{} probabilistic switching fraction".format(ctx.attr.power_switching_activity),
),
),
),
Expand Down
2 changes: 1 addition & 1 deletion place_and_route/private/global_routing.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ foreach layer_adjustment {global_routing_layer_adjustments} {{
"report_check_types -max_slew -max_capacitance -max_fanout -violators",
"report_floating_nets -verbose",
"report_units",
"set_power_activity -input -activity 1 -duty 0.5",
"set_power_activity -input -activity {} -duty 0.5".format(ctx.attr.power_switching_activity),
]
open_road_commands.extend(generate_power_results(ctx, general_routing_power_results))
open_road_commands.extend(generate_area_results(general_routing_area_results))
Expand Down
4 changes: 4 additions & 0 deletions synthesis/power_performance_area.proto
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ message Power {

// Clock tree
optional PowerBreakdown clock = 6;

// Description of the method used to estimate power, e.g. probabilistic
// switching or a vector power analysis.
optional string estimation_method = 7;
}

message PowerBreakdown {
Expand Down

0 comments on commit ff21ae2

Please sign in to comment.