From e88884b322d4f7166927968ab339da7ff72f8a33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Harboe?= Date: Mon, 29 Apr 2024 14:44:58 +0200 Subject: [PATCH] dry: add add_options_all_stages() helper function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Øyvind Harboe --- BUILD | 6 +++--- openroad.bzl | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/BUILD b/BUILD index b4685d86..b5eb6d75 100644 --- a/BUILD +++ b/BUILD @@ -1,5 +1,5 @@ load("@rules_oci//oci:defs.bzl", "oci_tarball") -load("//:openroad.bzl", "build_openroad") +load("//:openroad.bzl", "build_openroad", "add_options_all_stages") # FIXME: this shouldn't be required exports_files(glob(["*.mk"])) @@ -113,7 +113,7 @@ build_openroad( "lb_32x128", ], sdc_constraints = ":test/constraints-top.sdc", - stage_args = { + stage_args = add_options_all_stages({ "synth": ["SYNTH_HIERARCHICAL=1"], "floorplan": [ "CORE_UTILIZATION=3", @@ -125,7 +125,7 @@ build_openroad( "PLACE_DENSITY=0.20", "PLACE_PINS_ARGS=-annealing", ], - }, + }, ['SKIP_REPORT_METRICS=1']), variant = "test_gds", verilog_files = ["test/rtl/L1MetadataArray.sv"], ) diff --git a/openroad.bzl b/openroad.bzl index 99747703..a29a5693 100644 --- a/openroad.bzl +++ b/openroad.bzl @@ -3,6 +3,21 @@ This module contains a definiton of build_openroad() macro used for declaring targets for running physical design flow with OpenROAD-flow-scripts. """ +def add_options_all_stages(options, new_options): + """Add new_options to all options in options dictionary. + + Args: + options (dict): options dictionary + new_options: options to add to all options in dictionary. + + Returns: + dict: A new updated dictionary. + """ + result = {} + for key, value in options.items(): + result[key] = value + new_options + return result + def enumerate(iterable): """ Convert list of elements into list of tuples (index, element)