Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dry: add add_option_all_stages() helper function #37

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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