-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblockio.tex
More file actions
1057 lines (836 loc) · 28.2 KB
/
blockio.tex
File metadata and controls
1057 lines (836 loc) · 28.2 KB
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
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[10pt]{standalone}
\usepackage{tikz}
\usepackage{pgfblockio}
\usepackage[margin=1mm]{geometry} % no margins
\widowpenalty=0\relax % no empty lines at the end of page
\clubpenalty=0\relax % no empty lines at the end of page
\pagestyle{empty} % no headers or footers
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\begin{document}
%
% ------- Test Block AT
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\coordinate (ref) at (1,1);
\filldraw (ref) circle[radius=1pt] node[below,font=\tiny] {ref};
\begin{blockio}[at=(ref)]{Block AT}
\end{blockio}
\end{tikzpicture}
%
% ------- Test Block size and text anchor
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\begin{blockio}[min width=2cm,
min height=3cm,
name=blk,
text anchor=north east]{size 2 x 3}
\end{blockio}
\node[below=5pt of blk-text,font=\tiny,align=center] {text anchor\\north east};
\end{tikzpicture}
%
% ------- Test Block inner sep
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\begin{blockio}[inner sep=0pt,name=empty]{}
\end{blockio}
\node[below=5pt of empty,font=\tiny] {inner sep=0pt};
\end{tikzpicture}
%
% ------- Test Block fit
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\coordinate (ref1) at (1,1);
\coordinate (ref2) at (-1,0);
\filldraw (ref1) circle[radius=1pt] node[below,font=\tiny] {ref1};
\filldraw (ref2) circle[radius=1pt] node[above,font=\tiny] {ref2};
\begin{blockio}[fit=(ref1)(ref2),text style={align=center,font=\tiny}]{Block Fit\\ Text Style \\ Center \& Tiny }
\end{blockio}
\end{tikzpicture}
%
% ------- Test Block name
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\begin{blockio}[name=BLK_CN,
text style={align=center},
anchor=south west]
{Custom Name\\BLK\_CN\\anchored south west}
\end{blockio}
\node[below=5pt of BLK_CN,font=\tiny] {BLK\_CN};
\end{tikzpicture}
%
% ------- Test block iopin in sep
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\begin{blockio}[in sep=1pt]{\tiny in sep=0pt}
\iopin[north,in,name=iopin-n]{N}
\iopin[east,out]{E}
\end{blockio}
\end{tikzpicture}
%
% ------- Test block iopin out sep and IOPin name
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\begin{blockio}[out sep=1pt]{\tiny out sep=1pt}
\iopin[west,in,name=IOPW]{W}
\iopin[south,out]{\tiny S}
\iopin[east,in]{E-exp}
\iopin[east,out]{E-out}
\end{blockio}
\node[above left=0pt of IOPW-text,inner sep=0,font=\tiny,align=center] {IO Pin\\'IOPW'};
\end{tikzpicture}
%
% ------- Test iopin shape and path style, iopin text style
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\tikzset{mystyle/.style={
blue,thick,
append after command={
node[fill=blue,dart,font=\tiny,
inner sep=0.5mm,outer sep=0,
minimum size=0mm,rotate=\blkiopinrotate]
at (\tikzlastnode.out) {}
}
}}
\begin{blockio}[shape=diamond]{\tiny Shape}
\iopin[west,in,style={iopin}]{iopin1}
\iopin[west,out,style={iopin}]{iopin2}
\iopin[south,in,style={ioduplex}]{S1}
\iopin[south,out,style={ioduplex},text style={blue,draw}]{S2}
\iopin[east,in,style={ioline}]{E1}
\iopin[east,out,style={ioline,mystyle},link style={blue,thick}]{E2}
\iopin[north,out,style={draw=none,
append after command={ (\blkiopinname.in) to[bend left] (\tikzlastnode.out) node {\tikzlastnode -\blkiopinrotate - \blkiopinanchor} node[draw] at (\blkiopinname.symbol) {}
}}]
{N1}
\end{blockio}
\end{tikzpicture}
%
% ------- Sides Min Depth
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\blkioset{block/mindepth/.style={min depth north=20mm,min depth south=20mm,
min depth east=10mm,min depth west=10mm}}
\begin{blockio}[mindepth,name=blk]{Min Depth}
\iopin[west,in,style={iopin}]{iopin0}
\iopin[west,in,style={iopin}]{iopin1}
\iopin[west,out,style={iopin}]{iopin2}
\iopin[south left,in,style={ioduplex}]{S1}
\iopin[south right,out,style={ioduplex}]{S2}
\end{blockio}
\draw[<->] (blk.block north) -- node[above,font=\tiny,rotate=90] {2cm} ($(blk.block north)+(0,20mm)$);
\draw[<->] (blk.block south) -- node[above,font=\tiny,rotate=90] {2cm} ($(blk.block south)+(0,-20mm)$);
\draw[<->] (blk.block east) -- node[above,font=\tiny] {10mm} ($(blk.block east)+(10mm,0)$);
\draw[<->] (blk.block north west) -- node[above,font=\tiny] {10mm} ($(blk.block north west)+(-10mm,0)$);
\node[below right=0 of blk.block south east,font=\tiny,gray] {blk};
\end{tikzpicture}
%
% ------- Sides Min Span
%
\begin{tikzpicture}
\begin{blockio}[name=blk, min span north=2cm,min span west down=2cm]{Min Span\\north / west}
\iopin[north left,in]{NL-i}
\iopin[north center,in]{NC-i}
\iopin[north right,in]{NR-i}
\iopin[east up,in]{EU-i}
\iopin[east center,in]{EC-i}
\iopin[east down,in]{ED-i}
\iopin[west up,out]{WU-o}
\iopin[west center,out]{WC-o}
\iopin[west down,out]{WD-o}
\iopin[south left,out]{SL-o}
\iopin[south center,out]{SC-o}
\iopin[south right,out]{SR-o}
\end{blockio}
\begin{blockio}[ min span north right=2cm,min span east=2cm,right= of blk]{Min Span\\north / east}
\iopin[north left,in]{NL-i}
\iopin[north center,in]{NC-i}
\iopin[north right,in]{NR-i}
\iopin[east up,in]{EU-i}
\iopin[east center,in]{EC-i}
\iopin[east down,in]{ED-i}
\iopin[west up,out]{WU-o}
\iopin[west center,out]{WC-o}
\iopin[west down,out]{WD-o}
\iopin[south left,out]{SL-o}
\iopin[south center,out]{SC-o}
\iopin[south right,out]{SR-o}
\end{blockio}
\begin{blockio}[min span west=2cm,min span south right=2cm,below= of blk]{Min Span\\ west / south}
\iopin[north left,in]{NL-i}
\iopin[north center,in]{NC-i}
\iopin[north right,in]{NR-i}
\iopin[east up,in]{EU-i}
\iopin[east center,in]{EC-i}
\iopin[east down,in]{ED-i}
\iopin[west up,out]{WU-o}
\iopin[west center,out]{WC-o}
\iopin[west down,out]{WD-o}
\iopin[south left,out]{SL-o}
\iopin[south center,out]{SC-o}
\iopin[south right,out]{SR-o}
\end{blockio}
\begin{blockio}[min span east down=2cm,min span south=2cm,below right= of blk]{Min Span\\ east / south}
\iopin[north left,in]{NL-i}
\iopin[north center,in]{NC-i}
\iopin[north right,in]{NR-i}
\iopin[east up,in]{EU-i}
\iopin[east center,in]{EC-i}
\iopin[east down,in]{ED-i}
\iopin[west up,out]{WU-o}
\iopin[west center,out]{WC-o}
\iopin[west down,out]{WD-o}
\iopin[south left,out]{SL-o}
\iopin[south center,out]{SC-o}
\iopin[south right,out]{SR-o}
\end{blockio}
\end{tikzpicture}
%
% ------------- Block All IOPin
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\begin{blockio}[ min size=4cm,text style={align=center}]
{Block\\
All IOPin\\
\small [north,south][left,center,right]\\
\small [east, west][up,center,down] }
\iopin[north left,in]{NL-i}
\iopin[north left,out]{NL-o}
\iopin[north center,in]{NC-i}
\iopin[north center,out]{NC-o}
\iopin[north right,in]{NR-i}
\iopin[north right,out]{NR-o}
\iopin[east up,in]{EU-i}
\iopin[east up,out]{EU-o}
\iopin[east center,in]{EC-i}
\iopin[east center,out]{EC-o}
\iopin[east down,in]{ED-i}
\iopin[east down,out]{ED-o}
\iopin[west up,in]{WU-i}
\iopin[west up,out]{WU-o}
\iopin[west center,in]{WC-i}
\iopin[west center,out]{WC-o}
\iopin[west down,in]{WD-i}
\iopin[west down,out]{WD-o}
\iopin[south left,in]{SL-i}
\iopin[south left,out]{SL-o}
\iopin[south center,in]{SC-i}
\iopin[south center,out]{SC-o}
\iopin[south right,in]{SR-i}
\iopin[south right,out]{SR-o}
\end{blockio}
\end{tikzpicture}
%
% ---------------- Block anchors
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\begin{blockio}[text style={align=center},block style={draw,gray},shape=diamond,min size=3cm,name=s]{}
\iopin[north right,in]{NR-In}
\iopin[east down,out]{ED-Out}
\iopin[west up,in]{WU-In}
\iopin[south left,out]{SL-Out}
\end{blockio}
\foreach \anchor/\placement in
{north west/above left, north/above, north east/above right,
west/left, center/above, east/right,
south west/below left, south/below, south east/below right,
20/right, 130/above}
\draw [shift=(s.\anchor)] plot [mark=*] coordinates{(0, 0)}
node [\placement] {\scriptsize\texttt{(s.\anchor)}};
\foreach \anchor/\placement in
{north west/above left, north/above, north east/above right,
west/left, center/below, east/right,
south west/below left, south/below, south east/below right}
\draw [color=red,shift=(s.block \anchor)] plot [mark=x] coordinates{(0, 0)}
node [\placement] {\scriptsize\texttt{(s.block \anchor)}};
\end{tikzpicture}
%
% ---------------- IOPin anchors
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\begin{blockio}[text style={align=center},min height=3cm,name=s,every io space = 4mm,in sep=2cm,out sep=2cm]{IOPin\\Anchor}
\iopin[east up,out]{Eo}
\iopin[east down,in,style={opacity=0.3},text style={minimum width=2cm,minimum height=5mm,text opacity=.3}]{Ei}
\end{blockio}
\foreach \anchor/\placement in
{north west/above left, north east/above right,
south west/below left, south east/below right}
\draw [shift=(Eo.\anchor)] plot [mark=x] coordinates{(0, 0)}
node [\placement] {\tiny\texttt{(Eo.\anchor)}};
\foreach \anchor/\placement in
{in/left, out/right,symbol in/above left,symbol out/above right,symbol/below}
\draw [color=red,shift=(Eo.\anchor)] plot [mark=x] coordinates{(0, 0)}
node [\placement] {\tiny\texttt{(Eo.\anchor)}};
\foreach \anchor/\placement in
{north west/above left, north/above, north east/above right,
west/left, center/above, east/right,
south west/below left, south/below, south east/below right,
10/right}
\draw [shift=(Ei-text.\anchor)] plot [mark=x] coordinates{(0, 0)}
node [\placement] {\tiny\texttt{(Ei-text.\anchor)}};
\end{tikzpicture}
%
% ---------------- IOPin Block Labels
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
% ------------ GPIO
\tikzset{LKLabel/.style={
color=teal
}}
\blkioset{IOLABEL/.style={/blkio/io/.cd,
style={
LKLabel,fill=white,
append after command={
node[anchor=\blklabelinanchor,text=teal,rotate=\blkiopinrotate,font=\fontsize{0.1em}{1pt}\selectfont] at (pinblockedge) {Label}
}
},
out,
link style={
LKLabel
}
}}
\begin{blockio}[text style={align=center},min size=2cm,name=s,every io space = 4mm,inner sep=10mm]{IOPin\\Block Label}
\iopin[east,IOLABEL]{Ele}
\iopin[west,IOLABEL,in]{Elw}
\iopin[north,IOLABEL]{Eln}
\iopin[south,IOLABEL,in]{Els}
\end{blockio}
\end{tikzpicture}
%
% IO Pin standalone
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\coordinate (ref1) at (1,1);
\filldraw (ref1) circle[radius=1pt] node[below,font=\tiny] {ref};
\coordinate (ref2) at (-1,-1);
\filldraw (ref2) circle[radius=1pt] node[below,font=\tiny] {ref};
\iopin[above,at=(ref1)]{above};
\iopin[right,at=(ref1)]{right};
\iopin[left,at=(ref1)]{left};
\iopin[below,at=(ref1)]{below};
\iopin[out,above,at=(ref2)]{above};
\iopin[out,right,at=(ref2)]{right};
\iopin[out,left,at=(ref2)]{left};
\iopin[out,below,at=(ref2)]{below};
\end{tikzpicture}
%
% IO Pin standalone - long text and lines
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\coordinate (ref) at (-1,-1);
\filldraw (ref) circle[radius=1pt] node[below,font=\tiny] {ref};
\iopin[out,right,at=(ref)]{IOPin\\With Long Text\\And lines};
\end{tikzpicture}
%
% IO Pin standalone - growth
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\coordinate (ref) at (0,0);
\filldraw (ref) circle[radius=1pt] node[below,font=\tiny] {ref};
\iopin[in,right,at=(ref),text style={font=\tiny}]{Growth \\@ io};
\iopin[out,growth=start,left,at=(ref),text style={font=\tiny}]{Growth \\@ start};
\iopin[out,growth=end,left,at=(ref),text style={font=\tiny}]{Growth \\@ end};
\iopin[in,right,at=(ref),gshift=-1cm,text style={font=\tiny}]{Growth \\@ io\\ \& -1cm shift};
\end{tikzpicture}
%
% IO Pin standalone - growth
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\coordinate (ref) at (0,0);
\filldraw (ref) circle[radius=1pt] node[below,font=\tiny] {ref};
\iopin[in,above,at=(ref),text style={font=\tiny}]{Growth \\@ io};
\iopin[out,growth=start,below,at=(ref),text style={font=\tiny}]{Growth \\@ start};
\iopin[out,growth=end,below,at=(ref),text style={font=\tiny}]{Growth \\@ end};
\iopin[in,above,at=(ref),gshift=-1cm,text style={font=\tiny}]{Growth \\@ io\\ \& -1cm shift};
\end{tikzpicture}
%
%
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\coordinate (ref) at (0.5,0.5);
\filldraw (ref) circle[radius=1pt] node[below,font=\tiny,text opacity=0.3] {ref};
\begin{blockio}[text style={align=center,draw,blue},
at=(ref),
inner sep=0pt,
name=BS,
shape=ellipse
%shape={diamond}
%shape={regular polygon,regular polygon sides=5,shape border rotate=15}
%shape={isosceles triangle,isosceles triangle stretches,shape border rotate=0}
%shape={shape=kite,shape border rotate=90}
%shape={ellipse}
]{Block Shape}
\iopin[north left,in]{NL-i}
\iopin[north left,out]{NL-o}
\iopin[north center,in]{NC-i}
\iopin[north center,out]{NC-o}
\iopin[north right,in]{NR-i}
\iopin[north right,out]{NR-o}
\iopin[east up,in]{EU-i}
\iopin[east up,out]{EU-o}
% \iopin[east center,out]{EC-o}
% \iopin[east center,in]{EC-i}
\iopin[east down,in]{ED-i}
\iopin[east down,out]{ED-o}
\iopin[west up,in]{WU-i}
\iopin[west up,out]{WU-o}
% \iopin[west center,in]{WC-i}
% \iopin[west center,out]{WC-o}
\iopin[west down,in]{WD-i}
\iopin[west down,out]{WD-o}
\iopin[south left,in]{SL-i}
\iopin[south left,out]{SL-o}
\iopin[south center,in]{SC-i}
\iopin[south center,out]{SC-o}
\iopin[south right,in]{SR-i}
\iopin[south right,out]{SR-o}
\end{blockio}
%\pgfpointshapeborder
\draw[yellow,thick] (BS.south east) -- (BS);
\draw[yellow,thick] (BS.north east) -- (BS-shape);
\draw[yellow,thick] (BS.south west) -- (BS);
%\filldraw (BS.center) circle[radius=1pt];
%\filldraw (BS-shape.center) circle[radius=1pt];
\end{tikzpicture}
%
%
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\foreach \n [count=\i] in {RP3N,RP3E,RP3W,RP3S,
RP5N,RP5E,RP5W,RP5S,
RP6H,RP6V,RP8}
{
\pgfmathparse{mod(\i-1,4)}
\edef\iy{\pgfmathresult}
\pgfmathparse{(\i-\iy-1)/4}
\edef\ix{\pgfmathresult}
\begin{blockio}[block style={draw,dashed,gray},shape=\n,at={(\ix*2.5cm-4cm,\iy*2.5cm-4cm)},text style={font=\tiny},name=\n]{\n}
\end{blockio}
\draw [shift=(\n-shape.corner 1)] plot [mark=x] coordinates{(0, 0)};
}
\end{tikzpicture}
%
%
%
\begin{tikzpicture}
\foreach \n [count=\i] in {rectangle,diamond,ellipse}
{
\pgfmathparse{mod(\i-1,4)}
\edef\iy{\pgfmathresult}
\pgfmathparse{(\i-\iy-1)/4}
\edef\ix{\pgfmathresult}
\begin{blockio}[inner sep=0,block style={draw,dashed,gray},shape=\n,at={(\ix*2.5cm,\iy*2.5cm)},text style={font=\tiny,draw,cyan,densely dashed,text=black},name=\n]{\n}
\end{blockio}
}
\end{tikzpicture}
%
%
%
\begin{tikzpicture}
\begin{blockio}[block style={draw,dashed,gray},shape=RP5E,text style={font=\tiny},name=B]{1-RP5E}
\iopin[north left,in]{NL-i}
\iopin[north left,out]{NL-o}
\iopin[north center,in]{NC-i}
\iopin[north center,out]{NC-o}
\iopin[north right,in]{NR-i}
\iopin[north right,out]{NR-o}
\iopin[east up,in]{EU-i}
\iopin[east up,out]{EU-o}
\iopin[west up,in]{WU-i}
\iopin[west down,out]{WD-o}
\iopin[south left,in]{SL-i}
\iopin[south left,out]{SL-o}
\iopin[south center,in]{SC-i}
\iopin[south center,out]{SC-o}
\iopin[south right,in]{SR-i}
\iopin[south right,out]{SR-o}
\end{blockio}
\begin{blockio}[block style={draw,dashed,gray},shape=RP5E,text style={font=\tiny},anchor=south west,at=(B.north west)]{2-RP5E}
\iopin[north left,in]{NL-i}
\iopin[north left,out]{NL-o}
\iopin[east up,in]{EU-i}
\iopin[east up,out]{EU-o}
\iopin[east center,out]{EC-o}
\iopin[east center,in]{EC-i}
\iopin[east down,in]{ED-i}
\iopin[east down,out]{ED-o}
\iopin[west up,in]{WU-i}
\iopin[west up,out]{WU-o}
\iopin[west center,in]{WC-i}
\iopin[west center,out]{WC-o}
\iopin[west down,in]{WD-i}
\iopin[west down,out]{WD-o}
\iopin[south left,in]{SL-i}
\iopin[south right,out]{SR-o}
\end{blockio}
\end{tikzpicture}
%
%
%
\begin{tikzpicture}
\draw[gray,opacity=0.2,step=10pt] (-1,-1) grid (1,1);
\foreach \i in {0,...,4} {
\filldraw (-0.5cm,-0.5cm+\i*2cm) circle[radius=1pt] node[coordinate,label={[font=\tiny]below left:\i-A}] (\i-A) {} ;
\filldraw (0.5cm,0.5cm+\i*2cm) circle[radius=1pt] node[coordinate,label={[font=\tiny]above right:\i-B}] (\i-B) {} ;
}
\linkio{0-A}{0-B}
\iopin[at=(1-A),below,in]{P1}
\linkio{P1}{1-B}
\iopin[at=(2-B),above,out]{P2}
\linkio{2-A}{P2}
\iopin[at=(3-B),right,out]{P3}
\linkio{3-A}{P3}
\iopin[at=(4-A),left,in]{P4}
\linkio{P4}{4-B}
\end{tikzpicture}
%
%
%
\begin{tikzpicture}
\draw[gray,opacity=0.2,step=10pt] (-1,-1) grid (1,1);
\foreach \i in {0,...,4} {
\filldraw (-0.5cm,-0.5cm+\i*2cm) circle[radius=1pt] node[coordinate,label={[font=\tiny]below left:\i-A}] (\i-A) {} ;
\filldraw (0.5cm,0.5cm+\i*2cm) circle[radius=1pt] node[coordinate,label={[font=\tiny]above right:\i-B}] (\i-B) {} ;
}
\iopin[at=(0-A),left,in]{P0i}
\iopin[at=(0-B),right,out]{P0o}
\linkio{P0i}{P0o}
\iopin[at=(1-A),below,in]{P1i}
\iopin[at=(1-B),above,out]{P1o}
\linkio{P1i}{P1o}
\iopin[at=(2-A),left,in]{P2i}
\iopin[at=(2-B),right,out]{P2o}
\filldraw ($(2-A)+(3mm,3mm)$) circle[radius=1pt] node[coordinate,label={[font=\tiny]above right:byref}] (byref) {} ;
\linkio[by=(byref)]{P2i}{P2o}
\filldraw ($(3-A)+(3mm,3mm)$) circle[radius=1pt] node[coordinate,label={[font=\tiny]above right:byref}] (byref) {} ;
\linkio[by=(byref),V]{3-A}{3-B}
\iopin[at=(4-A),left,in]{P4i}
\iopin[at=(4-B),above,out]{P4o}
\filldraw ($(4-A)+(3mm,3mm)$) circle[radius=1pt] node[coordinate,label={[font=\tiny]above right:byref}] (byref) {} ;
\linkio[by=(byref)]{P4i}{P4o}
\end{tikzpicture}
%
%
%
\begin{tikzpicture}
\draw[gray,opacity=0.2,step=10pt] (-1,-1) grid (1,1);
\foreach \i in {0,...,4} {
\filldraw (-0.5cm,-0.5cm+\i*2cm) circle[radius=1pt] node[coordinate,label={[font=\tiny]below left:\i-A}] (\i-A) {} ;
\filldraw (0.5cm,0.5cm+\i*2cm) circle[radius=1pt] node[coordinate,label={[font=\tiny]above right:\i-B}] (\i-B) {} ;
}
\iopin[at=(0-A),left,in]{P0i}
\iopin[at=(0-B),right,out]{P0o}
\filldraw ($(0-A)+(3mm,-3mm)$) circle[radius=1pt] node[coordinate,label={[font=\tiny]above right:viaref}] (viaref) {} ;
\linkio[via=(viaref)]{P0i}{P0o}
\iopin[at=(1-A),below,in]{P1i}
\iopin[at=(1-B),above,out]{P1o}
\filldraw ($(1-A)+(-3mm,3mm)$) circle[radius=1pt] node[coordinate,label={[font=\tiny]above right:viaref}] (viaref) {} ;
\linkio[via=(viaref)]{P1i}{P1o}
\iopin[at=(2-A),left,in]{P2i}
\iopin[at=(2-B),above,out]{P2o}
\filldraw ($(2-A)+(3mm,-3mm)$) circle[radius=1pt] node[coordinate,label={[font=\tiny]above right:viaref}] (viaref) {} ;
\linkio[via=(viaref)]{P2i}{P2o}
\filldraw ($(3-A)+(-3mm,3mm)$) circle[radius=1pt] node[coordinate,label={[font=\tiny]above right:viaref}] (viaref) {} ;
\linkio[via=(viaref),V]{3-A}{3-B}
\filldraw ($(4-A)+(-3mm,-3mm)$) circle[radius=1pt] node[coordinate,label={[font=\tiny]above right:viaref}] (viaref) {} ;
\linkio[via=(viaref),H]{4-A}{4-B}
\end{tikzpicture}
%
%
%
\begin{tikzpicture}
\draw[gray,opacity=0.2,step=10pt] (-1,-1) grid (1,1);
\foreach \i in {0,...,4} {
\filldraw (-0.5cm,-0.5cm+\i*2cm) circle[radius=1pt] node[coordinate,label={[font=\tiny]below left:\i-A}] (\i-A) {} ;
\filldraw (0.5cm,0.5cm+\i*2cm) circle[radius=1pt] node[coordinate,label={[font=\tiny]above right:\i-B}] (\i-B) {} ;
}
\linkio[mid=0.8,V]{0-A}{0-B}
\iopin[at=(1-A),left,in]{X1i}
\linkio[mid=0.2]{X1i}{1-B}
\iopin[at=(2-B),right,out]{X2o}
\linkio[mid=0.3]{2-A}{X2o}
\iopin[at=(3-B),above,out]{X3o}
\linkio[mid=0.3]{3-A}{X3o}
\linkio[onto,V]{4-A}{4-B}
\end{tikzpicture}
%
%
%
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\begin{blockio}[name=B,block style={draw,gray}]{Link}
\iopin[east up,out]{EU-o}
\iopin[east up,in]{EU-i}
\iopin[south right,in,link style={draw=red,thick},style={draw=red,thick}]{SR-i}
\iopin[south right,out]{SR-o}
\end{blockio}
\foreach \c in {ne,se,sw,nw} {
\foreach \i in {1,...,2} {
\filldraw (B.\c\i) circle[radius=1pt] node[below,font=\tiny,text opacity=0.3] {\c\i};
}
}
\linkio[by=(B.se1)]{SR-o}{EU-i}
\linkio{EU-o}{B.se2}
\linkio[via={($(B.se2)+(0,-2)$)},draw=red,thick]
{B.nw2}{SR-i}
\end{tikzpicture}
%
%
%
\begin{tikzpicture}
\tikzset{every block shape/.append style={dashed,
append after command={node[gray,below right= 2mm of \blkioname.block south east,font=\tiny] {\blkioname} edge[->,dashed,draw=gray] (\blkioname) }
}}
\tikzset{every block text/.append style={yellow}}
\tikzset{every block/.style={dotted}}
\tikzset{every iopin/.append style={cyan,thick}}
\tikzset{every iopin text/.append style={red}}
\tikzset{every link/.style={draw=cyan,thick}}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\filldraw (1,1) circle[radius=1pt] node[coordinate,label={[font=\tiny]below right:ref}] (ref) {} ;
\begin{blockio}[block style={draw,gray,above right=2cm of ref},shape=diamond]{B}
\iopin[east up,out]{EU-o}
\iopin[east up,in]{EU-i}
\iopin[south right,in]{SR-i}
\iopin[south right,out]{SR-o}
\end{blockio}
\def\anchor{se3}
\filldraw (B.\anchor) circle[radius=1pt] node[coordinate,label={[font=\tiny]below right:\anchor}] {} ;
\begin{blockio}[below left=5mm of B.\anchor,block style={draw,gray}]{Below Left\\of B.\anchor}
\iopin[west up,out]{1}
\iopin[west up,in]{2}
\iopin[north right,out]{3}
\iopin[north right,in]{4}
\end{blockio}
\linkio[via=(B.se1)]{SR-o}{4}
\linkio[via=(B.se2)]{3}{SR-i}
\end{tikzpicture}
\begin{tikzpicture}
\draw[gray,opacity=0.5,step=10pt] (-1,-1) grid (1,1);
\foreach \n [count=\i] in {RP3N,RP3E,RP3W,RP3S,
RP5N,RP5E,RP5W,RP5S,
RP6H,RP6V,ellipse,diamond}
{
\pgfmathparse{mod(\i-1,4)}
\edef\iy{\pgfmathresult}
\pgfmathparse{(\i-\iy-1)/4}
\edef\ix{\pgfmathresult}
\begin{blockio}[block style={draw,dashed,gray},shape=\n,at={(\ix*7cm-4cm,\iy*7cm-4cm)},text style={font=\tiny},name=\n]{\n}
\iopin[north left,in]{NL-i}
\iopin[north center,in]{NC-i}
\iopin[north right,out]{NR-i}
\iopin[east up,out]{EU-o}
\iopin[east center,in]{EC-i}
\iopin[east down,out]{ED-o}
\iopin[west up,in]{WU-i}
\iopin[west center,out]{WC-o}
\iopin[west down,in]{WD-i}
\iopin[south left,out]{SL-o}
\iopin[south center,in]{SC-i}
\iopin[south right,out]{SR-o}
\end{blockio}
}
\end{tikzpicture}
\begin{tikzpicture}
\begin{blockio}[block style={draw,dashed,gray},shape=RP8,at={(4cm,4cm)},name=B1]{B1}
\iopin[north left,in]{NL-i}
\iopin[north left,out]{NL-o}
\iopin[north center,in]{NC-i}
\iopin[north center,out]{NC-o}
\iopin[north right,in]{NR-i}
\iopin[north right,out]{NR-o}
\iopin[east up,in]{EU-i}
\iopin[east up,out]{EU-o}
\iopin[east center,out]{EC-o}
\iopin[east center,in]{EC-i}
\iopin[east down,in]{ED-i}
\iopin[east down,out]{ED-o}
\iopin[west up,in]{WU-i}
\iopin[west up,out]{WU-o}
\iopin[west center,in]{WC-i}
\iopin[west center,out]{WC-o}
\iopin[west down,in]{WD-i}
\iopin[west down,out]{WD-o}
\iopin[south left,in]{SL-i}
\iopin[south left,out]{SL-o}
\iopin[south center,in]{SC-i}
\iopin[south center,out]{SC-o}
\iopin[south right,in]{SR-i}
\iopin[south right,out]{SR-o}
\end{blockio}
\begin{blockio}[block style={draw,dashed,gray},right= of B1.east,shape=RP5N,name=B2]{B2}
\iopin[north left,in]{NL-i}
\iopin[north left,out]{NL-o}
\iopin[north center,in]{NC-i}
\iopin[north center,out]{NC-o}
\iopin[north right,in]{NR-i}
\iopin[north right,out]{NR-o}
\iopin[east up,in]{EU-i}
\iopin[east up,out]{EU-o}
\iopin[east center,out]{EC-o}
\iopin[east center,in]{EC-i}
\iopin[east down,in]{ED-i}
\iopin[east down,out]{ED-o}
\iopin[west up,in]{WU-i}
\iopin[west up,out]{WU-o}
\iopin[west center,in]{WC-i}
\iopin[west center,out]{WC-o}
\iopin[west down,in]{WD-i}
\iopin[west down,out]{WD-o}
\iopin[south left,in]{SL-i}
\iopin[south left,out]{SL-o}
\iopin[south center,in]{SC-i}
\iopin[south center,out]{SC-o}
\iopin[south right,in]{SR-i}
\iopin[south right,out]{SR-o}
\end{blockio}
\begin{blockio}[block style={draw,dashed,gray},below= of B1.south,shape=RP3W,name=B3]{B3}
\iopin[north left,in]{NL-i}
\iopin[north left,out]{NL-o}
\iopin[north center,in]{NC-i}
\iopin[north center,out]{NC-o}
\iopin[north right,in]{NR-i}
\iopin[north right,out]{NR-o}
\iopin[east up,in]{EU-i}
\iopin[east up,out]{EU-o}
\iopin[east center,out]{EC-o}
\iopin[east center,in]{EC-i}
\iopin[east down,in]{ED-i}
\iopin[east down,out]{ED-o}
\iopin[west up,in]{WU-i}
\iopin[west up,out]{WU-o}
\iopin[west center,in]{WC-i}
\iopin[west center,out]{WC-o}
\iopin[west down,in]{WD-i}
\iopin[west down,out]{WD-o}
\iopin[south left,in]{SL-i}
\iopin[south left,out]{SL-o}
\iopin[south center,in]{SC-i}
\iopin[south center,out]{SC-o}
\iopin[south right,in]{SR-i}
\iopin[south right,out]{SR-o}
\end{blockio}
\begin{blockio}[block style={draw,dashed,gray},below right= of B1.south east,shape=RP6V,name=B4]{B4}
\iopin[north left,in]{NL-i}
\iopin[north left,out]{NL-o}
\iopin[north center,in]{NC-i}
\iopin[north center,out]{NC-o}
\iopin[north right,in]{NR-i}
\iopin[north right,out]{NR-o}
\iopin[east up,in]{EU-i}
\iopin[east up,out]{EU-o}
\iopin[east center,out]{EC-o}
\iopin[east center,in]{EC-i}
\iopin[east down,in]{ED-i}
\iopin[east down,out]{ED-o}
\iopin[west up,in]{WU-i}
\iopin[west up,out]{WU-o}
\iopin[west center,in]{WC-i}
\iopin[west center,out]{WC-o}
\iopin[west down,in]{WD-i}
\iopin[west down,out]{WD-o}
\iopin[south left,in]{SL-i}
\iopin[south left,out]{SL-o}
\iopin[south center,in]{SC-i}
\iopin[south center,out]{SC-o}
\iopin[south right,in]{SR-i}
\iopin[south right,out]{SR-o}
\end{blockio}
\begin{blockio}[block style={draw,dashed,gray},below= of B3.south,shape=ellipse]{ellipse}
\iopin[north left,in]{NL}
\iopin[north center,out]{NC}
\iopin[north right,in]{NR}
\iopin[east up,in]{EU-i}
\iopin[east up,out]{EU-o}
\iopin[east center,out]{EC-o}
\iopin[east center,in]{EC-i}
\iopin[east down,in]{ED-i}
\iopin[east down,out]{ED-o}
\iopin[west up,in]{WU-i}
\iopin[west up,out]{WU-o}
\iopin[west center,in]{WC-i}
\iopin[west center,out]{WC-o}
\iopin[west down,in]{WD-i}
\iopin[west down,out]{WD-o}
\iopin[south left,out]{SL}
\iopin[south center,in]{SC}
\iopin[south right,in]{SR}
\end{blockio}
\begin{blockio}[block style={draw,dashed,gray},below right= of B3.south east,shape=circle]{circle}
\iopin[north left,in]{NL}
\iopin[north center,out]{NC}
\iopin[north right,in]{NR}
\iopin[east up,in]{EU-i}
\iopin[east up,out]{EU-o}
\iopin[east center,out]{EC-o}
\iopin[east center,in]{EC-i}
\iopin[east down,in]{ED-i}
\iopin[east down,out]{ED-o}
\iopin[west up,in]{WU-i}
\iopin[west up,out]{WU-o}
\iopin[west center,in]{WC-i}
\iopin[west center,out]{WC-o}
\iopin[west down,in]{WD-i}
\iopin[west down,out]{WD-o}
\iopin[south left,out]{SL}