blob: 4ce3aa9a2e2829048dbf7e1d4103ea47a31c014a [file] [log] [blame]
Jeff DiCorpo5dfffea2021-02-15 18:09:12 -08001#----------------------------------------------------------------------
2# Assumes running magic -T micross using the micross technology file
3# from the open_pdks installation of sky130A
4#----------------------------------------------------------------------
5# bump bond pitch is 500um. Bump diameter is set by the technology
6
7namespace path {::tcl::mathop ::tcl::mathfunc}
8
9if {[catch {set PDKPATH $env(PDKPATH)}]} {
10 set PDKPATH "$::env(PDK_ROOT)/sky130A"
11}
12
13source $PDKPATH/libs.tech/magic/current/bump_bond_generator/bump_bond.tcl
14
15# Caravel dimensions, in microns
16set chipwidth 3588
17set chipheight 5188
18
19set halfwidth [/ $chipwidth 2]
20set halfheight [/ $chipheight 2]
21
22set columns 6
23set rows 10
24
25set bump_pitch 500
26
27set llx [- $halfwidth [* [- [/ $columns 2] 0.5] $bump_pitch]]
28set lly [- $halfheight [* [- [/ $rows 2] 0.5] $bump_pitch]]
29
30# Create a new cell
31load caravel_bump_bond -quiet
32
33# Build the bump cells
34make_bump_bond 0
35make_bump_bond 45
36
37# View the whole chip during generation. This is not strictly
38# necessary, but looks nice!
39snap internal
40box values 0 0 ${chipwidth}um ${chipheight}um
41paint glass
42view
43erase glass
44box values 0 0 0 0
45grid 250um 250um 45um 95um
46
47# Starting from the bottom left-hand corner and scanning across and up,
48# these are the orientations of the bump bond pad tapers:
49set tapers {}
50lappend tapers 180 225 270 270 270 270
51lappend tapers 180 135 225 270 0 0
52lappend tapers 180 135 135 270 315 0
53lappend tapers 180 135 135 315 315 0
54lappend tapers 135 135 0 180 315 0
55lappend tapers 180 135 0 180 315 0
56lappend tapers 180 135 180 315 315 0
57lappend tapers 180 180 135 45 315 0
58lappend tapers 135 135 135 45 45 45
59lappend tapers 90 90 90 90 45 90
60
61box values 0 0 0 0
62set t 0
63for {set y 0} {$y < $rows} {incr y} {
64 for {set x 0} {$x < $columns} {incr x} {
65 set xpos [+ $llx [* $x $bump_pitch]]
66 set ypos [+ $lly [* $y $bump_pitch]]
67 draw_bump_bond $xpos $ypos [lindex $tapers $t]
68 incr t
69 }
70}
71
72# The pad at E6 has wires exiting two sides, so put another pad down
73# at the other orientation.
74set y 4
75set x 4
76set xpos [+ $llx [* $x $bump_pitch]]
77set ypos [+ $lly [* $y $bump_pitch]]
78draw_bump_bond $xpos $ypos 180
79
80select top cell
81expand
82
83# These are the pad Y positions on the left side from bottom to top
84
85set leftpads {}
86lappend leftpads 377.5 588.5 950.5 1166.5 1382.5 1598.5 1814.5
87lappend leftpads 2030.5 2241.5 2452.5 2668.5 2884.5 3100.5
88lappend leftpads 3316.5 3532.5 3748.5 3964.5 4175.5 4386.5 4597.5 4813.5
89
90# These are the pad X positions on the top side from left to right
91
92set toppads {}
93lappend toppads 423.5 680.5 937.5 1194.5 1452.5 1704.5 1961.5 2406.5
94lappend toppads 2663.5 2915.5 3172.5
95
96# These are the pad Y positions on the right side from bottom to top
97
98set rightpads {}
99lappend rightpads 537.5 763.5 988.5 1214.5 1439.5 1664.5 1890.5
100lappend rightpads 2115.5 2336.5 2556.5 2776.5 3002.5 3227.5 3453.5
101lappend rightpads 3678.5 3903.5 4129.5 4349.5 4575.5 4795.5
102
103# These are the pad X positions on the bottom side from left to right
104
105set bottompads {}
106lappend bottompads 431.5 700.5 969.5 1243.5 1512.5 1786.5 2060.5
107lappend bottompads 2334.5 2608.5 2882.5 3151.5
108
109set leftpadx 64.6
110set rightpadx 3523.78
111set bottompady 64.6
112set toppady 5123.78
113
114set xpos $leftpadx
115for {set y 0} {$y < [llength $leftpads]} {incr y} {
116 set ypos [lindex $leftpads $y]
117 draw_pad_bond $xpos $ypos
118}
119
120set ypos $toppady
121for {set x 0} {$x < [llength $toppads]} {incr x} {
122 set xpos [lindex $toppads $x]
123 draw_pad_bond $xpos $ypos
124}
125
126set xpos $rightpadx
127for {set y 0} {$y < [llength $rightpads]} {incr y} {
128 set ypos [lindex $rightpads $y]
129 draw_pad_bond $xpos $ypos
130}
131
132set ypos $bottompady
133for {set x 0} {$x < [llength $bottompads]} {incr x} {
134 set xpos [lindex $bottompads $x]
135 draw_pad_bond $xpos $ypos
136}
137
138# Now route between the wirebond pads and the bump bond pads
139# routes start centered on the wirebond pad and align to grid points
140# on a 1/2 ball pitch, although positions do not need to be on
141# integer values. The overlaid grid starts 1/2 pitch to the left
142# and below the center of the bottom left bump bond. Grid columns
143# are numbered 0 to 12, and grid rows are numbered 0 to 20. To
144# convert to a micron unit coordinate, use the to_grid procedure
145# defined below.
146
147set gridllx [- $llx 250.0]
148set gridlly [- $lly 250.0]
149set gridpitchx 250.0
150set gridpitchy 250.0
151
152proc to_grid {x y} {
153 global gridllx gridlly
154 set coords []
155 catch {lappend coords [+ $gridllx [* 250.0 $x]]}
156 catch {lappend coords [+ $gridlly [* 250.0 $y]]}
157 return $coords
158}
159
160# Detailed routing, scanning left to right and from bottom to top.
161# (This really needs to be automated. . .)
162
163set wire_width 40.0
164
165# A10 vccd
166set coords [list $leftpadx [lindex $leftpads 0]]
167lappend coords {*}[to_grid -0.8 1]
168lappend coords {*}[to_grid 1 1]
169draw_pad_route $coords $wire_width
170
171# B10 resetb
172set coords [list [lindex $bottompads 1] $bottompady]
173lappend coords {*}[to_grid 1.9 0.2]
174lappend coords {*}[to_grid 2.2 0.2]
175lappend coords {*}[to_grid 3 1]
176draw_pad_route $coords $wire_width
177
178# C10 flash csb
179set coords [list [lindex $bottompads 4] $bottompady]
180lappend coords {*}[to_grid 5 0]
181lappend coords {*}[to_grid 5 1]
182draw_pad_route $coords $wire_width
183
184# D10 flash io0
185set coords [list [lindex $bottompads 6] $bottompady]
186lappend coords {*}[to_grid 7 0]
187lappend coords {*}[to_grid 7 1]
188draw_pad_route $coords $wire_width
189
190# E10 gpio
191set coords [list [lindex $bottompads 8] $bottompady]
192lappend coords {*}[to_grid 9 0.2]
193lappend coords {*}[to_grid 9 1]
194draw_pad_route $coords $wire_width
195
196# F10 vdda
197set coords [list [lindex $bottompads 10] $bottompady]
198lappend coords {*}[to_grid 11 0.3]
199lappend coords {*}[to_grid 11 1]
200draw_pad_route $coords $wire_width
201
202# A9 mprj_io[37]
203set coords [list $leftpadx [lindex $leftpads 2]]
204lappend coords {*}[to_grid -0.5 3]
205lappend coords {*}[to_grid 1 3]
206draw_pad_route $coords $wire_width
207
208# B9 mprj_io[36]
209set coords [list $leftpadx [lindex $leftpads 3]]
210lappend coords {*}[to_grid -0.6 4]
211lappend coords {*}[to_grid 2 4]
212lappend coords {*}[to_grid 3 3]
213draw_pad_route $coords $wire_width
214
215# C9 clock
216set coords [list [lindex $bottompads 2] $bottompady]
217lappend coords {*}[to_grid 3 0.2]
218lappend coords {*}[to_grid 3.4 0.2]
219lappend coords {*}[to_grid 3.8 0.6]
220lappend coords {*}[to_grid 3.8 1.6]
221lappend coords {*}[to_grid 4.5 2.3]
222lappend coords {*}[to_grid 4.5 2.5]
223lappend coords {*}[to_grid 5 3]
224draw_pad_route $coords $wire_width
225
226# D9 flash io1
227set coords [list [lindex $bottompads 7] $bottompady]
228lappend coords {*}[to_grid 8 0.1]
229lappend coords {*}[to_grid 8 1.3]
230lappend coords {*}[to_grid 7 2.3]
231lappend coords {*}[to_grid 7 3]
232draw_pad_route $coords $wire_width
233
234# E9 mprj_io[1]/SDO
235set coords [list $rightpadx [lindex $rightpads 1]]
236lappend coords {*}[to_grid 12.4 2.2]
237lappend coords {*}[to_grid 10.5 2.2]
238lappend coords {*}[to_grid 9.7 3]
239lappend coords {*}[to_grid 9 3]
240draw_pad_route $coords $wire_width
241
242# F9 mprj_io[2]/SDI
243set coords [list $rightpadx [lindex $rightpads 2]]
244lappend coords {*}[to_grid 12.3 3]
245lappend coords {*}[to_grid 11 3]
246draw_pad_route $coords $wire_width
247
248# A8 mprj_io[35]
249set coords [list $leftpadx [lindex $leftpads 4]]
250lappend coords {*}[to_grid -0.7 5]
251lappend coords {*}[to_grid 1 5]
252draw_pad_route $coords $wire_width
253
254# B8 mprj_io[34]
255set coords [list $leftpadx [lindex $leftpads 5]]
256lappend coords {*}[to_grid -0.7 5.8]
257lappend coords {*}[to_grid 2.2 5.8]
258lappend coords {*}[to_grid 3 5]
259draw_pad_route $coords $wire_width
260
261# C8 mprj_io[33]
262set coords [list $leftpadx [lindex $leftpads 6]]
263lappend coords {*}[to_grid -0.3 6.2]
264lappend coords {*}[to_grid 3.8 6.2]
265lappend coords {*}[to_grid 5 5]
266draw_pad_route $coords $wire_width
267
268# D8 flash clk
269set coords [list [lindex $bottompads 5] $bottompady]
270lappend coords {*}[to_grid 6 0]
271lappend coords {*}[to_grid 6 1]
272lappend coords {*}[to_grid 6.2 1.2]
273lappend coords {*}[to_grid 6.2 3.5]
274lappend coords {*}[to_grid 7 4.3]
275lappend coords {*}[to_grid 7 5]
276draw_pad_route $coords $wire_width
277
278# E8 mprj_io[3]/CSB
279set coords [list $rightpadx [lindex $rightpads 3]]
280lappend coords {*}[to_grid 12.4 4]
281lappend coords {*}[to_grid 10 4]
282lappend coords {*}[to_grid 9 5]
283draw_pad_route $coords $wire_width
284
285# F8 mrpj_io[4]/SCK
286set coords [list $rightpadx [lindex $rightpads 4]]
287lappend coords {*}[to_grid 12.5 5]
288lappend coords {*}[to_grid 11 5]
289draw_pad_route $coords $wire_width
290
291# A7 mrpj_io[32]
292set coords [list $leftpadx [lindex $leftpads 7]]
293lappend coords {*}[to_grid -0.2 7]
294lappend coords {*}[to_grid 1 7]
295draw_pad_route $coords $wire_width
296
297# B7 vssd2
298set coords [list $leftpadx [lindex $leftpads 8]]
299lappend coords {*}[to_grid -0.1 7.8]
300lappend coords {*}[to_grid 2.2 7.8]
301lappend coords {*}[to_grid 3 7]
302draw_pad_route $coords $wire_width
303
304# C7 vdda2
305set coords [list $leftpadx [lindex $leftpads 9]]
306lappend coords {*}[to_grid 0.3 8.2]
307lappend coords {*}[to_grid 2.3 8.2]
308lappend coords {*}[to_grid 2.5 8]
309lappend coords {*}[to_grid 4 8]
310lappend coords {*}[to_grid 5 7]
311draw_pad_route $coords $wire_width
312
313# D7 mrpj_io[0]/JTAG
314set coords [list $rightpadx [lindex $rightpads 0]]
315lappend coords {*}[to_grid 12.8 1.8]
316lappend coords {*}[to_grid 10.2 1.8]
317lappend coords {*}[to_grid 9.8 2.2]
318lappend coords {*}[to_grid 8.6 2.2]
319lappend coords {*}[to_grid 8.2 2.6]
320lappend coords {*}[to_grid 8.2 5.8]
321lappend coords {*}[to_grid 7 7]
322draw_pad_route $coords $wire_width
323
324# E7 mrpj_io[5]/ser_rx
325set coords [list $rightpadx [lindex $rightpads 5]]
326lappend coords {*}[to_grid 12.6 6]
327lappend coords {*}[to_grid 10 6]
328lappend coords {*}[to_grid 9 7]
329draw_pad_route $coords $wire_width
330
331# F7 mprj_io[6]/ser_tx
332set coords [list $rightpadx [lindex $rightpads 6]]
333lappend coords {*}[to_grid 12.7 7]
334lappend coords {*}[to_grid 11 7]
335draw_pad_route $coords $wire_width
336
337# A6 mprj_io[31]
338set coords [list $leftpadx [lindex $leftpads 10]]
339lappend coords {*}[to_grid -0.3 10.3]
340lappend coords {*}[to_grid 1 9]
341draw_pad_route $coords $wire_width
342
343# B6 mprj_io[30]
344set coords [list $leftpadx [lindex $leftpads 11]]
345lappend coords {*}[to_grid -0.5 10.8]
346lappend coords {*}[to_grid -0.3 10.8]
347lappend coords {*}[to_grid 0.5 10]
348lappend coords {*}[to_grid 2 10]
349lappend coords {*}[to_grid 3 9]
350draw_pad_route $coords $wire_width
351
352# C6 vssio/vssa/vssd: Connects to D6, D5, C5
353set coords [to_grid 5 9]
354lappend coords {*}[to_grid 5.65 9]
355lappend coords {*}[to_grid 5.85 9.2]
356lappend coords {*}[to_grid 6 9.2]
357draw_pad_route $coords $wire_width
358
359# D6 vssio/vssa/vssd
360set coords [to_grid 7 9]
361lappend coords {*}[to_grid 6.35 9]
362lappend coords {*}[to_grid 6.15 8.8]
363lappend coords {*}[to_grid 6 8.8]
364draw_pad_route $coords $wire_width
365
366# D6 vssio/vssa/vssd also goes to:
367set coords [list [lindex $bottompads 0] $bottompady]
368lappend coords {*}[to_grid 0.9 0.2]
369lappend coords {*}[to_grid 1.3 0.2]
370lappend coords {*}[to_grid 2 0.9]
371lappend coords {*}[to_grid 2 1.5]
372lappend coords {*}[to_grid 2.3 1.8]
373lappend coords {*}[to_grid 3.5 1.8]
374lappend coords {*}[to_grid 4.2 2.5]
375lappend coords {*}[to_grid 4.2 3.5]
376lappend coords {*}[to_grid 4.5 3.8]
377lappend coords {*}[to_grid 5.3 3.8]
378lappend coords {*}[to_grid 5.8 3.3]
379lappend coords {*}[to_grid 5.8 2.5]
380lappend coords {*}[to_grid 5.3 2]
381lappend coords {*}[to_grid 4.8 2]
382lappend coords {*}[to_grid 4.2 1.4]
383lappend coords {*}[to_grid 4.2 0.3]
384lappend coords {*}[list [lindex $bottompads 3] $bottompady]
385draw_pad_route $coords $wire_width
386
387# D6 vssio/vssa/vssd also goes to:
388set coords [list [lindex $bottompads 9] $bottompady]
389lappend coords {*}[to_grid 10 0.3]
390lappend coords {*}[to_grid 10 1.4]
391lappend coords {*}[to_grid 9.6 1.8]
392lappend coords {*}[to_grid 8.5 1.8]
393lappend coords {*}[to_grid 7.8 2.5]
394lappend coords {*}[to_grid 7.8 5.5]
395lappend coords {*}[to_grid 7.3 6]
396lappend coords {*}[to_grid 6.2 6]
397draw_pad_route $coords $wire_width
398
399# D6 vssio/vssa/vssd also goes to:
400set coords [list [lindex $toppads 5] $toppady]
401lappend coords {*}[to_grid 6 19.7]
402lappend coords {*}[to_grid 6 16]
403lappend coords {*}[to_grid 5.8 15.8]
404lappend coords {*}[to_grid 5.8 12.2]
405lappend coords {*}[to_grid 6 12]
406lappend coords {*}[to_grid 6 8]
407lappend coords {*}[to_grid 6.2 7.8]
408lappend coords {*}[to_grid 6.2 4.3]
409lappend coords {*}[to_grid 5.5 3.6]
410draw_pad_route $coords $wire_width
411
412# E6 vssa1
413set coords [list $rightpadx [lindex $rightpads 7]]
414lappend coords {*}[to_grid 12.8 8]
415lappend coords {*}[to_grid 10 8]
416lappend coords {*}[to_grid 9 9]
417draw_pad_route $coords $wire_width
418
419# E6 vssa1 also goes to
420set coords [list [lindex $toppads 9] $toppady]
421lappend coords {*}[to_grid 10 19.5]
422lappend coords {*}[to_grid 10 18.5]
423lappend coords {*}[to_grid 9.5 18]
424lappend coords {*}[to_grid 8.5 18]
425lappend coords {*}[to_grid 8 17.5]
426lappend coords {*}[to_grid 8 16.5]
427lappend coords {*}[to_grid 7.5 16]
428lappend coords {*}[to_grid 6.7 16]
429lappend coords {*}[to_grid 6.2 15.5]
430lappend coords {*}[to_grid 6.2 12.6]
431lappend coords {*}[to_grid 6.7 12]
432lappend coords {*}[to_grid 7.3 12]
433lappend coords {*}[to_grid 7.8 11.5]
434lappend coords {*}[to_grid 7.8 10.2]
435lappend coords {*}[to_grid 8 10]
436lappend coords {*}[to_grid 8 9.3]
437lappend coords {*}[to_grid 8.3 9]
438lappend coords {*}[to_grid 9 9]
439draw_pad_route $coords $wire_width
440
441# F6 vssd1
442set coords [list $rightpadx [lindex $rightpads 8]]
443lappend coords {*}[to_grid 12.9 9]
444lappend coords {*}[to_grid 11 9]
445draw_pad_route $coords $wire_width
446
447# A5 mprj_io[29]
448set coords [list $leftpadx [lindex $leftpads 12]]
449lappend coords {*}[to_grid 0.2 11]
450lappend coords {*}[to_grid 1 11]
451draw_pad_route $coords $wire_width
452
453# B5 mprj_io[28]
454set coords [list $leftpadx [lindex $leftpads 13]]
455lappend coords {*}[to_grid 0 12]
456lappend coords {*}[to_grid 2 12]
457lappend coords {*}[to_grid 3 11]
458draw_pad_route $coords $wire_width
459
460# C5 vssio/vssa/vssd : Connects to D6, C6, D5
461set coords [to_grid 5 11]
462lappend coords {*}[to_grid 5.65 11]
463lappend coords {*}[to_grid 5.85 11.2]
464lappend coords {*}[to_grid 6 11.2]
465draw_pad_route $coords $wire_width
466
467# D5 vssio/vssa/vssd : Connects to D6, C6, C5
468set coords [to_grid 7 11]
469lappend coords {*}[to_grid 6.35 11]
470lappend coords {*}[to_grid 6.15 10.8]
471lappend coords {*}[to_grid 6 10.8]
472draw_pad_route $coords $wire_width
473
474# E5 mprj_io[7]/irq
475set coords [list $rightpadx [lindex $rightpads 10]]
476lappend coords {*}[to_grid 12.4 10.2]
477lappend coords {*}[to_grid 9.8 10.2]
478lappend coords {*}[to_grid 9 11]
479draw_pad_route $coords $wire_width
480
481# F5 mprj_io[8]/flash2 csb
482set coords [list $rightpadx [lindex $rightpads 11]]
483lappend coords {*}[to_grid 12.3 11]
484lappend coords {*}[to_grid 11 11]
485draw_pad_route $coords $wire_width
486
487# A4 mprj_io[27]
488set coords [list $leftpadx [lindex $leftpads 14]]
489lappend coords {*}[to_grid -0.1 13]
490lappend coords {*}[to_grid 1 13]
491draw_pad_route $coords $wire_width
492
493# B4 mprj_io[26]
494set coords [list $leftpadx [lindex $leftpads 15]]
495lappend coords {*}[to_grid -0.2 14]
496lappend coords {*}[to_grid 2 14]
497lappend coords {*}[to_grid 3 13]
498draw_pad_route $coords $wire_width
499
500# C4 vddio
501set coords [list $leftpadx [lindex $leftpads 1]]
502lappend coords {*}[to_grid -0.8 2]
503lappend coords {*}[to_grid 1.8 2]
504lappend coords {*}[to_grid 2 2.2]
505lappend coords {*}[to_grid 3.3 2.2]
506lappend coords {*}[to_grid 3.8 2.7]
507lappend coords {*}[to_grid 3.8 3.7]
508lappend coords {*}[to_grid 4.3 4.2]
509lappend coords {*}[to_grid 5.3 4.2]
510lappend coords {*}[to_grid 5.8 4.7]
511lappend coords {*}[to_grid 5.8 7.4]
512lappend coords {*}[to_grid 5.2 8]
513lappend coords {*}[to_grid 4.7 8]
514lappend coords {*}[to_grid 4 8.7]
515lappend coords {*}[to_grid 4 13]
516draw_pad_route $coords $wire_width
517
518# C4 vddio is also:
519set coords [list $leftpadx [lindex $leftpads 18]]
520lappend coords {*}[to_grid 0.1 16.2]
521lappend coords {*}[to_grid 1.6 16.2]
522lappend coords {*}[to_grid 2 15.8]
523lappend coords {*}[to_grid 3.4 15.8]
524lappend coords {*}[to_grid 4 15.2]
525lappend coords {*}[to_grid 4 13]
526lappend coords {*}[to_grid 5 13]
527draw_pad_route $coords $wire_width
528
529# D4 vdda1
530set coords [list $rightpadx [lindex $rightpads 9]]
531lappend coords {*}[to_grid 12.8 9.8]
532lappend coords {*}[to_grid 9.7 9.8]
533lappend coords {*}[to_grid 9.5 10]
534lappend coords {*}[to_grid 8.8 10]
535lappend coords {*}[to_grid 8.2 10.6]
536lappend coords {*}[to_grid 8.2 11.8]
537lappend coords {*}[to_grid 7 13]
538draw_pad_route $coords $wire_width
539
540# D4 vdda1 is also:
541set coords [list $rightpadx [lindex $rightpads 16]]
542lappend coords {*}[to_grid 12.6 15.8]
543lappend coords {*}[to_grid 8.4 15.8]
544lappend coords {*}[to_grid 8 15.4]
545lappend coords {*}[to_grid 8 12.4]
546lappend coords {*}[to_grid 7.8 12.2]
547draw_pad_route $coords $wire_width
548
549# E4 mprj_io[9]/flash2 sck
550set coords [list $rightpadx [lindex $rightpads 12]]
551lappend coords {*}[to_grid 12.4 12]
552lappend coords {*}[to_grid 10 12]
553lappend coords {*}[to_grid 9 13]
554draw_pad_route $coords $wire_width
555
556# F4 mprj_io[10]/flash2 io0
557set coords [list $rightpadx [lindex $rightpads 13]]
558lappend coords {*}[to_grid 12.5 13]
559lappend coords {*}[to_grid 11 13]
560draw_pad_route $coords $wire_width
561
562# A3 mprj_io[25]
563set coords [list $leftpadx [lindex $leftpads 16]]
564lappend coords {*}[to_grid -0.4 15]
565lappend coords {*}[to_grid 1 15]
566draw_pad_route $coords $wire_width
567
568# B3 vssa2
569set coords [list $leftpadx [lindex $leftpads 17]]
570lappend coords {*}[to_grid -0.4 15.8]
571lappend coords {*}[to_grid 0 15.8]
572lappend coords {*}[to_grid 1.3 15.8]
573lappend coords {*}[to_grid 2.2 15]
574lappend coords {*}[to_grid 3 15]
575draw_pad_route $coords $wire_width
576
577# C3 mprj_io[24]
578set coords [list $leftpadx [lindex $leftpads 20]]
579lappend coords {*}[to_grid 0 18]
580lappend coords {*}[to_grid 1.5 18]
581lappend coords {*}[to_grid 2 17.5]
582lappend coords {*}[to_grid 2 16.5]
583lappend coords {*}[to_grid 2.3 16.2]
584lappend coords {*}[to_grid 3.8 16.2]
585lappend coords {*}[to_grid 5 15]
586draw_pad_route $coords $wire_width
587
588# D3 mprj_io[13]
589set coords [list $rightpadx [lindex $rightpads 17]]
590lappend coords {*}[to_grid 12 16.2]
591lappend coords {*}[to_grid 8.2 16.2]
592lappend coords {*}[to_grid 7 15]
593draw_pad_route $coords $wire_width
594
595# E3 mprj_io[11]/flash2 io1
596set coords [list $rightpadx [lindex $rightpads 14]]
597lappend coords {*}[to_grid 12.6 14]
598lappend coords {*}[to_grid 10 14]
599lappend coords {*}[to_grid 9 15]
600draw_pad_route $coords $wire_width
601
602# F3 mprj_io[12]
603set coords [list $rightpadx [lindex $rightpads 15]]
604lappend coords {*}[to_grid 12.7 15]
605lappend coords {*}[to_grid 11 15]
606draw_pad_route $coords $wire_width
607
608# A2 vccd2
609set coords [list $leftpadx [lindex $leftpads 19]]
610lappend coords {*}[to_grid -0.4 17.5]
611lappend coords {*}[to_grid 0.5 17.5]
612lappend coords {*}[to_grid 1 17]
613draw_pad_route $coords $wire_width
614
615# B2 mprj_io[22]
616set coords [list [lindex $toppads 1] $toppady]
617lappend coords {*}[to_grid 2 19.7]
618lappend coords {*}[to_grid 2 18]
619lappend coords {*}[to_grid 3 17]
620draw_pad_route $coords $wire_width
621
622# C2 mprj_io[20]
623set coords [list [lindex $toppads 3] $toppady]
624lappend coords {*}[to_grid 4 19.7]
625lappend coords {*}[to_grid 4 18]
626lappend coords {*}[to_grid 5 17]
627draw_pad_route $coords $wire_width
628
629# D2 mprj_io[17]
630set coords [list [lindex $toppads 7] $toppady]
631lappend coords {*}[to_grid 8 19.7]
632lappend coords {*}[to_grid 8 18]
633lappend coords {*}[to_grid 7 17]
634draw_pad_route $coords $wire_width
635
636# E2 mprj_io[14]
637set coords [list $rightpadx [lindex $rightpads 19]]
638lappend coords {*}[to_grid 12.6 18.5]
639lappend coords {*}[to_grid 12 18.5]
640lappend coords {*}[to_grid 11.5 18]
641lappend coords {*}[to_grid 10 18]
642lappend coords {*}[to_grid 9 17]
643draw_pad_route $coords $wire_width
644
645# F2 vccd1
646set coords [list $rightpadx [lindex $rightpads 18]]
647lappend coords {*}[to_grid 12.5 17.5]
648lappend coords {*}[to_grid 11.5 17.5]
649lappend coords {*}[to_grid 11 17]
650draw_pad_route $coords $wire_width
651
652# A1 mprj_io[23]
653set coords [list [lindex $toppads 0] $toppady]
654lappend coords {*}[to_grid 1 19.7]
655lappend coords {*}[to_grid 1 19]
656draw_pad_route $coords $wire_width
657
658# B1 mprj_io[21]
659set coords [list [lindex $toppads 2] $toppady]
660lappend coords {*}[to_grid 3 19.7]
661lappend coords {*}[to_grid 3 19]
662draw_pad_route $coords $wire_width
663
664# C1 mprj_io[19]
665set coords [list [lindex $toppads 4] $toppady]
666lappend coords {*}[to_grid 5 19.7]
667lappend coords {*}[to_grid 5 19]
668draw_pad_route $coords $wire_width
669
670# D1 mrpj_io[18]
671set coords [list [lindex $toppads 6] $toppady]
672lappend coords {*}[to_grid 7 19.7]
673lappend coords {*}[to_grid 7 19]
674draw_pad_route $coords $wire_width
675
676# E1 mprj_io[16]
677set coords [list [lindex $toppads 8] $toppady]
678lappend coords {*}[to_grid 9.5 20]
679lappend coords {*}[to_grid 9.5 19.5]
680lappend coords {*}[to_grid 9 19]
681draw_pad_route $coords $wire_width
682
683# F1 mprj_io[15]
684set coords [list [lindex $toppads 10] $toppady]
685lappend coords {*}[to_grid 11 19.7]
686lappend coords {*}[to_grid 11 19]
687draw_pad_route $coords $wire_width
688