Skip to content

Commit 9c9ce06

Browse files
committed
flow/util: fix non-line length issues
Signed-off-by: Jack Luar <[email protected]>
1 parent 298d78b commit 9c9ce06

File tree

5 files changed

+34
-28
lines changed

5 files changed

+34
-28
lines changed

flow/util/cell-veneer/lefdef.tcl

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ proc relative_rectangle { rect offset } {
1313
[expr [lindex $rect 3] - [lindex $offset 1]]]
1414
}
1515

16+
# tclint-disable-next-line command-args
1617
if [package vcompare 8.6 $tcl_version] {
1718
proc lmap {_var list body} {
1819
upvar 1 $_var var
@@ -26,11 +27,13 @@ namespace eval lef {
2627
variable lefOut stdout
2728
variable def_units 2000
2829

30+
# tclint-disable-next-line redefined-builtin
2931
proc open { file_name } {
3032
variable lefOut
3133
set lefOut [::open $file_name w]
3234
}
3335

36+
# tclint-disable-next-line redefined-builtin
3437
proc close { } {
3538
variable lefOut
3639
if { $lefOut != "stdout" } {
@@ -288,13 +291,13 @@ proc write_footer { } {
288291
# - shape
289292
# - ports: a list of lists of shapes that make up a physical connection
290293
# - layer
291-
# - rect
294+
# - rect
292295
# - mask?
293296
# - obstructions
294297
# - layer: a dictionaries with layer_name as the key
295-
# - rect
298+
# - rect
296299
# - mask?
297-
#
300+
#
298301
proc write { design } {
299302
set def_units [dict get $design units]
300303

@@ -449,11 +452,13 @@ variable def_units
449452
variable defOut stdout
450453
variable designs {}
451454

455+
# tclint-disable-next-line redefined-builtin
452456
proc open { file_name } {
453457
variable defOut
454458
set defOut [::open $file_name w]
455459
}
456460

461+
# tclint-disable-next-line redefined-builtin
457462
proc close { } {
458463
variable defOut
459464
if { $defOut != "stdout" } {
@@ -499,32 +504,32 @@ proc out { args } {
499504
# - shapes : list of rectangles (or polygons)
500505
# - (rect|polygon)
501506
# - physical_viarules: dict with the name of the viarule as the key
502-
# - rule
503-
# - cutsize
504-
# - layers
505-
# - cutspacing
506-
# - enclosure
507-
# - rowcol
507+
# - rule
508+
# - cutsize
509+
# - layers
510+
# - cutspacing
511+
# - enclosure
512+
# - rowcol
508513
# - components: dict with the instance name of the component as the key
509514
# - inst_name
510515
# - cell_name
511516
# - (fixed|placed)?
512517
# - orientation
513518
# - nets: dict with the name of the net as the key
514519
# - use: SIGNAL | POWER | GROUND
515-
# - connections: list of instance pin pairs
516-
# - routes: list of dictionaries
517-
# - layer
518-
# - points: list of points, where a point can be an XY location or the name of a VIA
520+
# - connections: list of instance pin pairs
521+
# - routes: list of dictionaries
522+
# - layer
523+
# - points: list of points, where a point can be an XY location or the name of a VIA
519524
# - special_nets: dict with the name of the net as the key
520-
# - use: SIGNAL | POWER | GROUND
521-
# - connections: list of instance pin pairs
522-
# - routes: list of dictioaries
523-
# - layer
524-
# - width
525-
# - shape
525+
# - use: SIGNAL | POWER | GROUND
526+
# - connections: list of instance pin pairs
527+
# - routes: list of dictioaries
528+
# - layer
529+
# - width
530+
# - shape
526531
# - points: list of points, where a point can be an XY location or the name of a VIA
527-
#
532+
#
528533

529534
proc shift_point { point x y } {
530535
return [list [expr [lindex $point 0] + $x] [expr [lindex $point 1] + $y]]
@@ -727,8 +732,8 @@ proc write { design } {
727732

728733
if { [dict exists $design rows] } {
729734
foreach idx [lsort -integer [dict keys $design rows]] {
730-
out -nonewline "ROW ROW_$idx [dict keys $design rows $idx site] [dict keys $design rows $idx start] [dict keys $design rows $idx height] [dict keys $design rows $idx orientation]"
731-
out " DO [dict keys $design rows $idx num_sites] BY 1 STEP [dict keys $design rows $idx site_width] 0 ;"
735+
out -nonewline "ROW ROW_$idx [dict get $design rows $idx site] [dict get $design rows $idx start] [dict get $design rows $idx height] [dict get $design rows $idx orientation]"
736+
out " DO [dict get $design rows $idx num_sites] BY 1 STEP [dict get $design rows $idx site_width] 0 ;"
732737
}
733738
}
734739

flow/util/cell-veneer/pkgIndex.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
# tclint-disable command-args
12
package ifneeded lefdef 1.0.0 [list source [file join $dir lefdef.tcl]]
23
package ifneeded wrapper 1.0.0 [list source [file join $dir wrap_stdcells.tcl]]

flow/util/cell-veneer/wrap_stdcells.tcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ proc move_m2_pins_to_edge { cell_name cell_data } {
193193
dict for {pin_name pin} [dict get $cell_data pins] {
194194
set wires {}
195195
foreach physical_pin $pin {
196-
if { [dict get $physical_pin to] >= [expr $cell_width / 2.0] } {
196+
if { [dict get $physical_pin to] >= ($cell_width / 2.0) } {
197197
if { [dict exists $cell_data blockages] } {
198198
if { [wrapper::clear_right $physical_pin [dict get $cell_data blockages]] } {
199199
set direction right
@@ -470,7 +470,7 @@ proc wrap_macro { cell_name } {
470470
# Need to check that the grid point we're trying to use is going to be accessible.
471471
# If it is not, then try the point 2 grid points higher
472472
if { [dict exists $grid_pins $grid_y] } {
473-
if { [dict exists [expr $grid_y + 2]] } {
473+
if { [dict exists $grid_pins [expr $grid_y + 2]] } {
474474
puts "Cell $cell_name"
475475
puts "Problem assigning pin grid - requested and upper grid points for $pin_name at $grid_y already allocated to [dict get $grid_pins $grid_y] and [dict get $grid_pins [expr $grid_y + 2]]"
476476
exit -1

flow/util/write_net_rc.tcl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ proc write_rc_csv { filename } {
4646
set is_routing([$layer getNumber]) $routing
4747
set is_routing([$layer getNumber]) $routing
4848
puts -nonewline $stream " [$layer getName]"
49-
if $routing {
49+
if { $routing } {
5050
puts -nonewline $stream "(routing)"
5151
} else {
5252
# insert via resistance information
@@ -75,15 +75,15 @@ proc write_rc_csv { filename } {
7575
puts -nonewline $stream "[format %.3e $wire_res1],[format %.3e $wire_cap1],[format %.3e $wire_res2],[format %.3e $wire_cap2],[format %.3e $wire_res3],[format %.3e $wire_cap3]"
7676
set db_net [sta::sta_to_db_net $net]
7777

78-
if $use_drt_data {
78+
if { $use_drt_data } {
7979
set layer_lengths [drt::route_layer_lengths [$db_net getWire]]
8080
} else {
8181
set layer_lengths [grt::route_layer_lengths $db_net]
8282
}
8383

8484
for { set layer 0 } { $layer < [$tech getLayerCount] } { incr layer } {
8585
set length [lindex $layer_lengths $layer]
86-
if $is_routing($layer) {
86+
if { $is_routing($layer) } {
8787
puts -nonewline $stream ",[ord::dbu_to_microns $length]"
8888
} else {
8989
puts -nonewline $stream ",$length"

tclint.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ exclude = [
55
"flow/logs",
66
"flow/designs",
77
"flow/platforms",
8-
"flow/util",
98
"flow/scripts/*.tcl",
109
"tools/OpenROAD",
1110
"tools/yosys",
11+
"tools/yosys-slang",
1212
]
1313

1414
ignore = [

0 commit comments

Comments
 (0)