diff --git a/place_and_route/build_defs.bzl b/place_and_route/build_defs.bzl index 40bfd971..3295b50e 100644 --- a/place_and_route/build_defs.bzl +++ b/place_and_route/build_defs.bzl @@ -88,6 +88,7 @@ place_and_route = rule( """, ), "sdc": attr.label(allow_single_file = True), + "pin_placement_script": attr.label(allow_single_file = [".tcl"], doc = "See https://openroad.readthedocs.io/en/latest/main/src/ppl/README.html for syntax"), "clocks": attr.string_dict(), "die_width_microns": attr.int(), "die_height_microns": attr.int(), @@ -95,5 +96,8 @@ place_and_route = rule( "target_die_utilization_percentage": attr.string(doc = "string float value from 0-100 which sets the die area based on an estimated die area target utilization"), "placement_density": attr.string(default = "0.69", doc = "When performing global placement this is how densely our cells should be packaged on the die parameter is (0-1]"), "density_fill_config": attr.label(allow_single_file = True), + "sink_clustering_size": attr.int(doc = "Clock tree synthesis sink group size"), + "sink_clustering_max_diameter": attr.int(doc = "Clock tree synthesis sink group desired diamater in microns"), + "min_pin_distance": attr.string(doc = "The minimum distance in microns between pins around the outside of the block."), }, ) diff --git a/place_and_route/private/clock_tree_synthesis.bzl b/place_and_route/private/clock_tree_synthesis.bzl index cfddf571..3e6e4fdf 100644 --- a/place_and_route/private/clock_tree_synthesis.bzl +++ b/place_and_route/private/clock_tree_synthesis.bzl @@ -41,8 +41,10 @@ def clock_tree_synthesis(ctx, open_road_info): format_openroad_do_not_use_list(open_road_configuration.do_not_use_cell_list), "estimate_parasitics -placement", "repair_clock_inverters", - "clock_tree_synthesis -root_buf \"{cts_buffer}\" -buf_list \"{cts_buffer}\" -sink_clustering_enable -post_cts_disable".format( + "clock_tree_synthesis -root_buf \"{cts_buffer}\" -buf_list \"{cts_buffer}\" -sink_clustering_enable {sink_clustering_size} {sink_clustering_max_diameter}".format( cts_buffer = open_road_configuration.cts_buffer_cell, + sink_clustering_size = "-sink_clustering_size {}".format(ctx.attr.sink_clustering_size) if ctx.attr.sink_clustering_size else "", + sink_clustering_max_diameter = "-sink_clustering_max_diameter {}".format(ctx.attr.sink_clustering_max_diameter) if ctx.attr.sink_clustering_max_diameter else "", ), "set_propagated_clock [all_clocks]", "repair_clock_nets", diff --git a/place_and_route/private/global_placement.bzl b/place_and_route/private/global_placement.bzl index 9ffa6a54..bb654c60 100644 --- a/place_and_route/private/global_placement.bzl +++ b/place_and_route/private/global_placement.bzl @@ -40,6 +40,7 @@ def global_placement(ctx, open_road_info): pad_left = open_road_configuration.global_placement_cell_pad, pad_right = open_road_configuration.global_placement_cell_pad, ), + "remove_buffers", ] command_output = openroad_command( diff --git a/place_and_route/private/place_pins.bzl b/place_and_route/private/place_pins.bzl index 793f7084..c6b16155 100644 --- a/place_and_route/private/place_pins.bzl +++ b/place_and_route/private/place_pins.bzl @@ -46,12 +46,16 @@ def place_pins(ctx, open_road_info): ] tapcell_command = "source {}".format(open_road_configuration.tapcell_tcl.path) + if ctx.file.pin_placement_script: + inputs.append(ctx.file.pin_placement_script) + open_road_commands = timing_setup_command_struct.commands + [ - "remove_buffers", - "place_pins -hor_layers {hor_layers} -ver_layers {ver_layers}".format( + "source {}".format(ctx.file.pin_placement_script.path) if ctx.file.pin_placement_script else "", + "place_pins -hor_layers {hor_layers} -ver_layers {ver_layers} {min_pin_distance}".format( hor_layers = open_road_configuration.pin_horizontal_metal_layer, ver_layers = open_road_configuration.pin_vertical_metal_layer, - ), + min_pin_distance = "-min_distance {}".format(ctx.attr.min_pin_distance) if ctx.attr.min_pin_distance else "", + ), tapcell_command, ]