Skip to content

Commit

Permalink
Bumped version and updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rbnprdy committed Jan 25, 2021
1 parent a5dbd0a commit 0c21614
Show file tree
Hide file tree
Showing 20 changed files with 377 additions and 160 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.

## [0.1.2] - 2021-01-24
### FIXED
- Synthesis now works with python3.6 again

### Added
- DesignCompiler synthesis

## [0.1.1] - 2021-01-22
### FIXED
- Parsing is now being included correctly
Expand Down
4 changes: 2 additions & 2 deletions docs/analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.9.2" />
<meta name="generator" content="pdoc 0.8.4" />
<title>circuitgraph.analysis API documentation</title>
<meta name="description" content="Functions for analysis of Boolean properties" />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
Expand Down Expand Up @@ -453,7 +453,7 @@ <h1>Index</h1>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.8.4</a>.</p>
</footer>
</body>
</html>
36 changes: 18 additions & 18 deletions docs/circuit.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.9.2" />
<meta name="generator" content="pdoc 0.8.4" />
<title>circuitgraph.circuit API documentation</title>
<meta name="description" content="Class for circuit graphs …" />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
Expand Down Expand Up @@ -410,7 +410,7 @@ <h1 class="title">Module <code>circuitgraph.circuit</code></h1>
if fanin and type in [&#34;0&#34;, &#34;1&#34;, &#34;input&#34;]:
raise ValueError(f&#34;{type} cannot have fanin&#34;)
if fanout and type in [&#34;output&#34;]:
raise ValueError(f&#34;{type} cannot have fanin&#34;)
raise ValueError(f&#34;{type} cannot have fanout&#34;)
if n[0] in &#34;0123456789&#34;:
raise ValueError(f&#34;cannot add node starting with int: {n}&#34;)

Expand Down Expand Up @@ -877,18 +877,18 @@ <h2 id="parameters">Parameters</h2>
</dl>
<h2 id="examples">Examples</h2>
<p>Create an empty circuit.</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; import circuitgraph as cg
<pre><code class="python">&gt;&gt;&gt; import circuitgraph as cg
&gt;&gt;&gt; c = cg.Circuit()
</code></pre>
<p>Add an AND gate named 'x'.</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; c.add('x','and')
<pre><code class="python">&gt;&gt;&gt; c.add('x','and')
</code></pre>
<p>Add an additional nodes and connect them.</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; c.add('y','or',fanout='x')
<pre><code class="python">&gt;&gt;&gt; c.add('y','or',fanout='x')
&gt;&gt;&gt; c.add('z','xor',fanin=['x','y'])
</code></pre>
<p>Another way to create the circuit is through a file.</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; c = cg.from_file('path/circuit.v')
<pre><code class="python">&gt;&gt;&gt; c = cg.from_file('path/circuit.v')
</code></pre></div>
<details class="source">
<summary>
Expand Down Expand Up @@ -1231,7 +1231,7 @@ <h2 id="examples">Examples</h2>
if fanin and type in [&#34;0&#34;, &#34;1&#34;, &#34;input&#34;]:
raise ValueError(f&#34;{type} cannot have fanin&#34;)
if fanout and type in [&#34;output&#34;]:
raise ValueError(f&#34;{type} cannot have fanin&#34;)
raise ValueError(f&#34;{type} cannot have fanout&#34;)
if n[0] in &#34;0123456789&#34;:
raise ValueError(f&#34;cannot add node starting with int: {n}&#34;)

Expand Down Expand Up @@ -1636,15 +1636,15 @@ <h2 id="returns">Returns</h2>
</dl>
<h2 id="example">Example</h2>
<p>Add a single node</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; import circuitgraph as cg
<pre><code class="python">&gt;&gt;&gt; import circuitgraph as cg
&gt;&gt;&gt; c = cg.Circuit()
&gt;&gt;&gt; c.add('a','or')
'a'
</code></pre>
<p>In the above example the function returns the name of the new node.
This allows us to quickly generate an AND tree with the following
syntax.</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; c.add('g','and',fanin=[c.add(f'in_{i}','input') for i in range(4)])
<pre><code class="python">&gt;&gt;&gt; c.add('g','and',fanin=[c.add(f'in_{i}','input') for i in range(4)])
'g'
&gt;&gt;&gt; c.fanin('g')
{'in_1', 'in_0', 'in_3', 'in_2'}
Expand Down Expand Up @@ -1713,7 +1713,7 @@ <h2 id="example">Example</h2>
if fanin and type in [&#34;0&#34;, &#34;1&#34;, &#34;input&#34;]:
raise ValueError(f&#34;{type} cannot have fanin&#34;)
if fanout and type in [&#34;output&#34;]:
raise ValueError(f&#34;{type} cannot have fanin&#34;)
raise ValueError(f&#34;{type} cannot have fanout&#34;)
if n[0] in &#34;0123456789&#34;:
raise ValueError(f&#34;cannot add node starting with int: {n}&#34;)

Expand Down Expand Up @@ -2000,7 +2000,7 @@ <h2 id="returns">Returns</h2>
<dd>Nodes in fanin.</dd>
</dl>
<h2 id="example">Example</h2>
<pre><code class="language-python-repl">&gt;&gt;&gt; c.fanout('n_20')
<pre><code class="python">&gt;&gt;&gt; c.fanout('n_20')
{'G17'}
&gt;&gt;&gt; c.fanout('n_11')
{'n_12'}
Expand Down Expand Up @@ -2272,15 +2272,15 @@ <h2 id="returns">Returns</h2>
</dl>
<h2 id="examples">Examples</h2>
<p>Create a circuit with several gate types.</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; c = cg.Circuit()
<pre><code class="python">&gt;&gt;&gt; c = cg.Circuit()
&gt;&gt;&gt; for i,g in enumerate(['xor','or','xor','ff']): c.add(f'g{i}',g)
</code></pre>
<p>Calling <code>nodes</code> with no argument returns all nodes in the circuit</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; c.nodes()
<pre><code class="python">&gt;&gt;&gt; c.nodes()
{'g0', 'g1', 'g2', 'g3'}
</code></pre>
<p>Passing a node type, we can selectively return nodes.</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; c.filter_type('xor')
<pre><code class="python">&gt;&gt;&gt; c.filter_type('xor')
{'g2', 'g0'}
</code></pre></div>
<details class="source">
Expand Down Expand Up @@ -2701,15 +2701,15 @@ <h2 id="raises">Raises</h2>
</dl>
<h2 id="examples">Examples</h2>
<p>Create a with several gate types.</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; c = cg.Circuit()
<pre><code class="python">&gt;&gt;&gt; c = cg.Circuit()
&gt;&gt;&gt; for i,g in enumerate(['xor','or','xor','ff']): c.add(f'g{i}', g)
</code></pre>
<p>Calling <code>type</code> for a single gate returns a single type</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; c.type('g0')
<pre><code class="python">&gt;&gt;&gt; c.type('g0')
{'xor'}
</code></pre>
<p>Calling <code>type</code> on an iterable returns a set of types</p>
<pre><code class="language-python-repl">&gt;&gt;&gt; c.type(c.nodes())
<pre><code class="python">&gt;&gt;&gt; c.type(c.nodes())
['xor', 'or', 'xor', 'ff']
</code></pre></div>
<details class="source">
Expand Down Expand Up @@ -2855,7 +2855,7 @@ <h4><code><a title="circuitgraph.circuit.Circuit" href="#circuitgraph.circuit.Ci
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.8.4</a>.</p>
</footer>
</body>
</html>
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.9.2" />
<meta name="generator" content="pdoc 0.8.4" />
<title>circuitgraph API documentation</title>
<meta name="description" content="Python package `circuitgraph` provides a data structure
for the generation, manipulation, and evaluation of
Expand Down Expand Up @@ -142,7 +142,7 @@ <h1>Index</h1>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.8.4</a>.</p>
</footer>
</body>
</html>
20 changes: 13 additions & 7 deletions docs/io.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.9.2" />
<meta name="generator" content="pdoc 0.8.4" />
<title>circuitgraph.io API documentation</title>
<meta name="description" content="Functions for reading/writing CircuitGraphs" />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
Expand Down Expand Up @@ -150,7 +150,7 @@ <h1 class="title">Module <code>circuitgraph.io</code></h1>

Parameters
----------
path: str
netlist: str
Verilog code.
name: str
Module name.
Expand All @@ -170,7 +170,10 @@ <h1 class="title">Module <code>circuitgraph.io</code></h1>
# parse module
regex = f&#34;(module\s+{name}\s*\(.*?\);(.*?)endmodule)&#34;
m = re.search(regex, netlist, re.DOTALL)
module = m.group(1)
try:
module = m.group(1)
except AttributeError:
raise ValueError(&#34;Could not read netlist: no modules found&#34;)

if blackboxes is None:
blackboxes = []
Expand Down Expand Up @@ -750,7 +753,7 @@ <h2 id="parameters">Parameters</h2>
<div class="desc"><p>Creates a new Circuit from a module inside Verilog code.</p>
<h2 id="parameters">Parameters</h2>
<dl>
<dt><strong><code>path</code></strong> :&ensp;<code>str</code></dt>
<dt><strong><code>netlist</code></strong> :&ensp;<code>str</code></dt>
<dd>Verilog code.</dd>
<dt><strong><code>name</code></strong> :&ensp;<code>str</code></dt>
<dd>Module name.</dd>
Expand Down Expand Up @@ -779,7 +782,7 @@ <h2 id="returns">Returns</h2>

Parameters
----------
path: str
netlist: str
Verilog code.
name: str
Module name.
Expand All @@ -799,7 +802,10 @@ <h2 id="returns">Returns</h2>
# parse module
regex = f&#34;(module\s+{name}\s*\(.*?\);(.*?)endmodule)&#34;
m = re.search(regex, netlist, re.DOTALL)
module = m.group(1)
try:
module = m.group(1)
except AttributeError:
raise ValueError(&#34;Could not read netlist: no modules found&#34;)

if blackboxes is None:
blackboxes = []
Expand Down Expand Up @@ -842,7 +848,7 @@ <h1>Index</h1>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.8.4</a>.</p>
</footer>
</body>
</html>
4 changes: 2 additions & 2 deletions docs/logic.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.9.2" />
<meta name="generator" content="pdoc 0.8.4" />
<title>circuitgraph.logic API documentation</title>
<meta name="description" content="A collection of common logic elements as `Circuit` objects" />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
Expand Down Expand Up @@ -442,7 +442,7 @@ <h1>Index</h1>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.8.4</a>.</p>
</footer>
</body>
</html>
4 changes: 2 additions & 2 deletions docs/parsing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.9.2" />
<meta name="generator" content="pdoc 0.8.4" />
<title>circuitgraph.parsing API documentation</title>
<meta name="description" content="Utilities for parsing netlists" />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
Expand Down Expand Up @@ -73,7 +73,7 @@ <h1>Index</h1>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.2</a>.</p>
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.8.4</a>.</p>
</footer>
</body>
</html>
Loading

0 comments on commit 0c21614

Please sign in to comment.