From 32b9af4ea2b054ef551262e735c09b3842c49515 Mon Sep 17 00:00:00 2001 From: Ethan Mahintorabi Date: Tue, 10 Dec 2024 23:01:58 +0000 Subject: [PATCH 1/2] Adds improve_placement and balance_rows control at the PDK level The PDK can now control balance_rows and improve_placement, because some PDKs either need these passes or disable them. --- pdk/open_road_configuration.bzl | 12 ++++++++++++ place_and_route/private/resize.bzl | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pdk/open_road_configuration.bzl b/pdk/open_road_configuration.bzl index af2b32a8..007a68c4 100644 --- a/pdk/open_road_configuration.bzl +++ b/pdk/open_road_configuration.bzl @@ -46,6 +46,8 @@ OpenRoadPdkInfo = provider( "tracks_file": "Track setup script", "wire_rc_clock_metal_layer": "The metal layer to pull RC information for clock nets", "wire_rc_signal_metal_layer": "The metal layer to pull RC information for signal nets", + "enable_improve_placement": "Enable/Disable improve_placement pass.", + "enable_balance_row_usage": "Enable/Disable balance row usage pass.", }, ) @@ -86,6 +88,8 @@ def _open_road_pdk_configuration_impl(ctx): detailed_routing_configuration = ctx.attr.detailed_routing_configuration, density_fill_config = ctx.attr.density_fill_config, klayout_tech_file = ctx.attr.klayout_tech_file, + enable_improve_placement = ctx.attr.enable_improve_placement, + enable_balance_row_usage = ctx.attr.enable_balance_row_usage, ), ] @@ -188,6 +192,14 @@ open_road_pdk_configuration = rule( "wire_rc_signal_metal_layer": attr.string( mandatory = True, ), + "enable_improve_placement": attr.bool( + default = True, + doc = "Enable/Disable improve_placement pass.", + ), + "enable_balance_row_usage": attr.bool( + default = False, + doc = "Enable/Disable balance row usage pass.", + ), }, ) diff --git a/place_and_route/private/resize.bzl b/place_and_route/private/resize.bzl index 200f394e..7395c856 100644 --- a/place_and_route/private/resize.bzl +++ b/place_and_route/private/resize.bzl @@ -14,7 +14,9 @@ """Resize openROAD commands""" +load("//pdk:open_road_configuration.bzl", "get_open_road_configuration") load("//place_and_route:open_road.bzl", "OpenRoadInfo", "merge_open_road_info", "openroad_command", "placement_padding_commands") +load("//synthesis:defs.bzl", "SynthesisInfo") def resize(ctx, open_road_info): """Performs resizing operation of the standard cells. @@ -28,12 +30,14 @@ def resize(ctx, open_road_info): """ placement_padding_struct = placement_padding_commands(ctx) + open_road_configuration = get_open_road_configuration(ctx.attr.synthesized_rtl[SynthesisInfo]) inputs = placement_padding_struct.inputs open_road_commands = placement_padding_struct.commands + [ + "balance_row_usage" if open_road_configuration.enable_balance_row_usage else "", "detailed_placement", - "improve_placement" if ctx.attr.enable_improve_placement else "", + "improve_placement" if ctx.attr.enable_improve_placement and open_road_configuration.enable_improve_placement else "", "optimize_mirroring", "check_placement -verbose", "report_checks -path_delay min_max -format full_clock_expanded -fields {input_pin slew capacitance} -digits 3", From 987c648b6a0e7a7f5e5af52221a7676b7e2f08d0 Mon Sep 17 00:00:00 2001 From: Ethan Mahintorabi Date: Tue, 10 Dec 2024 23:09:13 +0000 Subject: [PATCH 2/2] buildifier --- pdk/open_road_configuration.bzl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pdk/open_road_configuration.bzl b/pdk/open_road_configuration.bzl index 007a68c4..e422c2b1 100644 --- a/pdk/open_road_configuration.bzl +++ b/pdk/open_road_configuration.bzl @@ -24,6 +24,8 @@ OpenRoadPdkInfo = provider( "density_fill_config": "optional path to file with metal fill configuration", "detailed_routing_configuration": "optional detailed routing configuration", "do_not_use_cell_list": "Do not use cells in timing repair. This supports wild card * cell names", + "enable_balance_row_usage": "Enable/Disable balance row usage pass.", + "enable_improve_placement": "Enable/Disable improve_placement pass.", "endcap_cell": "The endcap cell to use in place and route", "fill_cells": "Metal fill cells", "global_placement_cell_pad": "Global placement cell padding to aide in routing", @@ -46,8 +48,6 @@ OpenRoadPdkInfo = provider( "tracks_file": "Track setup script", "wire_rc_clock_metal_layer": "The metal layer to pull RC information for clock nets", "wire_rc_signal_metal_layer": "The metal layer to pull RC information for signal nets", - "enable_improve_placement": "Enable/Disable improve_placement pass.", - "enable_balance_row_usage": "Enable/Disable balance row usage pass.", }, ) @@ -121,6 +121,14 @@ open_road_pdk_configuration = rule( mandatory = True, doc = "This value can be an empty list if all cells should be used in P&R", ), + "enable_balance_row_usage": attr.bool( + default = False, + doc = "Enable/Disable balance row usage pass.", + ), + "enable_improve_placement": attr.bool( + default = True, + doc = "Enable/Disable improve_placement pass.", + ), "endcap_cell": attr.string( ), "fill_cells": attr.string_list( @@ -192,14 +200,6 @@ open_road_pdk_configuration = rule( "wire_rc_signal_metal_layer": attr.string( mandatory = True, ), - "enable_improve_placement": attr.bool( - default = True, - doc = "Enable/Disable improve_placement pass.", - ), - "enable_balance_row_usage": attr.bool( - default = False, - doc = "Enable/Disable balance row usage pass.", - ), }, )