Skip to content

Commit

Permalink
dry: add add_options_all_stages() helper function
Browse files Browse the repository at this point in the history
Signed-off-by: Øyvind Harboe <[email protected]>
  • Loading branch information
oharboe committed Apr 30, 2024
1 parent 8b2ad94 commit e88884b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions BUILD
Original file line number Diff line number Diff line change
@@ -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"]))
Expand Down Expand Up @@ -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",
Expand All @@ -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"],
)
Expand Down
15 changes: 15 additions & 0 deletions openroad.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e88884b

Please sign in to comment.