Skip to content

Commit f86870b

Browse files
committed
Pass the target utilitization to macro placement
Refactor the common code to set_place_density.tcl Signed-off-by: Matt Liberty <[email protected]>
1 parent e65cfc7 commit f86870b

File tree

4 files changed

+17
-24
lines changed

4 files changed

+17
-24
lines changed

flow/scripts/global_place.tcl

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,7 @@ if {[info exist env(FASTROUTE_TCL)]} {
1515
}
1616
}
1717

18-
# check the lower boundary of the PLACE_DENSITY and add PLACE_DENSITY_LB_ADDON if it exists
19-
if {[info exist ::env(PLACE_DENSITY_LB_ADDON)]} {
20-
set place_density_lb [gpl::get_global_placement_uniform_density \
21-
-pad_left $::env(CELL_PAD_IN_SITES_GLOBAL_PLACEMENT) \
22-
-pad_right $::env(CELL_PAD_IN_SITES_GLOBAL_PLACEMENT)]
23-
set place_density [expr $place_density_lb + ((1.0 - $place_density_lb) * $::env(PLACE_DENSITY_LB_ADDON)) + 0.01]
24-
if {$place_density > 1.0} {
25-
utl::error FLW 24 "Place density exceeds 1.0 (current PLACE_DENSITY_LB_ADDON = $::env(PLACE_DENSITY_LB_ADDON)). Please check if the value of PLACE_DENSITY_LB_ADDON is between 0 and 0.99."
26-
}
27-
} else {
28-
set place_density $::env(PLACE_DENSITY)
29-
}
18+
source $::env(SCRIPTS_DIR)/set_place_density.tcl
3019

3120
set global_placement_args {}
3221

flow/scripts/global_place_skip_io.tcl

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,7 @@ if {
2424
} {
2525
puts "Has top down IO Constraints. Skip global placement without IOs"
2626
} else {
27-
# check the lower boundary of the PLACE_DENSITY and add PLACE_DENSITY_LB_ADDON if it exists
28-
if {[info exist ::env(PLACE_DENSITY_LB_ADDON)]} {
29-
set place_density_lb [gpl::get_global_placement_uniform_density \
30-
-pad_left $::env(CELL_PAD_IN_SITES_GLOBAL_PLACEMENT) \
31-
-pad_right $::env(CELL_PAD_IN_SITES_GLOBAL_PLACEMENT)]
32-
set place_density [expr $place_density_lb + $::env(PLACE_DENSITY_LB_ADDON) + 0.01]
33-
if {$place_density > 1.0} {
34-
set place_density 1.0
35-
}
36-
} else {
37-
set place_density $::env(PLACE_DENSITY)
38-
}
27+
source $::env(SCRIPTS_DIR)/set_place_density.tcl
3928

4029
if { 0 != [llength [array get ::env GLOBAL_PLACEMENT_ARGS]] } {
4130
global_placement -skip_io -density $place_density \

flow/scripts/macro_place_util.tcl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ if {[find_macros] != ""} {
118118
append additional_rtlmp_args " -fence_uy $env(RTLMP_FENCE_UY)"
119119
}
120120

121+
source $::env(SCRIPTS_DIR)/set_place_density.tcl
122+
append additional_rtlmp_args " -target_util $place_density"
123+
121124
set all_args $additional_rtlmp_args
122125

123126
if { [info exists ::env(RTLMP_ARGS)] } {

flow/scripts/set_place_density.tcl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# check the lower boundary of the PLACE_DENSITY and add PLACE_DENSITY_LB_ADDON if it exists
2+
if {[info exist ::env(PLACE_DENSITY_LB_ADDON)]} {
3+
set place_density_lb [gpl::get_global_placement_uniform_density \
4+
-pad_left $::env(CELL_PAD_IN_SITES_GLOBAL_PLACEMENT) \
5+
-pad_right $::env(CELL_PAD_IN_SITES_GLOBAL_PLACEMENT)]
6+
set place_density [expr $place_density_lb + ((1.0 - $place_density_lb) * $::env(PLACE_DENSITY_LB_ADDON)) + 0.01]
7+
if {$place_density > 1.0} {
8+
utl::error FLW 24 "Place density exceeds 1.0 (current PLACE_DENSITY_LB_ADDON = $::env(PLACE_DENSITY_LB_ADDON)). Please check if the value of PLACE_DENSITY_LB_ADDON is between 0 and 0.99."
9+
}
10+
} else {
11+
set place_density $::env(PLACE_DENSITY)
12+
}

0 commit comments

Comments
 (0)