Skip to content

Commit 92f1274

Browse files
authored
Non-fixed layer count for GLB RT adjustments (The-OpenROAD-Project#721)
* Non-fixed layer count for GLB RT adjustments Remember this kids, nothing is more permanent than a temporary solution. * GLB_RT_LX_ADJUSTMENT variables consolidated into GLB_RT_LAYER_ADJUSTMENTS, a comma-delimited set of values * GLB_RT_LX_ADJUSTMENT will continue to be accepted but display a deprecation warning, and will be removed in a later version of OpenLane. * GLB_RT_L1_ADJUSTMENT value from the PDK is now ignored. * Bashrc fix (Line wrap problem), or_issue fix
1 parent f77d85e commit 92f1274

7 files changed

Lines changed: 94 additions & 41 deletions

File tree

configuration/README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,7 @@ These variables are optional that can be specified in the design configuration f
158158
| `GLB_RT_MAXLAYER` | The number of highest layer to be used in routing. <br> (Default: `6`)|
159159
| `GLB_RT_CLOCK_MINLAYER` | The number of lowest layer to be used in routing the clock net. <br> (Default: `GLB_RT_MINLAYER`)|
160160
| `GLB_RT_CLOCK_MAXLAYER` | The number of highest layer to be used in routing the clock net. <br> (Default: `GLB_RT_MAXLAYER`)|
161-
| `GLB_RT_ADJUSTMENT` | Reduction in the routing capacity of the edges between the cells in the global routing graph. Values range from 0 to 1. <br> 1 = most reduction, 0 = least reduction <br> (Default: `0`)|
162-
| `GLB_RT_L1_ADJUSTMENT` | Reduction in the routing capacity of the edges between the cells in the global routing graph but specific to li1 layer in sky130A. Values range from 0 to 1 <br> (Default: `0.99`) |
163-
| `GLB_RT_L2_ADJUSTMENT` | Reduction in the routing capacity of the edges between the cells in the global routing graph but specific to met1 in sky130A. Values range from 0 to 1 <br> (Default: `0`) |
164-
| `GLB_RT_L3_ADJUSTMENT` | Reduction in the routing capacity of the edges between the cells in the global routing graph but specific to met2 in sky130A. Values range from 0 to 1 <br> (Default: `0`) |
165-
| `GLB_RT_L4_ADJUSTMENT` | Reduction in the routing capacity of the edges between the cells in the global routing graph but specific to met3 in sky130A. Values range from 0 to 1 <br> (Default: `0`) |
166-
| `GLB_RT_L5_ADJUSTMENT` | Reduction in the routing capacity of the edges between the cells in the global routing graph but specific to met4 in sky130A. Values range from 0 to 1 <br> (Default: `0`) |
167-
| `GLB_RT_L6_ADJUSTMENT` | Reduction in the routing capacity of the edges between the cells in the global routing graph but specific to met5 in sky130A. Values range from 0 to 1 <br> (Default: `0`) |
168-
| `GLB_RT_ALLOW_CONGESTION` | Allow congestion in the resultign guides. 0 = false, 1 = true <br> (Default: `0`) |
161+
| `GLB_RT_ALLOW_CONGESTION` | Allow congestion in the resultign guides. 0 = false, 1 = true <br> (Default: `0`)
169162
| `GLB_RT_OVERFLOW_ITERS` | The maximum number of iterations waiting for the overflow to reach the desired value. <br> (Default: `50`) |
170163
| `GLB_RT_ANT_ITERS` | The maximum number of iterations for global router repair_antenna. This option is only available in `DIODE_INSERTION_STRATEGY` = `3`. <br> (Default: `3`) |
171164
| `GLB_RT_ESTIMATE_PARASITICS` | Specifies whether or not to run STA after global routing using OpenROAD's estimate_parasitics -global_routing and generates reports under `logs/routing`. 1 = Enabled, 0 = Disabled. <br> (Default: `1`) |
@@ -181,7 +174,26 @@ These variables are optional that can be specified in the design configuration f
181174
| `GLB_RESIZER_HOLD_MAX_BUFFER_PERCENT` | Specifies a max number of buffers to insert to fix hold violations. This number is calculated as a percentage of the number of instances in the design. <br> (Default: `50`)|
182175
| `GLB_RESIZER_SETUP_MAX_BUFFER_PERCENT` | Specifies a max number of buffers to insert to fix setup violations. This number is calculated as a percentage of the number of instances in the design. <br> (Default: `50`)|
183176
| `GLB_RESIZER_ALLOW_SETUP_VIOS` | Allows setup violations when fixing hold. <br> (Default: `0`)|
184-
| `GLB_OPTIMIZE_MIRRORING` | Specifies whether or not to run an optimize_mirroring pass whenever detailed placement happens after Routing timing optimization. This pass will mirror the cells whenever possible to optimize the design. 1 = Enabled, 0 = Disabled. <br> (Default: `1`) |
177+
| `GLB_OPTIMIZE_MIRRORING` | Specifies whether or not to run an optimize_mirroring pass whenever detailed placement happens after Routing timing optimization. This pass will mirror the cells whenever possible to optimize the design. 1 = Enabled, 0 = Disabled. <br> (Default: `1`) |
178+
| `GLB_RT_ADJUSTMENT` | Reduction in the routing capacity of the edges between the cells in the global routing graph. Values range from 0 to 1. <br> 1 = most reduction, 0 = least reduction <br> (Default: `0`)|
179+
| `GLB_RT_LAYER_ADJUSTMENTS` | Layer-specific reductions in the routing capacity of the edges between the cells in the global routing graph, delimited by commas. Values range from 0 to 1. <br> (Default: `0.99,0,0,0,0,0`)
180+
181+
#### Deprecated Layer Adjustment Variables
182+
These variables worked initially, but they were too sky130 specific to be scalable. Currently, if they exist, they'll be concatenated into GLB_RT_LAYER_ADJUSTMENTS, but it's recommended to update your configuration to use `GLB_RT_LAYER_ADJUSTMENTS`.
183+
184+
| Variable | Description |
185+
|---------------|---------------------------------------------------------------|
186+
| `GLB_RT_L1_ADJUSTMENT` | **Deprecated**: Reduction in the routing capacity of the edges between the cells in the global routing graph but specific to li1 layer in sky130A. Values range from 0 to 1 <br> (Default: `0.99`) |
187+
| `GLB_RT_L2_ADJUSTMENT` | **Deprecated**: Reduction in the routing capacity of the edges between the cells in the global routing graph but specific to met1 in sky130A. Values range from 0 to 1 <br> (Default: `0`) |
188+
| `GLB_RT_L3_ADJUSTMENT` | **Deprecated**: Reduction in the routing capacity of the edges between the cells in the global routing graph but specific to met2 in sky130A. Values range from 0 to 1 <br> (Default: `0`) |
189+
| `GLB_RT_L4_ADJUSTMENT` | **Deprecated**: Reduction in the routing capacity of the edges between the cells in the global routing graph but specific to met3 in sky130A. Values range from 0 to 1 <br> (Default: `0`) |
190+
| `GLB_RT_L5_ADJUSTMENT` | **Deprecated**: Reduction in the routing capacity of the edges between the cells in the global routing graph but specific to met4 in sky130A. Values range from 0 to 1 <br> (Default: `0`) |
191+
| `GLB_RT_L6_ADJUSTMENT` | **Deprecated**: Reduction in the routing capacity of the edges between the cells in the global routing graph but specific to met5 in sky130A. Values range from 0 to 1 <br> (Default: `0`) |
192+
193+
#### Removed
194+
195+
| Variable | Description |
196+
|---------------|---------------------------------------------------------------|
185197
| `GLB_RT_UNIDIRECTIONAL` | **Removed**: Allow unidirectional routing. 0 = false, 1 = true <br> (Default: `1`) |
186198
| `GLB_RT_TILES` | **Removed**: The size of the GCELL used by Fastroute during global routing. <br> (Default: `15`) |
187199

configuration/routing.tcl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,8 @@ if {! [info exists ::env(ROUTING_CORES)] } {
1717
set ::env(ROUTING_CORES) 2
1818
}
1919
set ::env(GLB_RT_ADJUSTMENT) 0.0
20-
set ::env(GLB_RT_L1_ADJUSTMENT) 0; # more like pdk-specific (e.g., when L1 = li)
21-
set ::env(GLB_RT_L2_ADJUSTMENT) 0
22-
set ::env(GLB_RT_L3_ADJUSTMENT) 0
23-
set ::env(GLB_RT_L4_ADJUSTMENT) 0
24-
set ::env(GLB_RT_L5_ADJUSTMENT) 0
25-
set ::env(GLB_RT_L6_ADJUSTMENT) 0; # We go up to 6 here because the lowest met layer we've dealt with was met5, starting from li1. This might need to be adjusted.
20+
set ::env(GLB_RT_LAYER_ADJUSTMENTS) 0.99,0,0,0,0,0
21+
2622
set ::env(GLB_RT_ALLOW_CONGESTION) 0
2723
set ::env(GLB_RT_OVERFLOW_ITERS) 50
2824
set ::env(GLB_RT_MINLAYER) 1

docker/tar/.bashrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ alias ll='ls -lAGFh';
88

99
export OL_GIT_VERSION=$(cat /git_version);
1010

11-
export PS1="\033[1;31mOpenLane Container ($OL_GIT_VERSION)\033[0m:\033[4;30m\w\033[0m$ ";
11+
export PS1="\[\033[1;31m\]OpenLane Container ($OL_GIT_VERSION)\[\033[0m\]:\[\033[4;30m\]\w\[\033[0m\]$ ";

docs/source/PDK_STRUCTURE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ This section defines the neccessary variables for PDK configuration file
4848
| `GPIO_PADS_LEF` | A list of the pads lef views. For example:`[glob "$::env(PDK_ROOT)/sky130A/libs.ref/sky130_fd_io/lef/sky130_fd_io.lef"]` |
4949
| `NETGEN_SETUP_FILE` | Points to the setup file for netgen(lvs), that can exclude certain cells etc.. |
5050
| `FP_TAPCELL_DIST` | The distance between tapcell columns. Used in floorplanning in tapcell insertion. |
51-
| `GLB_RT_L1_ADJUSTMENT` | Reduction in the routing capacity of the edges between the cells in the global routing graph but specific to li1 layer in sky130A. Values range from 0 to 1 <br> (Default: `0`) |
5251
| `DEFAULT_MAX_TRAN` | Defines the default maximum transition value, used in CTS & synthesis. |
5352
| `FP_PDN_RAIL_OFFSET` | Defines the rail offset for met1 used in PDN. <br> Default: `0`. |
5453
| `FP_PDN_VWIDTH` | Defines the strap width for the vertical layer used in PDN. <br> Default: `1.6`. |

scripts/openroad/layer_adjustments.tcl

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,53 @@
1414

1515
set_global_routing_layer_adjustment * $::env(GLB_RT_ADJUSTMENT)
1616

17-
set_global_routing_layer_adjustment [lindex $::env(TECH_METAL_LAYERS) 0] $::env(GLB_RT_L1_ADJUSTMENT)
18-
set_global_routing_layer_adjustment [lindex $::env(TECH_METAL_LAYERS) 1] $::env(GLB_RT_L2_ADJUSTMENT)
19-
set_global_routing_layer_adjustment [lindex $::env(TECH_METAL_LAYERS) 2] $::env(GLB_RT_L3_ADJUSTMENT)
20-
21-
if { $::env(GLB_RT_MAXLAYER) > 3 } {
22-
set_global_routing_layer_adjustment [lindex $::env(TECH_METAL_LAYERS) 3] $::env(GLB_RT_L4_ADJUSTMENT)
23-
if { $::env(GLB_RT_MAXLAYER) > 4 } {
24-
set_global_routing_layer_adjustment [lindex $::env(TECH_METAL_LAYERS) 4] $::env(GLB_RT_L5_ADJUSTMENT)
25-
if { $::env(GLB_RT_MAXLAYER) > 5 } {
26-
set_global_routing_layer_adjustment [lindex $::env(TECH_METAL_LAYERS) 5] $::env(GLB_RT_L6_ADJUSTMENT)
27-
}
28-
}
17+
# Legacy format for layer adjustments: Convert to new format
18+
set array [split $::env(GLB_RT_LAYER_ADJUSTMENTS) ","]
19+
20+
set conversion_flag 0
21+
22+
set l1_adj [lindex $array 0]
23+
if { [info exists ::env(GLB_RT_L1_ADJUSTMENT)] } {
24+
set conversion_flag 1
25+
set l1_adj $::env(GLB_RT_L1_ADJUSTMENT)
26+
}
27+
set l2_adj [lindex $array 1]
28+
if { [info exists ::env(GLB_RT_L2_ADJUSTMENT)] } {
29+
set conversion_flag 1
30+
set l2_adj $::env(GLB_RT_L2_ADJUSTMENT)
31+
}
32+
set l3_adj [lindex $array 2]
33+
if { [info exists ::env(GLB_RT_L3_ADJUSTMENT)] } {
34+
set conversion_flag 1
35+
set l3_adj $::env(GLB_RT_L3_ADJUSTMENT)
36+
}
37+
set l4_adj [lindex $array 3]
38+
if { [info exists ::env(GLB_RT_L4_ADJUSTMENT)] } {
39+
set conversion_flag 1
40+
set l4_adj $::env(GLB_RT_L4_ADJUSTMENT)
41+
}
42+
set l5_adj [lindex $array 4]
43+
if { [info exists ::env(GLB_RT_L5_ADJUSTMENT)] } {
44+
set conversion_flag 1
45+
set l5_adj $::env(GLB_RT_L5_ADJUSTMENT)
46+
}
47+
set l6_adj [lindex $array 5]
48+
if { [info exists ::env(GLB_RT_L6_ADJUSTMENT)] } {
49+
set conversion_flag 1
50+
set l6_adj $::env(GLB_RT_L6_ADJUSTMENT)
51+
}
52+
53+
if { $conversion_flag } {
54+
set ::env(GLB_RT_LAYER_ADJUSTMENTS) "$l1_adj,$l2_adj,$l3_adj,$l4_adj,$l5_adj,$l6_adj"
55+
56+
puts stderr "\[DEPRECATION WARNING] A GLB_RT_LX_ADJUSTMENT variable is still used by your design and will be removed in a future version of OpenLane. We recommend you update to GLB_RT_LAYER_ADJUSTMENTS. Check configuration/README.md for more info."
57+
58+
puts stderr "Recommended replacement:\nset ::env(GLB_RT_LAYER_ADJUSTMENTS) $::env(GLB_RT_LAYER_ADJUSTMENTS)"
59+
}
60+
61+
set i 0
62+
foreach adjustment $array {
63+
set layer_name [lindex $::env(TECH_METAL_LAYERS) $i]
64+
set_global_routing_layer_adjustment $layer_name $adjustment
65+
incr i
2966
}

scripts/or_issue.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -184,21 +184,24 @@ def get_or_script():
184184
env_keys_used.add(env_key)
185185
env[env_key] = current
186186

187-
script = open(current).read()
187+
try:
188+
script = open(current).read()
188189

189-
for key, value in env.items():
190-
key_accessor = re.compile(rf"((\$::env\({re.escape(key)}\))([/\-\w\.]*))")
191-
for use in key_accessor.findall(script):
192-
use: List[str]
193-
full, accessor, extra = use
194-
env_keys_used.add(key)
190+
for key, value in env.items():
191+
key_accessor = re.compile(rf"((\$::env\({re.escape(key)}\))([/\-\w\.]*))")
192+
for use in key_accessor.findall(script):
193+
use: List[str]
194+
full, accessor, extra = use
195+
env_keys_used.add(key)
195196

196-
value_substituted = full.replace(accessor, value)
197+
value_substituted = full.replace(accessor, value)
197198

198-
if value_substituted.endswith(".tcl") or value_substituted.endswith(".sdc"):
199-
if value_substituted not in tcls:
200-
tcls.add(value_substituted)
201-
tcls_to_process.append(value_substituted)
199+
if value_substituted.endswith(".tcl") or value_substituted.endswith(".sdc"):
200+
if value_substituted not in tcls:
201+
tcls.add(value_substituted)
202+
tcls_to_process.append(value_substituted)
203+
except:
204+
print(f"⚠ {current} was not found, might be a product. Skipping", file=sys.stderr)
202205

203206
current = shift(tcls_to_process)
204207

scripts/tcl_commands/all.tcl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ proc prep {args} {
367367
set pdk_config $::env(PDK_ROOT)/$::env(PDK)/libs.tech/openlane/config.tcl
368368
set scl_config $::env(PDK_ROOT)/$::env(PDK)/libs.tech/openlane/$::env(STD_CELL_LIBRARY)/config.tcl
369369
source $pdk_config
370+
371+
# Value set by PDK for some reason
372+
if { [info exists ::env(GLB_RT_L1_ADJUSTMENT) ] } {
373+
unset ::env(GLB_RT_L1_ADJUSTMENT)
374+
}
375+
370376
source $scl_config
371377

372378
# needs to be resourced to make sure it overrides the above

0 commit comments

Comments
 (0)