-
Notifications
You must be signed in to change notification settings - Fork 118
/
api.html
2167 lines (1968 loc) · 124 KB
/
api.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>skidl 0.0.25 documentation</title>
<link rel="stylesheet" href="static/agogo.css" type="text/css" />
<link rel="stylesheet" href="static/pygments.css" type="text/css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="static/documentation_options.js"></script>
<script type="text/javascript" src="static/jquery.js"></script>
<script type="text/javascript" src="static/underscore.js"></script>
<script type="text/javascript" src="static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
</head><body>
<div class="header-wrapper" role="banner">
<div class="header">
<div class="headertitle"><a
href="api.html#document-api">skidl 0.0.25 documentation</a></div>
<div class="rel" role="navigation" aria-label="related navigation">
</div>
</div>
</div>
<div class="content-wrapper">
<div class="content">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<p><strong>This is a really, really bad API document.</strong> I’m working to make Sphinx generate a better one
but, right now, the description on the homepage about how to use SKiDL is much better than this.</p>
<div class="section" id="skidl-api">
<h1>SKiDL API<a class="headerlink" href="#skidl-api" title="Permalink to this headline">¶</a></h1>
<div class="toctree-wrapper compound">
<span id="document-modules"></span><div class="section" id="skidl">
<h2>skidl<a class="headerlink" href="#skidl" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<span id="document-skidl"></span><div class="section" id="skidl-package">
<h3>skidl package<a class="headerlink" href="#skidl-package" title="Permalink to this headline">¶</a></h3>
<div class="section" id="subpackages">
<h4>Subpackages<a class="headerlink" href="#subpackages" title="Permalink to this headline">¶</a></h4>
<div class="toctree-wrapper compound">
<span id="document-skidl.tools"></span><div class="section" id="skidl-tools-package">
<h5>skidl.tools package<a class="headerlink" href="#skidl-tools-package" title="Permalink to this headline">¶</a></h5>
<div class="section" id="submodules">
<h6>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h6>
</div>
<div class="section" id="module-skidl.tools.kicad">
<span id="skidl-tools-kicad-module"></span><h6>skidl.tools.kicad module<a class="headerlink" href="#module-skidl.tools.kicad" title="Permalink to this headline">¶</a></h6>
<p>Handler for reading Kicad libraries and generating netlists.</p>
</div>
<div class="section" id="module-skidl.tools.skidl">
<span id="skidl-tools-skidl-module"></span><h6>skidl.tools.skidl module<a class="headerlink" href="#module-skidl.tools.skidl" title="Permalink to this headline">¶</a></h6>
<p>Handler for reading SKiDL libraries and generating netlists.</p>
</div>
<div class="section" id="module-skidl.tools.spice">
<span id="skidl-tools-spice-module"></span><h6>skidl.tools.spice module<a class="headerlink" href="#module-skidl.tools.spice" title="Permalink to this headline">¶</a></h6>
<p>Handler for reading SPICE libraries.</p>
<dl class="function">
<dt id="skidl.tools.spice.node">
<code class="descclassname">skidl.tools.spice.</code><code class="descname">node</code><span class="sig-paren">(</span><em>net_or_pin</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.node" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="function">
<dt id="skidl.tools.spice.add_part_to_circuit">
<code class="descclassname">skidl.tools.spice.</code><code class="descname">add_part_to_circuit</code><span class="sig-paren">(</span><em>part</em>, <em>circuit</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.add_part_to_circuit" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a part to a PySpice Circuit object.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>part</strong> – SKiDL Part object.</li>
<li><strong>circuit</strong> – PySpice Circuit object.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="skidl.tools.spice.add_subcircuit_to_circuit">
<code class="descclassname">skidl.tools.spice.</code><code class="descname">add_subcircuit_to_circuit</code><span class="sig-paren">(</span><em>part</em>, <em>circuit</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.add_subcircuit_to_circuit" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a .SUBCKT part to a PySpice Circuit object.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>part</strong> – SKiDL Part object.</li>
<li><strong>circuit</strong> – PySpice Circuit object.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="skidl.tools.spice.not_implemented">
<code class="descclassname">skidl.tools.spice.</code><code class="descname">not_implemented</code><span class="sig-paren">(</span><em>part</em>, <em>circuit</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.not_implemented" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</div>
<div class="section" id="module-skidl.tools">
<span id="module-contents"></span><h6>Module contents<a class="headerlink" href="#module-skidl.tools" title="Permalink to this headline">¶</a></h6>
<p>This package contains the handler functions for various EDA tools.</p>
</div>
</div>
</div>
</div>
<div class="section" id="submodules">
<h4>Submodules<a class="headerlink" href="#submodules" title="Permalink to this headline">¶</a></h4>
</div>
<div class="section" id="module-skidl.Alias">
<span id="skidl-alias-module"></span><h4>skidl.Alias module<a class="headerlink" href="#module-skidl.Alias" title="Permalink to this headline">¶</a></h4>
<p>Handles aliases for parts and other stuff.</p>
<dl class="class">
<dt id="skidl.Alias.Alias">
<em class="property">class </em><code class="descclassname">skidl.Alias.</code><code class="descname">Alias</code><span class="sig-paren">(</span><em>name</em>, <em>id_tag=None</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Alias.Alias" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>An alias can be added to another object to give it another name.
Since an object might have several aliases, each alias can be tagged
with an identifier to discriminate between them.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> – The alias name.</li>
<li><strong>id_tag</strong> – The identifier tag.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-skidl.Bus">
<span id="skidl-bus-module"></span><h4>skidl.Bus module<a class="headerlink" href="#module-skidl.Bus" title="Permalink to this headline">¶</a></h4>
<p>Handles buses.</p>
<dl class="class">
<dt id="skidl.Bus.Bus">
<em class="property">class </em><code class="descclassname">skidl.Bus.</code><code class="descname">Bus</code><span class="sig-paren">(</span><em>name</em>, <em>*args</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Bus.Bus" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>This class collects one or more nets into a group that can be indexed.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> – A string with the name of the bus.</li>
<li><strong>args</strong> – A list of ints, pins, nets, buses to attach to the net.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">Keyword Arguments:</th></tr>
<tr class="field-even field"><td> </td><td class="field-body"><p class="first last"><strong>attribs</strong> – A dictionary of attributes and values to attach to
the Net object.</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Example</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">n</span> <span class="o">=</span> <span class="n">Net</span><span class="p">()</span>
<span class="n">led1</span> <span class="o">=</span> <span class="n">Part</span><span class="p">(</span><span class="s1">'device'</span><span class="p">,</span> <span class="s1">'LED'</span><span class="p">)</span>
<span class="n">b</span> <span class="o">=</span> <span class="n">Bus</span><span class="p">(</span><span class="s1">'B'</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="n">n</span><span class="p">,</span> <span class="n">led1</span><span class="p">[</span><span class="s1">'K'</span><span class="p">])</span>
</pre></div>
</div>
<dl class="classmethod">
<dt id="skidl.Bus.Bus.get">
<em class="property">classmethod </em><code class="descname">get</code><span class="sig-paren">(</span><em>name</em>, <em>circuit=None</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Bus.Bus.get" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the bus with the given name from a circuit, or return None.</p>
</dd></dl>
<dl class="classmethod">
<dt id="skidl.Bus.Bus.fetch">
<em class="property">classmethod </em><code class="descname">fetch</code><span class="sig-paren">(</span><em>name</em>, <em>*args</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Bus.Bus.fetch" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the bus with the given name from a circuit, or create it if not found.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Bus.Bus.extend">
<code class="descname">extend</code><span class="sig-paren">(</span><em>*objects</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Bus.Bus.extend" title="Permalink to this definition">¶</a></dt>
<dd><p>Extend bus by appending objects to the end (MSB).</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Bus.Bus.insert">
<code class="descname">insert</code><span class="sig-paren">(</span><em>index</em>, <em>*objects</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Bus.Bus.insert" title="Permalink to this definition">¶</a></dt>
<dd><p>Insert objects into bus starting at indexed position.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Bus.Bus.get_nets">
<code class="descname">get_nets</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Bus.Bus.get_nets" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the list of nets contained in this bus.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Bus.Bus.get_pins">
<code class="descname">get_pins</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Bus.Bus.get_pins" title="Permalink to this definition">¶</a></dt>
<dd><p>It’s an error to get the list of pins attached to all bus lines.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Bus.Bus.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><em>num_copies=None</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Bus.Bus.copy" title="Permalink to this definition">¶</a></dt>
<dd><p>Make zero or more copies of this bus.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>num_copies</strong> – Number of copies to make of this bus.</td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">Keyword Arguments:</th></tr>
<tr class="field-even field"><td> </td><td class="field-body"><strong>attribs</strong> – Name/value pairs for setting attributes for the copy.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A list of Bus copies or a Bus if num_copies==1.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body">Exception if the requested number of copies is a non-integer or negative.</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>An instance of a bus can be copied just by calling it like so:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="n">Bus</span><span class="p">(</span><span class="s1">'A'</span><span class="p">,</span> <span class="mi">8</span><span class="p">)</span> <span class="c1"># Create a bus.</span>
<span class="n">b_copy</span> <span class="o">=</span> <span class="n">b</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="c1"># Get two copies of the bus.</span>
</pre></div>
</div>
<p>You can also use the multiplication operator to make copies:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="mi">10</span> <span class="o">*</span> <span class="n">Bus</span><span class="p">(</span><span class="s1">'A'</span><span class="p">,</span> <span class="mi">8</span><span class="p">)</span> <span class="c1"># Create an array of buses.</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="skidl.Bus.Bus.is_movable">
<code class="descname">is_movable</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Bus.Bus.is_movable" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if the bus is movable to another circuit.</p>
<p>A bus is movable if all the nets in it are movable.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Bus.Bus.connect">
<code class="descname">connect</code><span class="sig-paren">(</span><em>*pins_nets_buses</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Bus.Bus.connect" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the bus after connecting one or more nets, pins, or buses.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>pins_nets_buses</strong> – One or more Pin, Net or Bus objects or
lists/tuples of them.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The updated bus with the new connections.</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>You can connect nets or pins to a bus like so:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">p</span> <span class="o">=</span> <span class="n">Pin</span><span class="p">()</span> <span class="c1"># Create a pin.</span>
<span class="n">n</span> <span class="o">=</span> <span class="n">Net</span><span class="p">()</span> <span class="c1"># Create a net.</span>
<span class="n">b</span> <span class="o">=</span> <span class="n">Bus</span><span class="p">(</span><span class="s1">'B'</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span> <span class="c1"># Create a two-wire bus.</span>
<span class="n">b</span> <span class="o">+=</span> <span class="n">p</span><span class="p">,</span><span class="n">n</span> <span class="c1"># Connect pin and net to B[0] and B[1].</span>
</pre></div>
</div>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Bus.Bus.name">
<code class="descname">name</code><a class="headerlink" href="#skidl.Bus.Bus.name" title="Permalink to this definition">¶</a></dt>
<dd><p>Get, set and delete the name of the bus.</p>
<p>When setting the bus name, if another bus with the same name
is found, the name for this bus is adjusted to make it unique.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Bus.Bus.width">
<code class="descname">width</code><a class="headerlink" href="#skidl.Bus.Bus.width" title="Permalink to this definition">¶</a></dt>
<dd><p>Return width of a Bus, which is the same as using the len() operator.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-skidl.Circuit">
<span id="skidl-circuit-module"></span><h4>skidl.Circuit module<a class="headerlink" href="#module-skidl.Circuit" title="Permalink to this headline">¶</a></h4>
<p>Handles complete circuits made of parts and nets.</p>
<dl class="class">
<dt id="skidl.Circuit.Circuit">
<em class="property">class </em><code class="descclassname">skidl.Circuit.</code><code class="descname">Circuit</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Class object that holds the entire netlist of parts and nets.</p>
<dl class="attribute">
<dt id="skidl.Circuit.Circuit.parts">
<code class="descname">parts</code><a class="headerlink" href="#skidl.Circuit.Circuit.parts" title="Permalink to this definition">¶</a></dt>
<dd><p>List of all the schematic parts as Part objects.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Circuit.Circuit.nets">
<code class="descname">nets</code><a class="headerlink" href="#skidl.Circuit.Circuit.nets" title="Permalink to this definition">¶</a></dt>
<dd><p>List of all the schematic nets as Net objects.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Circuit.Circuit.buses">
<code class="descname">buses</code><a class="headerlink" href="#skidl.Circuit.Circuit.buses" title="Permalink to this definition">¶</a></dt>
<dd><p>List of all the buses as Bus objects.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Circuit.Circuit.hierarchy">
<code class="descname">hierarchy</code><a class="headerlink" href="#skidl.Circuit.Circuit.hierarchy" title="Permalink to this definition">¶</a></dt>
<dd><p>A ‘.’-separated concatenation of the names of nested
SubCircuits at the current time it is read.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Circuit.Circuit.level">
<code class="descname">level</code><a class="headerlink" href="#skidl.Circuit.Circuit.level" title="Permalink to this definition">¶</a></dt>
<dd><p>The current level in the schematic hierarchy.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Circuit.Circuit.context">
<code class="descname">context</code><a class="headerlink" href="#skidl.Circuit.Circuit.context" title="Permalink to this definition">¶</a></dt>
<dd><p>Stack of contexts for each level in the hierarchy.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Circuit.Circuit.OK">
<code class="descname">OK</code><em class="property"> = 0</em><a class="headerlink" href="#skidl.Circuit.Circuit.OK" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="skidl.Circuit.Circuit.WARNING">
<code class="descname">WARNING</code><em class="property"> = 1</em><a class="headerlink" href="#skidl.Circuit.Circuit.WARNING" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="skidl.Circuit.Circuit.ERROR">
<code class="descname">ERROR</code><em class="property"> = 2</em><a class="headerlink" href="#skidl.Circuit.Circuit.ERROR" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.reset">
<code class="descname">reset</code><span class="sig-paren">(</span><em>init=False</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.reset" title="Permalink to this definition">¶</a></dt>
<dd><p>Clear any circuitry and cached part libraries and start over.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.mini_reset">
<code class="descname">mini_reset</code><span class="sig-paren">(</span><em>init=False</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.mini_reset" title="Permalink to this definition">¶</a></dt>
<dd><p>Clear any circuitry but don’t erase any loaded part libraries.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.add_parts">
<code class="descname">add_parts</code><span class="sig-paren">(</span><em>*parts</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.add_parts" title="Permalink to this definition">¶</a></dt>
<dd><p>Add some Part objects to the circuit.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.rmv_parts">
<code class="descname">rmv_parts</code><span class="sig-paren">(</span><em>*parts</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.rmv_parts" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove some Part objects from the circuit.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.add_nets">
<code class="descname">add_nets</code><span class="sig-paren">(</span><em>*nets</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.add_nets" title="Permalink to this definition">¶</a></dt>
<dd><p>Add some Net objects to the circuit. Assign a net name if necessary.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.rmv_nets">
<code class="descname">rmv_nets</code><span class="sig-paren">(</span><em>*nets</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.rmv_nets" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove some Net objects from the circuit.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.add_buses">
<code class="descname">add_buses</code><span class="sig-paren">(</span><em>*buses</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.add_buses" title="Permalink to this definition">¶</a></dt>
<dd><p>Add some Bus objects to the circuit. Assign a bus name if necessary.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.rmv_buses">
<code class="descname">rmv_buses</code><span class="sig-paren">(</span><em>*buses</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.rmv_buses" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove some buses from the circuit.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.add_interfaces">
<code class="descname">add_interfaces</code><span class="sig-paren">(</span><em>*interfaces</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.add_interfaces" title="Permalink to this definition">¶</a></dt>
<dd><p>Add some Interface objects to the circuit. Assign an interface name if necessary.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.rmv_interfaces">
<code class="descname">rmv_interfaces</code><span class="sig-paren">(</span><em>*interfaces</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.rmv_interfaces" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove some interfaces from the circuit.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.add_stuff">
<code class="descname">add_stuff</code><span class="sig-paren">(</span><em>*stuff</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.add_stuff" title="Permalink to this definition">¶</a></dt>
<dd><p>Add Parts, Nets, Buses, and Interfaces to the circuit.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.rmv_stuff">
<code class="descname">rmv_stuff</code><span class="sig-paren">(</span><em>*stuff</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.rmv_stuff" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove Parts, Nets, Buses, and Interfaces from the circuit.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.get_nets">
<code class="descname">get_nets</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.get_nets" title="Permalink to this definition">¶</a></dt>
<dd><p>Get all the distinct nets for the circuit.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.set_pin_conflict_rule">
<code class="descname">set_pin_conflict_rule</code><span class="sig-paren">(</span><em>pin1_func</em>, <em>pin2_func</em>, <em>conflict_level</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.set_pin_conflict_rule" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the level of conflict for two types of pins on the same net.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>pin1_func</strong> – The function of the first pin (e.g., Pin.OUTPUT).</li>
<li><strong>pin2_func</strong> – The function of the second pin (e.g., Pin.TRISTATE).</li>
<li><strong>conflict_level</strong> – Severity of conflict (e.g., self.OK, self.WARNING, self.ERROR).</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.erc_pin_to_pin_chk">
<code class="descname">erc_pin_to_pin_chk</code><span class="sig-paren">(</span><em>pin1</em>, <em>pin2</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.erc_pin_to_pin_chk" title="Permalink to this definition">¶</a></dt>
<dd><p>Check for conflict between two pins on a net.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.ERC">
<code class="descname">ERC</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.ERC" title="Permalink to this definition">¶</a></dt>
<dd><p>Do an electrical rules check on the circuit.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.generate_netlist">
<code class="descname">generate_netlist</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.generate_netlist" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a netlist and also write it to a file/stream.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>file</strong> – Either a file object that can be written to, or a string
containing a file name, or None.</li>
<li><strong>tool</strong> – The EDA tool the netlist will be generated for.</li>
<li><strong>do_backup</strong> – If true, create a library with all the parts in the circuit.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A netlist.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.generate_xml">
<code class="descname">generate_xml</code><span class="sig-paren">(</span><em>file_=None</em>, <em>tool=None</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.generate_xml" title="Permalink to this definition">¶</a></dt>
<dd><p>Return netlist as an XML string and also write it to a file/stream.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>file</strong> – Either a file object that can be written to, or a string
containing a file name, or None.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A string containing the netlist.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.generate_graph">
<code class="descname">generate_graph</code><span class="sig-paren">(</span><em>file_=None</em>, <em>engine='neato'</em>, <em>rankdir='LR'</em>, <em>part_shape='rectangle'</em>, <em>net_shape='point'</em>, <em>splines=None</em>, <em>show_values=True</em>, <em>show_anon=False</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.generate_graph" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a graphviz graph as graphviz object and can also write it to a file/stream.
When used in ipython the graphviz object will drawn as an SVG in the output.</p>
<p>See <a class="reference external" href="https://graphviz.readthedocs.io/en/stable/">https://graphviz.readthedocs.io/en/stable/</a> and <a class="reference external" href="http://graphviz.org/doc/info/attrs.html">http://graphviz.org/doc/info/attrs.html</a></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>file</strong> – A string containing a file name, or None.</li>
<li><strong>engine</strong> – See graphviz documentation</li>
<li><strong>rankdir</strong> – See graphviz documentation</li>
<li><strong>part_shape</strong> – Shape of the part nodes</li>
<li><strong>net_shape</strong> – Shape of the net nodes</li>
<li><strong>splines</strong> – Style for the edges, try ‘ortho’ for a schematic like feel</li>
<li><strong>show_values</strong> – Show values as external labels on part nodes</li>
<li><strong>show_anon</strong> – Show anonymous net names</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">graphviz.Digraph</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="skidl.Circuit.Circuit.backup_parts">
<code class="descname">backup_parts</code><span class="sig-paren">(</span><em>file_=None</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.Circuit.backup_parts" title="Permalink to this definition">¶</a></dt>
<dd><p>Saves parts in circuit as a SKiDL library in a file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>file</strong> – Either a file object that can be written to, or a string
containing a file name, or None. If None, a standard library
file will be used.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Nothing.</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="skidl.Circuit.SubCircuit">
<code class="descclassname">skidl.Circuit.</code><code class="descname">SubCircuit</code><span class="sig-paren">(</span><em>f</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.SubCircuit" title="Permalink to this definition">¶</a></dt>
<dd><p>A @SubCircuit decorator is used to create hierarchical circuits.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>f</strong> – The function containing SKiDL statements that represents a subcircuit.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="skidl.Circuit.subcircuit">
<code class="descclassname">skidl.Circuit.</code><code class="descname">subcircuit</code><span class="sig-paren">(</span><em>f</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Circuit.subcircuit" title="Permalink to this definition">¶</a></dt>
<dd><p>A @SubCircuit decorator is used to create hierarchical circuits.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>f</strong> – The function containing SKiDL statements that represents a subcircuit.</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-skidl.Interface">
<span id="skidl-interface-module"></span><h4>skidl.Interface module<a class="headerlink" href="#module-skidl.Interface" title="Permalink to this headline">¶</a></h4>
<p>Handles interfaces for subsystems with complicated I/O.</p>
<dl class="class">
<dt id="skidl.Interface.Interface">
<em class="property">class </em><code class="descclassname">skidl.Interface.</code><code class="descname">Interface</code><span class="sig-paren">(</span><em>prefix</em>, <em>circuit=None</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Interface.Interface" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>An Interface bundles a group of signals into a single entity with each
signal becoming an attribute.</p>
<dl class="method">
<dt id="skidl.Interface.Interface.is_movable">
<code class="descname">is_movable</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Interface.Interface.is_movable" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="skidl.Interface.Interface.name">
<code class="descname">name</code><a class="headerlink" href="#skidl.Interface.Interface.name" title="Permalink to this definition">¶</a></dt>
<dd><p>Get, set and delete the name of this interface.</p>
<p>When setting the name, if another interface with the same name
is found, the name for this interface is adjusted to make it unique.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-skidl.Net">
<span id="skidl-net-module"></span><h4>skidl.Net module<a class="headerlink" href="#module-skidl.Net" title="Permalink to this headline">¶</a></h4>
<p>Handles nets.</p>
<dl class="class">
<dt id="skidl.Net.Net">
<em class="property">class </em><code class="descclassname">skidl.Net.</code><code class="descname">Net</code><span class="sig-paren">(</span><em>name=None</em>, <em>circuit=None</em>, <em>*pins_nets_buses</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Lists of connected pins are stored as nets using this class.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> – A string with the name of the net. If None or ‘’, then
a unique net name will be assigned.</li>
<li><strong>circuit</strong> – The Circuit object this net belongs to.</li>
<li><strong>*pins_nets_buses</strong> – One or more Pin, Net, or Bus objects or
lists/tuples of them to be connected to this net.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">Keyword Arguments:</th></tr>
<tr class="field-even field"><td> </td><td class="field-body"><p class="first last"><strong>attribs</strong> – A dictionary of attributes and values to attach to
the Net object.</p>
</td>
</tr>
</tbody>
</table>
<dl class="classmethod">
<dt id="skidl.Net.Net.get">
<em class="property">classmethod </em><code class="descname">get</code><span class="sig-paren">(</span><em>name</em>, <em>circuit=None</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.get" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the net with the given name from a circuit, or return None.</p>
</dd></dl>
<dl class="classmethod">
<dt id="skidl.Net.Net.fetch">
<em class="property">classmethod </em><code class="descname">fetch</code><span class="sig-paren">(</span><em>name</em>, <em>*args</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.fetch" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the net with the given name from a circuit, or create it if not found.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.get_pins">
<code class="descname">get_pins</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.get_pins" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of pins attached to this net.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.get_nets">
<code class="descname">get_nets</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.get_nets" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a list of nets attached to this net, including this net.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.is_attached">
<code class="descname">is_attached</code><span class="sig-paren">(</span><em>pin_net_bus</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.is_attached" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if the pin, net or bus is attached to this one.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.is_movable">
<code class="descname">is_movable</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.is_movable" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if the net is movable to another circuit.</p>
<p>A net is movable if it’s not part of a Circuit or if there are no pins
attached to it.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><em>num_copies=None</em>, <em>circuit=None</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.copy" title="Permalink to this definition">¶</a></dt>
<dd><p>Make zero or more copies of this net.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>num_copies</strong> – Number of copies to make of this net.</td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">Keyword Arguments:</th></tr>
<tr class="field-even field"><td> </td><td class="field-body"><strong>attribs</strong> – Name/value pairs for setting attributes for the copy.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A list of Net copies or a Net if num_copies==1.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body">Exception if the requested number of copies is a non-integer or negative.</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>An instance of a net can be copied just by calling it like so:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">n</span> <span class="o">=</span> <span class="n">Net</span><span class="p">(</span><span class="s1">'A'</span><span class="p">)</span> <span class="c1"># Create a net.</span>
<span class="n">n_copy</span> <span class="o">=</span> <span class="n">n</span><span class="p">()</span> <span class="c1"># Copy the net.</span>
</pre></div>
</div>
<p>You can also use the multiplication operator to make copies:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">n</span> <span class="o">=</span> <span class="mi">10</span> <span class="o">*</span> <span class="n">Net</span><span class="p">(</span><span class="s1">'A'</span><span class="p">)</span> <span class="c1"># Create an array of nets.</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.is_implicit">
<code class="descname">is_implicit</code><span class="sig-paren">(</span><em>net_name=None</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.is_implicit" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if the net name is implicit.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.connect">
<code class="descname">connect</code><span class="sig-paren">(</span><em>*pins_nets_buses</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.connect" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the net after connecting other pins, nets, and buses to it.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>*pins_nets_buses</strong> – One or more Pin, Net, or Bus objects or
lists/tuples of them to be connected to this net.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">The updated net with the new connections.</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Connections to nets can also be made using the += operator like so:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">atmega</span> <span class="o">=</span> <span class="n">Part</span><span class="p">(</span><span class="s1">'atmel'</span><span class="p">,</span> <span class="s1">'ATMEGA16U2'</span><span class="p">)</span>
<span class="n">net</span> <span class="o">=</span> <span class="n">Net</span><span class="p">()</span>
<span class="n">net</span> <span class="o">+=</span> <span class="n">atmega</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="c1"># Connects pin 1 of chip to the net.</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.disconnect">
<code class="descname">disconnect</code><span class="sig-paren">(</span><em>pin</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.disconnect" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove the pin from this net but not any other nets it’s attached to.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.merge_names">
<code class="descname">merge_names</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.merge_names" title="Permalink to this definition">¶</a></dt>
<dd><p>For multi-segment nets, select a common name for all the segments.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.create_network">
<code class="descname">create_network</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.create_network" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a network from a single net.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.generate_netlist_net">
<code class="descname">generate_netlist_net</code><span class="sig-paren">(</span><em>tool=None</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.generate_netlist_net" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate the net information for inclusion in a netlist.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>tool</strong> – The format for the netlist file (e.g., KICAD).</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.generate_xml_net">
<code class="descname">generate_xml_net</code><span class="sig-paren">(</span><em>tool=None</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.generate_xml_net" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate the net information for inclusion in an XML file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>tool</strong> – The format for the XML file (e.g., KICAD).</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.erc">
<code class="descname">erc</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.erc" title="Permalink to this definition">¶</a></dt>
<dd><p>Do electrical rules check on a net in the schematic.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Net.Net.width">
<code class="descname">width</code><a class="headerlink" href="#skidl.Net.Net.width" title="Permalink to this definition">¶</a></dt>
<dd><p>Return width of a Net, which is always 1.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Net.Net.name">
<code class="descname">name</code><a class="headerlink" href="#skidl.Net.Net.name" title="Permalink to this definition">¶</a></dt>
<dd><p>Get, set and delete the name of this net.</p>
<p>When setting the net name, if another net with the same name
is found, the name for this net is adjusted to make it unique.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Net.Net.drive">
<code class="descname">drive</code><a class="headerlink" href="#skidl.Net.Net.drive" title="Permalink to this definition">¶</a></dt>
<dd><p>Get, set and delete the drive strength of this net.</p>
<p>The drive strength cannot be set to a value less than its current
value. So as pins are added to a net, the drive strength reflects the
maximum drive value of the pins currently on the net.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Net.Net.valid">
<code class="descname">valid</code><a class="headerlink" href="#skidl.Net.Net.valid" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="skidl.Net.Net.test_validity">
<code class="descname">test_validity</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.Net.test_validity" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="class">
<dt id="skidl.Net.NCNet">
<em class="property">class </em><code class="descclassname">skidl.Net.</code><code class="descname">NCNet</code><span class="sig-paren">(</span><em>name=None</em>, <em>circuit=None</em>, <em>*pins_nets_buses</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.NCNet" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#skidl.Net.Net" title="skidl.Net.Net"><code class="xref py py-class docutils literal notranslate"><span class="pre">skidl.Net.Net</span></code></a></p>
<p>Lists of unconnected pins are stored using this Net subclass.</p>
<p>This is a netlist subclass used for storing lists of pins which are
explicitly specified as not being connected. This means the ERC won’t
flag these pins as floating, but no net connections for these pins
will be placed in the netlist so there will actually be no
connections to these pins in the physical circuit.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>name</strong> – A string with the name of the net. If None or ‘’, then
a unique net name will be assigned.</li>
<li><strong>*pins_nets_buses</strong> – One or more Pin, Net, or Bus objects or
lists/tuples of them to be connected to this net.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">Keyword Arguments:</th></tr>
<tr class="field-even field"><td> </td><td class="field-body"><p class="first last"><strong>attribs</strong> – A dictionary of attributes and values to attach to
the object.</p>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="skidl.Net.NCNet.generate_netlist_net">
<code class="descname">generate_netlist_net</code><span class="sig-paren">(</span><em>tool=None</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.NCNet.generate_netlist_net" title="Permalink to this definition">¶</a></dt>
<dd><p>NO_CONNECT nets don’t generate anything for netlists.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Net.NCNet.erc">
<code class="descname">erc</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Net.NCNet.erc" title="Permalink to this definition">¶</a></dt>
<dd><p>No need to check NO_CONNECT nets.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Net.NCNet.drive">
<code class="descname">drive</code><a class="headerlink" href="#skidl.Net.NCNet.drive" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the drive strength of this net.</p>
<p>The drive strength is always NOCONNECT_DRIVE. It can’t be changed.
The drive strength cannot be deleted.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-skidl.NetPinList">
<span id="skidl-netpinlist-module"></span><h4>skidl.NetPinList module<a class="headerlink" href="#module-skidl.NetPinList" title="Permalink to this headline">¶</a></h4>
<p>Specialized list for handling nets, pins, and buses.</p>
<dl class="class">
<dt id="skidl.NetPinList.NetPinList">
<em class="property">class </em><code class="descclassname">skidl.NetPinList.</code><code class="descname">NetPinList</code><a class="headerlink" href="#skidl.NetPinList.NetPinList" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code></p>
<dl class="method">
<dt id="skidl.NetPinList.NetPinList.create_network">
<code class="descname">create_network</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.NetPinList.NetPinList.create_network" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a network from a list of pins and nets.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.NetPinList.NetPinList.width">
<code class="descname">width</code><a class="headerlink" href="#skidl.NetPinList.NetPinList.width" title="Permalink to this definition">¶</a></dt>
<dd><p>Return width, which is the same as using the len() operator.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-skidl.Network">
<span id="skidl-network-module"></span><h4>skidl.Network module<a class="headerlink" href="#module-skidl.Network" title="Permalink to this headline">¶</a></h4>
<p>Object for for handling series and parallel networks of two-pin parts, nets, and pins.</p>
<dl class="class">
<dt id="skidl.Network.Network">
<em class="property">class </em><code class="descclassname">skidl.Network.</code><code class="descname">Network</code><span class="sig-paren">(</span><em>*objs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Network.Network" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">list</span></code></p>
<dl class="method">
<dt id="skidl.Network.Network.create_network">
<code class="descname">create_network</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Network.Network.create_network" title="Permalink to this definition">¶</a></dt>
<dd><p>Creating a network from a network just returns the original network.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-skidl.Part">
<span id="skidl-part-module"></span><h4>skidl.Part module<a class="headerlink" href="#module-skidl.Part" title="Permalink to this headline">¶</a></h4>
<p>Handles parts.</p>
<dl class="class">
<dt id="skidl.Part.Part">
<em class="property">class </em><code class="descclassname">skidl.Part.</code><code class="descname">Part</code><span class="sig-paren">(</span><em>lib=None</em>, <em>name=None</em>, <em>dest='NETLIST'</em>, <em>tool=None</em>, <em>connections=None</em>, <em>part_defn=None</em>, <em>circuit=None</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Part.Part" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>A class for storing a definition of a schematic part.</p>
<dl class="attribute">
<dt id="skidl.Part.Part.ref">
<code class="descname">ref</code><a class="headerlink" href="#skidl.Part.Part.ref" title="Permalink to this definition">¶</a></dt>
<dd><p>String storing the reference of a part within a schematic (e.g., ‘R5’).</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Part.Part.value">
<code class="descname">value</code><a class="headerlink" href="#skidl.Part.Part.value" title="Permalink to this definition">¶</a></dt>
<dd><p>String storing the part value (e.g., ‘3K3’).</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Part.Part.footprint">
<code class="descname">footprint</code><a class="headerlink" href="#skidl.Part.Part.footprint" title="Permalink to this definition">¶</a></dt>
<dd><p>String storing the PCB footprint associated with a part (e.g., SOIC-8).</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.Part.Part.pins">
<code class="descname">pins</code><a class="headerlink" href="#skidl.Part.Part.pins" title="Permalink to this definition">¶</a></dt>
<dd><p>List of Pin objects for this part.</p>
</dd></dl>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>lib</strong> – Either a SchLib object or a schematic part library file name.</li>
<li><strong>name</strong> – A string with name of the part to find in the library, or to assign to
the part defined by the part definition.</li>
<li><strong>dest</strong> – String that indicates where the part is destined for (e.g., LIBRARY).</li>
<li><strong>tool</strong> – The format for the library file or part definition (e.g., KICAD).</li>
<li><strong>connections</strong> – A dictionary with part pin names/numbers as keys and the
names of nets to which they will be connected as values. For example:
{ ‘IN-‘:’a_in’, ‘IN+’:’GND’, ‘1’:’AMPED_OUTPUT’, ‘14’:’VCC’, ‘7’:’GND’ }</li>
<li><strong>part_defn</strong> – A list of strings that define the part (usually read from a
schematic library file).</li>
<li><strong>circuit</strong> – The Circuit object this Part belongs to.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name" colspan="2">Keyword Arguments:</th></tr>
<tr class="field-even field"><td> </td><td class="field-body"><p class="first"><strong>attribs</strong> – Name/value pairs for setting attributes for the part.
For example, manf_num=’LM4808MP-8’ would create an attribute
named ‘manf_num’ for the part and assign it the value ‘LM4808MP-8’.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><ul class="first last simple">
<li>* Exception if the part library and definition are both missing.</li>
<li>* Exception if an unknown file format is requested.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="skidl.Part.Part.parse">
<code class="descname">parse</code><span class="sig-paren">(</span><em>just_get_name=False</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Part.Part.parse" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a part from its stored part definition.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>just_get_name</strong> – When true, just get the name and aliases for the
part. Leave the rest unparsed.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="skidl.Part.Part.associate_pins">
<code class="descname">associate_pins</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Part.Part.associate_pins" title="Permalink to this definition">¶</a></dt>
<dd><p>Make sure all the pins in a part have valid references to the part.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.Part.Part.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><em>num_copies=None</em>, <em>dest='NETLIST'</em>, <em>circuit=None</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Part.Part.copy" title="Permalink to this definition">¶</a></dt>
<dd><p>Make zero or more copies of this part while maintaining all pin/net
connections.</p>