Skip to content

Commit 4fd6b4a

Browse files
committed
scripts: tclfmt --in-place scripts/
To reduce noise in future PRs Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 432a91a commit 4fd6b4a

36 files changed

Lines changed: 1539 additions & 1539 deletions

‎flow/scripts/add_routing_blk.tcl‎

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,33 @@ set allInsts [$block getInsts]
1717
set cnt 0
1818

1919
foreach inst $allInsts {
20-
set master [$inst getMaster]
21-
set name [$master getName]
22-
set loc_llx [lindex [$inst getLocation] 0]
23-
set loc_lly [lindex [$inst getLocation] 1]
24-
25-
if { [string match "*gf12*" $name] || [string match "IN12LP*" $name] } {
26-
set w [$master getWidth]
27-
set h [$master getHeight]
28-
29-
set llx_Mx [expr $loc_llx - (128*$numTrack)]
30-
set lly_Mx [expr $loc_lly - (128*$numTrack)]
31-
set urx_Mx [expr $loc_llx + $w + (128*$numTrack)]
32-
set ury_Mx [expr $loc_lly + $h + (128*$numTrack)]
33-
34-
set llx_Cx $loc_llx
35-
set lly_Cx [expr $loc_lly - (160*$numTrack)]
36-
set urx_Cx [expr $loc_llx + $w]
37-
set ury_Cx [expr $loc_lly + $h + (160*$numTrack)]
38-
39-
set obs_M2 [odb::dbObstruction_create $block $layer_M2 $llx_Mx $lly_Mx $urx_Mx $ury_Mx]
40-
set obs_M3 [odb::dbObstruction_create $block $layer_M3 $llx_Mx $lly_Mx $urx_Mx $ury_Mx]
41-
set obs_C4 [odb::dbObstruction_create $block $layer_C4 $llx_Cx $lly_Cx $urx_Cx $ury_Cx]
42-
43-
incr cnt
44-
}
20+
set master [$inst getMaster]
21+
set name [$master getName]
22+
set loc_llx [lindex [$inst getLocation] 0]
23+
set loc_lly [lindex [$inst getLocation] 1]
24+
25+
if {[string match "*gf12*" $name] || [string match "IN12LP*" $name]} {
26+
set w [$master getWidth]
27+
set h [$master getHeight]
28+
29+
set llx_Mx [expr $loc_llx - (128*$numTrack)]
30+
set lly_Mx [expr $loc_lly - (128*$numTrack)]
31+
set urx_Mx [expr $loc_llx + $w + (128*$numTrack)]
32+
set ury_Mx [expr $loc_lly + $h + (128*$numTrack)]
33+
34+
set llx_Cx $loc_llx
35+
set lly_Cx [expr $loc_lly - (160*$numTrack)]
36+
set urx_Cx [expr $loc_llx + $w]
37+
set ury_Cx [expr $loc_lly + $h + (160*$numTrack)]
38+
39+
set obs_M2 [odb::dbObstruction_create $block $layer_M2 $llx_Mx $lly_Mx $urx_Mx $ury_Mx]
40+
set obs_M3 [odb::dbObstruction_create $block $layer_M3 $llx_Mx $lly_Mx $urx_Mx $ury_Mx]
41+
set obs_C4 [odb::dbObstruction_create $block $layer_C4 $llx_Cx $lly_Cx $urx_Cx $ury_Cx]
42+
43+
incr cnt
44+
}
4545
}
4646

47-
if { $cnt != 0 } {
48-
puts "Created $cnt routing blockages over macros"
47+
if {$cnt != 0} {
48+
puts "Created $cnt routing blockages over macros"
4949
}

‎flow/scripts/cts.tcl‎

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ load_design 3_place.odb 3_place.sdc
77
# so cts does not try to buffer the inverted clocks.
88
repair_clock_inverters
99

10-
proc save_progress { stage } {
11-
puts "Run 'make gui_$stage.odb' to load progress snapshot"
12-
write_db $::env(RESULTS_DIR)/$stage.odb
13-
write_sdc -no_timestamp $::env(RESULTS_DIR)/$stage.sdc
10+
proc save_progress {stage} {
11+
puts "Run 'make gui_$stage.odb' to load progress snapshot"
12+
write_db $::env(RESULTS_DIR)/$stage.odb
13+
write_sdc -no_timestamp $::env(RESULTS_DIR)/$stage.sdc
1414
}
1515

1616
# Run CTS
1717
set cts_args [list \
18-
-sink_clustering_enable \
19-
-repair_clock_nets]
18+
-sink_clustering_enable \
19+
-repair_clock_nets]
2020

2121
append_env_var cts_args CTS_BUF_DISTANCE -distance_between_buffers 1
2222
append_env_var cts_args CTS_CLUSTER_SIZE -sink_clustering_size 1
@@ -25,8 +25,8 @@ append_env_var cts_args CTS_BUF_LIST -buf_list 1
2525
append_env_var cts_args CTS_LIB_NAME -library 1
2626

2727

28-
if { [env_var_exists_and_non_empty CTS_ARGS] } {
29-
set cts_args $::env(CTS_ARGS)
28+
if {[env_var_exists_and_non_empty CTS_ARGS]} {
29+
set cts_args $::env(CTS_ARGS)
3030
}
3131

3232
set_dont_use $::env(DONT_USE_CELLS)
@@ -35,45 +35,45 @@ log_cmd clock_tree_synthesis {*}$cts_args
3535

3636
utl::push_metrics_stage "cts__{}__pre_repair_timing"
3737
estimate_parasitics -placement
38-
if { $::env(DETAILED_METRICS) } {
39-
report_metrics 4 "cts pre-repair-timing"
38+
if {$::env(DETAILED_METRICS)} {
39+
report_metrics 4 "cts pre-repair-timing"
4040
}
4141
utl::pop_metrics_stage
4242

4343
set_placement_padding -global \
44-
-left $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) \
45-
-right $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT)
44+
-left $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) \
45+
-right $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT)
4646

47-
set result [catch { detailed_placement } msg]
48-
if { $result != 0 } {
49-
save_progress 4_1_error
50-
error "Detailed placement failed in CTS: $msg"
47+
set result [catch {detailed_placement} msg]
48+
if {$result != 0} {
49+
save_progress 4_1_error
50+
error "Detailed placement failed in CTS: $msg"
5151
}
5252

5353
estimate_parasitics -placement
5454

55-
if { $::env(CTS_SNAPSHOTS) } {
56-
save_progress 4_1_pre_repair_hold_setup
55+
if {$::env(CTS_SNAPSHOTS)} {
56+
save_progress 4_1_pre_repair_hold_setup
5757
}
5858

59-
if { !$::env(SKIP_CTS_REPAIR_TIMING) } {
60-
if { $::env(EQUIVALENCE_CHECK) } {
61-
write_eqy_verilog 4_before_rsz.v
62-
}
59+
if {!$::env(SKIP_CTS_REPAIR_TIMING)} {
60+
if {$::env(EQUIVALENCE_CHECK)} {
61+
write_eqy_verilog 4_before_rsz.v
62+
}
6363

64-
repair_timing_helper
64+
repair_timing_helper
6565

66-
if { $::env(EQUIVALENCE_CHECK) } {
67-
run_equivalence_test
68-
}
66+
if {$::env(EQUIVALENCE_CHECK)} {
67+
run_equivalence_test
68+
}
6969

70-
set result [catch { detailed_placement } msg]
71-
if { $result != 0 } {
72-
save_progress 4_1_error
73-
error "Detailed placement failed in CTS: $msg"
74-
}
70+
set result [catch {detailed_placement} msg]
71+
if {$result != 0} {
72+
save_progress 4_1_error
73+
error "Detailed placement failed in CTS: $msg"
74+
}
7575

76-
check_placement -verbose
76+
check_placement -verbose
7777
}
7878

7979
report_metrics 4 "cts final"

‎flow/scripts/deleteNonClkNets.tcl‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
read_lef $::env(TECH_LEF)
22
read_lef $::env(SC_LEF)
3-
if { [info exist ::env(ADDITIONAL_LEFS)] } {
4-
foreach lef $::env(ADDITIONAL_LEFS) {
5-
read_lef $lef
6-
}
3+
if {[info exist ::env(ADDITIONAL_LEFS)]} {
4+
foreach lef $::env(ADDITIONAL_LEFS) {
5+
read_lef $lef
6+
}
77
}
88

99
# Read liberty files
@@ -18,23 +18,23 @@ set insts [$block getInsts]
1818

1919
# Delete all non-clock nets
2020
foreach net $nets {
21-
set sigType [$net getSigType]
22-
set wire [$net getWire]
23-
if { "$sigType" eq "SIGNAL" && "$wire" ne "NULL" } {
24-
odb::dbWire_destroy $wire
25-
} elseif {
26-
"$sigType" eq "POWER" ||
27-
"$sigType" eq "GROUND"
28-
} {
29-
$net destroySWires
30-
}
21+
set sigType [$net getSigType]
22+
set wire [$net getWire]
23+
if {"$sigType" eq "SIGNAL" && "$wire" ne "NULL"} {
24+
odb::dbWire_destroy $wire
25+
} elseif {
26+
"$sigType" eq "POWER" ||
27+
"$sigType" eq "GROUND"
28+
} {
29+
$net destroySWires
30+
}
3131
}
3232

3333
# Delete fill cells to clean up screenshot
3434
foreach inst $insts {
35-
if { "[[$inst getMaster] getType]" eq "CORE_SPACER" } {
36-
odb::dbInst_destroy $inst
37-
}
35+
if {"[[$inst getMaster] getType]" eq "CORE_SPACER"} {
36+
odb::dbInst_destroy $inst
37+
}
3838
}
3939

4040
write_def $::env(RESULTS_DIR)/6_final_only_clk.def

‎flow/scripts/deletePowerNets.tcl‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
read_lef $::env(TECH_LEF)
22
read_lef $::env(SC_LEF)
3-
if { [info exist ::env(ADDITIONAL_LEFS)] } {
4-
foreach lef $::env(ADDITIONAL_LEFS) {
5-
read_lef $lef
6-
}
3+
if {[info exist ::env(ADDITIONAL_LEFS)]} {
4+
foreach lef $::env(ADDITIONAL_LEFS) {
5+
read_lef $lef
6+
}
77
}
88

99
# Read liberty files
@@ -12,13 +12,13 @@ source $::env(SCRIPTS_DIR)/read_liberty.tcl
1212
# Read def and sdc
1313
read_def $::env(RESULTS_DIR)/6_final.def
1414

15-
proc deleteNetByName { name } {
16-
set db [ord::get_db]
17-
set chip [$db getChip]
18-
set block [$chip getBlock]
19-
set net [$block findNet $name]
20-
$net destroySWires
21-
puts "Deleted net '[$net getName]'"
15+
proc deleteNetByName {name} {
16+
set db [ord::get_db]
17+
set chip [$db getChip]
18+
set block [$chip getBlock]
19+
set net [$block findNet $name]
20+
$net destroySWires
21+
puts "Deleted net '[$net getName]'"
2222
}
2323

2424
deleteNetByName VDD
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
proc deleteRoutingObstructions { } {
2-
set db [ord::get_db]
3-
set chip [$db getChip]
4-
set block [$chip getBlock]
5-
set obstructions [$block getObstructions]
1+
proc deleteRoutingObstructions {} {
2+
set db [ord::get_db]
3+
set chip [$db getChip]
4+
set block [$chip getBlock]
5+
set obstructions [$block getObstructions]
66

7-
foreach obstruction $obstructions {
8-
odb::dbObstruction_destroy $obstruction
9-
}
10-
puts "Deleted [llength $obstructions] routing obstructions"
7+
foreach obstruction $obstructions {
8+
odb::dbObstruction_destroy $obstruction
9+
}
10+
puts "Deleted [llength $obstructions] routing obstructions"
1111
}

‎flow/scripts/density_fill.tcl‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ source $::env(SCRIPTS_DIR)/load.tcl
22
erase_non_stage_variables final
33
load_design 5_route.odb 5_route.sdc
44

5-
if { $::env(USE_FILL) } {
6-
set_propagated_clock [all_clocks]
7-
density_fill -rules $::env(FILL_CONFIG)
8-
# The .v file is just for debugging purposes, not a result of
9-
# this stage.
10-
write_verilog $::env(RESULTS_DIR)/6_1_fill.v
11-
write_db $::env(RESULTS_DIR)/6_1_fill.odb
5+
if {$::env(USE_FILL)} {
6+
set_propagated_clock [all_clocks]
7+
density_fill -rules $::env(FILL_CONFIG)
8+
# The .v file is just for debugging purposes, not a result of
9+
# this stage.
10+
write_verilog $::env(RESULTS_DIR)/6_1_fill.v
11+
write_db $::env(RESULTS_DIR)/6_1_fill.odb
1212
} else {
13-
log_cmd exec cp $::env(RESULTS_DIR)/5_route.odb $::env(RESULTS_DIR)/6_1_fill.odb
14-
# There is no 5_route.v file to copy
13+
log_cmd exec cp $::env(RESULTS_DIR)/5_route.odb $::env(RESULTS_DIR)/6_1_fill.odb
14+
# There is no 5_route.v file to copy
1515
}

‎flow/scripts/detail_place.tcl‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@ load_design 3_4_place_resized.odb 2_floorplan.sdc
55

66
source $::env(PLATFORM_DIR)/setRC.tcl
77

8-
proc do_dpl { } {
9-
# Only for use with hybrid rows
10-
if { $::env(BALANCE_ROWS) } {
11-
balance_row_usage
12-
}
13-
14-
set_placement_padding -global \
15-
-left $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) \
16-
-right $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT)
17-
detailed_placement
18-
19-
if { $::env(ENABLE_DPO) } {
20-
if { [env_var_exists_and_non_empty DPO_MAX_DISPLACEMENT] } {
21-
improve_placement -max_displacement $::env(DPO_MAX_DISPLACEMENT)
22-
} else {
23-
improve_placement
8+
proc do_dpl {} {
9+
# Only for use with hybrid rows
10+
if {$::env(BALANCE_ROWS)} {
11+
balance_row_usage
2412
}
25-
}
26-
optimize_mirroring
2713

28-
utl::info FLW 12 "Placement violations [check_placement -verbose]."
14+
set_placement_padding -global \
15+
-left $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT) \
16+
-right $::env(CELL_PAD_IN_SITES_DETAIL_PLACEMENT)
17+
detailed_placement
18+
19+
if {$::env(ENABLE_DPO)} {
20+
if {[env_var_exists_and_non_empty DPO_MAX_DISPLACEMENT]} {
21+
improve_placement -max_displacement $::env(DPO_MAX_DISPLACEMENT)
22+
} else {
23+
improve_placement
24+
}
25+
}
26+
optimize_mirroring
27+
28+
utl::info FLW 12 "Placement violations [check_placement -verbose]."
2929

30-
estimate_parasitics -placement
30+
estimate_parasitics -placement
3131
}
3232

33-
set result [catch { do_dpl } errMsg]
34-
if { $result != 0 } {
35-
write_db $::env(RESULTS_DIR)/3_5_place_dp-failed.odb
36-
error $errMsg
33+
set result [catch {do_dpl} errMsg]
34+
if {$result != 0} {
35+
write_db $::env(RESULTS_DIR)/3_5_place_dp-failed.odb
36+
error $errMsg
3737
}
3838

3939
report_metrics 3 "detailed place" true false

0 commit comments

Comments
 (0)