Skip to content

Commit

Permalink
peer-coding session results
Browse files Browse the repository at this point in the history
  • Loading branch information
donn committed Jan 22, 2025
1 parent 3924101 commit f95d9ed
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 51 deletions.
10 changes: 6 additions & 4 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@

* `OpenROAD.DetailedRouting`

* Added `DRT_SAVE_SNAPSHOTS` which enables saving snapshots of the layout each detalied routing iteration.
* Added `DRT_SAVE_SNAPSHOTS` which enables saving snapshots of the layout each
detalied routing iteration.
* Added `DRT_SAVE_DRC_REPORT_ITERS`
* Added `DRT_ANTENNA_REPAIR` which enables antenna fixing after detailed routing
* Added `DRT_ANTENNA_MARGIN` which is similar to `GRT_ANTENNA_MARGIN`
* Added `DRT_ANTENNA_REPAIR_ITERS`
* Added `DRT_ANTENNA_REPAIR_ITERS`, which if greater than zero, enables
antenna fixing after detailed routing
* Added `DRT_ANTENNA_MARGIN` which is similar to `GRT_ANTENNA_MARGIN` but for
the aforementioned antenna repair iterations

* `OpenROAD.GlobalPlacement`

Expand Down
71 changes: 33 additions & 38 deletions openlane/scripts/openroad/drt.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@
# 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.
proc run_drt_antenna_repair_step {i args} {
set directory "${i}-antenna-repair"
file mkdir $directory
set output_drc "-output_drc $::env(STEP_DIR)/$directory/$::env(DESIGN_NAME).drc"
log_cmd detailed_route {*}$args {*}$output_drc
if { $::env(DRT_SAVE_SNAPSHOTS) } {
foreach snapshot [glob -nocomplain drt_iter*.odb] {
file rename -force $snapshot $directory/[file tail $snapshot]
}
proc drt_run {i args} {
set directory "drt-run-${i}"
file mkdir "$::env(STEP_DIR)/$directory"
set output_drc "-output_drc $::env(STEP_DIR)/$directory/$::env(DESIGN_NAME).drc"
log_cmd detailed_route {*}$args {*}$output_drc
if { $::env(DRT_SAVE_SNAPSHOTS) } {
foreach snapshot [glob -nocomplain drt_iter*.odb] {
file rename -force $snapshot $directory/[file tail $snapshot]
}
foreach drc_file [glob -nocomplain $::env(STEP_DIR)/$directory/*.drc] {
file copy -force $drc_file $::env(STEP_DIR)/[file tail $drc_file]
}
write_db $::env(STEP_DIR)/$directory/$::env(DESIGN_NAME).odb
}
foreach drc_file [glob -nocomplain $::env(STEP_DIR)/$directory/*.drc] {
file copy -force $drc_file $::env(STEP_DIR)/[file tail $drc_file]
}
write_db $::env(STEP_DIR)/$directory/$::env(DESIGN_NAME).odb
}

source $::env(SCRIPTS_DIR)/openroad/common/io.tcl
Expand Down Expand Up @@ -53,35 +53,30 @@ if { [info exists ::env(DRT_SAVE_DRC_REPORT_ITERS)] } {
set drc_report_iter_step_arg "-drc_report_iter_step $::env(DRT_SAVE_DRC_REPORT_ITERS)"
}

set args [list]
lappend args -bottom_routing_layer $min_layer
lappend args -top_routing_layer $max_layer
set output_drc "-output_drc $::env(STEP_DIR)/$::env(DESIGN_NAME).drc"
if { $::env(DRT_ANTENNA_REPAIR) } {
set output_drc "-output_drc $::env(STEP_DIR)/$::env(DESIGN_NAME).drc"
}
lappend args -output_drc $::env(STEP_DIR)/$::env(DESIGN_NAME).drc
lappend args -droute_end_iter $::env(DRT_OPT_ITERS)
lappend args -or_seed 42
lappend args -verbose 1
lappend args {*}$drc_report_iter_step_arg {*}$output_drc
set i 0

log_cmd detailed_route {*}$args
set drt_args [list]
lappend drt_args -bottom_routing_layer $min_layer
lappend drt_args -top_routing_layer $max_layer
lappend drt_args -droute_end_iter $::env(DRT_OPT_ITERS)
lappend drt_args -or_seed 42
lappend drt_args -verbose 1
lappend drt_args {*}$drc_report_iter_step_arg
drt_run $i {*}$drt_args

incr i

if { $::env(DRT_ANTENNA_REPAIR) } {
set i 0
set has_antenna_vios 1
set diode_split [split $::env(DIODE_CELL) "/"]
set has_antenna_vios [log_cmd repair_antennas "[lindex $diode_split 0]" -ratio_margin $::env(DRT_ANTENNA_MARGIN)]
if {$has_antenna_vios} {
run_drt_antenna_repair_step $i {*}$args
set diode_cell [lindex [split $::env(DIODE_CELL) "/"] 0]

while {$i <= $::env(DRT_ANTENNA_REPAIR_ITERS) && [log_cmd check_antennas]} {
puts "\[INFO\] Running antenna repair iteration $i"
set diodes_inserted [log_cmd repair_antennas $diode_cell -ratio_margin $::env(DRT_ANTENNA_MARGIN)]
if {$diodes_inserted} {
drt_run $i {*}$drt_args
} else {
puts "\[INFO\] No diodes inserted. Ending antenna repair iterations."
break
}
incr i
while {[check_antennas] && $i <= $::env(DRT_ANTENNA_REPAIR_ITERS)} {
run_drt_antenna_repair_step $i {*}$args
incr i
}
}

write_views
10 changes: 2 additions & 8 deletions openlane/steps/openroad.py
Original file line number Diff line number Diff line change
Expand Up @@ -1651,17 +1651,11 @@ class DetailedRouting(OpenROADStep):
"This is an experimental variable. Saves an odb snapshot of the layout each routing iteration. This generates multiple odb files increasing disk usage.",
default=False,
),
Variable(
"DRT_ANTENNA_REPAIR",
bool,
"Run antenna repair after detailed routing",
default=False,
),
Variable(
"DRT_ANTENNA_REPAIR_ITERS",
int,
"The maximum number of iterations to run antenna repair.",
default=5,
"The maximum number of iterations to run antenna repair. Set to a positive integer to attempt to repair antennas and then re-run DRT as appropriate.",
default=0,
),
Variable(
"DRT_ANTENNA_MARGIN",
Expand Down
2 changes: 1 addition & 1 deletion test/designs

0 comments on commit f95d9ed

Please sign in to comment.