Skip to content

Commit

Permalink
Added XSPICE capability.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Vandenbout committed Jan 30, 2020
1 parent e1a54df commit b4bc749
Show file tree
Hide file tree
Showing 15 changed files with 1,292 additions and 192 deletions.
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
History
-------

0.0.29 (2020-01-24)
0.0.29 (2020-01-30)
______________________

* Added XSPICE parts capability to SPICE simulations.
Expand Down
16 changes: 16 additions & 0 deletions docs/_posts/2020-01-30-xspice-capability.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
layout: post
title: xspice capability
date: 2020-01-30T09:01:10-05:00
author:
name: Dave Vandenbout
photo: devb-pic.jpg
email: [email protected]
description: Relax, I do this stuff for a living.
category: blog
permalink: blog/xspice-capability
---

[Somebody asked about using XSPICE components](https://github.com/xesscorp/skidl/issues/76) in SPICE simulations with SKiDL.
That wasn't possible since [PySpice](https://pyspice.fabrice-salvaire.fr/) didn't really support these when I [built the interface](https://xesscorp.github.io/skidl/docs/_site/blog/spice-simulation).
So I added XSPICE parts to the [SKiDL SPICE interface](https://github.com/xesscorp/skidl/blob/master/examples/spice-sim-intro/spice-sim-intro.ipynb) and released it as [SKiDL 0.0.29](https://pypi.org/project/skidl/).
114 changes: 59 additions & 55 deletions docs/_site/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@ <h6>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
<code class="descclassname">skidl.tools.spice.</code><code class="descname">_mk_subckt_part</code><span class="sig-paren">(</span><em>defn='XXX'</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice._mk_subckt_part" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="class">
<dt id="skidl.tools.spice.XspiceModel">
<em class="property">class </em><code class="descclassname">skidl.tools.spice.</code><code class="descname">XspiceModel</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.XspiceModel" 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>Object to hold the parameters for an XSPICE model.</p>
<dl class="method">
<dt id="skidl.tools.spice.XspiceModel.__init__">
<code class="descname">__init__</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.XspiceModel.__init__" title="Permalink to this definition"></a></dt>
<dd><p>Initialize self. See help(type(self)) for accurate signature.</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="skidl.tools.spice._gen_netlist_">
<code class="descclassname">skidl.tools.spice.</code><code class="descname">_gen_netlist_</code><span class="sig-paren">(</span><em>self</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice._gen_netlist_" title="Permalink to this definition"></a></dt>
Expand Down Expand Up @@ -240,38 +253,6 @@ <h6>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
</dl>
</dd></dl>

<dl class="class">
<dt id="skidl.tools.spice.PinList">
<em class="property">class </em><code class="descclassname">skidl.tools.spice.</code><code class="descname">PinList</code><span class="sig-paren">(</span><em>num</em>, <em>name</em>, <em>part</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.PinList" 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>
<p>A list of Pin objects that’s meant to look something like a Pin to a Part.
This is used for vector I/O of XSPICE parts.</p>
<dl class="method">
<dt id="skidl.tools.spice.PinList.__init__">
<code class="descname">__init__</code><span class="sig-paren">(</span><em>num</em>, <em>name</em>, <em>part</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.PinList.__init__" title="Permalink to this definition"></a></dt>
<dd><p>Initialize self. See help(type(self)) for accurate signature.</p>
</dd></dl>

<dl class="method">
<dt id="skidl.tools.spice.PinList.__getitem__">
<code class="descname">__getitem__</code><span class="sig-paren">(</span><em>i</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.PinList.__getitem__" title="Permalink to this definition"></a></dt>
<dd><p>Get a Pin from the list. Add Pin objects to the list if they don’t exist.</p>
</dd></dl>

<dl class="method">
<dt id="skidl.tools.spice.PinList.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.PinList.copy" title="Permalink to this definition"></a></dt>
<dd><p>Return a copy of a PinList for use when a Part is copied.</p>
</dd></dl>

<dl class="method">
<dt id="skidl.tools.spice.PinList.disconnect">
<code class="descname">disconnect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.PinList.disconnect" title="Permalink to this definition"></a></dt>
<dd><p>Disconnect all the pins in the list.</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="skidl.tools.spice.add_xspice_to_circuit">
<code class="descclassname">skidl.tools.spice.</code><code class="descname">add_xspice_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_xspice_to_circuit" title="Permalink to this definition"></a></dt>
Expand All @@ -286,25 +267,6 @@ <h6>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
</dl>
</dd></dl>

<dl class="class">
<dt id="skidl.tools.spice.XspiceModel">
<em class="property">class </em><code class="descclassname">skidl.tools.spice.</code><code class="descname">XspiceModel</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.XspiceModel" 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>Object to hold the parameters for an XSPICE model.</p>
<dl class="method">
<dt id="skidl.tools.spice.XspiceModel.__init__">
<code class="descname">__init__</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.XspiceModel.__init__" title="Permalink to this definition"></a></dt>
<dd><p>Initialize self. See help(type(self)) for accurate signature.</p>
</dd></dl>

</dd></dl>

<dl class="function">
<dt id="skidl.tools.spice.A">
<code class="descclassname">skidl.tools.spice.</code><code class="descname">A</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.tools.spice.A" title="Permalink to this definition"></a></dt>
<dd><p>This function creates an XSPICE part. It replaces the A part in the pyspice_sklib.py file.</p>
</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>
Expand Down Expand Up @@ -1719,8 +1681,8 @@ <h4>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
<li><p><strong>dest</strong> – String that indicates where the part is destined for (e.g., LIBRARY).</p></li>
<li><p><strong>tool</strong> – The format for the library file or part definition (e.g., KICAD).</p></li>
<li><p><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’ }</p></li>
nets to which they will be connected as values. For example:
{ ‘IN-‘:a_in, ‘IN+’:gnd, ‘1’:AMPED_OUTPUT, ‘14’:vcc, ‘7’:gnd }</p></li>
<li><p><strong>part_defn</strong> – A list of strings that define the part (usually read from a
schematic library file).</p></li>
<li><p><strong>circuit</strong> – The Circuit object this Part belongs to.</p></li>
Expand Down Expand Up @@ -1749,6 +1711,12 @@ <h4>Submodules<a class="headerlink" href="#submodules" title="Permalink to this
<dd><p>Initialize self. See help(type(self)) for accurate signature.</p>
</dd></dl>

<dl class="method">
<dt id="skidl.Part.Part.add_xspice_io">
<code class="descname">add_xspice_io</code><span class="sig-paren">(</span><em>io</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Part.Part.add_xspice_io" title="Permalink to this definition"></a></dt>
<dd><p>Add XSPICE I/O to the pins of a part.</p>
</dd></dl>

<dl class="classmethod">
<dt id="skidl.Part.Part.get">
<em class="property">classmethod </em><code class="descname">get</code><span class="sig-paren">(</span><em>text</em>, <em>circuit=None</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Part.Part.get" title="Permalink to this definition"></a></dt>
Expand Down Expand Up @@ -1795,14 +1763,16 @@ <h4>Submodules<a class="headerlink" href="#submodules" title="Permalink to this

<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>
<code class="descname">copy</code><span class="sig-paren">(</span><em>num_copies=None</em>, <em>dest='NETLIST'</em>, <em>circuit=None</em>, <em>io=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>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>num_copies</strong> – Number of copies to make of this part.</p></li>
<li><p><strong>dest</strong> – Indicates where the copy is destined for (e.g., NETLIST).</p></li>
<li><p><strong>circuit</strong> – The circuit this part should be added to.</p></li>
<li><p><strong>io</strong> – XSPICE I/O names.</p></li>
</ul>
</dd>
<dt class="field-even">Keyword Arguments</dt>
Expand Down Expand Up @@ -1830,14 +1800,16 @@ <h4>Submodules<a class="headerlink" href="#submodules" title="Permalink to this

<dl class="method">
<dt id="skidl.Part.Part.__call__">
<code class="descname">__call__</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.__call__" title="Permalink to this definition"></a></dt>
<code class="descname">__call__</code><span class="sig-paren">(</span><em>num_copies=None</em>, <em>dest='NETLIST'</em>, <em>circuit=None</em>, <em>io=None</em>, <em>**attribs</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Part.Part.__call__" title="Permalink to this definition"></a></dt>
<dd><p>Make zero or more copies of this part while maintaining all pin/net
connections.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>num_copies</strong> – Number of copies to make of this part.</p></li>
<li><p><strong>dest</strong> – Indicates where the copy is destined for (e.g., NETLIST).</p></li>
<li><p><strong>circuit</strong> – The circuit this part should be added to.</p></li>
<li><p><strong>io</strong> – XSPICE I/O names.</p></li>
</ul>
</dd>
<dt class="field-even">Keyword Arguments</dt>
Expand Down Expand Up @@ -2814,6 +2786,38 @@ <h4>Submodules<a class="headerlink" href="#submodules" title="Permalink to this

</dd></dl>

<dl class="class">
<dt id="skidl.Pin.PinList">
<em class="property">class </em><code class="descclassname">skidl.Pin.</code><code class="descname">PinList</code><span class="sig-paren">(</span><em>num</em>, <em>name</em>, <em>part</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Pin.PinList" 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>
<p>A list of Pin objects that’s meant to look something like a Pin to a Part.
This is used for vector I/O of XSPICE parts.</p>
<dl class="method">
<dt id="skidl.Pin.PinList.__init__">
<code class="descname">__init__</code><span class="sig-paren">(</span><em>num</em>, <em>name</em>, <em>part</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Pin.PinList.__init__" title="Permalink to this definition"></a></dt>
<dd><p>Initialize self. See help(type(self)) for accurate signature.</p>
</dd></dl>

<dl class="method">
<dt id="skidl.Pin.PinList.__getitem__">
<code class="descname">__getitem__</code><span class="sig-paren">(</span><em>i</em><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Pin.PinList.__getitem__" title="Permalink to this definition"></a></dt>
<dd><p>Get a Pin from the list. Add Pin objects to the list if they don’t exist.</p>
</dd></dl>

<dl class="method">
<dt id="skidl.Pin.PinList.copy">
<code class="descname">copy</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Pin.PinList.copy" title="Permalink to this definition"></a></dt>
<dd><p>Return a copy of a PinList for use when a Part is copied.</p>
</dd></dl>

<dl class="method">
<dt id="skidl.Pin.PinList.disconnect">
<code class="descname">disconnect</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#skidl.Pin.PinList.disconnect" title="Permalink to this definition"></a></dt>
<dd><p>Disconnect all the pins in the list.</p>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="module-skidl.SchLib">
<span id="skidl-schlib-module"></span><h4>skidl.SchLib module<a class="headerlink" href="#module-skidl.SchLib" title="Permalink to this headline"></a></h4>
Expand Down
60 changes: 30 additions & 30 deletions docs/_site/blog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,36 @@
<div class="small-12 medium-9 large-10 columns">


<article class="notepad-index-post post row">
<div class="small-12 medium-3 large-2 columns datetime">
<span class="notepad-post-meta">
<time datetime="2020-01-30T09:01:10-05:00">
<span class="day">
30
</span>
<span class="month-year">
January 2020
</span>
</time>
</span>
</div>
<div class="small-12 medium-9 large-10 columns">
<header class="notepad-post-header">
<h3 class="notepad-post-title">
<a href="https://xesscorp.github.io/skidl/docs/_site/blog/xspice-capability">
xspice capability
</a>
</h3>
</header>
<section class="notepad-post-excerpt">
<p>Somebody asked about using XSPICE components in SPICE simulations with SKiDL. That wasn’t possible since PySpice didn’t really support these when I built the interface. So I added XSPICE parts to the SKiDL SPICE interface and released it as SKiDL...</p>
</section>
<div class="notepad-index-post-tags">
<a href="https://xesscorp.github.io/skidl/docs/_site/categories/index.html#blog" title="Other posts from the Blog category">Blog</a>
</div>
</div>
</article>

<article class="notepad-index-post post row">
<div class="small-12 medium-3 large-2 columns datetime">
<span class="notepad-post-meta">
Expand Down Expand Up @@ -386,36 +416,6 @@ <h3 class="notepad-post-title">
</div>
</article>

<article class="notepad-index-post post row">
<div class="small-12 medium-3 large-2 columns datetime">
<span class="notepad-post-meta">
<time datetime="2017-03-02T16:45:58-05:00">
<span class="day">
02
</span>
<span class="month-year">
March 2017
</span>
</time>
</span>
</div>
<div class="small-12 medium-9 large-10 columns">
<header class="notepad-post-header">
<h3 class="notepad-post-title">
<a href="https://xesscorp.github.io/skidl/docs/_site/blog/two-easy-pieces">
Two Easy Pieces
</a>
</h3>
</header>
<section class="notepad-post-excerpt">
<p>I really wanted to call this post Five Easy Pieces, but I’m not Jack Nicholson and I only had two simple SKiDL designs to show. So here they are. LED Clock DougE recently posted a script that will layout a...</p>
</section>
<div class="notepad-index-post-tags">
<a href="https://xesscorp.github.io/skidl/docs/_site/categories/index.html#blog" title="Other posts from the Blog category">Blog</a>
</div>
</div>
</article>


<nav class="pagination" role="navigation">

Expand Down
30 changes: 30 additions & 0 deletions docs/_site/blog/page2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,36 @@
<div class="small-12 medium-9 large-10 columns">


<article class="notepad-index-post post row">
<div class="small-12 medium-3 large-2 columns datetime">
<span class="notepad-post-meta">
<time datetime="2017-03-02T16:45:58-05:00">
<span class="day">
02
</span>
<span class="month-year">
March 2017
</span>
</time>
</span>
</div>
<div class="small-12 medium-9 large-10 columns">
<header class="notepad-post-header">
<h3 class="notepad-post-title">
<a href="https://xesscorp.github.io/skidl/docs/_site/blog/two-easy-pieces">
Two Easy Pieces
</a>
</h3>
</header>
<section class="notepad-post-excerpt">
<p>I really wanted to call this post Five Easy Pieces, but I’m not Jack Nicholson and I only had two simple SKiDL designs to show. So here they are. LED Clock DougE recently posted a script that will layout a...</p>
</section>
<div class="notepad-index-post-tags">
<a href="https://xesscorp.github.io/skidl/docs/_site/categories/index.html#blog" title="Other posts from the Blog category">Blog</a>
</div>
</div>
</article>

<article class="notepad-index-post post row">
<div class="small-12 medium-3 large-2 columns datetime">
<span class="notepad-post-meta">
Expand Down
Loading

0 comments on commit b4bc749

Please sign in to comment.