Skip to content

Commit

Permalink
Deploying to pages from @ 4376b46 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
flaport committed Aug 12, 2024
1 parent 2479848 commit 3f93634
Show file tree
Hide file tree
Showing 21 changed files with 3,131 additions and 3,116 deletions.
Binary file modified _downloads/efb3b4666098beb850423676c57575d3/sax-utils-1.pdf
Binary file not shown.
15 changes: 15 additions & 0 deletions _modules/sax/circuit.html
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ <h1>Source code for sax.circuit</h1><div class="highlight"><pre>
<span class="n">recnet</span><span class="p">:</span> <span class="n">RecursiveNetlist</span> <span class="o">=</span> <span class="n">parse_netlist</span><span class="p">(</span>
<span class="n">netlist</span><span class="p">,</span> <span class="n">with_unconnected_instances</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">with_placements</span><span class="o">=</span><span class="kc">False</span>
<span class="p">)</span>
<span class="n">_validate_netlist_ports</span><span class="p">(</span><span class="n">recnet</span><span class="p">)</span>
<span class="n">dependency_dag</span><span class="p">:</span> <span class="n">nx</span><span class="o">.</span><span class="n">DiGraph</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="n">_create_dag</span><span class="p">(</span><span class="n">recnet</span><span class="p">,</span> <span class="n">models</span><span class="p">,</span> <span class="n">validate</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">models</span> <span class="o">=</span> <span class="n">_validate_models</span><span class="p">(</span><span class="n">models</span><span class="p">,</span> <span class="n">dependency_dag</span><span class="p">,</span> <span class="n">extra_models</span><span class="o">=</span><span class="n">instance_models</span><span class="p">)</span>

Expand Down Expand Up @@ -746,6 +747,20 @@ <h1>Source code for sax.circuit</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="ow">not</span> <span class="n">dag</span><span class="o">.</span><span class="n">is_directed</span><span class="p">():</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Netlist dependency cycles detected!&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">dag</span>


<span class="k">def</span> <span class="nf">_validate_netlist_ports</span><span class="p">(</span><span class="n">netlist</span><span class="p">:</span> <span class="n">RecursiveNetlist</span><span class="p">):</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">netlist</span><span class="o">.</span><span class="n">root</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">1</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Cannot create circuit: empty netlist&quot;</span><span class="p">)</span>
<span class="n">net</span><span class="p">:</span> <span class="n">Netlist</span> <span class="o">=</span> <span class="n">netlist</span><span class="o">.</span><span class="n">root</span><span class="p">[</span><span class="nb">list</span><span class="p">(</span><span class="n">netlist</span><span class="o">.</span><span class="n">root</span><span class="p">)[</span><span class="mi">0</span><span class="p">]]</span>
<span class="n">ports_str</span> <span class="o">=</span> <span class="s2">&quot;, &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">net</span><span class="o">.</span><span class="n">ports</span><span class="p">))</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">ports_str</span><span class="p">:</span>
<span class="n">ports_str</span> <span class="o">=</span> <span class="s2">&quot;no ports given&quot;</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">net</span><span class="o">.</span><span class="n">ports</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mi">2</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span>
<span class="s2">&quot;Cannot create circuit: &quot;</span>
<span class="sa">f</span><span class="s2">&quot;at least 2 ports need to be defined. Got </span><span class="si">{</span><span class="n">ports_str</span><span class="si">}</span><span class="s2">.&quot;</span>
<span class="p">)</span>
</pre></div>

</article>
Expand Down
Loading

0 comments on commit 3f93634

Please sign in to comment.