diff --git a/place_and_route/build_defs.bzl b/place_and_route/build_defs.bzl index 6c4c83ae..027742f5 100644 --- a/place_and_route/build_defs.bzl +++ b/place_and_route/build_defs.bzl @@ -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.", diff --git a/place_and_route/private/benchmark.bzl b/place_and_route/private/benchmark.bzl index 08b09522..4d247be0 100644 --- a/place_and_route/private/benchmark.bzl +++ b/place_and_route/private/benchmark.bzl @@ -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", @@ -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]) @@ -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), ), ), ), diff --git a/place_and_route/private/global_routing.bzl b/place_and_route/private/global_routing.bzl index 866f10a3..fe13a197 100644 --- a/place_and_route/private/global_routing.bzl +++ b/place_and_route/private/global_routing.bzl @@ -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)) diff --git a/synthesis/power_performance_area.proto b/synthesis/power_performance_area.proto index 85337a3d..ba4065ce 100644 --- a/synthesis/power_performance_area.proto +++ b/synthesis/power_performance_area.proto @@ -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 {