Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: openroad enhancements, variable renames #608

Merged
merged 36 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7cd5485
Yosys Step Rewrite, Update `nix-eda`
donn Aug 21, 2024
f752ac9
Exclude Pyosys Scripts from mypy
donn Aug 21, 2024
a5cfc8c
Fix missing passes in proc/synth
donn Aug 22, 2024
8082f54
Fix VHDL and Power Defines Issues + Add booth/fix -dff
donn Aug 22, 2024
13b7c3a
Fix Lint
donn Aug 22, 2024
5b72255
Fix `&nf` usage
donn Aug 22, 2024
7b36a6e
Fix nonsynth deletes
donn Aug 25, 2024
72875b8
Fix `vh`
donn Aug 25, 2024
66524bd
Merge remote-tracking branch 'origin/main' into dev
donn Aug 25, 2024
3d55222
Merge remote-tracking branch 'origin/dev' into synthesis-adjustments
donn Aug 25, 2024
60bcad1
Add support for Hierarchical RTL Macro Placer
donn Aug 26, 2024
29b3424
lint michigan
donn Aug 26, 2024
a6fa5e6
Update OpenROAD again + docs
donn Aug 27, 2024
58bafed
Squashed commit of the following:
kareefardi Nov 10, 2024
b8ea607
Merge branch 'dev' into rtl-macro-placer
donn Dec 2, 2024
c07e571
Rever HierRTLMP changes
donn Dec 2, 2024
2675f26
merge in dev
donn Dec 2, 2024
9d37ee8
Make pruning rows use an actual variable (forgot to commit)
donn Dec 2, 2024
0cec677
Replace prune threshold variable
donn Dec 2, 2024
4d726a7
Address review feedback
donn Dec 3, 2024
b99b1cb
Merge remote-tracking branch 'origin/dev' into couple_openroad_goodies
donn Dec 16, 2024
67ae717
restore __PL_SKIP_IO
donn Dec 16, 2024
8109f33
Merge remote-tracking branch 'origin/dev' into couple_openroad_goodies
donn Dec 16, 2024
faac72d
steal- i mean squash pr 594 (expose more OpenROAD options)
kareefardi Dec 16, 2024
b808b78
use LEF classes in openroad i/o write
donn Dec 30, 2024
df14e8e
fix io.tcl, rename some variables for consistency [skip ci]
donn Jan 5, 2025
c79ab4d
Merge remote-tracking branch 'origin/dev' into couple_openroad_goodies
donn Jan 5, 2025
83414b1
Merge remote-tracking branch 'origin/dev' into couple_openroad_goodies
donn Jan 5, 2025
7dff357
update and format changelog, version
donn Jan 5, 2025
829dd21
add pads to logical classes, fix magic issue
donn Jan 9, 2025
0b91a08
version and changelog
donn Jan 9, 2025
6666189
fix obstructions and their tests
donn Jan 9, 2025
cd07013
include more cells in logical_classess for whitelist of sdf friendly
kareefardi Jan 12, 2025
169a99b
Merge branch 'dev' into couple_openroad_goodies
donn Jan 13, 2025
d1c08c9
Merge branch 'dev' into couple_openroad_goodies
donn Jan 13, 2025
d3211d7
fix version
donn Jan 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openlane/config/preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def evaluate(expression: str, symbols: Mapping[str, Any]) -> Decimal:
eval_stack.pop()
eval_stack.pop()

result = Decimal(0.0)
result = Decimal("0")
if token.value == "**":
result = number1**number2
elif token.value == "*":
Expand Down
2 changes: 1 addition & 1 deletion openlane/scripts/openroad/common/dpl.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ source $::env(SCRIPTS_DIR)/openroad/common/dpl_cell_pad.tcl

remove_fillers

detailed_placement\
log_cmd detailed_placement\
-max_displacement [subst { $::env(PL_MAX_DISPLACEMENT_X) $::env(PL_MAX_DISPLACEMENT_Y) }]

if { [info exists ::env(PL_OPTIMIZE_MIRRORING)] && $::env(PL_OPTIMIZE_MIRRORING) } {
Expand Down
6 changes: 3 additions & 3 deletions openlane/scripts/openroad/common/grt.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ lappend arg_list -verbose
if { $::env(GRT_ALLOW_CONGESTION) == 1 } {
lappend arg_list -allow_congestion
}
puts $arg_list
global_route {*}$arg_list

write_guide $::env(STEP_DIR)/after_grt.guide
log_cmd global_route {*}$arg_list

write_guide $::env(STEP_DIR)/after_grt.guide
62 changes: 62 additions & 0 deletions openlane/scripts/openroad/common/io.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -474,3 +474,65 @@ if { [namespace exists utl] } {
puts "%OL_METRIC $metric $value"
}
}

proc exit_unless_gui {{status 0}} {
if { ![info exists ::env(_OPENROAD_GUI)] || !$::env(_OPENROAD_GUI) } {
exit $status
}
}

proc find_unfixed_macros {} {
set macros [list]

foreach inst [$::block getInsts] {
set inst_master [$inst getMaster]

# BLOCK means MACRO cells
if { ![string match [$inst_master getType] "BLOCK"] } {
continue
}

if { [$inst isFixed] } {
continue
}

lappend macros $inst
}
return $macros
}

# Code below adapted from OpenROAD Flow Scripts under the following license:
#
# BSD 3-Clause License
#
# Copyright (c) 2018-2023, The Regents of the University of California
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:

# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# * Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
proc log_cmd {cmd args} {
puts "+ $cmd [join $args " "]"
$cmd {*}$args
}
4 changes: 2 additions & 2 deletions openlane/scripts/openroad/common/set_global_connections.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ proc set_global_connections {} {

if { $power_pin == "" || $ground_pin == "" } {
puts "PDN_MACRO_CONNECTIONS missing power and ground pin names"
exit -1
exit_unless_gui 1
}

set matched 0
Expand All @@ -57,7 +57,7 @@ proc set_global_connections {} {
}
if { $matched != 1 } {
puts "\[ERROR\] No match found for regular expression '$instance_name' defined in PDN_MACRO_CONNECTIONS."
exit 1
exit_unless_gui 1
}

add_global_connection \
Expand Down
2 changes: 1 addition & 1 deletion openlane/scripts/openroad/common/set_power_nets.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if { [info exists ::env(VDD_NETS)] || [info exists ::env(GND_NETS)] } {
# current assumption: they cannot have a common ground
if { ! [info exists ::env(VDD_NETS)] || ! [info exists ::env(GND_NETS)] } {
puts stderr "\[ERROR\] VDD_NETS and GND_NETS must *both* either be defined or undefined"
exit -1
exit_unless_gui 1
}
set ::env(VDD_NET) [lindex $::env(VDD_NETS) 0]
set ::env(GND_NET) [lindex $::env(GND_NETS) 0]
Expand Down
4 changes: 2 additions & 2 deletions openlane/scripts/openroad/cts.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ if { [info exists ::env(CTS_MAX_CAP)] } {
if { [info exists ::env(CTS_MAX_SLEW)] } {
lappend cts_characterization_args -max_slew [expr {$::env(CTS_MAX_SLEW) * 1e-9}]; # ns -> S
}
configure_cts_characterization {*}$cts_characterization_args
log_cmd configure_cts_characterization {*}$cts_characterization_args

puts "\[INFO\] Performing clock tree synthesis…"
puts "\[INFO\] Looking for the following net(s): $::env(CLOCK_NET)"
Expand All @@ -55,7 +55,7 @@ if { $::env(CTS_DISABLE_POST_PROCESSING) } {
lappend arg_list -post_cts_disable
}

clock_tree_synthesis {*}$arg_list
log_cmd clock_tree_synthesis {*}$arg_list

set_propagated_clock [all_clocks]

Expand Down
25 changes: 21 additions & 4 deletions openlane/scripts/openroad/cut_rows.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,27 @@
source $::env(SCRIPTS_DIR)/openroad/common/io.tcl
read_current_odb

cut_rows\
-endcap_master $::env(ENDCAP_CELL)\
-halo_width_x $::env(FP_MACRO_HORIZONTAL_HALO)\
-halo_width_y $::env(FP_MACRO_VERTICAL_HALO)
set arg_list [list]
lappend arg_list -endcap_master $::env(ENDCAP_CELL)
lappend arg_list -halo_width_x $::env(FP_MACRO_HORIZONTAL_HALO)
lappend arg_list -halo_width_y $::env(FP_MACRO_VERTICAL_HALO)
if { [info exists ::env(FP_PRUNE_THRESHOLD)] } {
lappend arg_list -row_min_width $::env(FP_PRUNE_THRESHOLD)
}
log_cmd cut_rows {*}$arg_list

# # verify -row_min_width worked
donn marked this conversation as resolved.
Show resolved Hide resolved
# if { [info exists ::env(FP_PRUNE_THRESHOLD)] } {
# foreach row [$::block getRows] {
# set bbox [$row getBBox]
# set width [expr ([$bbox xMax] - [$bbox xMin])]
# set width_um [expr $width / $::dbu]
# if { $width < $::env(FP_PRUNE_THRESHOLD) } {
# exit -1
# # odb::dbRow_destroy $row
# }
# }
# }

write_views

Expand Down
4 changes: 2 additions & 2 deletions openlane/scripts/openroad/drt.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ if { [info exists ::env(DRT_MAX_LAYER)] } {
set max_layer $::env(DRT_MAX_LAYER)
}

detailed_route\
log_cmd detailed_route\
-bottom_routing_layer $min_layer\
-top_routing_layer $max_layer\
-output_drc $::env(STEP_DIR)/$::env(DESIGN_NAME).drc\
-droute_end_iter $::env(DRT_OPT_ITERS)\
-or_seed 42\
-verbose 1

write_views
write_views
6 changes: 3 additions & 3 deletions openlane/scripts/openroad/floorplan.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ puts "\[INFO\] Using $::env(FP_SIZING) sizing for the floorplan."
if {$::env(FP_SIZING) == "absolute"} {
if { [llength $::env(DIE_AREA)] != 4 } {
puts stderr "Invalid die area string '$::env(DIE_AREA)'."
exit -1
exit_unless_gui 1
}
if { ! [info exists ::env(CORE_AREA)] } {
set die_ll_x [lindex $::env(DIE_AREA) 0]
Expand All @@ -70,7 +70,7 @@ if {$::env(FP_SIZING) == "absolute"} {
} else {
if { [llength $::env(CORE_AREA)] != 4 } {
puts stderr "Invalid core area string '$::env(CORE_AREA)'."
exit -1
exit_unless_gui 1
}
puts "\[INFO\] Using the set CORE_AREA; ignoring core margin parameters"
}
Expand All @@ -94,7 +94,7 @@ if { [info exists ::env(FP_OBSTRUCTIONS)] } {
}
}

initialize_floorplan {*}$arg_list
log_cmd initialize_floorplan {*}$arg_list

insert_tiecells $::env(SYNTH_TIELO_CELL) -prefix "TIE_ZERO_"
insert_tiecells $::env(SYNTH_TIEHI_CELL) -prefix "TIE_ONE_"
Expand Down
13 changes: 6 additions & 7 deletions openlane/scripts/openroad/gpl.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ foreach inst $::insts {
}

if { !$placement_needed } {
puts stderr "\[WARNING\] All instances are FIXED/FIRM."
puts stderr "\[WARNING\] No need to perform global placement."
puts stderr "\[WARNING\] Skipping…"
puts stderr "\[INFO\] All instances are FIXED/FIRM."
donn marked this conversation as resolved.
Show resolved Hide resolved
puts stderr "\[INFO\] No need to perform global placement."
puts stderr "\[INFO\] Skipping…"
write_views
exit 0
exit_unless_gui
}

set arg_list [list]
Expand All @@ -53,8 +53,7 @@ if { $::env(PL_SKIP_INITIAL_PLACEMENT) } {
lappend arg_list -skip_initial_place
}


if { [info exists ::env(__PL_SKIP_IO)] } {
if { $::env(STEP_ID) == "OpenROAD.GlobalPlacementSkipIO" } {
donn marked this conversation as resolved.
Show resolved Hide resolved
lappend arg_list -skip_io
}

Expand All @@ -72,7 +71,7 @@ lappend arg_list -pad_right $cell_pad_side
lappend arg_list -pad_left $cell_pad_side
lappend arg_list -init_wirelength_coef $::env(PL_WIRE_LENGTH_COEF)

global_placement {*}$arg_list
log_cmd global_placement {*}$arg_list


source $::env(SCRIPTS_DIR)/openroad/common/set_rc.tcl
Expand Down
4 changes: 2 additions & 2 deletions openlane/scripts/openroad/insert_buffer.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ if { [info exists ::env(INSERT_BUFFER_COMMAND) ]} {
read_current_odb

set arg_list [split $::env(INSERT_BUFFER_COMMAND) " "]
insert_buffer {*}$arg_list
log_cmd insert_buffer {*}$arg_list

write_views
}
}
3 changes: 1 addition & 2 deletions openlane/scripts/openroad/ioplacer.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ if { $::env(FP_PPL_MODE) == "annealing" } {
set HMETAL $::env(FP_IO_HLAYER)
set VMETAL $::env(FP_IO_VLAYER)

puts "\[INFO\] place_pins args: $arg_list"
place_pins {*}$arg_list \
log_cmd place_pins {*}$arg_list \
-random_seed 42 \
-hor_layers $HMETAL \
-ver_layers $VMETAL
Expand Down
6 changes: 3 additions & 3 deletions openlane/scripts/openroad/irdrop.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if { [info exists ::env(VSRC_LOC_FILES)] } {
lappend arg_list -net $net
lappend arg_list -voltage_file $::env(STEP_DIR)/net-$net.csv
lappend arg_list -vsrc $vsrc_file
analyze_power_grid {*}$arg_list
log_cmd analyze_power_grid {*}$arg_list
}
puts "%OL_END_REPORT"
} else {
Expand All @@ -38,14 +38,14 @@ if { [info exists ::env(VSRC_LOC_FILES)] } {
lappend arg_list -net $net
lappend arg_list -voltage_file $::env(STEP_DIR)/net-$net.csv
set_pdnsim_net_voltage -net $net -voltage $::env(LIB_VOLTAGE)
analyze_power_grid {*}$arg_list
log_cmd analyze_power_grid {*}$arg_list
}
foreach net "$::env(GND_NETS)" {
set arg_list [list]
lappend arg_list -net $net
lappend arg_list -voltage_file $::env(STEP_DIR)/net-$net.csv
set_pdnsim_net_voltage -net $net -voltage 0
analyze_power_grid {*}$arg_list
log_cmd analyze_power_grid {*}$arg_list
}
puts "%OL_END_REPORT"
}
39 changes: 20 additions & 19 deletions openlane/scripts/openroad/pdn.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,31 @@ read_pdn_cfg
set arg_list [list]
if { $::env(FP_PDN_SKIPTRIM) } {
lappend arg_list -skip_trim
puts "adding -skip_trim to pdngen"
}
# run PDNGEN
if {[catch {pdngen {*}$arg_list} errmsg]} {
if {[catch {log_cmd pdngen {*}$arg_list} errmsg]} {
puts stderr $errmsg
exit 1
}

write_views
report_design_area_metrics
exit_unless_gui 1
} else {
write_views
report_design_area_metrics

foreach {net} "$::env(VDD_NETS) $::env(GND_NETS)" {
set report_file $::env(STEP_DIR)/$net-grid-errors.rpt
foreach {net} "$::env(VDD_NETS) $::env(GND_NETS)" {
set report_file $::env(STEP_DIR)/$net-grid-errors.rpt

# For some reason, check_power_grid is… totally okay if no nodes are found
# at all. i.e. PDN generation has completely failed.
# This is a fallback file.
set f [open $report_file "w"]
puts $f "violation type: no nodes"
puts $f " srcs: "
puts $f " - N/A"
close $f
# For some reason, check_power_grid is… totally okay if no nodes are found
# at all. i.e. PDN generation has completely failed.
# This is a fallback file.
set f [open $report_file "w"]
puts $f "violation type: no nodes"
puts $f " srcs: "
puts $f " - N/A"
close $f

if { [catch {check_power_grid -net $net -error_file $report_file} err] } {
puts stderr "\[WARNING\] Grid check for $net failed: $err"
if { [catch {check_power_grid -net $net -error_file $report_file} err] } {
puts stderr "\[WARNING\] Grid check for $net failed: $err"
}
}

}

2 changes: 1 addition & 1 deletion openlane/scripts/openroad/rcx.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if { !$::env(RCX_MERGE_VIA_WIRE_RES) } {
# RCX
puts "Using RCX ruleset '$::env(RCX_RULESET)'…"
define_process_corner -ext_model_index 0 CURRENT_CORNER
extract_parasitics $rcx_flags\
log_cmd extract_parasitics $rcx_flags\
-ext_model_file $::env(RCX_RULESET)\
-lef_res
write_views
2 changes: 1 addition & 1 deletion openlane/scripts/openroad/repair_design.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if { $::env(DESIGN_REPAIR_BUFFER_OUTPUT_PORTS) } {
}

# Repair Design
repair_design -verbose \
log_cmd repair_design -verbose \
-max_wire_length $::env(DESIGN_REPAIR_MAX_WIRE_LENGTH) \
-slew_margin $::env(DESIGN_REPAIR_MAX_SLEW_PCT) \
-cap_margin $::env(DESIGN_REPAIR_MAX_CAP_PCT)
Expand Down
2 changes: 1 addition & 1 deletion openlane/scripts/openroad/repair_design_postgrt.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ source $::env(SCRIPTS_DIR)/openroad/common/grt.tcl
estimate_parasitics -global_routing

# Repair design
repair_design -verbose \
log_cmd repair_design -verbose \
-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)
Expand Down
4 changes: 2 additions & 2 deletions openlane/scripts/openroad/rsz_timing_postcts.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ lappend arg_list -max_buffer_percent $::env(PL_RESIZER_SETUP_MAX_BUFFER_PCT)
if { $::env(PL_RESIZER_GATE_CLONING) != 1 } {
lappend arg_list -skip_gate_cloning
}
repair_timing {*}$arg_list
log_cmd repair_timing {*}$arg_list

set arg_list [list]
lappend arg_list -verbose
Expand All @@ -48,7 +48,7 @@ lappend arg_list -max_buffer_percent $::env(PL_RESIZER_HOLD_MAX_BUFFER_PCT)
if { $::env(PL_RESIZER_ALLOW_SETUP_VIOS) == 1 } {
lappend arg_list -allow_setup_violations
}
repair_timing {*}$arg_list
log_cmd repair_timing {*}$arg_list

# Legalize
source $::env(SCRIPTS_DIR)/openroad/common/dpl.tcl
Expand Down
Loading
Loading