Skip to content

Commit

Permalink
Add OpenROAD.RepairDesignPostGRT (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
kareefardi authored Oct 3, 2023
1 parent 723e134 commit ae5f959
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 9 deletions.
19 changes: 14 additions & 5 deletions openlane/flows/classic.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Classic(SequentialFlow):
OpenROAD.GlobalPlacement,
OpenROAD.GeneratePDN,
OpenROAD.STAMidPNR,
OpenROAD.RepairDesign,
OpenROAD.RepairDesignPostGPL,
Odb.DiodesOnPorts,
Odb.HeuristicDiodeInsertion,
OpenROAD.DetailedPlacement,
Expand All @@ -71,6 +71,7 @@ class Classic(SequentialFlow):
OpenROAD.STAMidPNR,
OpenROAD.GlobalRouting,
OpenROAD.ResizerTimingPostGRT,
OpenROAD.RepairDesignPostGRT,
OpenROAD.STAMidPNR,
OpenROAD.DetailedRouting,
Checker.TrDRC,
Expand Down Expand Up @@ -133,11 +134,11 @@ class Classic(SequentialFlow):
deprecated_names=["TAP_DECAP_INSERTION", "RUN_TAP_DECAP_INSERTION"],
),
Variable(
"RUN_REPAIR_DESIGN",
"RUN_POST_GPL_REPAIR_DESIGN",
bool,
"Enables resizer design repair using the OpenROAD.RepairDesign step.",
"Enables resizer design repair after global placement using the OpenROAD.RepairDesign step.",
default=True,
deprecated_names=["PL_RESIZER_DESIGN_OPTIMIZATIONS"],
deprecated_names=["PL_RESIZER_DESIGN_OPTIMIZATIONS", "RUN_REPAIR_DESIGN"],
),
Variable(
"RUN_CTS",
Expand All @@ -160,6 +161,13 @@ class Classic(SequentialFlow):
default=True,
deprecated_names=["GLB_RESIZER_TIMING_OPTIMIZATIONS"],
),
Variable(
"RUN_POST_GRT_REPAIR_DESIGN",
bool,
"Enables resizer design repair post-grt using the OpenROAD.RepairDesignPostGRT step.",
default=True,
deprecated_names=["GLB_RESIZER_DESIGN_OPTIMIZATIONS"],
),
Variable(
"RUN_HEURISTIC_DIODE_INSERTION",
bool,
Expand Down Expand Up @@ -307,12 +315,13 @@ class Classic(SequentialFlow):
"RUN_LINTER",
"QUIT_ON_LINTER_TIMING_CONSTRUCTS",
],
"OpenROAD.RepairDesign": ["RUN_REPAIR_DESIGN"],
"OpenROAD.RepairDesignPostGPL": ["RUN_POST_GPL_REPAIR_DESIGN"],
"OpenROAD.CTS": ["RUN_CTS"],
"OpenROAD.ResizerTimingPostCTS": ["RUN_POST_CTS_RESIZER_TIMING"],
"OpenROAD.RCX": ["RUN_SPEF_EXTRACTION"],
"OpenROAD.TapEndcapInsertion": ["RUN_TAP_ENDCAP_INSERTION"],
"OpenROAD.ResizerTimingPostGRT": ["RUN_POST_GRT_RESIZER_TIMING"],
"OpenROAD.RepairDesignPostGRT": ["RUN_POST_GRT_REPAIR_DESIGN"],
"Odb.HeuristicDiodeInsertion": ["RUN_HEURISTIC_DIODE_INSERTION"],
"OpenROAD.DetailedRouting": ["RUN_DRT"],
"OpenROAD.FillInsertion": ["RUN_FILL_INSERTION"],
Expand Down
45 changes: 45 additions & 0 deletions openlane/scripts/openroad/repair_design_postgrt.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Copyright 2020-2023 Efabless Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
source $::env(SCRIPTS_DIR)/openroad/common/io.tcl
source $::env(SCRIPTS_DIR)/openroad/common/resizer.tcl

load_rsz_corners
read_current_odb

set_propagated_clock [all_clocks]

set_dont_touch_objects

# set rc values
source $::env(SCRIPTS_DIR)/openroad/common/set_rc.tcl

# (Re-)GRT and Estimate Parasitics
source $::env(SCRIPTS_DIR)/openroad/common/grt.tcl
estimate_parasitics -global_routing

# Repair design
repair_design\
-max_wire_length $::env(GRT_DESIGN_REPAIR_MAX_WIRE_LENGTH) \
-slew_margin $::env(GRT_DESIGN_REPAIR_MAX_SLEW_PCT) \
-cap_margin $::env(GRT_DESIGN_REPAIR_MAX_CAP_PCT)

# Re-DPL and GRT
source $::env(SCRIPTS_DIR)/openroad/common/dpl.tcl
unset_dont_touch_objects
source $::env(SCRIPTS_DIR)/openroad/common/grt.tcl

write_views

report_design_area_metrics

56 changes: 53 additions & 3 deletions openlane/steps/openroad.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,12 +1437,12 @@ def run(self, state_in: State, **kwargs) -> Tuple[ViewsUpdate, MetricsUpdate]:


@Step.factory.register()
class RepairDesign(ResizerStep):
class RepairDesignPostGPL(ResizerStep):
"""
Runs a number of design "repairs" on a global-placed ODB file.
"""

id = "OpenROAD.RepairDesign"
id = "OpenROAD.RepairDesignPostGPL"
name = "Repair Design (Post-Global Placement)"

config_vars = ResizerStep.config_vars + [
Expand Down Expand Up @@ -1477,7 +1477,7 @@ class RepairDesign(ResizerStep):
Variable(
"DESIGN_REPAIR_MAX_WIRE_LENGTH",
Decimal,
"Specifies the maximum wire length cap used by resizer to insert buffers. If set to 0, no buffers will be inserted.",
"Specifies the maximum wire length cap used by resizer to insert buffers during design repair. If set to 0, no buffers will be inserted.",
default=0,
units="µm",
deprecated_names=["PL_RESIZER_MAX_WIRE_LENGTH"],
Expand All @@ -1504,6 +1504,56 @@ def get_script_path(self):
return os.path.join(get_script_dir(), "openroad", "repair_design.tcl")


@Step.factory.register()
class RepairDesign(RepairDesignPostGPL):
"""
This is identical to OpenROAD.RepairDesignPostGPL. It is retained for backwards compatibility.
"""

id = "OpenROAD.RepairDesign"
name = "Repair Design (Post-Global Placement)"


@Step.factory.register()
class RepairDesignPostGRT(ResizerStep):
"""
Runs a number of design "repairs" on a global-routed ODB file.
"""

id = "OpenROAD.RepairDesignPostGRT"
name = "Repair Design (Post-Global Routing)"

config_vars = ResizerStep.config_vars + [
Variable(
"GRT_DESIGN_REPAIR_MAX_WIRE_LENGTH",
Decimal,
"Specifies the maximum wire length cap used by resizer to insert buffers during post-grt design repair. If set to 0, no buffers will be inserted.",
default=0,
units="µm",
deprecated_names=["GLB_RESIZER_MAX_WIRE_LENGTH"],
),
Variable(
"GRT_DESIGN_REPAIR_MAX_SLEW_PCT",
Decimal,
"Specifies a margin for the slews during post-grt design repair.",
default=10,
units="%",
deprecated_names=["GLB_RESIZER_MAX_SLEW_MARGIN"],
),
Variable(
"GRT_DESIGN_REPAIR_MAX_CAP_PCT",
Decimal,
"Specifies a margin for the capacitances during design post-grt repair.",
default=10,
units="%",
deprecated_names=["GLB_RESIZER_MAX_CAP_MARGIN"],
),
]

def get_script_path(self):
return os.path.join(get_script_dir(), "openroad", "repair_design_postgrt.tcl")


@Step.factory.register()
class ResizerTimingPostCTS(ResizerStep):
"""
Expand Down
2 changes: 1 addition & 1 deletion test/designs

0 comments on commit ae5f959

Please sign in to comment.