Commit TP5b

This commit is contained in:
Rémi Di Guardia
2022-10-26 09:44:46 +02:00
parent 1c151ffe93
commit a89ae6ffb7
20 changed files with 269 additions and 21 deletions
+7
View File
@@ -115,6 +115,13 @@ See the documentation for <code class="xref py py-class docutils literal notrans
(including phi-nodes and the terminator, but not the label of the block).</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.CFG.Block.get_body_and_terminator">
<span class="sig-name descname"><span class="pre">get_body_and_terminator</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><a class="reference internal" href="Lib.Statement.html#Lib.Statement.Statement" title="Lib.Statement.Statement"><span class="pre">Statement</span></a><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="../_modules/Lib/CFG.html#Block.get_body_and_terminator"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.CFG.Block.get_body_and_terminator" title="Permalink to this definition"></a></dt>
<dd><p>Return all statements of the block, except phi-nodes
(and the label of the block).</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.CFG.Block.get_label">
<span class="sig-name descname"><span class="pre">get_label</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="Lib.Statement.html#Lib.Statement.Label" title="Lib.Statement.Label"><span class="pre">Label</span></a></span></span><a class="reference internal" href="../_modules/Lib/CFG.html#Block.get_label"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.CFG.Block.get_label" title="Permalink to this definition"></a></dt>
+6
View File
@@ -230,6 +230,12 @@ Return a dict vertex -&gt; color, where color is an integer (0, 1, …).</p>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">Lib.Graphes.</span></span><span class="sig-name descname"><span class="pre">DiGraph</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">graph_dict</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/Lib/Graphes.html#DiGraph"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Graphes.DiGraph" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#Lib.Graphes.GeneralGraph" title="Lib.Graphes.GeneralGraph"><code class="xref py py-class docutils literal notranslate"><span class="pre">GeneralGraph</span></code></a></p>
<p>Class for directed graphs.</p>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Graphes.DiGraph.pred">
<span class="sig-name descname"><span class="pre">pred</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">v</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Any</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">Set</span></span></span><a class="reference internal" href="../_modules/Lib/Graphes.html#DiGraph.pred"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Graphes.DiGraph.pred" title="Permalink to this definition"></a></dt>
<dd><p>Return all predecessors of the vertex <cite>v</cite> in the graph.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="Lib.Graphes.DiGraph.neighbourhoods">
<span class="sig-name descname"><span class="pre">neighbourhoods</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">Any</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="pre">Set</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></span></span><a class="reference internal" href="../_modules/Lib/Graphes.html#DiGraph.neighbourhoods"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Graphes.DiGraph.neighbourhoods" title="Permalink to this definition"></a></dt>
+2 -4
View File
@@ -110,10 +110,8 @@ the RiscV program to a file.</p>
<dt class="sig sig-object py" id="Lib.LinearCode.LinearCode.iter_statements">
<span class="sig-name descname"><span class="pre">iter_statements</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">f</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="reference internal" href="../_modules/Lib/LinearCode.html#LinearCode.iter_statements"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.LinearCode.LinearCode.iter_statements" title="Permalink to this definition"></a></dt>
<dd><p>Iterate over instructions.
For each real instruction (not label or comment), call f,
which must return either None or a list of instruction. If it
returns None, nothing happens. If it returns a list, then the
instruction is replaced by this list.</p>
For each real instruction i (not label or comment), replace it
with the list of instructions given by f(i).</p>
</dd></dl>
<dl class="py method">
+1 -1
View File
@@ -88,7 +88,7 @@ is inherited by <a class="reference internal" href="#Lib.Statement.Instru3A" tit
<a class="reference internal" href="#Lib.Statement.AbsoluteJump" title="Lib.Statement.AbsoluteJump"><code class="xref py py-class docutils literal notranslate"><span class="pre">AbsoluteJump</span></code></a> and <a class="reference internal" href="#Lib.Statement.ConditionalJump" title="Lib.Statement.ConditionalJump"><code class="xref py py-class docutils literal notranslate"><span class="pre">ConditionalJump</span></code></a>.</p>
<dl class="py function">
<dt class="sig sig-object py" id="Lib.Statement.regset_to_string">
<span class="sig-prename descclassname"><span class="pre">Lib.Statement.</span></span><span class="sig-name descname"><span class="pre">regset_to_string</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">registerset</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/Lib/Statement.html#regset_to_string"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Statement.regset_to_string" title="Permalink to this definition"></a></dt>
<span class="sig-prename descclassname"><span class="pre">Lib.Statement.</span></span><span class="sig-name descname"><span class="pre">regset_to_string</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">registerset</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">str</span></span></span><a class="reference internal" href="../_modules/Lib/Statement.html#regset_to_string"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#Lib.Statement.regset_to_string" title="Permalink to this definition"></a></dt>
<dd><p>Utility function: pretty-prints a set of locations.</p>
</dd></dl>