-
Notifications
You must be signed in to change notification settings - Fork 118
/
api.html
707 lines (654 loc) · 43.7 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
<!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="Content-Type" content="text/html; charset=utf-8" />
<title>skidl 0.0.10 documentation</title>
<link rel="stylesheet" href="static/classic.css" type="text/css" />
<link rel="stylesheet" href="static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.0.10',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</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="top" title="None" href="index.html#document-index" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="nav-item nav-item-0"><a href="index.html#document-index">skidl 0.0.10 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<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-api"></span><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>
<span class="target" id="module-skidl.skidl"></span><p>SKiDL: A Python-Based Schematic Design Language</p>
<p>This module extends Python with the ability to design electronic
circuits. It provides classes for working with <strong>1)</strong> electronic parts (<code class="docutils literal"><span class="pre">Part</span></code>),
<strong>2)</strong> collections of part terminals (<code class="docutils literal"><span class="pre">Pin</span></code>) connected via wires (<code class="docutils literal"><span class="pre">Net</span></code>), and
<strong>3)</strong> groups of related nets (<code class="docutils literal"><span class="pre">Bus</span></code>). Using these classes, you can
concisely describe the interconnection of components using a linear
and/or hierarchical structure. It also provides the capability to
check the resulting circuitry for the violation of electrical rules.
The output of a SKiDL-enabled Python script is a netlist that can be
imported into a PCB layout tool.</p>
<dl class="class">
<dt id="skidl.skidl.Alias">
<em class="property">class </em><code class="descclassname">skidl.skidl.</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="reference internal" href="_modules/skidl/skidl.html#Alias"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.Alias" title="Permalink to this definition">¶</a></dt>
<dd><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>
<dl class="class">
<dt id="skidl.skidl.Bus">
<em class="property">class </em><code class="descclassname">skidl.skidl.</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="reference internal" href="_modules/skidl/skidl.html#Bus"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.Bus" title="Permalink to this definition">¶</a></dt>
<dd><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"><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="method">
<dt id="skidl.skidl.Bus.connect">
<code class="descname">connect</code><span class="sig-paren">(</span><em>*pins_nets_buses</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#Bus.connect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.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"><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="method">
<dt id="skidl.skidl.Bus.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><em>num_copies=1</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#Bus.copy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.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"><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"><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.skidl.Bus.extend">
<code class="descname">extend</code><span class="sig-paren">(</span><em>*objects</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#Bus.extend"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.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.skidl.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="reference internal" href="_modules/skidl/skidl.html#Bus.insert"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.Bus.insert" title="Permalink to this definition">¶</a></dt>
<dd><p>Insert objects into bus starting at indexed position.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.skidl.Bus.name">
<code class="descname">name</code><a class="headerlink" href="#skidl.skidl.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>
</dd></dl>
<dl class="attribute">
<dt id="skidl.skidl.Circuit">
<code class="descclassname">skidl.skidl.</code><code class="descname">Circuit</code><a class="headerlink" href="#skidl.skidl.Circuit" title="Permalink to this definition">¶</a></dt>
<dd><p>alias of <a class="reference internal" href="#skidl.skidl.SubCircuit" title="skidl.skidl.SubCircuit"><code class="xref py py-class docutils literal"><span class="pre">SubCircuit</span></code></a></p>
</dd></dl>
<dl class="class">
<dt id="skidl.skidl.Net">
<em class="property">class </em><code class="descclassname">skidl.skidl.</code><code class="descname">Net</code><span class="sig-paren">(</span><em>name=None</em>, <em>*pins_nets_buses</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#Net"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.Net" title="Permalink to this definition">¶</a></dt>
<dd><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>*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="method">
<dt id="skidl.skidl.Net.connect">
<code class="descname">connect</code><span class="sig-paren">(</span><em>*pins_nets_buses</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#Net.connect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.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"><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.skidl.Net.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><em>num_copies=1</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#Net.copy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.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"><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"><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="attribute">
<dt id="skidl.skidl.Net.drive">
<code class="descname">drive</code><a class="headerlink" href="#skidl.skidl.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.skidl.Net.name">
<code class="descname">name</code><a class="headerlink" href="#skidl.skidl.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>
</dd></dl>
<dl class="class">
<dt id="skidl.skidl.Part">
<em class="property">class </em><code class="descclassname">skidl.skidl.</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='kicad'</em>, <em>connections=None</em>, <em>part_defn=None</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#Part"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.Part" title="Permalink to this definition">¶</a></dt>
<dd><p>A class for storing a definition of a schematic part.</p>
<dl class="attribute">
<dt id="skidl.skidl.Part.ref">
<code class="descname">ref</code><a class="headerlink" href="#skidl.skidl.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.skidl.Part.value">
<code class="descname">value</code><a class="headerlink" href="#skidl.skidl.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.skidl.Part.footprint">
<code class="descname">footprint</code><a class="headerlink" href="#skidl.skidl.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.skidl.Part.pins">
<code class="descname">pins</code><a class="headerlink" href="#skidl.skidl.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>part_defn</strong> – A list of strings that define the part (usually read from a
schematic library file).</li>
<li><strong>tool</strong> – The format for the library file or part definition (e.g., KICAD).</li>
<li><strong>dest</strong> – String that indicates where the part is destined for (e.g., LIBRARY).</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>
</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.skidl.Part.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><em>num_copies=1</em>, <em>dest='NETLIST'</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#Part.copy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.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>
<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>num_copies</strong> – Number of copies to make of this part.</li>
<li><strong>dest</strong> – Indicates where the copy is destined for (e.g., NETLIST).</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 copy.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">A list of Part copies or a single Part if num_copies==1.</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">Exception if the requested number of copies is a non-integer or negative.</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>An instance of a part can be copied just by calling it like so:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">res</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">'R'</span><span class="p">)</span> <span class="c1"># Get a resistor.</span>
<span class="n">res_copy</span> <span class="o">=</span> <span class="n">res</span><span class="p">(</span><span class="n">value</span><span class="o">=</span><span class="s1">'1K'</span><span class="p">)</span> <span class="c1"># Copy the resistor and set resistance value.</span>
</pre></div>
</div>
<p>You can also use the multiplication operator to make copies:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">cap</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">'C'</span><span class="p">)</span> <span class="c1"># Get a capacitor</span>
<span class="n">caps</span> <span class="o">=</span> <span class="mi">10</span> <span class="o">*</span> <span class="n">cap</span> <span class="c1"># Make an array with 10 copies of it.</span>
</pre></div>
</div>
</dd></dl>
<dl class="attribute">
<dt id="skidl.skidl.Part.foot">
<code class="descname">foot</code><a class="headerlink" href="#skidl.skidl.Part.foot" title="Permalink to this definition">¶</a></dt>
<dd><p>Get, set and delete the part footprint.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.skidl.Part.get_pins">
<code class="descname">get_pins</code><span class="sig-paren">(</span><em>*pin_ids</em>, <em>**criteria</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#Part.get_pins"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.Part.get_pins" title="Permalink to this definition">¶</a></dt>
<dd><p>Return list of part pins selected by pin numbers or names.</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>pin_ids</strong> – A list of strings containing pin names, numbers,
regular expressions, slices, lists or tuples. If empty,
then it will select all pins.</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>criteria</strong> – Key/value pairs that specify attribute values the
pins must have in order to be selected.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">A list of pins matching the given IDs and satisfying all the criteria,
or just a single Pin object if only a single match was found.
Or None if no match was found.</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Pins can be selected from a part by using brackets like so:</p>
<div class="highlight-default"><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">atmega</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="o">+=</span> <span class="n">net</span> <span class="c1"># Connects pin 1 of chip to the net.</span>
<span class="n">net</span> <span class="o">+=</span> <span class="n">atmega</span><span class="p">[</span><span class="s1">'.*RESET.*'</span><span class="p">]</span> <span class="c1"># Connects reset pin to the net.</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="skidl.skidl.Part.make_unit">
<code class="descname">make_unit</code><span class="sig-paren">(</span><em>label</em>, <em>*pin_ids</em>, <em>**criteria</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#Part.make_unit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.Part.make_unit" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a PartUnit from a set of pins in a Part object.</p>
<p>Parts can be organized into smaller pieces called PartUnits. A PartUnit
acts like a Part but contains only a subset of the pins of the Part.</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>label</strong> – The label used to identify the PartUnit.</li>
<li><strong>pin_ids</strong> – A list of strings containing pin names, numbers,
regular expressions, slices, lists or tuples.</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>criteria</strong> – Key/value pairs that specify attribute values the
pin must have in order to be selected.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">The PartUnit.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt>
<code class="descname">ref</code></dt>
<dd><p>Get, set and delete the part reference.</p>
<p>When setting the part reference, if another part with the same
reference is found, the reference for this part is adjusted to make
it unique.</p>
</dd></dl>
<dl class="attribute">
<dt>
<code class="descname">value</code></dt>
<dd><p>Get, set and delete the part value.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="skidl.skidl.PartUnit">
<em class="property">class </em><code class="descclassname">skidl.skidl.</code><code class="descname">PartUnit</code><span class="sig-paren">(</span><em>part</em>, <em>*pin_ids</em>, <em>**criteria</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#PartUnit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.PartUnit" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a PartUnit from a set of pins in a Part object.</p>
<p>Parts can be organized into smaller pieces called PartUnits. A PartUnit
acts like a Part but contains only a subset of the pins of the Part.</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>part</strong> – This is the parent Part whose pins the PartUnit is built from.</li>
<li><strong>pin_ids</strong> – A list of strings containing pin names, numbers,
regular expressions, slices, lists or tuples.</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>criteria</strong> – Key/value pairs that specify attribute values the
pin must have in order to be selected.</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Examples</p>
<p>This will return unit 1 from a part:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">lm358</span> <span class="o">=</span> <span class="n">Part</span><span class="p">(</span><span class="s1">'linear'</span><span class="p">,</span><span class="s1">'lm358'</span><span class="p">)</span>
<span class="n">lm358a</span> <span class="o">=</span> <span class="n">PartUnit</span><span class="p">(</span><span class="n">lm358</span><span class="p">,</span> <span class="n">unit</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
</pre></div>
</div>
<p>Or you can specify the pins directly:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">lm358a</span> <span class="o">=</span> <span class="n">PartUnit</span><span class="p">(</span><span class="n">lm358</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
</pre></div>
</div>
</dd></dl>
<dl class="class">
<dt id="skidl.skidl.PhantomPin">
<em class="property">class </em><code class="descclassname">skidl.skidl.</code><code class="descname">PhantomPin</code><span class="sig-paren">(</span><em>**attribs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#PhantomPin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.PhantomPin" title="Permalink to this definition">¶</a></dt>
<dd><p>A pin type that exists solely to tie two pinless nets together.
It will not participate in generating any netlists.</p>
</dd></dl>
<dl class="class">
<dt id="skidl.skidl.Pin">
<em class="property">class </em><code class="descclassname">skidl.skidl.</code><code class="descname">Pin</code><span class="sig-paren">(</span><em>**attribs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#Pin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.Pin" title="Permalink to this definition">¶</a></dt>
<dd><p>A class for storing data about pins for a part.</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>attribs</strong> – Key/value pairs of attributes to add to the library.</td>
</tr>
</tbody>
</table>
<dl class="attribute">
<dt id="skidl.skidl.Pin.nets">
<code class="descname">nets</code><a class="headerlink" href="#skidl.skidl.Pin.nets" title="Permalink to this definition">¶</a></dt>
<dd><p>The electrical nets this pin is connected to (can be >1).</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.skidl.Pin.part">
<code class="descname">part</code><a class="headerlink" href="#skidl.skidl.Pin.part" title="Permalink to this definition">¶</a></dt>
<dd><p>Link to the Part object this pin belongs to.</p>
</dd></dl>
<dl class="attribute">
<dt id="skidl.skidl.Pin.do_erc">
<code class="descname">do_erc</code><a class="headerlink" href="#skidl.skidl.Pin.do_erc" title="Permalink to this definition">¶</a></dt>
<dd><p>When false, the pin is not checked for ERC violations.</p>
</dd></dl>
<dl class="method">
<dt id="skidl.skidl.Pin.connect">
<code class="descname">connect</code><span class="sig-paren">(</span><em>*pins_nets_buses</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#Pin.connect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.Pin.connect" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the pin after connecting it to one or more nets or pins.</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 pin with the new connections.</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>You can connect nets or pins to a pin like so:</p>
<div class="highlight-default"><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">p</span> <span class="o">+=</span> <span class="n">net</span> <span class="c1"># Connect the net to the pin.</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="skidl.skidl.Pin.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><em>num_copies=1</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#Pin.copy"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.Pin.copy" title="Permalink to this definition">¶</a></dt>
<dd><p>Return copy or list of copies of a pin including any net connection.</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 pin.</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 pin.</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>An instance of a pin can be copied just by calling it like so:</p>
<div class="highlight-default"><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">p_copy</span> <span class="o">=</span> <span class="n">p</span><span class="p">()</span> <span class="c1"># This is a copy of the pin.</span>
</pre></div>
</div>
</dd></dl>
<dl class="attribute">
<dt id="skidl.skidl.Pin.net">
<code class="descname">net</code><a class="headerlink" href="#skidl.skidl.Pin.net" title="Permalink to this definition">¶</a></dt>
<dd><p>Return one of the nets the pin is connected to.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="skidl.skidl.SubCircuit">
<em class="property">class </em><code class="descclassname">skidl.skidl.</code><code class="descname">SubCircuit</code><span class="sig-paren">(</span><em>circuit_func</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#SubCircuit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.SubCircuit" title="Permalink to this definition">¶</a></dt>
<dd><p>Class object that holds the entire netlist of parts and nets. This is
initialized once when the module is first imported and then all parts
and nets are added to its static members.</p>
<dl class="attribute">
<dt id="skidl.skidl.SubCircuit.parts">
<code class="descname">parts</code><a class="headerlink" href="#skidl.skidl.SubCircuit.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.skidl.SubCircuit.nets">
<code class="descname">nets</code><a class="headerlink" href="#skidl.skidl.SubCircuit.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.skidl.SubCircuit.hierarchy">
<code class="descname">hierarchy</code><a class="headerlink" href="#skidl.skidl.SubCircuit.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.skidl.SubCircuit.level">
<code class="descname">level</code><a class="headerlink" href="#skidl.skidl.SubCircuit.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.skidl.SubCircuit.context">
<code class="descname">context</code><a class="headerlink" href="#skidl.skidl.SubCircuit.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.skidl.SubCircuit.circuit_func">
<code class="descname">circuit_func</code><a class="headerlink" href="#skidl.skidl.SubCircuit.circuit_func" title="Permalink to this definition">¶</a></dt>
<dd><p>The function that creates a given subcircuit.</p>
</dd></dl>
<dl class="classmethod">
<dt id="skidl.skidl.SubCircuit.set_pin_conflict_rule">
<em class="property">classmethod </em><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="reference internal" href="_modules/skidl/skidl.html#SubCircuit.set_pin_conflict_rule"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.SubCircuit.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., cls.OK, cls.WARNING, cls.ERROR).</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="skidl.skidl.search">
<code class="descclassname">skidl.skidl.</code><code class="descname">search</code><span class="sig-paren">(</span><em>term</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#search"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.search" title="Permalink to this definition">¶</a></dt>
<dd><p>Print a list of components with the regex term within their name, alias, description or keywords.</p>
</dd></dl>
<dl class="function">
<dt id="skidl.skidl.show">
<code class="descclassname">skidl.skidl.</code><code class="descname">show</code><span class="sig-paren">(</span><em>lib_name</em>, <em>part_name</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/skidl/skidl.html#show"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#skidl.skidl.show" title="Permalink to this definition">¶</a></dt>
<dd><p>Print the I/O pins for a given part in a library.</p>
</dd></dl>
</div>
</div>
<div class="section" id="indices-and-tables">
<h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
<ul class="simple">
<li><a class="reference internal" href="genindex.html"><span class="std std-ref">Index</span></a></li>
<li><a class="reference internal" href="py-modindex.html"><span class="std std-ref">Module Index</span></a></li>
<li><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html#document-index">Table Of Contents</a></h3>
<ul class="simple">
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="nav-item nav-item-0"><a href="index.html#document-index">skidl 0.0.10 documentation</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.4.
</div>
</body>
</html>