aboutsummaryrefslogtreecommitdiff
path: root/fix-labels.py
blob: fa5f823cd269ba60c0eaeceab3a9c7c557570b2e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
#!/usr/bin/env python

"""
Change all net labels from a static list into global labels
"""

import os
import re
import sys
import pprint
from copy import copy

import pcbnew

labels = {
    'rev02_01.sch': {
        #'15V_LDO_ENABLE': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 9000, 'y': 3100, 'ori': 0},],
        'FPGA_ENTROPY_DISABLE': [{'t': 'GLabel', 'dir': 'Input', 'x': 5450, 'y': 3550, 'ori': 0},],
        'VCC_5V0': [{'t': 'Label', 'x': 11800, 'y': 6600, 'ori': 2, 'new_x': 12300},],
    },
    'rev02_02.sch': {
        'AMPLIFIED': [#{'t': 'GLabel', 'dir': 'UnSpc', 'x': 10300, 'y': 5000, 'ori': 0},
                      {'t': 'Label', 'x': 9650, 'y': 5000, 'ori': 2, 'new_x': 10050}],
        'DIGITIZED_NOISE': [{'t': 'GLabel', 'dir': 'Output', 'x': 13400, 'y': 4800, 'ori': 2},],
        #'NOISE_IN': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 3950, 'y': 5400, 'ori': 0},],
        #'NOISE_OUT': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 4500, 'y': 6000, 'ori': 0},],
        'RAW_NOISE': [{'t': 'Label', 'x': 6000, 'y': 5400, 'ori': 2, 'new_x': 6400},],
                      #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6750, 'y': 5400, 'ori': 0},],
    },
    'rev02_03.sch': {
        'ARM_LED1': [{'t': 'GLabel', 'dir': 'Input', 'x': 11960, 'y': 6500, 'ori': 0},],
        'ARM_LED2': [{'t': 'GLabel', 'dir': 'Input', 'x': 11960, 'y': 6600, 'ori': 0},],
        'ARM_LED3': [{'t': 'GLabel', 'dir': 'Input', 'x': 11950, 'y': 6700, 'ori': 0},],
        'ARM_LED4': [{'t': 'GLabel', 'dir': 'Input', 'x': 11950, 'y': 6800, 'ori': 0},],
        #'BOOT0': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6440, 'y': 5600, 'ori': 0},],
        #'NRST': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 12760, 'y': 4230, 'ori': 0},
        #         {'t': 'GLabel', 'dir': 'UnSpc', 'x': 9400, 'y': 4600, 'ori': 0},],
        #'OSC_IN': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2700, 'y': 5800, 'ori': 1},
        #           {'t': 'GLabel', 'dir': 'UnSpc', 'x': 6420, 'y': 4900, 'ori': 0},],
        #'OSC_OUT': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 3700, 'y': 5800, 'ori': 1},
        #            {'t': 'GLabel', 'dir': 'UnSpc', 'x': 6420, 'y': 5000, 'ori': 0},],
        #'SWDCLK': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 12760, 'y': 3930, 'ori': 0},
        #           {'t': 'GLabel', 'dir': 'UnSpc', 'x': 9400, 'y': 4700, 'ori': 0},],
        #'SWDIO': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 12760, 'y': 4130, 'ori': 0},
        #          {'t': 'GLabel', 'dir': 'UnSpc', 'x': 9400, 'y': 4800, 'ori': 0},],
    },
    'rev02_04.sch': {
        #'VCAP1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 7200, 'y': 5300, 'ori': 0},
        #          {'t': 'GLabel', 'dir': 'UnSpc', 'x': 3100, 'y': 3700, 'ori': 0},],
        'VCAP2': [#{'t': 'GLabel', 'dir': 'UnSpc', 'x': 5900, 'y': 5300, 'ori': 0},
                  {'t': 'Label', 'x': 3500, 'y': 3700, 'ori': 2, 'new_x': 3700},],
    },
    'rev02_05.sch': {
        'ARM_FPGA_CFG_CS_N': [{'t': 'GLabel', 'dir': 'Output', 'x': 2250, 'y': 4100, 'ori': 0},],
        'ARM_FPGA_CFG_MISO': [{'t': 'GLabel', 'dir': 'Input', 'x': 2250, 'y': 4300, 'ori': 0},],
        'ARM_FPGA_CFG_MOSI': [{'t': 'GLabel', 'dir': 'Output', 'x': 2250, 'y': 4400, 'ori': 0},],
        'ARM_FPGA_CFG_SCLK': [{'t': 'GLabel', 'dir': 'Output', 'x': 2250, 'y': 4200, 'ori': 0},],
        'ARM_LED1': [{'t': 'GLabel', 'dir': 'Output', 'x': 6400, 'y': 7700, 'ori': 2, 'new_x': 7000},],
        'ARM_LED2': [{'t': 'GLabel', 'dir': 'Output', 'x': 6400, 'y': 7800, 'ori': 2, 'new_x': 7000},],
        'ARM_LED3': [{'t': 'GLabel', 'dir': 'Output', 'x': 6400, 'y': 7900, 'ori': 2, 'new_x': 7000},],
        'ARM_LED4': [{'t': 'GLabel', 'dir': 'Output', 'x': 6400, 'y': 8000, 'ori': 2, 'new_x': 7000},],
        'AVR_GPIO_ARM_0': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 6400, 'y': 4400, 'ori': 2, 'new_x': 7050},],
        'AVR_GPIO_ARM_1': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 6400, 'y': 4300, 'ori': 2, 'new_x': 7050},],
        'AVR_GPIO_ARM_2': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2250, 'y': 7300, 'ori': 0},],
        'AVR_GPIO_ARM_3': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2250, 'y': 7200, 'ori': 0},],
        'FMC_A0': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 3400, 'ori': 2, 'rel_x': 0},],
        'FMC_A1': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 3500, 'ori': 2, 'rel_x': 0},],
        'FMC_A10': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 4400, 'ori': 2, 'rel_x': 0},],
        'FMC_A11': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 4500, 'ori': 2, 'rel_x': 0},],
        'FMC_A12': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 4600, 'ori': 2, 'rel_x': 0},],
        'FMC_A13': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 4700, 'ori': 2, 'rel_x': 0},],
        'FMC_A14': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 4800, 'ori': 2, 'rel_x': 0},],
        'FMC_A15': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 4900, 'ori': 2, 'rel_x': 0},],
        'FMC_A16': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 5000, 'ori': 2, 'rel_x': 0},],
        'FMC_A17': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 5100, 'ori': 2, 'rel_x': 0},],
        'FMC_A18': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 5200, 'ori': 2, 'rel_x': 0},],
        'FMC_A19': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 5300, 'ori': 2, 'rel_x': 0},],
        'FMC_A2': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 3600, 'ori': 2, 'rel_x': 0},],
        'FMC_A20': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 5400, 'ori': 2, 'rel_x': 0},],
        'FMC_A21': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 5500, 'ori': 2, 'rel_x': 0},],
        'FMC_A22': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 5600, 'ori': 2, 'rel_x': 0},],
        'FMC_A23': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 5700, 'ori': 2, 'rel_x': 0},],
        'FMC_A24': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 5800, 'ori': 2, 'rel_x': 0},],
        'FMC_A25': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 5900, 'ori': 2, 'rel_x': 0},],
        'FMC_A3': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 3700, 'ori': 2, 'rel_x': 0},],
        'FMC_A4': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 3800, 'ori': 2, 'rel_x': 0},],
        'FMC_A5': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 3900, 'ori': 2, 'rel_x': 0},],
        'FMC_A6': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 4000, 'ori': 2, 'rel_x': 0},],
        'FMC_A7': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 4100, 'ori': 2, 'rel_x': 0},],
        'FMC_A8': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 4200, 'ori': 2, 'rel_x': 0},],
        'FMC_A9': [{'t': 'GLabel', 'dir': 'Output', 'x': 10160, 'y': 4300, 'ori': 2, 'rel_x': 0},],
        'FMC_CLK': [{'t': 'GLabel', 'dir': 'Output', 'x': 9990, 'y': 7100, 'ori': 0},],
        'FMC_D0': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 3400, 'ori': 2, 'rel_x': -50},],
        'FMC_D1': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 3500, 'ori': 2, 'rel_x': -50},],
        'FMC_D10': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 4400, 'ori': 2, 'rel_x': -50},],
        'FMC_D11': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 4500, 'ori': 2, 'rel_x': -50},],
        'FMC_D12': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 4600, 'ori': 2, 'rel_x': -50},],
        'FMC_D13': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 4700, 'ori': 2, 'rel_x': -50},],
        'FMC_D14': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 4800, 'ori': 2, 'rel_x': -50},],
        'FMC_D15': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 4900, 'ori': 2, 'rel_x': -50},],
        'FMC_D16': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 5000, 'ori': 2, 'rel_x': -50},],
        'FMC_D17': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 5100, 'ori': 2, 'rel_x': -50},],
        'FMC_D18': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 5200, 'ori': 2, 'rel_x': -50},],
        'FMC_D19': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 5300, 'ori': 2, 'rel_x': -50},],
        'FMC_D2': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 3600, 'ori': 2, 'rel_x': -50},],
        'FMC_D20': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 5400, 'ori': 2, 'rel_x': -50},],
        'FMC_D21': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 5500, 'ori': 2, 'rel_x': -50},],
        'FMC_D22': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 5600, 'ori': 2, 'rel_x': -50},],
        'FMC_D23': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 5700, 'ori': 2, 'rel_x': -50},],
        'FMC_D24': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 5800, 'ori': 2, 'rel_x': -50},],
        'FMC_D25': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 5900, 'ori': 2, 'rel_x': -50},],
        'FMC_D26': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 6000, 'ori': 2, 'rel_x': -50},],
        'FMC_D27': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 6100, 'ori': 2, 'rel_x': -50},],
        'FMC_D28': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 6200, 'ori': 2, 'rel_x': -50},],
        'FMC_D29': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 6300, 'ori': 2, 'rel_x': -50},],
        'FMC_D3': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 3700, 'ori': 2, 'rel_x': -50},],
        'FMC_D30': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 6400, 'ori': 2, 'rel_x': -50},],
        'FMC_D31': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 6500, 'ori': 2, 'rel_x': -50},],
        'FMC_D4': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 3800, 'ori': 2, 'rel_x': -50},],
        'FMC_D5': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 3900, 'ori': 2, 'rel_x': -50},],
        'FMC_D6': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 4000, 'ori': 2, 'rel_x': -50},],
        'FMC_D7': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 4100, 'ori': 2, 'rel_x': -50},],
        'FMC_D8': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 4200, 'ori': 2, 'rel_x': -50},],
        'FMC_D9': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 13120, 'y': 4300, 'ori': 2, 'rel_x': -50},],
        'FMC_NBL0': [{'t': 'GLabel', 'dir': 'Output', 'x': 9990, 'y': 6200, 'ori': 0},],
        'FMC_NBL1': [{'t': 'GLabel', 'dir': 'Output', 'x': 9990, 'y': 6300, 'ori': 0},],
        'FMC_NBL2': [{'t': 'GLabel', 'dir': 'Output', 'x': 9990, 'y': 6400, 'ori': 0},],
        'FMC_NBL3': [{'t': 'GLabel', 'dir': 'Output', 'x': 9990, 'y': 6500, 'ori': 0},],
        'FMC_NE1': [{'t': 'GLabel', 'dir': 'Output', 'x': 9990, 'y': 7500, 'ori': 0},],
        'FMC_NL': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 9990, 'y': 6800, 'ori': 0},],
        'FMC_NOE': [{'t': 'GLabel', 'dir': 'Output', 'x': 9990, 'y': 7200, 'ori': 0},],
        'FMC_NWAIT': [{'t': 'GLabel', 'dir': 'Output', 'x': 9990, 'y': 7400, 'ori': 0},],
        'FMC_NWE': [{'t': 'GLabel', 'dir': 'Output', 'x': 9990, 'y': 7300, 'ori': 0},],
        'FMC_SDCKE0': [{'t': 'GLabel', 'dir': 'Output', 'x': 13110, 'y': 7400, 'ori': 2, 'new_x': 13490},],
        'FMC_SDCKE1': [{'t': 'GLabel', 'dir': 'Output', 'x': 13110, 'y': 7500, 'ori': 2, 'new_x': 13490},],
        'FMC_SDCLK': [{'t': 'GLabel', 'dir': 'Output', 'x': 13120, 'y': 6800, 'ori': 2, 'new_x': 13490},],
        'FMC_SDNCAS': [{'t': 'GLabel', 'dir': 'Output', 'x': 13110, 'y': 7700, 'ori': 2, 'new_x': 13490},],
        'FMC_SDNE0': [{'t': 'GLabel', 'dir': 'Output', 'x': 13120, 'y': 7100, 'ori': 2, 'new_x': 13490},],
        'FMC_SDNE1': [{'t': 'GLabel', 'dir': 'Output', 'x': 13120, 'y': 7200, 'ori': 2, 'new_x': 13490},],
        'FMC_SDNRAS': [{'t': 'GLabel', 'dir': 'Output', 'x': 13110, 'y': 7800, 'ori': 2, 'new_x': 13490},],
        'FMC_SDNWE': [{'t': 'GLabel', 'dir': 'Output', 'x': 13120, 'y': 6900, 'ori': 2, 'new_x': 13490},],
        'FPGA_CFG_CTRL_ARM_ENA': [{'t': 'GLabel', 'dir': 'Output', 'x': 6400, 'y': 2700, 'ori': 2, 'new_x': 7000},],
        'FPGA_CFG_CTRL_FPGA_DIS': [{'t': 'GLabel', 'dir': 'Output', 'x': 6400, 'y': 5100, 'ori': 2, 'new_x': 7000},],
        'FPGA_DONE': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6400, 'y': 7000, 'ori': 2, 'new_x': 7000},],
        'FPGA_INIT_B': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6400, 'y': 6200, 'ori': 2, 'new_x': 7000},],
        'FPGA_IRQ_N_0': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6400, 'y': 6500, 'ori': 2, 'new_x': 7000},],
        'FPGA_IRQ_N_1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6400, 'y': 6600, 'ori': 2, 'new_x': 7000},],
        'FPGA_IRQ_N_2': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6400, 'y': 6700, 'ori': 2, 'new_x': 7000},],
        'FPGA_IRQ_N_3': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6400, 'y': 6800, 'ori': 2, 'new_x': 7000},],
        'FPGA_PROGRAM_B': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6400, 'y': 6300, 'ori': 2, 'new_x': 7000},],
        'FT_CTS': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2250, 'y': 3000, 'ori': 0},],
        'FT_DTR': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2250, 'y': 2700, 'ori': 0},],
        'FT_MGMT_CTS': [{'t': 'GLabel', 'dir': 'Input', 'x': 2250, 'y': 3700, 'ori': 0},],
        'FT_MGMT_DTR': [{'t': 'GLabel', 'dir': 'Output', 'x': 2250, 'y': 3400, 'ori': 0},],
        'FT_MGMT_RTS': [{'t': 'GLabel', 'dir': 'Output', 'x': 2250, 'y': 3800, 'ori': 0},],
        'FT_MGMT_RXD': [{'t': 'GLabel', 'dir': 'Output', 'x': 2250, 'y': 3500, 'ori': 0},],
        'FT_MGMT_TXD': [{'t': 'GLabel', 'dir': 'Input', 'x': 2250, 'y': 3600, 'ori': 0},],
        'FT_RTS': [{'t': 'GLabel', 'dir': 'Output', 'x': 2250, 'y': 3100, 'ori': 0},],
        'FT_RXD': [{'t': 'GLabel', 'dir': 'Output', 'x': 2250, 'y': 2800, 'ori': 0},],
        'FT_TXD': [{'t': 'GLabel', 'dir': 'Input', 'x': 2250, 'y': 2900, 'ori': 0},],
        'KSM_PROM_CS_N': [{'t': 'GLabel', 'dir': 'Output', 'x': 2250, 'y': 4700, 'ori': 0},],
        'KSM_PROM_MISO': [{'t': 'GLabel', 'dir': 'Input', 'x': 2250, 'y': 4900, 'ori': 0},],
        'KSM_PROM_MOSI': [{'t': 'GLabel', 'dir': 'Output', 'x': 2250, 'y': 5000, 'ori': 0},],
        'KSM_PROM_SCLK': [{'t': 'GLabel', 'dir': 'Output', 'x': 2250, 'y': 4800, 'ori': 0},],
        'RTC_MFP': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2250, 'y': 6300, 'ori': 0},],
        'RTC_SCL': [{'t': 'GLabel', 'dir': 'Output', 'x': 2250, 'y': 6200, 'ori': 0},],
        'RTC_SDA': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2250, 'y': 6100, 'ori': 0},],
    },
    'rev02_06.sch': {
        'FMC_A0': [{'t': 'GLabel', 'dir': 'Input', 'x': 2810, 'y': 2600, 'ori': 2, 'rel_x': 50},
                   {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 2700, 'ori': 2, 'rel_x': 50},],
        'FMC_A1': [{'t': 'GLabel', 'dir': 'Input', 'x': 2810, 'y': 2700, 'ori': 2, 'rel_x': 50},
                   {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 2800, 'ori': 2, 'rel_x': 50},],
        'FMC_A10': [{'t': 'GLabel', 'dir': 'Input', 'x': 2810, 'y': 3600, 'ori': 2, 'rel_x': 50},
                    {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 3700, 'ori': 2, 'rel_x': 50},],
        'FMC_A11': [{'t': 'GLabel', 'dir': 'Input', 'x': 2810, 'y': 3700, 'ori': 2, 'rel_x': 50},
                    {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 3800, 'ori': 2, 'rel_x': 50},],
        'FMC_A12': [{'t': 'GLabel', 'dir': 'Input', 'x': 2810, 'y': 3800, 'ori': 2, 'rel_x': 50},
                    {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 3900, 'ori': 2, 'rel_x': 50},],
        'FMC_A14': [{'t': 'GLabel', 'dir': 'Input', 'x': 2800, 'y': 4100, 'ori': 2, 'rel_x': 50},
                    {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 4200, 'ori': 2, 'rel_x': 50},],
        'FMC_A15': [{'t': 'GLabel', 'dir': 'Input', 'x': 2800, 'y': 4200, 'ori': 2, 'rel_x': 50},
                    {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 4300, 'ori': 2, 'rel_x': 50},],
        'FMC_A2': [{'t': 'GLabel', 'dir': 'Input', 'x': 2810, 'y': 2800, 'ori': 2, 'rel_x': 50},
                   {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 2900, 'ori': 2, 'rel_x': 50},],
        'FMC_A3': [{'t': 'GLabel', 'dir': 'Input', 'x': 2810, 'y': 2900, 'ori': 2, 'rel_x': 50},
                   {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 3000, 'ori': 2, 'rel_x': 50},],
        'FMC_A4': [{'t': 'GLabel', 'dir': 'Input', 'x': 2810, 'y': 3000, 'ori': 2, 'rel_x': 50},
                   {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 3100, 'ori': 2, 'rel_x': 50},],
        'FMC_A5': [{'t': 'GLabel', 'dir': 'Input', 'x': 2810, 'y': 3100, 'ori': 2, 'rel_x': 50},
                   {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 3200, 'ori': 2, 'rel_x': 50},],
        'FMC_A6': [{'t': 'GLabel', 'dir': 'Input', 'x': 2810, 'y': 3200, 'ori': 2, 'rel_x': 50},
                   {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 3300, 'ori': 2, 'rel_x': 50},],
        'FMC_A7': [{'t': 'GLabel', 'dir': 'Input', 'x': 2810, 'y': 3300, 'ori': 2, 'rel_x': 50},
                   {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 3400, 'ori': 2, 'rel_x': 50},],
        'FMC_A8': [{'t': 'GLabel', 'dir': 'Input', 'x': 2810, 'y': 3400, 'ori': 2, 'rel_x': 50},
                   {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 3500, 'ori': 2, 'rel_x': 50},],
        'FMC_A9': [{'t': 'GLabel', 'dir': 'Input', 'x': 2810, 'y': 3500, 'ori': 2, 'rel_x': 50},
                   {'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 3600, 'ori': 2, 'rel_x': 50},],
        'FMC_D0': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 2600, 'ori': 2, 'rel_x': -150},
                   {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 2700, 'ori': 2, 'rel_x': -150},],
        'FMC_D1': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 2700, 'ori': 2, 'rel_x': -150},
                   {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 2800, 'ori': 2, 'rel_x': -150},],
        'FMC_D10': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 3600, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 3700, 'ori': 2, 'rel_x': -150},],
        'FMC_D11': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 3700, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 3800, 'ori': 2, 'rel_x': -150},],
        'FMC_D12': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 3800, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 3900, 'ori': 2, 'rel_x': -150},],
        'FMC_D13': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 3900, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 4000, 'ori': 2, 'rel_x': -150},],
        'FMC_D14': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 4000, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 4100, 'ori': 2, 'rel_x': -150},],
        'FMC_D15': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 4100, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 4200, 'ori': 2, 'rel_x': -150},],
        'FMC_D16': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 4200, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 4300, 'ori': 2, 'rel_x': -150},],
        'FMC_D17': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 4300, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 4400, 'ori': 2, 'rel_x': -150},],
        'FMC_D18': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 4400, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 4500, 'ori': 2, 'rel_x': -150},],
        'FMC_D19': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 4500, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 4600, 'ori': 2, 'rel_x': -150},],
        'FMC_D2': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 2800, 'ori': 2, 'rel_x': -150},
                   {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 2900, 'ori': 2, 'rel_x': -150},],
        'FMC_D20': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 4600, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 4700, 'ori': 2, 'rel_x': -150},],
        'FMC_D21': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 4700, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 4800, 'ori': 2, 'rel_x': -150},],
        'FMC_D22': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 4800, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 4900, 'ori': 2, 'rel_x': -150},],
        'FMC_D23': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 4900, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 5000, 'ori': 2, 'rel_x': -150},],
        'FMC_D24': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 5000, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 5100, 'ori': 2, 'rel_x': -150},],
        'FMC_D25': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 5100, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 5200, 'ori': 2, 'rel_x': -150},],
        'FMC_D26': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 5200, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 5300, 'ori': 2, 'rel_x': -150},],
        'FMC_D27': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 5300, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 5400, 'ori': 2, 'rel_x': -150},],
        'FMC_D28': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 5400, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 5500, 'ori': 2, 'rel_x': -150},],
        'FMC_D29': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 5500, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 5600, 'ori': 2, 'rel_x': -150},],
        'FMC_D3': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 2900, 'ori': 2, 'rel_x': -150},
                   {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 3000, 'ori': 2, 'rel_x': -150},],
        'FMC_D30': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 5600, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 5700, 'ori': 2, 'rel_x': -150},],
        'FMC_D31': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 5700, 'ori': 2, 'rel_x': -150},
                    {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 5800, 'ori': 2, 'rel_x': -150},],
        'FMC_D4': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 3000, 'ori': 2, 'rel_x': -150},
                   {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 3100, 'ori': 2, 'rel_x': -150},],
        'FMC_D5': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 3100, 'ori': 2, 'rel_x': -150},
                   {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 3200, 'ori': 2, 'rel_x': -150},],
        'FMC_D6': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 3200, 'ori': 2, 'rel_x': -150},
                   {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 3300, 'ori': 2, 'rel_x': -150},],
        'FMC_D7': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 3300, 'ori': 2, 'rel_x': -150},
                   {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 3400, 'ori': 2, 'rel_x': -150},],
        'FMC_D8': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 3400, 'ori': 2, 'rel_x': -150},
                   {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 3500, 'ori': 2, 'rel_x': -150},],
        'FMC_D9': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 5970, 'y': 3500, 'ori': 2, 'rel_x': -150},
                   {'t': 'GLabel', 'dir': 'BiDi', 'x': 12970, 'y': 3600, 'ori': 2, 'rel_x': -150},],
        'FMC_NBL0': [{'t': 'GLabel', 'dir': 'Input', 'x': 5960, 'y': 5900, 'ori': 2, 'new_x': 6300},
                     {'t': 'GLabel', 'dir': 'Input', 'x': 12980, 'y': 6000, 'ori': 2, 'new_x': 13300},],
        'FMC_NBL1': [{'t': 'GLabel', 'dir': 'Input', 'x': 5960, 'y': 6000, 'ori': 2, 'new_x': 6300},
                     {'t': 'GLabel', 'dir': 'Input', 'x': 12980, 'y': 6100, 'ori': 2, 'new_x': 13300},],
        'FMC_NBL2': [{'t': 'GLabel', 'dir': 'Input', 'x': 5960, 'y': 6100, 'ori': 2, 'new_x': 6300},
                     {'t': 'GLabel', 'dir': 'Input', 'x': 12980, 'y': 6200, 'ori': 2, 'new_x': 13300},],
        'FMC_NBL3': [{'t': 'GLabel', 'dir': 'Input', 'x': 5960, 'y': 6200, 'ori': 2, 'new_x': 6300},
                     {'t': 'GLabel', 'dir': 'Input', 'x': 12980, 'y': 6300, 'ori': 2, 'new_x': 13300},],
        'FMC_SDCKE0': [{'t': 'GLabel', 'dir': 'Input', 'x': 2700, 'y': 5500, 'ori': 0},],
        'FMC_SDCKE1': [{'t': 'GLabel', 'dir': 'Input', 'x': 9700, 'y': 5600, 'ori': 0},],
        'FMC_SDCLK': [{'t': 'GLabel', 'dir': 'Input', 'x': 2700, 'y': 5000, 'ori': 0},
                      {'t': 'GLabel', 'dir': 'Input', 'x': 9700, 'y': 5100, 'ori': 0},],
        'FMC_SDNCAS': [{'t': 'GLabel', 'dir': 'Input', 'x': 2700, 'y': 4400, 'ori': 0},
                       {'t': 'GLabel', 'dir': 'Input', 'x': 9700, 'y': 4500, 'ori': 0},],
        'FMC_SDNE0': [{'t': 'GLabel', 'dir': 'Input', 'x': 2700, 'y': 6000, 'ori': 0},],
        'FMC_SDNE1': [{'t': 'GLabel', 'dir': 'Input', 'x': 9700, 'y': 6100, 'ori': 0},],
        'FMC_SDNRAS': [{'t': 'GLabel', 'dir': 'Input', 'x': 2700, 'y': 4500, 'ori': 0},
                       {'t': 'GLabel', 'dir': 'Input', 'x': 9700, 'y': 4600, 'ori': 0},],
        'FMC_SDNWE': [{'t': 'GLabel', 'dir': 'Input', 'x': 2700, 'y': 6500, 'ori': 0},
                      {'t': 'GLabel', 'dir': 'Input', 'x': 9700, 'y': 6600, 'ori': 0},],
    },
    'rev02_07.sch': {
        'KSM_PROM_CS_N': [{'t': 'GLabel', 'dir': 'Input', 'x': 6270, 'y': 5500, 'ori': 0},],
        'KSM_PROM_MISO': [{'t': 'GLabel', 'dir': 'Output', 'x': 6270, 'y': 5600, 'ori': 0},],
        'KSM_PROM_MOSI': [{'t': 'GLabel', 'dir': 'Input', 'x': 8600, 'y': 5800, 'ori': 2},],
        'KSM_PROM_SCLK': [{'t': 'GLabel', 'dir': 'Input', 'x': 8600, 'y': 5700, 'ori': 2},],
    },
    'rev02_08.sch': {
        'RTC_MFP': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 9500, 'y': 5500, 'ori': 2},],
        'RTC_SCL': [{'t': 'GLabel', 'dir': 'Input', 'x': 9500, 'y': 5600, 'ori': 2},],
        'RTC_SDA': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 9500, 'y': 5700, 'ori': 2},],
    },
    'rev02_09.sch': {
        #'D1_N': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2050, 'y': 3500, 'ori': 0, 'dim': 60},],
        #'D1_P': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2050, 'y': 3400, 'ori': 0, 'dim': 60},],
        'DIFFPAIR': [{'t': 'Delete', 'dir': 'UnSpc', 'x': 2300, 'y': 3600, 'ori': 0, 'dim': 70},
                     {'t': 'Delete', 'dir': 'UnSpc', 'x': 2270, 'y': 3400, 'ori': 0, 'dim': 70},
                     {'t': 'Delete', 'dir': 'UnSpc', 'x': 3660, 'y': 3600, 'ori': 0, 'dim': 70},
                     {'t': 'Delete', 'dir': 'UnSpc', 'x': 3660, 'y': 3400, 'ori': 0, 'dim': 70},],
        'FT_CTS': [{'t': 'GLabel', 'dir': 'Input', 'x': 9700, 'y': 3700, 'ori': 2},],
        'FT_DTR': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 9700, 'y': 3800, 'ori': 2},],
        #'FT_REF': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6930, 'y': 4500, 'ori': 0},],
        #'FT_RESET': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6970, 'y': 4300, 'ori': 0},],
        'FT_RTS': [{'t': 'GLabel', 'dir': 'Output', 'x': 9700, 'y': 3600, 'ori': 2},],
        'FT_RXD': [{'t': 'GLabel', 'dir': 'Input', 'x': 11200, 'y': 3500, 'ori': 2},],
        #'FT_RXD1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 9800, 'y': 3500, 'ori': 0},
        #            {'t': 'GLabel', 'dir': 'UnSpc', 'x': 12400, 'y': 6200, 'ori': 0},],
        'FT_TXD': [{'t': 'GLabel', 'dir': 'Output', 'x': 11200, 'y': 3400, 'ori': 2},],
        'FT_TXD1': [#{'t': 'GLabel', 'dir': 'UnSpc', 'x': 9800, 'y': 3400, 'ori': 0},
                    {'t': 'Label', 'x': 13200, 'y': 6200, 'ori': 0, 'new_x': 13400},],
        #'FT_VCC3V3': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6000, 'y': 3600, 'ori': 0},],
        #'FT_VCCA': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6200, 'y': 3800, 'ori': 0},],
        #'FT_VCCORE': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6000, 'y': 3700, 'ori': 0},],
        #'FT_VPHY': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 7550, 'y': 2800, 'ori': 0},],
        #'FT_VPLL': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 7550, 'y': 2600, 'ori': 0},],
        #'FT_VREGIN': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6000, 'y': 3400, 'ori': 0},],
        'USB_N': [#{'t': 'GLabel', 'dir': 'UnSpc', 'x': 4050, 'y': 3600, 'ori': 0},
                  #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 7090, 'y': 4000, 'ori': 0},
                  {'t': 'Label', 'x': 13200, 'y': 6100, 'ori': 0, 'new_x': 13400},],
        #'USB_P': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 4050, 'y': 3400, 'ori': 0},
        #          {'t': 'GLabel', 'dir': 'UnSpc', 'x': 7090, 'y': 4100, 'ori': 0},
        #          {'t': 'GLabel', 'dir': 'UnSpc', 'x': 12400, 'y': 6100, 'ori': 0},],
    },
    'rev02_10.sch': {
        'DIFFPAIR': [{'t': 'Delete', 'dir': 'UnSpc', 'x': 2400, 'y': 3700, 'ori': 0, 'dim': 70},
                     {'t': 'Delete', 'dir': 'UnSpc', 'x': 2370, 'y': 3500, 'ori': 0, 'dim': 70},
                     {'t': 'Delete', 'dir': 'UnSpc', 'x': 3760, 'y': 3500, 'ori': 0, 'dim': 70},
                     {'t': 'Delete', 'dir': 'UnSpc', 'x': 3760, 'y': 3700, 'ori': 0, 'dim': 70},],
        #'DM_N': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2100, 'y': 3600, 'ori': 0, 'dim': 60},],
        #'DM_P': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2100, 'y': 3500, 'ori': 0, 'dim': 60},],
        'FT_MGMT_CTS': [{'t': 'GLabel', 'dir': 'Input', 'x': 9800, 'y': 3800, 'ori': 2},],
        'FT_MGMT_DTR': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 9800, 'y': 3900, 'ori': 2},],
        'FT_MGMT_RTS': [{'t': 'GLabel', 'dir': 'Output', 'x': 9800, 'y': 3700, 'ori': 2},],
        'FT_MGMT_RXD': [{'t': 'GLabel', 'dir': 'Input', 'x': 11300, 'y': 3600, 'ori': 2},],
        #'FT_MGMT_RXD1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 9900, 'y': 3600, 'ori': 0},
        #                 {'t': 'GLabel', 'dir': 'UnSpc', 'x': 12050, 'y': 6300, 'ori': 0},],
        'FT_MGMT_TXD': [{'t': 'GLabel', 'dir': 'Output', 'x': 11300, 'y': 3500, 'ori': 2},],
        'FT_MGMT_TXD1': [#{'t': 'GLabel', 'dir': 'UnSpc', 'x': 9900, 'y': 3500, 'ori': 0},
                         {'t': 'Label', 'x': 13300, 'y': 6300, 'ori': 0, 'new_x': 13500},],
        #'FT_MGMT_VCC3V3': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6100, 'y': 3700, 'ori': 0},],
        #'FT_MGMT_VPHY': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 7650, 'y': 2900, 'ori': 0},],
        #'FT_MGMT_VPLL': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 7650, 'y': 2700, 'ori': 0},],
        #'FT_MGMT_VREGIN': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6100, 'y': 3500, 'ori': 0},],
        #'FT_REF1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 7150, 'y': 4600, 'ori': 0},],
        #'FT_RESET1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 7040, 'y': 4400, 'ori': 0},],
        #'FT_VCCA1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6670, 'y': 3900, 'ori': 0},],
        #'FT_VCCORE1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6100, 'y': 3800, 'ori': 0},],
        'USB_MGMT_N': [#{'t': 'GLabel', 'dir': 'UnSpc', 'x': 4150, 'y': 3700, 'ori': 0},
                       #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6980, 'y': 4100, 'ori': 0},
                       {'t': 'Label', 'x': 13300, 'y': 6200, 'ori': 0, 'new_x': 13500},],
        #'USB_MGMT_P': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 4150, 'y': 3500, 'ori': 0},
        #               {'t': 'GLabel', 'dir': 'UnSpc', 'x': 6980, 'y': 4200, 'ori': 0},
        #               {'t': 'GLabel', 'dir': 'UnSpc', 'x': 12050, 'y': 6200, 'ori': 0},],
    },
    'rev02_11.sch': {
        'AVR_GPIO_0': [{'t': 'Label', 'dir': 'UnSpc', 'x': 13500, 'y': 6600, 'ori': 2},],
                       #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 8500, 'y': 4100, 'ori': 0},],
        'AVR_GPIO_1': [{'t': 'Label', 'dir': 'UnSpc', 'x': 13500, 'y': 6700, 'ori': 2},],
                       #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 8500, 'y': 4200, 'ori': 0},],
        'AVR_GPIO_2': [{'t': 'Label', 'dir': 'UnSpc', 'x': 13500, 'y': 6800, 'ori': 2},],
                       #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 8500, 'y': 4300, 'ori': 0},],
        'AVR_GPIO_3': [{'t': 'Label', 'dir': 'UnSpc', 'x': 13500, 'y': 6900, 'ori': 2},],
                       #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 8500, 'y': 4400, 'ori': 0},],
        'AVR_GPIO_4': [{'t': 'Label', 'dir': 'UnSpc', 'x': 13500, 'y': 7000, 'ori': 2},],
                       #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 8500, 'y': 4500, 'ori': 0},],
        'AVR_GPIO_5': [{'t': 'Label', 'dir': 'UnSpc', 'x': 13500, 'y': 7100, 'ori': 2},],
                       #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 8500, 'y': 4600, 'ori': 0},],
        'AVR_GPIO_6': [{'t': 'Label', 'dir': 'UnSpc', 'x': 13500, 'y': 7200, 'ori': 2},],
                       #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 8500, 'y': 4700, 'ori': 0},],
        'AVR_GPIO_7': [{'t': 'Label', 'dir': 'UnSpc', 'x': 13500, 'y': 7300, 'ori': 2},],
                       #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 8500, 'y': 4800, 'ori': 0},],
        'AVR_GPIO_ARM_0': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 3170, 'y': 5300, 'ori': 0},],
        'AVR_GPIO_ARM_1': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 3170, 'y': 5400, 'ori': 0},],
        'AVR_GPIO_ARM_2': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 3170, 'y': 5500, 'ori': 0},],
        'AVR_GPIO_ARM_3': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 3170, 'y': 5600, 'ori': 0},],
        'AVR_GPIO_FPGA_0': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 3170, 'y': 5700, 'ori': 0},],
        'AVR_GPIO_FPGA_1': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 3170, 'y': 5800, 'ori': 0},],
        'AVR_GPIO_FPGA_2': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 3170, 'y': 5900, 'ori': 0},],
        'AVR_GPIO_FPGA_3': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 3170, 'y': 6000, 'ori': 0},],
        #'AVR_LED1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 12610, 'y': 8700, 'ori': 0},
        #             {'t': 'GLabel', 'dir': 'UnSpc', 'x': 3170, 'y': 4400, 'ori': 0},],
        #'AVR_LED2': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 12610, 'y': 8800, 'ori': 0},
        #             {'t': 'GLabel', 'dir': 'UnSpc', 'x': 3170, 'y': 4500, 'ori': 0},],
        #'AVR_LED3': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 12610, 'y': 8900, 'ori': 0},
        #             {'t': 'GLabel', 'dir': 'UnSpc', 'x': 3180, 'y': 4600, 'ori': 0},],
        #'AVR_LED4': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 12610, 'y': 9000, 'ori': 0},
        #             {'t': 'GLabel', 'dir': 'UnSpc', 'x': 3170, 'y': 4700, 'ori': 0},],
        #'AVR_PANIC': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 12500, 'y': 5100, 'ori': 0},
        #              {'t': 'GLabel', 'dir': 'UnSpc', 'x': 3170, 'y': 4800, 'ori': 0},],
        #'AVR_RESET': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 9600, 'y': 5700, 'ori': 0},],
        'MKM_AVR_CS_N': [{'t': 'GLabel', 'dir': 'Output', 'x': 3070, 'y': 4900, 'ori': 0},],
        'MKM_AVR_MISO': [{'t': 'GLabel', 'dir': 'Input', 'x': 8440, 'y': 5100, 'ori': 2},],
        'MKM_AVR_MOSI': [{'t': 'GLabel', 'dir': 'Output', 'x': 8440, 'y': 5000, 'ori': 2},],
        'MKM_AVR_SCK': [{'t': 'GLabel', 'dir': 'Output', 'x': 8440, 'y': 5300, 'ori': 2},],
        'MKM_CONTROL_AVR_ENA': [{'t': 'GLabel', 'dir': 'Output', 'x': 3070, 'y': 5000, 'ori': 0},],
        'MKM_CONTROL_FPGA_DIS': [{'t': 'GLabel', 'dir': 'Output', 'x': 3070, 'y': 5100, 'ori': 0},],
    },
    'rev02_12.sch': {
        'MKM_AVR_CS_N': [{'t': 'GLabel', 'dir': 'Input', 'x': 4800, 'y': 5200, 'ori': 0},],
        'MKM_AVR_MISO': [{'t': 'GLabel', 'dir': 'Output', 'x': 7800, 'y': 5500, 'ori': 2},],
        'MKM_AVR_MOSI': [{'t': 'GLabel', 'dir': 'Input', 'x': 4800, 'y': 5400, 'ori': 0},],
        'MKM_AVR_SCK': [{'t': 'GLabel', 'dir': 'Input', 'x': 4800, 'y': 5300, 'ori': 0},],
        'MKM_CONTROL_AVR_ENA': [{'t': 'GLabel', 'dir': 'Input', 'x': 4550, 'y': 5700, 'ori': 0},],
        'MKM_CONTROL_FPGA_DIS': [{'t': 'GLabel', 'dir': 'Input', 'x': 4480, 'y': 6800, 'ori': 0},],
        #'MKM_CS_N': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 10140, 'y': 5400, 'ori': 0},
        #             {'t': 'GLabel', 'dir': 'UnSpc', 'x': 7000, 'y': 5200, 'ori': 0},],
        'MKM_FPGA_CS_N': [{'t': 'GLabel', 'dir': 'Input', 'x': 4610, 'y': 6300, 'ori': 0},],
        'MKM_FPGA_MISO': [{'t': 'GLabel', 'dir': 'Output', 'x': 6500, 'y': 6600, 'ori': 2},],
        'MKM_FPGA_MOSI': [{'t': 'GLabel', 'dir': 'Input', 'x': 4610, 'y': 6500, 'ori': 0},],
        'MKM_FPGA_SCK': [{'t': 'GLabel', 'dir': 'Input', 'x': 4610, 'y': 6400, 'ori': 0},],
        'MKM_MISO': [{'t': 'Label', 'x': 12800, 'y': 5200, 'ori': 2, 'new_x': 13150},],
                     #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 4800, 'y': 5500, 'ori': 0},],
        #'MKM_MOSI': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 10100, 'y': 5500, 'ori': 0},
        #             {'t': 'GLabel', 'dir': 'UnSpc', 'x': 7000, 'y': 5400, 'ori': 0},],
        #'MKM_SCK': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 10100, 'y': 5600, 'ori': 0},
        #            {'t': 'GLabel', 'dir': 'UnSpc', 'x': 7000, 'y': 5300, 'ori': 0},],
    },
    'rev02_13.sch': {
        'FPGA_CFG_SCLK': [{'t': 'GLabel', 'dir': 'Output', 'x': 3340, 'y': 5400, 'ori': 2, 'new_x': 3940},],
        #'FPGA_CFG_SCLK1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2220, 'y': 5400, 'ori': 0},],
        'FPGA_DONE': [{'t': 'GLabel', 'dir': 'Output', 'x': 5400, 'y': 9500, 'ori': 2, 'new_x': 5700},],
        'FPGA_DONE_INT': [{'t': 'Label', 'x': 2900, 'y': 5100, 'ori': 2, 'new_x': 3400},],
        #                  {'t': 'GLabel', 'dir': 'UnSpc', 'x': 3700, 'y': 9500, 'ori': 0},],
        'FPGA_INIT_B': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 7130, 'y': 5600, 'ori': 2, 'new_x': 7600},],
        'FPGA_INIT_B_INT': [#{'t': 'GLabel', 'dir': 'UnSpc', 'x': 4800, 'y': 5400, 'ori': 0},
                            {'t': 'Label', 'x': 3340, 'y': 5200, 'ori': 2, 'new_x': 3940},],
        #'FPGA_INIT_B_INT1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2220, 'y': 5200, 'ori': 0},],
        'FPGA_JTAG_TCK': [{'t': 'Label', 'x': 2900, 'y': 5800, 'ori': 2, 'new_x': 3400},],
                          #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 8430, 'y': 8500, 'ori': 0},],
        'FPGA_JTAG_TDI': [{'t': 'Label', 'x': 2900, 'y': 5900, 'ori': 2, 'new_x': 3400},],
                          #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 8430, 'y': 8700, 'ori': 0},],
        'FPGA_JTAG_TDO': [{'t': 'Label', 'x': 2900, 'y': 6000, 'ori': 2, 'new_x': 3400},],
                          #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 8430, 'y': 8800, 'ori': 0},],
        'FPGA_JTAG_TMS': [{'t': 'Label', 'x': 2900, 'y': 6100, 'ori': 2, 'new_x': 3400},],
                          #{'t': 'GLabel', 'dir': 'UnSpc', 'x': 8430, 'y': 8600, 'ori': 0},],
        'FPGA_M0': [{'t': 'Label', 'x': 2900, 'y': 5500, 'ori': 2, 'new_x': 3400},
                    {'t': 'Label', 'x': 2600, 'y': 9000, 'ori': 0, 'new_x': 2500},],
        'FPGA_M1': [{'t': 'Label', 'x': 2900, 'y': 5600, 'ori': 2, 'new_x': 3400},
                    {'t': 'Label', 'x': 1750, 'y': 9000, 'ori': 0, 'new_x': 1700},],
        'FPGA_M2': [{'t': 'Label', 'x': 2900, 'y': 5700, 'ori': 2, 'new_x': 3400},
                    {'t': 'Label', 'x': 1000, 'y': 9000, 'ori': 0, 'new_x': 900},],
        'FPGA_PROGRAM_B': [{'t': 'GLabel', 'dir': 'Input', 'x': 7010, 'y': 5100, 'ori': 2, 'new_x': 7600},
                           {'t': 'GLabel', 'dir': 'Input', 'x': 3340, 'y': 5300, 'ori': 2, 'new_x': 3940},],
        #'FPGA_PROGRAM_B1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2220, 'y': 5300, 'ori': 0},],
    },
    'rev02_15.sch': {
       'ARM_FPGA_CFG_CS_N': [{'t': 'GLabel', 'dir': 'Input', 'x': 2980, 'y': 5630, 'ori': 0},],
       'ARM_FPGA_CFG_MISO': [{'t': 'GLabel', 'dir': 'Output', 'x': 5160, 'y': 5930, 'ori': 2},],
       'ARM_FPGA_CFG_MOSI': [{'t': 'GLabel', 'dir': 'Input', 'x': 2980, 'y': 5830, 'ori': 0},],
       'ARM_FPGA_CFG_SCLK': [{'t': 'GLabel', 'dir': 'Input', 'x': 2980, 'y': 5730, 'ori': 0},],
       'FPGA_CFG_CS_N': [{'t': 'GLabel', 'dir': 'Input', 'x': 3090, 'y': 6730, 'ori': 0},],
       'FPGA_CFG_CTRL_ARM_ENA': [{'t': 'GLabel', 'dir': 'Input', 'x': 430, 'y': 6130, 'ori': 0},],
       'FPGA_CFG_CTRL_FPGA_DIS': [{'t': 'GLabel', 'dir': 'Input', 'x': 430, 'y': 6430, 'ori': 0},],
       'FPGA_CFG_MISO': [{'t': 'GLabel', 'dir': 'Output', 'x': 5160, 'y': 7030, 'ori': 2},],
       'FPGA_CFG_MOSI': [{'t': 'GLabel', 'dir': 'Input', 'x': 3090, 'y': 6930, 'ori': 0},],
       'FPGA_CFG_SCLK': [{'t': 'GLabel', 'dir': 'Input', 'x': 3090, 'y': 6830, 'ori': 0},],
       'FPGA_GCLK': [{'t': 'GLabel', 'dir': 'Input', 'x': 6700, 'y': 9500, 'ori': 0},],
       #'FPGA_PROM_CS_N': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6900, 'y': 6300, 'ori': 0},
       #                   {'t': 'GLabel', 'dir': 'UnSpc', 'x': 5160, 'y': 5630, 'ori': 0},],
       #'FPGA_PROM_MISO': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6900, 'y': 6400, 'ori': 0},
       #                   {'t': 'GLabel', 'dir': 'UnSpc', 'x': 2980, 'y': 5930, 'ori': 0},],
       #'FPGA_PROM_MOSI': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 9150, 'y': 6600, 'ori': 0},
       #                   {'t': 'GLabel', 'dir': 'UnSpc', 'x': 5160, 'y': 5830, 'ori': 0},],
       #'FPGA_PROM_SCLK': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 9150, 'y': 6500, 'ori': 0},
       #                   {'t': 'GLabel', 'dir': 'UnSpc', 'x': 5160, 'y': 5730, 'ori': 0},],
       #'FPGA_PROM_W_N': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 6900, 'y': 6500, 'ori': 0},
       #                  {'t': 'GLabel', 'dir': 'UnSpc', 'x': 420, 'y': 6830, 'ori': 0},],
       #'SPI_A_TRISTATE': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 3360, 'y': 5510, 'ori': 1},],
       #'SPI_B_TRISTATE': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 3060, 'y': 7230, 'ori': 0},],
    },
    'rev02_17.sch': {
        'FMC_A0': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 5500, 'ori': 2, 'new_x': 7900},],
        'FMC_A1': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 5800, 'ori': 2, 'new_x': 7900},],
        'FMC_A10': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 6500, 'ori': 2, 'new_x': 7900},],
        'FMC_A11': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 6700, 'ori': 2, 'new_x': 7900},],
        'FMC_A12': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 7100, 'ori': 2, 'new_x': 7900},],
        'FMC_A13': [{'t': 'GLabel', 'dir': 'Input', 'x': 2220, 'y': 5600, 'ori': 2, 'new_x': 2950},],
        'FMC_A14': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 6900, 'ori': 2, 'new_x': 7900},],
        'FMC_A15': [{'t': 'GLabel', 'dir': 'Input', 'x': 2220, 'y': 9600, 'ori': 2, 'new_x': 2970},],
        'FMC_A16': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 7000, 'ori': 2, 'new_x': 7900},],
        'FMC_A17': [{'t': 'GLabel', 'dir': 'Input', 'x': 2220, 'y': 9500, 'ori': 2, 'new_x': 2970},],
        'FMC_A18': [{'t': 'GLabel', 'dir': 'Input', 'x': 2220, 'y': 9800, 'ori': 2, 'new_x': 2970},],
        'FMC_A2': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 5700, 'ori': 2, 'new_x': 7900},],
        'FMC_A3': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 5600, 'ori': 2, 'new_x': 7900},],
        'FMC_A4': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 5900, 'ori': 2, 'new_x': 7900},],
        'FMC_A5': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 6000, 'ori': 2, 'new_x': 7900},],
        'FMC_A6': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 6100, 'ori': 2, 'new_x': 7900},],
        'FMC_A7': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 6200, 'ori': 2, 'new_x': 7900},],
        'FMC_A8': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 6300, 'ori': 2, 'new_x': 7900},],
        'FMC_A9': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 6400, 'ori': 2, 'new_x': 7900},],
        'FMC_CLK': [{'t': 'GLabel', 'dir': 'Output', 'x': 7200, 'y': 7800, 'ori': 2, 'new_x': 7890},],
        'FMC_D0': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 9100, 'ori': 2, 'new_x': 2970},],
        'FMC_D1': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 9200, 'ori': 2, 'new_x': 2970},],
        'FMC_D13': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 6500, 'ori': 2, 'new_x': 2950},],
        'FMC_D14': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 6600, 'ori': 2, 'new_x': 2950},],
        'FMC_D15': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 6800, 'ori': 2, 'new_x': 2950},],
        'FMC_D16': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 6700, 'ori': 2, 'new_x': 2950},],
        'FMC_D17': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 6900, 'ori': 2, 'new_x': 2950},],
        'FMC_D18': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 7000, 'ori': 2, 'new_x': 2950},],
        'FMC_D19': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 7100, 'ori': 2, 'new_x': 2950},],
        'FMC_D2': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 5400, 'ori': 2, 'new_x': 2950},],
        'FMC_D20': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 7200, 'ori': 2, 'new_x': 2950},],
        'FMC_D21': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 7300, 'ori': 2, 'new_x': 2950},],
        'FMC_D22': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 7400, 'ori': 2, 'new_x': 2950},],
        'FMC_D23': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 7500, 'ori': 2, 'new_x': 2950},],
        'FMC_D24': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 7200, 'y': 7500, 'ori': 2, 'new_x': 7900},],
        'FMC_D25': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 7700, 'ori': 2, 'new_x': 2950},],
        'FMC_D26': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 7200, 'y': 7900, 'ori': 2, 'new_x': 7900},],
        'FMC_D27': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 7200, 'y': 6600, 'ori': 2, 'new_x': 7900},],
        'FMC_D3': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2220, 'y': 5500, 'ori': 2, 'new_x': 2950},],
        'FMC_D4': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 7200, 'y': 6800, 'ori': 2, 'new_x': 7900},],
        'FMC_D5': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 7200, 'y': 7300, 'ori': 2, 'new_x': 7900},],
        'FMC_D6': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 7200, 'y': 7600, 'ori': 2, 'new_x': 7900},],
        'FMC_D7': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 7200, 'y': 7700, 'ori': 2, 'new_x': 7900},],
        'FMC_NE1': [{'t': 'GLabel', 'dir': 'Input', 'x': 2220, 'y': 8400, 'ori': 2, 'new_x': 2950},],
        'FMC_NOE': [{'t': 'GLabel', 'dir': 'Input', 'x': 7200, 'y': 8700, 'ori': 2, 'new_x': 7910},],
        'FMC_NWAIT': [{'t': 'GLabel', 'dir': 'Output', 'x': 2220, 'y': 8700, 'ori': 2, 'new_x': 2960},],
        'FMC_NWE': [{'t': 'GLabel', 'dir': 'Input', 'x': 2220, 'y': 8800, 'ori': 2, 'new_x': 2960},],
        'FPGA_GPIO_LED_0': [{'t': 'GLabel', 'dir': 'Output', 'x': 2220, 'y': 6300, 'ori': 2, 'new_x': 2950},],
        'FPGA_GPIO_LED_1': [{'t': 'GLabel', 'dir': 'Output', 'x': 2230, 'y': 5300, 'ori': 2, 'new_x': 2950},],
        'MKM_FPGA_CS_N': [{'t': 'GLabel', 'dir': 'Output', 'x': 2230, 'y': 5900, 'ori': 2, 'new_x': 2950},],
        'MKM_FPGA_MISO': [{'t': 'GLabel', 'dir': 'Input', 'x': 2230, 'y': 6200, 'ori': 2, 'new_x': 2950},],
        'MKM_FPGA_MOSI': [{'t': 'GLabel', 'dir': 'Output', 'x': 2230, 'y': 6100, 'ori': 2, 'new_x': 2950},],
        'MKM_FPGA_SCK': [{'t': 'GLabel', 'dir': 'Output', 'x': 2230, 'y': 6400, 'ori': 2, 'new_x': 2950},],
    },
    'rev02_18.sch': {
        'FPGA_VCCAUX_1V8': [{'t': 'GLabel', 'dir': 'Output', 'x': 6100, 'y': 4800, 'ori': 2, 'new_x': 7000},],
        'POK_VCCAUX': [{'t': 'GLabel', 'dir': 'Output', 'x': 4000, 'y': 6200, 'ori': 2, 'new_y': 6500},],
        'POK_VCCO': [{'t': 'GLabel', 'dir': 'Output', 'x': 4000, 'y': 9700, 'ori': 2},],
        'PWR_ENA_VCCAUX': [{'t': 'GLabel', 'dir': 'Input', 'x': 1900, 'y': 4740, 'ori': 0, 'new_y': 4150},],
        'PWR_ENA_VCCO': [{'t': 'GLabel', 'dir': 'Input', 'x': 1400, 'y': 7500, 'ori': 0},],
        'VCCO_3V3': [{'t': 'Label', 'x': 6100, 'y': 8000, 'ori': 2, 'new_x': 7000},],
    },
    'rev02_19.sch': {
        'AVR_GPIO_FPGA_0': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2100, 'y': 8100, 'ori': 2, 'new_x': 3100},],
        'AVR_GPIO_FPGA_1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2100, 'y': 8200, 'ori': 2, 'new_x': 3100},],
        'AVR_GPIO_FPGA_2': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2100, 'y': 8300, 'ori': 2, 'new_x': 3100},],
        'AVR_GPIO_FPGA_3': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2100, 'y': 8400, 'ori': 2, 'new_x': 3100},],
        'FPGA_ENTROPY_DISABLE': [{'t': 'GLabel', 'dir': 'Output', 'x': 2100, 'y': 7200, 'ori': 2, 'new_x': 3100},],
        'FPGA_GCLK': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2100, 'y': 7300, 'ori': 2, 'new_x': 3100},],
        'FPGA_GPIO_A_0': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2100, 'y': 5800, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 7600, 'y': 5000, 'ori': 0},],
        'FPGA_GPIO_A_1': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2100, 'y': 5700, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 9300, 'y': 5000, 'ori': 2, 'new_x': 10000},],
        'FPGA_GPIO_A_2': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2100, 'y': 6900, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 7600, 'y': 5100, 'ori': 0},],
        'FPGA_GPIO_A_3': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2100, 'y': 7000, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 9300, 'y': 5100, 'ori': 2, 'new_x': 10000},],
        'FPGA_GPIO_A_4': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2100, 'y': 6500, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 7600, 'y': 5300, 'ori': 0},],
        'FPGA_GPIO_A_5': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2100, 'y': 6600, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 9300, 'y': 5300, 'ori': 2, 'new_x': 10000},],
        'FPGA_GPIO_A_6': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2110, 'y': 6700, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 7600, 'y': 5400, 'ori': 0},],
        'FPGA_GPIO_A_7': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2100, 'y': 6300, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 9300, 'y': 5400, 'ori': 2, 'new_x': 10000},],
        'FPGA_GPIO_B_0': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2110, 'y': 6800, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 7600, 'y': 6900, 'ori': 0},],
        'FPGA_GPIO_B_1': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2100, 'y': 5600, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 9300, 'y': 6900, 'ori': 2, 'new_x': 10000},],
        'FPGA_GPIO_B_2': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2100, 'y': 6400, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 7600, 'y': 7000, 'ori': 0},],
        'FPGA_GPIO_B_3': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2110, 'y': 6100, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 9300, 'y': 7000, 'ori': 2, 'new_x': 10000},],
        'FPGA_GPIO_B_4': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2100, 'y': 7500, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 7600, 'y': 7200, 'ori': 0},],
        'FPGA_GPIO_B_5': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2100, 'y': 9200, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 9300, 'y': 7200, 'ori': 2, 'new_x': 10000},],
        'FPGA_GPIO_B_6': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2100, 'y': 8800, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 7600, 'y': 7300, 'ori': 0},],
        'FPGA_GPIO_B_7': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2100, 'y': 8900, 'ori': 2, 'new_x': 3100},
                          {'t': 'GLabel', 'dir': 'BiDi', 'x': 9300, 'y': 7300, 'ori': 2, 'new_x': 10000},],
        'FPGA_GPIO_LED_0': [{'t': 'GLabel', 'dir': 'Input', 'x': 7300, 'y': 8900, 'ori': 0},],
        'FPGA_GPIO_LED_1': [{'t': 'GLabel', 'dir': 'Input', 'x': 7300, 'y': 8800, 'ori': 0},],
        'FPGA_GPIO_LED_2': [{'t': 'GLabel', 'dir': 'Input', 'x': 7300, 'y': 8700, 'ori': 0},],
        'FPGA_GPIO_LED_3': [{'t': 'GLabel', 'dir': 'Input', 'x': 7300, 'y': 8600, 'ori': 0},],
        'FPGA_IRQ_N_0': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2100, 'y': 5200, 'ori': 2, 'new_x': 3100},],
        'FPGA_IRQ_N_1': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2100, 'y': 5300, 'ori': 2, 'new_x': 3100},],
        'FPGA_IRQ_N_2': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2100, 'y': 5400, 'ori': 2, 'new_x': 3100},],
        'FPGA_IRQ_N_3': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2100, 'y': 5500, 'ori': 2, 'new_x': 3100},],
    },
    'rev02_20.sch': {
        'DIGITIZED_NOISE': [{'t': 'GLabel', 'dir': 'Input', 'x': 2460, 'y': 7400, 'ori': 2, 'new_x': 3600},],
        'FMC_A19': [{'t': 'GLabel', 'dir': 'Input', 'x': 2460, 'y': 7000, 'ori': 2, 'new_x': 3600},],
        'FMC_A20': [{'t': 'GLabel', 'dir': 'Input', 'x': 2460, 'y': 7100, 'ori': 2, 'new_x': 3600},],
        'FMC_A21': [{'t': 'GLabel', 'dir': 'Input', 'x': 2460, 'y': 8100, 'ori': 2, 'new_x': 3610},],
        'FMC_A22': [{'t': 'GLabel', 'dir': 'Input', 'x': 2460, 'y': 6800, 'ori': 2, 'new_x': 3600},],
        'FMC_A23': [{'t': 'GLabel', 'dir': 'Input', 'x': 2460, 'y': 6900, 'ori': 2, 'new_x': 3600},],
        'FMC_A24': [{'t': 'GLabel', 'dir': 'Input', 'x': 2460, 'y': 8500, 'ori': 2, 'new_x': 3600},],
        'FMC_A25': [{'t': 'GLabel', 'dir': 'Input', 'x': 2460, 'y': 8000, 'ori': 2, 'new_x': 3600},],
        'FMC_D10': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2460, 'y': 7500, 'ori': 2, 'new_x': 3600},],
        'FMC_D11': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2450, 'y': 10000, 'ori': 2, 'new_x': 3600},],
        'FMC_D12': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2460, 'y': 7200, 'ori': 2, 'new_x': 3600},],
        'FMC_D28': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2460, 'y': 7300, 'ori': 2, 'new_x': 3600},],
        'FMC_D29': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2460, 'y': 7800, 'ori': 2, 'new_x': 3600},],
        'FMC_D30': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2460, 'y': 5500, 'ori': 2, 'new_x': 3100},],
        'FMC_D31': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2460, 'y': 5400, 'ori': 2, 'new_x': 3100},],
        'FMC_D8': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2460, 'y': 7600, 'ori': 2, 'new_x': 3600},],
        'FMC_D9': [{'t': 'GLabel', 'dir': 'BiDi', 'x': 2460, 'y': 6700, 'ori': 2, 'new_x': 3600},],
        'FMC_NL': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 2460, 'y': 8300, 'ori': 2, 'new_x': 3600},],
        'FPGA_CFG_CS_N': [{'t': 'GLabel', 'dir': 'Output', 'x': 3600, 'y': 6200, 'ori': 2},],
        'FPGA_CFG_CS_N1': [{'t': 'Label', 'x': 2460, 'y': 6200, 'ori': 2},],
        'FPGA_CFG_MISO': [{'t': 'GLabel', 'dir': 'Input', 'x': 3600, 'y': 5300, 'ori': 2},],
        'FPGA_CFG_MISO1': [{'t': 'Label', 'x': 2460, 'y': 5300, 'ori': 2},],
        'FPGA_CFG_MOSI': [{'t': 'GLabel', 'dir': 'UnSpc', 'x': 3600, 'y': 5200, 'ori': 2},],
        'FPGA_CFG_MOSI1': [{'t': 'Label', 'x': 2460, 'y': 5200, 'ori': 2},],
        'FPGA_GPIO_LED_2': [{'t': 'GLabel', 'dir': 'Output', 'x': 2470, 'y': 6500, 'ori': 2, 'new_x': 3600},],
        'FPGA_GPIO_LED_3': [{'t': 'GLabel', 'dir': 'Output', 'x': 2470, 'y': 6600, 'ori': 2, 'new_x': 3600},],
    },
    'rev02_24.sch': {
        'FPGA_VCCINT_1V0': [{'t': 'Label', 'x': 8300, 'y': 6400, 'ori': 2},],
        'POK_VCCINT': [{'t': 'GLabel', 'dir': 'Output', 'x': 5350, 'y': 9100, 'ori': 2, 'new_x': 5600},],
        'PWR_ENA_VCCINT': [{'t': 'GLabel', 'dir': 'Input', 'x': 2700, 'y': 5900, 'ori': 0},],
    },
    'rev02_25.sch': {
        'POK_VCCAUX': [{'t': 'GLabel', 'dir': 'Input', 'x': 1540, 'y': 8700, 'ori': 0, 'new_x': 1450},],
        'POK_VCCINT': [{'t': 'GLabel', 'dir': 'Input', 'x': 5100, 'y': 5300, 'ori': 0, 'new_x': 5000},],
        'POK_VCCO': [{'t': 'GLabel', 'dir': 'Input', 'x': 6110, 'y': 8700, 'ori': 0, 'new_x': 6050},],
        'PWR_ENA_VCCAUX': [{'t': 'GLabel', 'dir': 'Output', 'x': 7250, 'y': 5300, 'ori': 2, 'new_x': 7900},],
        'PWR_ENA_VCCINT': [{'t': 'GLabel', 'dir': 'Output', 'x': 2660, 'y': 5300, 'ori': 2, 'new_x': 3400},],
        'PWR_ENA_VCCO': [{'t': 'GLabel', 'dir': 'Output', 'x': 3690, 'y': 8700, 'ori': 2, 'new_x': 4350},],
    },
}

def update_text_line(text, prev, entrys):
    m = re.match('^Text Label (\d+) +(\d+) +(\d+) +(\d+) +~', prev)
    x, y, orient, dim = m.groups()
    x = int(x)
    y = int(y)
    orient = int(orient)
    dim = int(dim)

    matching_entrys = [this for this in entrys if this['x'] == x and this['y'] == y]
    if not matching_entrys:
        sys.stderr.write("Label: {} No label matching X {!r} and Y {!r}: {!r}\n".format(text, x, y, entrys))
        return prev

    for this in matching_entrys:
        new = copy(this)
        if 'dim' not in new:
            new['dim'] = 48
        if 'new_x' in new:
            new['x'] = new.pop('new_x')
        if 'new_y' in new:
            new['y'] = new.pop('new_y')
        if 'rel_x' in new:
            new['x'] += new.pop('rel_x')
        if 'rel_y' in new:
            new['y'] += new.pop('rel_y')
        if this['t'] == 'GLabel':
            return 'Text GLabel {x:} {y:} {ori:} {dim:} {shape:} ~ 0'.format(
                x = new['x'],
                y = new['y'],
                ori = new['ori'],
                dim = new['dim'],
                shape = new['dir'],
            )
        if this['t'] == 'Label':
            return 'Text Label {x:} {y:} {ori:} {dim:} ~ 0'.format(
                x = new['x'],
                y = new['y'],
                ori = new['ori'],
                dim = new['dim'],
            )
        if this['t'] == 'Delete':
            return None
    return prev


def fix_labels(fn_in, fn_out, file_labels):
    in_ = open(fn_in)
    out = open(fn_out, 'w')
    prev = None
    fn = os.path.basename(fn_in)
    print('Fixing labels in {}'.format(fn))
    for line in in_.readlines():
        #print('R: {!r}'.format(line))
        if prev is not None:
            while prev.endswith('\n'):
                prev = prev[:-1]
            text = line[:-1]
            #print('CHECK: {!r} + {!r}'.format(prev, text))
            if re.match('^[A-Z0-9_]+$', text):
                if text in file_labels:
                    new = update_text_line(text, prev, file_labels[text])
                    if new is None:
                        print("Label: {!r} Deleting : {!r}".format(text, prev))
                        prev = None
                        continue
                    if new != prev:
                        print("Label: {!r} OLD {!r},  NEW : {!r}".format(text, prev, new))
                        out.write(new + '\n')
                    else:
                        print("Label: {!r} UNCHANGED : {}".format(text, prev))
                        out.write(prev + '\n')
                else:
                    #print("Unknown label: {!r} (not in {})".format(text, file_labels.keys()))
                    print("Unknown label: {!r}".format(text))
                    out.write(prev + '\n')
            else:
                out.write(prev + '\n')
            prev = None
        elif line.startswith('Text Label '):
            prev = line
            continue
        out.write(line)
    return True


def main(schemas, labels):
    for this in schemas:
        fn = os.path.basename(this)
        if fn not in labels:
            print('Skipping file {}'.format(fn))
            continue
        if fix_labels(this, this + '.tmp', labels[fn]):
            os.rename(this + '.tmp', this)

    return True


if __name__ == '__main__':
    try:
        if len(sys.argv) == 0:
            sys.stderr.write('Syntax: fix-labels.py *.sch\n')
            sys.exit(1)
        schemas = [x for x in sys.argv if x.endswith('.sch')]
        res = main(schemas, labels)
        if res:
            sys.exit(0)
        sys.exit(1)
    except KeyboardInterrupt:
        pass