Skip to content

Commit

Permalink
SYNTH_HIERARCHY_MODE
Browse files Browse the repository at this point in the history
  • Loading branch information
donn committed Nov 20, 2024
1 parent 4ef5756 commit 9720e82
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions openlane/scripts/pyosys/synthesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def synthesize(
openlane_synth(
d,
config["DESIGN_NAME"],
not config["SYNTH_NO_FLAT"],
config["SYNTH_HIERARCHY_MODE"] == "flatten",
report_dir,
booth=config["SYNTH_MUL_BOOTH"],
abc_dff=config["SYNTH_ABC_DFF"],
Expand Down Expand Up @@ -375,7 +375,7 @@ def run_strategy(d):

run_strategy(d)

if config["SYNTH_NO_FLAT"]:
if config["SYNTH_HIERARCHY_MODE"] == "deferred_flatten":
# Resynthesize, flattening
d_flat = ys.Design()
d_flat.add_blackbox_models(blackbox_models)
Expand Down
14 changes: 10 additions & 4 deletions openlane/steps/pyosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,16 @@ class SynthesisCommon(VerilogStep):
default=False,
),
Variable(
"SYNTH_NO_FLAT",
bool,
"A flag that disables flattening the hierarchy during synthesis, only flattening it after synthesis, mapping and optimizations.",
default=False,
"SYNTH_HIERARCHY_MODE",
Literal["flatten", "deferred_flatten", "keep"],
"Affects how hierarchy is maintained throughout and after synthesis. 'flatten' flattens it during and after synthesis. 'deferred_flatten' flattens it after synthesis. 'keep' never flattens it.",
default="flatten",
deprecated_names=[
(
"SYNTH_NO_FLAT",
lambda x: "deferred_flatten" if x else "flatten",
)
],
),
Variable(
"SYNTH_SHARE_RESOURCES",
Expand Down

0 comments on commit 9720e82

Please sign in to comment.