From f36954a6e5ab5398e04adc0467ccd8e7e8bbfea2 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Tue, 8 Oct 2024 11:17:53 +0300 Subject: [PATCH 1/4] Add OpenROAD.RepairAntennasPostDRT Signed-off-by: Kareem Farid --- openlane/flows/classic.py | 1 + .../openroad/antenna_repair_post_drt.tcl | 24 +++++++++++++ openlane/steps/openroad.py | 34 +++++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 openlane/scripts/openroad/antenna_repair_post_drt.tcl diff --git a/openlane/flows/classic.py b/openlane/flows/classic.py index 2da9d037a..b46558e33 100644 --- a/openlane/flows/classic.py +++ b/openlane/flows/classic.py @@ -87,6 +87,7 @@ class Classic(SequentialFlow): OpenROAD.ResizerTimingPostGRT, OpenROAD.STAMidPNR, OpenROAD.DetailedRouting, + OpenROAD.RepairAntennasPostDRT, Odb.RemoveRoutingObstructions, OpenROAD.CheckAntennas, Checker.TrDRC, diff --git a/openlane/scripts/openroad/antenna_repair_post_drt.tcl b/openlane/scripts/openroad/antenna_repair_post_drt.tcl new file mode 100644 index 000000000..137514f9b --- /dev/null +++ b/openlane/scripts/openroad/antenna_repair_post_drt.tcl @@ -0,0 +1,24 @@ +# Copyright 2020-2024 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 + +source $::env(SCRIPTS_DIR)/openroad/common/set_routing_layers.tcl +source $::env(SCRIPTS_DIR)/openroad/common/set_layer_adjustments.tcl + +set diode_split [split $::env(DIODE_CELL) "/"] +repair_antennas "[lindex $diode_split 0]" -ratio_margin $::env(DRT_ANTENNA_MARGIN) + +write_views +history diff --git a/openlane/steps/openroad.py b/openlane/steps/openroad.py index a358145e0..1fceee1d3 100644 --- a/openlane/steps/openroad.py +++ b/openlane/steps/openroad.py @@ -1620,6 +1620,40 @@ def run(self, state_in: State, **kwargs) -> Tuple[ViewsUpdate, MetricsUpdate]: return super().run(state_in, env=env, **kwargs) +class _DiodeInsertionPostDRT(OpenROADStep): + id = "DiodeInsertion" + + config_vars = ( + OpenROADStep.config_vars + + dpl_variables + + grt_variables + + [ + Variable( + "DRT_ANTENNA_MARGIN", + int, + "The margin to over fix antenna violations.", + default=10, + units="%", + ), + ] + ) + + def get_script_path(self): + return os.path.join(get_script_dir(), "openroad", "antenna_repair_post_drt.tcl") + + +@Step.factory.register() +class RepairAntennasPostDRT(CompositeStep): + """ + Similar to `OpenROAD.RepairAntennas`, but runs after detailed routing. + """ + + id = "OpenROAD.RepairAntennasPostDRT" + name = "Antenna Repair Post Detailed Routing" + + Steps = [_DiodeInsertionPostDRT, DetailedRouting, CheckAntennas] + + @Step.factory.register() class LayoutSTA(OpenROADStep): """ From 771e43822cb999a6c343d2c5e97227bcee2fae05 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Thu, 10 Oct 2024 17:18:03 +0300 Subject: [PATCH 2/4] default disable OpenROAD.RepairAntennasPostDRT --- openlane/flows/classic.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openlane/flows/classic.py b/openlane/flows/classic.py index 1279d2e7c..7c6dd850a 100644 --- a/openlane/flows/classic.py +++ b/openlane/flows/classic.py @@ -177,6 +177,12 @@ class Classic(SequentialFlow): default=True, deprecated_names=["GRT_REPAIR_ANTENNAS"], ), + Variable( + "RUN_POST_DRT_ANTENNA_REPAIR", + bool, + "Enables the OpenROAD.RepairAntennasPostDRT step.", + default=False, + ), Variable( "RUN_DRT", bool, @@ -278,6 +284,7 @@ class Classic(SequentialFlow): "OpenROAD.TapEndcapInsertion": ["RUN_TAP_ENDCAP_INSERTION"], "Odb.HeuristicDiodeInsertion": ["RUN_HEURISTIC_DIODE_INSERTION"], "OpenROAD.RepairAntennas": ["RUN_ANTENNA_REPAIR"], + "OpenROAD.RepairAntennasPostDRT": "RUN_POST_DRT_ANTENNA_REPAIR" "OpenROAD.DetailedRouting": ["RUN_DRT"], "OpenROAD.FillInsertion": ["RUN_FILL_INSERTION"], "OpenROAD.STAPostPNR": ["RUN_MCSTA"], From 4865802ad8a230babd79a45e29c055f7822d5a26 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Thu, 10 Oct 2024 17:47:52 +0300 Subject: [PATCH 3/4] Fix syntax error --- openlane/flows/classic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlane/flows/classic.py b/openlane/flows/classic.py index 7c6dd850a..eabfca327 100644 --- a/openlane/flows/classic.py +++ b/openlane/flows/classic.py @@ -284,7 +284,7 @@ class Classic(SequentialFlow): "OpenROAD.TapEndcapInsertion": ["RUN_TAP_ENDCAP_INSERTION"], "Odb.HeuristicDiodeInsertion": ["RUN_HEURISTIC_DIODE_INSERTION"], "OpenROAD.RepairAntennas": ["RUN_ANTENNA_REPAIR"], - "OpenROAD.RepairAntennasPostDRT": "RUN_POST_DRT_ANTENNA_REPAIR" + "OpenROAD.RepairAntennasPostDRT": ["RUN_POST_DRT_ANTENNA_REPAIR"], "OpenROAD.DetailedRouting": ["RUN_DRT"], "OpenROAD.FillInsertion": ["RUN_FILL_INSERTION"], "OpenROAD.STAPostPNR": ["RUN_MCSTA"], From 06c0e7660083ec971d74ccafb5464ee7ba5d76b7 Mon Sep 17 00:00:00 2001 From: Kareem Farid Date: Mon, 14 Oct 2024 15:42:41 +0300 Subject: [PATCH 4/4] Enable post antenna drt for picorv32a Signed-off-by: Kareem Farid --- test/designs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/designs b/test/designs index da5ed2cae..4746a7e53 160000 --- a/test/designs +++ b/test/designs @@ -1 +1 @@ -Subproject commit da5ed2cae9da72290c6fc016b2d19cd2b8914bae +Subproject commit 4746a7e53e9b9e582858437fc6117e425a337629