From 08da726f70c8efcd2e71d3eca7595472c0e48bbd Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 28 Nov 2023 15:08:54 +0200 Subject: [PATCH] Add `OpenROAD.CutRows` after `OpenROAD.ManualMacroPlacement` (#280) * Created new step `OpenROAD.CutRows * Placed in `Classic` Flow after `OpenROAD.ManualMacroPlacement` * Renamed `FP_TAP_VERTICAL_HALO` to `FP_MACRO_VERTICAL_HALO`, `FP_TAP_HORIZONTAL_HALO` to `FP_MACRO_HORIZONTAL_HALO` * Reason for the above renames is that the halo doesn't only affect tap insertion, it also affects cut rows generated in the floorplan. This affects cell insertion and power rails and anything related to floorplan and std cell placement. --- openlane/flows/classic.py | 1 + openlane/scripts/openroad/cut_rows.tcl | 24 +++++++++++++ openlane/scripts/openroad/tapcell.tcl | 4 +-- openlane/steps/openroad.py | 47 +++++++++++++++++++++++--- 4 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 openlane/scripts/openroad/cut_rows.tcl diff --git a/openlane/flows/classic.py b/openlane/flows/classic.py index 2639b80e..18cb5b06 100644 --- a/openlane/flows/classic.py +++ b/openlane/flows/classic.py @@ -281,6 +281,7 @@ class Classic(SequentialFlow): OpenROAD.Floorplan, Odb.SetPowerConnections, Odb.ManualMacroPlacement, + OpenROAD.CutRows, OpenROAD.TapEndcapInsertion, OpenROAD.GlobalPlacementSkipIO, OpenROAD.IOPlacement, diff --git a/openlane/scripts/openroad/cut_rows.tcl b/openlane/scripts/openroad/cut_rows.tcl new file mode 100644 index 00000000..8f92870b --- /dev/null +++ b/openlane/scripts/openroad/cut_rows.tcl @@ -0,0 +1,24 @@ +# Copyright 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 +read_current_odb + +cut_rows\ + -endcap_master $::env(FP_ENDCAP_CELL)\ + -halo_width_x $::env(FP_MACRO_HORIZONTAL_HALO)\ + -halo_width_y $::env(FP_MACRO_VERTICAL_HALO) + +write_views + +report_design_area_metrics diff --git a/openlane/scripts/openroad/tapcell.tcl b/openlane/scripts/openroad/tapcell.tcl index 49c98122..ff63503c 100755 --- a/openlane/scripts/openroad/tapcell.tcl +++ b/openlane/scripts/openroad/tapcell.tcl @@ -18,8 +18,8 @@ tapcell\ -distance $::env(FP_TAPCELL_DIST)\ -tapcell_master "$::env(FP_WELLTAP_CELL)"\ -endcap_master "$::env(FP_ENDCAP_CELL)"\ - -halo_width_x $::env(FP_TAP_HORIZONTAL_HALO)\ - -halo_width_y $::env(FP_TAP_VERTICAL_HALO) + -halo_width_x $::env(FP_MACRO_HORIZONTAL_HALO)\ + -halo_width_y $::env(FP_MACRO_VERTICAL_HALO) write_views diff --git a/openlane/steps/openroad.py b/openlane/steps/openroad.py index daa304cb..a8f36183 100644 --- a/openlane/steps/openroad.py +++ b/openlane/steps/openroad.py @@ -804,18 +804,20 @@ class TapEndcapInsertion(OpenROADStep): config_vars = OpenROADStep.config_vars + [ Variable( - "FP_TAP_HORIZONTAL_HALO", + "FP_MACRO_HORIZONTAL_HALO", Decimal, - "Specify the horizontal halo size around macros during tap insertion.", + "Specify the horizontal halo size around macros while cutting rows.", default=10, units="µm", + deprecated_names=["FP_TAP_HORIZONTAL_HALO"], ), Variable( - "FP_TAP_VERTICAL_HALO", + "FP_MACRO_VERTICAL_HALO", Decimal, - "Specify the vertical halo size around macros during tap insertion.", + "Specify the vertical halo size around macros while cutting rows.", default=10, units="µm", + deprecated_names=["FP_TAP_VERTICAL_HALO"], ), ] @@ -1395,6 +1397,43 @@ def run(self, state_in: State, **kwargs) -> Tuple[ViewsUpdate, MetricsUpdate]: @Step.factory.register() +class CutRows(OpenROADStep): + """ + Cut floorplan rows with respect to placed macros. + """ + + id = "OpenROAD.CutRows" + name = "CutRows" + + inputs = [DesignFormat.ODB] + outputs = [ + DesignFormat.ODB, + DesignFormat.DEF, + ] + + config_vars = OpenROADStep.config_vars + [ + Variable( + "FP_MACRO_HORIZONTAL_HALO", + Decimal, + "Specify the horizontal halo size around macros while cutting rows.", + default=10, + units="µm", + deprecated_names=["FP_TAP_HORIZONTAL_HALO"], + ), + Variable( + "FP_MACRO_VERTICAL_HALO", + Decimal, + "Specify the vertical halo size around macros while cutting rows.", + default=10, + units="µm", + deprecated_names=["FP_TAP_VERTICAL_HALO"], + ), + ] + + def get_script_path(self): + return os.path.join(get_script_dir(), "openroad", "cut_rows.tcl") + + class WriteViews(OpenROADStep): """ Write various layout views of an ODB design