Skip to content

Commit

Permalink
Merge pull request The-OpenROAD-Project#6069 from titan73/fp_args
Browse files Browse the repository at this point in the history
ifp: Issue an error if -site is not specified and update documention.
  • Loading branch information
maliberty authored Nov 4, 2024
2 parents 8ee1cee + 9f1bf21 commit a15114a
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/grt/test/no_tracks.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ read_lib Nangate45/Nangate45_typ.lib
read_verilog ../../../test/gcd_nangate45.v
link_design gcd

initialize_floorplan -site FreePDK45_38x28_10R_NP_162NW_34O -utilization 30
initialize_floorplan -site FreePDK45_38x28_10R_NP_162NW_34O -utilization 30 -core_space 0.0

catch {set_routing_layers -signal metal2-metal10} error
puts $error
18 changes: 7 additions & 11 deletions src/ifp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,26 @@ die = ( 0, 0 )

```tcl
initialize_floorplan
(-die_area {llx lly urx ury} -core_area {llx lly urx ury}) | (-utilization util -core_space (space | {bottom top left right}) [-aspect_ratio ratio])
-site site_name
[-additional_sites site_names]
[-aspect_ratio ratio]
[-core_area {llx lly urx ury}]
[-core_space space | {bottom top left right}]
[-die_area {llx lly urx ury}]
[-flip_sites site_names]
[-row_parity NONE|EVEN|ODD]
[-site site_name]
[-utilization util]
```

#### Options

| Switch Name | Description |
| ----- | ----- |
| `-core_area` | Core area coordinates in microns (lower left x/y and upper right x/y coordinates). |
| `-core_space` | Space around the core in microns. Allowed values are either one value for all margins or a set of four values, one for each margin. The order of the four values are: `{bottom top left right}`. |
| `-die_area` | Die area coordinates in microns (lower left x/y and upper right x/y coordinates). |
| `-site` | Site name. |
| `-utilization` | Percentage utilization. Allowed values are `double` in the range `(0-100]`. |
| `[-additional_sites]` | Tcl list of sites to make rows for (e.g. `{SITEXX, SITEYY}`) |
| `[-aspect_ratio]` | Ratio $\frac{height}{width}$. The default value is `1.0` and the allowed values are floats `[0, 1.0]`. |
| `[-core_area]` | Core area coordinates in microns (lower left x/y and upper right x/y coordinates). |
| `[-core_space]` | Space around the core, default `0.0` microns. Allowed values are either one value for all margins or a set of four values, one for each margin. The order of the four values are: `{bottom top left right}`. |
| `[-die_area]` | Die area coordinates in microns (lower left x/y and upper right x/y coordinates). |
| `[-flip_sites]` | Flip the orientations of rows matching these sites. Sites listed under this option will create `FS`-oriented rows at even indices and `N`-oriented rows at odd ones, and vice versa for sites not listed under this option. (e.g. `{SITEXX, SITEYY}`) |
| `[-row_parity]` | Snap to either an odd (`ODD`) or even (`EVEN`) number of rows. Defaults to `NONE` (no constraint on parity). |
| `[-site]` | Site name. |
| `[-utilization]` | Percentage utilization. Allowed values are `double` in the range `(0-100]`. |

### Make Tracks

Expand Down
22 changes: 17 additions & 5 deletions src/ifp/src/InitFloorplan.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ proc initialize_floorplan { args } {
if { [info exists keys(-site)] } {
set site [ifp::find_site $keys(-site)]
} else {
utl::warn IFP 11 "use -site to add placement rows."
utl::error IFP 11 "use -site to add placement rows."
}

set additional_sites {}
Expand Down Expand Up @@ -83,6 +83,12 @@ proc initialize_floorplan { args } {
sta::check_argc_eq0 "initialize_floorplan" $args
if { [info exists keys(-utilization)] } {
set util $keys(-utilization)
if { [info exists keys(-die_area)] } {
utl::error IFP 14 "-die_area cannot be used with -utilization."
}
if { [info exists keys(-core_area)] } {
utl::error IFP 20 "-core_area cannot be used with -utilization."
}
if { [info exists keys(-core_space)] } {
set core_sp $keys(-core_space)
if { [llength $core_sp] == 1 } {
Expand All @@ -101,10 +107,7 @@ proc initialize_floorplan { args } {
utl::error IFP 13 "-core_space is either a list of 4 margins or one value for all margins."
}
} else {
set core_sp_bottom 0.0
set core_sp_top 0.0
set core_sp_left 0.0
set core_sp_right 0.0
utl::error IFP 34 "no -core_space specified."
}
if { [info exists keys(-aspect_ratio)] } {
set aspect_ratio $keys(-aspect_ratio)
Expand All @@ -122,6 +125,15 @@ proc initialize_floorplan { args } {
$row_parity \
$flipped_sites
} elseif { [info exists keys(-die_area)] } {
if { [info exists keys(-utilization)] } {
utl::error IFP 23 "-utilization cannot be used with -die_area."
}
if { [info exists keys(-core_space)] } {
utl::error IFP 24 "-core_space cannot be used with -die_area."
}
if { [info exists keys(-aspect_ratio)] } {
utl::error IFP 33 "-aspect_ratio cannot be used with -die_area."
}
set die_area $keys(-die_area)
if { [llength $die_area] != 4 } {
utl::error IFP 15 "-die_area is a list of 4 coordinates."
Expand Down
2 changes: 1 addition & 1 deletion src/ifp/test/multi_height1.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ read_lef Nangate45/Nangate45.lef
read_lef Nangate45/fake_macros.lef
read_verilog multi_height1.v
link_design top
initialize_floorplan -utilization 30 -aspect_ratio 0.5 \
initialize_floorplan -utilization 30 -core_space 0.0 -aspect_ratio 0.5 \
-site FreePDK45_38x28_10R_NP_162NW_34O

set def_file [make_result_file multi_height1.def]
Expand Down
2 changes: 1 addition & 1 deletion src/ifp/test/multi_height2.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ read_lef Nangate45/Nangate45.lef
read_lef Nangate45/fake_macros.lef
read_verilog multi_height2.v
link_design top
initialize_floorplan -utilization 15 -aspect_ratio 0.5 -site "FreePDK45_38x28_10R_NP_162NW_34O" -additional_sites "DoubleHeightSite"
initialize_floorplan -utilization 15 -core_space 0.0 -aspect_ratio 0.5 -site "FreePDK45_38x28_10R_NP_162NW_34O" -additional_sites "DoubleHeightSite"

set def_file [make_result_file multi_height2.def]
write_def $def_file
Expand Down
2 changes: 1 addition & 1 deletion src/pdn/test/power_switch_upf_daisy.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ map_power_switch PS_1 \
-lib_cells POWER_SWITCH \
-port_map {{vout VPWR} {vin VDDG} {sleep SLEEP} {acknowledge SLEEP_OUT} {ground VGND}}

initialize_floorplan -utilization 10 -site unithd -additional_site unithddbl
initialize_floorplan -utilization 10 -core_space 0.0 -site unithd -additional_site unithddbl
tapcell \
-distance 14 \
-tapcell_master "sky130_fd_sc_hd__tapvpwrvgnd_1"
Expand Down
2 changes: 1 addition & 1 deletion src/pdn/test/power_switch_upf_error.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ link_design gcd
create_power_domain PD_TOP \
-elements {.}

initialize_floorplan -utilization 10 -site unithd -additional_site unithddbl
initialize_floorplan -utilization 10 -core_space 0.0 -site unithd -additional_site unithddbl
tapcell \
-distance 14 \
-tapcell_master "sky130_fd_sc_hd__tapvpwrvgnd_1"
Expand Down
2 changes: 1 addition & 1 deletion src/pdn/test/power_switch_upf_regions.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ map_power_switch PS_1 \
-lib_cells POWER_SWITCH \
-port_map {{vout VPWR} {vin VDDG} {sleep SLEEP} {acknowledge SLEEP_OUT} {ground VGND}}

initialize_floorplan -utilization 10 -site unithd -additional_site unithddbl
initialize_floorplan -utilization 10 -core_space 0.0 -site unithd -additional_site unithddbl
tapcell \
-distance 14 \
-tapcell_master "sky130_fd_sc_hd__tapvpwrvgnd_1"
Expand Down
2 changes: 1 addition & 1 deletion src/pdn/test/power_switch_upf_star.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ map_power_switch PS_1 \
-lib_cells POWER_SWITCH \
-port_map {{vout VPWR} {vin VDDG} {sleep SLEEP} {acknowledge SLEEP_OUT} {ground VGND}}

initialize_floorplan -utilization 10 -site unithd -additional_site unithddbl
initialize_floorplan -utilization 10 -core_space 0.0 -site unithd -additional_site unithddbl
tapcell \
-distance 14 \
-tapcell_master "sky130_fd_sc_hd__tapvpwrvgnd_1"
Expand Down
2 changes: 1 addition & 1 deletion src/ppl/test/no_tracks.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ read_verilog ../../../test/gcd_nangate45.v
link_design gcd

initialize_floorplan -site FreePDK45_38x28_10R_NP_162NW_34O \
-utilization 30
-utilization 30 -core_space 0.0

catch {place_pins -random -hor_layers metal3 -ver_layers metal2} error
puts $error
2 changes: 1 addition & 1 deletion src/rcx/test/names.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ read_liberty $liberty_file
read_verilog names.v
link_design top

initialize_floorplan -site $site -utilization 10
initialize_floorplan -site $site -utilization 10 -core_space 0.0

source $tracks_file

Expand Down

0 comments on commit a15114a

Please sign in to comment.