Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > aaf33964de706a538481c929c1da6a44 > files > 2408

faust-doc-0.9.10-5mdv2010.1.x86_64.rpm

<!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/xhtml;charset=UTF-8"/>
<title>FAUST compiler: VectorCompiler Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="classes.html"><span>Class&nbsp;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>VectorCompiler Class Reference</h1><!-- doxytag: class="VectorCompiler" --><!-- doxytag: inherits="ScalarCompiler" -->
<p>Compile a list of FAUST signals into a vector C++ class.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="compile__vect_8hh_source.html">compile_vect.hh</a>&gt;</code></p>

<p>Inherits <a class="el" href="classScalarCompiler.html">ScalarCompiler</a>.</p>
<div class="dynheader">
Collaboration diagram for VectorCompiler:</div>
<div class="dynsection">
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classVectorCompiler-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classVectorCompiler.html#ad8c0834a8b509393426211ae51aa9e97">VectorCompiler</a> (const string &amp;name, const string &amp;super, int numInputs, int numOutputs)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classVectorCompiler.html#ab2b38ca1eef65132e3efa091f427aa09">VectorCompiler</a> (<a class="el" href="classKlass.html">Klass</a> *k)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classVectorCompiler.html#aed983c23776dfd40264a14ee750f2c4c">compileMultiSignal</a> (<a class="el" href="classCTree.html">Tree</a> L)</td></tr>
<tr><td colspan="2"><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classVectorCompiler.html#a00dc47a1dd180a4c2a36494a5e9d0273">CS</a> (<a class="el" href="classCTree.html">Tree</a> sig)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compile a signal.  <a href="#a00dc47a1dd180a4c2a36494a5e9d0273"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classVectorCompiler.html#af8918246b8ae134504d606b1ee65da59">generateCode</a> (<a class="el" href="classCTree.html">Tree</a> sig)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Compile a signal.  <a href="#af8918246b8ae134504d606b1ee65da59"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classVectorCompiler.html#a446965617480f2c52ad9cc6e474395bb">generateCacheCode</a> (<a class="el" href="classCTree.html">Tree</a> sig, const string &amp;exp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Generate cache code for a signal if needed.  <a href="#a446965617480f2c52ad9cc6e474395bb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classVectorCompiler.html#a4a78b541b4c01df34c128aff55489675">generateDelayLine</a> (const string &amp;ctype, const string &amp;vname, int mxd, const string &amp;exp)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Generate code for the delay mecchanism without using temporary variables.  <a href="#a4a78b541b4c01df34c128aff55489675"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classVectorCompiler.html#a37bb71786922656262d3452a85e12c9d">generateVariableStore</a> (<a class="el" href="classCTree.html">Tree</a> sig, const string &amp;exp)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classVectorCompiler.html#a38318c939418370575a9b49707109655">generateFixDelay</a> (<a class="el" href="classCTree.html">Tree</a> sig, <a class="el" href="classCTree.html">Tree</a> exp, <a class="el" href="classCTree.html">Tree</a> delay)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Generate code for accessing a delayed signal.  <a href="#a38318c939418370575a9b49707109655"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classVectorCompiler.html#a905e49bf887c9689e72ab0bb73afbb80">generateDelayVec</a> (<a class="el" href="classCTree.html">Tree</a> sig, const string &amp;exp, const string &amp;ctype, const string &amp;vname, int mxd)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Generate code for the delay mecchanism.  <a href="#a905e49bf887c9689e72ab0bb73afbb80"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classVectorCompiler.html#a41f6414f75499ea54aafb110c3b203b4">needSeparateLoop</a> (<a class="el" href="classCTree.html">Tree</a> sig)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Test if a signal need to be compiled in a separate loop.  <a href="#a41f6414f75499ea54aafb110c3b203b4"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Compile a list of FAUST signals into a vector C++ class. </p>

<p>Definition at line <a class="el" href="compile__vect_8hh_source.html#l00039">39</a> of file <a class="el" href="compile__vect_8hh_source.html">compile_vect.hh</a>.</p>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ad8c0834a8b509393426211ae51aa9e97"></a><!-- doxytag: member="VectorCompiler::VectorCompiler" ref="ad8c0834a8b509393426211ae51aa9e97" args="(const string &amp;name, const string &amp;super, int numInputs, int numOutputs)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VectorCompiler::VectorCompiler </td>
          <td>(</td>
          <td class="paramtype">const string &amp;&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const string &amp;&nbsp;</td>
          <td class="paramname"> <em>super</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>numInputs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>numOutputs</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="compile__vect_8hh_source.html#l00044">44</a> of file <a class="el" href="compile__vect_8hh_source.html">compile_vect.hh</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00045"></a>00045         : <a class="code" href="classScalarCompiler.html#a5ba99c359e876e917a35366c1dbdf343">ScalarCompiler</a>(<a class="code" href="symbol_8hh.html#a8243134fbbd9d924ebbb3f833922e310" title="Returns the name of a symbol.">name</a>,super,numInputs,numOutputs)
<a name="l00046"></a>00046         {}
</pre></div></p>

</div>
</div>
<a class="anchor" id="ab2b38ca1eef65132e3efa091f427aa09"></a><!-- doxytag: member="VectorCompiler::VectorCompiler" ref="ab2b38ca1eef65132e3efa091f427aa09" args="(Klass *k)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">VectorCompiler::VectorCompiler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classKlass.html">Klass</a> *&nbsp;</td>
          <td class="paramname"> <em>k</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="compile__vect_8hh_source.html#l00048">48</a> of file <a class="el" href="compile__vect_8hh_source.html">compile_vect.hh</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00048"></a>00048                               : <a class="code" href="classScalarCompiler.html#a5ba99c359e876e917a35366c1dbdf343">ScalarCompiler</a>(k)
<a name="l00049"></a>00049     {}
</pre></div></p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aed983c23776dfd40264a14ee750f2c4c"></a><!-- doxytag: member="VectorCompiler::compileMultiSignal" ref="aed983c23776dfd40264a14ee750f2c4c" args="(Tree L)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void VectorCompiler::compileMultiSignal </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classCTree.html">Tree</a>&nbsp;</td>
          <td class="paramname"> <em>L</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reimplemented from <a class="el" href="classScalarCompiler.html#a3870aba6cb3a4ba4092a6fd1f1e01bb3">ScalarCompiler</a>.</p>

<p>Definition at line <a class="el" href="compile__vect_8cpp_source.html#l00032">32</a> of file <a class="el" href="compile__vect_8cpp_source.html">compile_vect.cpp</a>.</p>

<p>References <a class="el" href="klass_8hh_source.html#l00158">Klass::addExecCode()</a>, <a class="el" href="klass_8hh_source.html#l00148">Klass::addSharedDecl()</a>, <a class="el" href="klass_8hh_source.html#l00155">Klass::addZone3()</a>, <a class="el" href="klass_8cpp_source.html#l00285">Klass::buildTasksList()</a>, <a class="el" href="klass_8cpp_source.html#l00109">Klass::closeLoop()</a>, <a class="el" href="compile__vect_8cpp_source.html#l00081">CS()</a>, <a class="el" href="compile_8hh_source.html#l00053">Compiler::fClass</a>, <a class="el" href="compile_8hh_source.html#l00056">Compiler::fDescription</a>, <a class="el" href="compile_8hh_source.html#l00055">Compiler::fUIRoot</a>, <a class="el" href="compile_8cpp_source.html#l00410">Compiler::generateMacroInterfaceTree()</a>, <a class="el" href="compile_8cpp_source.html#l00279">Compiler::generateUserInterfaceTree()</a>, <a class="el" href="main_8cpp_source.html#l00137">gSchedulerSwitch</a>, <a class="el" href="list_8hh_source.html#l00133">hd()</a>, <a class="el" href="klass_8hh_source.html#l00190">Klass::inputs()</a>, <a class="el" href="list_8hh_source.html#l00138">isList()</a>, <a class="el" href="klass_8cpp_source.html#l00089">Klass::openLoop()</a>, <a class="el" href="klass_8hh_source.html#l00191">Klass::outputs()</a>, <a class="el" href="compile__scal_8cpp_source.html#l00096">ScalarCompiler::prepare()</a>, <a class="el" href="compile_8cpp_source.html#l00133">Compiler::prepareUserInterfaceTree()</a>, <a class="el" href="Text_8cpp_source.html#l00060">subst()</a>, <a class="el" href="Text_8cpp_source.html#l00163">T()</a>, <a class="el" href="list_8hh_source.html#l00134">tl()</a>, <a class="el" href="description_8cpp_source.html#l00204">Description::ui()</a>, <a class="el" href="floats_8cpp_source.html#l00050">xcast()</a>, and <a class="el" href="floats_8cpp_source.html#l00049">xfloat()</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00033"></a>00033 {
<a name="l00034"></a>00034     <span class="comment">//contextor recursivness(0);</span>
<a name="l00035"></a>00035     L = <a class="code" href="classScalarCompiler.html#a7144aea17822337a175d660cd6def014">prepare</a>(L);     <span class="comment">// optimize, share and annotate expression</span>
<a name="l00036"></a>00036     
<a name="l00037"></a>00037     <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#ae4a8930e2604b74416905dc1830c2bb1">inputs</a>(); i++) {
<a name="l00038"></a>00038         <span class="keywordflow">if</span> (<a class="code" href="compile__scal_8cpp.html#aed8da6f8f23ca426bf3ea6564e0bd6f2">gSchedulerSwitch</a>) {
<a name="l00039"></a>00039             <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a368fbe339be25ff39dcddd984e2c6342">addZone3</a>(<a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$1* input$0 = &amp;input[$0][fIndex];&quot;</span>, <a class="code" href="Text_8cpp.html#a16bacb907294be37af81cdf9aff4449a">T</a>(i), <a class="code" href="floats_8cpp.html#a2da2ae6649f9479320f115342675b275">xfloat</a>()));
<a name="l00040"></a>00040         } <span class="keywordflow">else</span> {
<a name="l00041"></a>00041             <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a368fbe339be25ff39dcddd984e2c6342">addZone3</a>(<a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$1* input$0 = &amp;input[$0][index];&quot;</span>, <a class="code" href="Text_8cpp.html#a16bacb907294be37af81cdf9aff4449a">T</a>(i), <a class="code" href="floats_8cpp.html#a2da2ae6649f9479320f115342675b275">xfloat</a>()));
<a name="l00042"></a>00042         }
<a name="l00043"></a>00043     }
<a name="l00044"></a>00044     <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a7050eb78afb74764622f1b6140297dd4">outputs</a>(); i++) {
<a name="l00045"></a>00045         <span class="keywordflow">if</span> (<a class="code" href="compile__scal_8cpp.html#aed8da6f8f23ca426bf3ea6564e0bd6f2">gSchedulerSwitch</a>) {
<a name="l00046"></a>00046             <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a368fbe339be25ff39dcddd984e2c6342">addZone3</a>(<a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$1* output$0 = &amp;output[$0][fIndex];&quot;</span>, <a class="code" href="Text_8cpp.html#a16bacb907294be37af81cdf9aff4449a">T</a>(i), <a class="code" href="floats_8cpp.html#a2da2ae6649f9479320f115342675b275">xfloat</a>()));
<a name="l00047"></a>00047         } <span class="keywordflow">else</span> {
<a name="l00048"></a>00048             <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a368fbe339be25ff39dcddd984e2c6342">addZone3</a>(<a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$1* output$0 = &amp;output[$0][index];&quot;</span>, <a class="code" href="Text_8cpp.html#a16bacb907294be37af81cdf9aff4449a">T</a>(i), <a class="code" href="floats_8cpp.html#a2da2ae6649f9479320f115342675b275">xfloat</a>()));
<a name="l00049"></a>00049         }
<a name="l00050"></a>00050     }
<a name="l00051"></a>00051                 
<a name="l00052"></a>00052     <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a9cbf32b697f222569fa953a740c0eb4c">addSharedDecl</a>(<span class="stringliteral">&quot;fullcount&quot;</span>); 
<a name="l00053"></a>00053     <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a9cbf32b697f222569fa953a740c0eb4c">addSharedDecl</a>(<span class="stringliteral">&quot;input&quot;</span>); 
<a name="l00054"></a>00054     <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a9cbf32b697f222569fa953a740c0eb4c">addSharedDecl</a>(<span class="stringliteral">&quot;output&quot;</span>); 
<a name="l00055"></a>00055     
<a name="l00056"></a>00056     <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; <a class="code" href="list_8hh.html#a8bdd73641276e0c0f999f504348eacc1">isList</a>(L); L = <a class="code" href="list_8hh.html#a4075748f5c7156306ec898795313a2e0">tl</a>(L), i++) {
<a name="l00057"></a>00057         <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a> sig = <a class="code" href="list_8hh.html#a067ad6f83087b420a1c44e48e56be389">hd</a>(L);
<a name="l00058"></a>00058         <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a393c343f0a6fe7d0cf16d6e91f243398" title="Open a non-recursive loop on top of the stack of open loops.">openLoop</a>(<span class="stringliteral">&quot;count&quot;</span>);
<a name="l00059"></a>00059         <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#afb18d2c8b90b89695d866dfa4d4ff52e">addExecCode</a>(<a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;output$0[i] = $2$1;&quot;</span>, <a class="code" href="Text_8cpp.html#a16bacb907294be37af81cdf9aff4449a">T</a>(i), <a class="code" href="classVectorCompiler.html#a00dc47a1dd180a4c2a36494a5e9d0273" title="Compile a signal.">CS</a>(sig), <a class="code" href="floats_8cpp.html#a73d3935ab38244e8006fbaa2b7caf33c">xcast</a>()));
<a name="l00060"></a>00060         <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a4d19081c50e9ce7300f9b220df6fce76" title="Close the top loop and either keep it or absorb it within its enclosing loop.">closeLoop</a>();
<a name="l00061"></a>00061     }
<a name="l00062"></a>00062     
<a name="l00063"></a>00063     <span class="keywordflow">if</span> (<a class="code" href="compile__scal_8cpp.html#aed8da6f8f23ca426bf3ea6564e0bd6f2">gSchedulerSwitch</a>) {
<a name="l00064"></a>00064         <span class="comment">// Build tasks list </span>
<a name="l00065"></a>00065         <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a0019dbeefbadbcb850c742e257508722">buildTasksList</a>();
<a name="l00066"></a>00066     }
<a name="l00067"></a>00067     
<a name="l00068"></a>00068     <a class="code" href="classCompiler.html#ae994f402a26a38796eab173a1028804e" title="Generate buildUserInterface C++ lines of code corresponding to user interface element...">generateUserInterfaceTree</a>(<a class="code" href="classCompiler.html#a4e6876486af1cf65dc633fd3b99aba85" title="Remove fake root folder if not needed (that is if the UI is completely enclosed in...">prepareUserInterfaceTree</a>(<a class="code" href="classCompiler.html#a2b8004ea1fd5b86ded1a093e7c5eb70d">fUIRoot</a>));
<a name="l00069"></a>00069     <a class="code" href="classCompiler.html#a83bb12b7d930bd1b574e35202f5d3da6" title="Generate user interface macros corresponding to user interface element t.">generateMacroInterfaceTree</a>(<span class="stringliteral">&quot;&quot;</span>, <a class="code" href="classCompiler.html#a4e6876486af1cf65dc633fd3b99aba85" title="Remove fake root folder if not needed (that is if the UI is completely enclosed in...">prepareUserInterfaceTree</a>(<a class="code" href="classCompiler.html#a2b8004ea1fd5b86ded1a093e7c5eb70d">fUIRoot</a>));
<a name="l00070"></a>00070     <span class="keywordflow">if</span> (<a class="code" href="classCompiler.html#a8a23c67dd7d72d5aa6353d29de84b711">fDescription</a>) {
<a name="l00071"></a>00071         <a class="code" href="classCompiler.html#a8a23c67dd7d72d5aa6353d29de84b711">fDescription</a>-&gt;<a class="code" href="classDescription.html#a7b97643d00e0cc786355a696cac2bcba">ui</a>(<a class="code" href="classCompiler.html#a4e6876486af1cf65dc633fd3b99aba85" title="Remove fake root folder if not needed (that is if the UI is completely enclosed in...">prepareUserInterfaceTree</a>(<a class="code" href="classCompiler.html#a2b8004ea1fd5b86ded1a093e7c5eb70d">fUIRoot</a>));
<a name="l00072"></a>00072     }
<a name="l00073"></a>00073 }
</pre></div></p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
</div>
</p>

</div>
</div>
<a class="anchor" id="a00dc47a1dd180a4c2a36494a5e9d0273"></a><!-- doxytag: member="VectorCompiler::CS" ref="a00dc47a1dd180a4c2a36494a5e9d0273" args="(Tree sig)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string VectorCompiler::CS </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classCTree.html">Tree</a>&nbsp;</td>
          <td class="paramname"> <em>sig</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Compile a signal. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sig</em>&nbsp;</td><td>the signal expression to compile. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the C code translation of sig as a string </dd></dl>

<p>Reimplemented from <a class="el" href="classScalarCompiler.html#aac679ae86346a78d59a4779c9bc5d988">ScalarCompiler</a>.</p>

<p>Definition at line <a class="el" href="compile__vect_8cpp_source.html#l00081">81</a> of file <a class="el" href="compile__vect_8cpp_source.html">compile_vect.cpp</a>.</p>

<p>References <a class="el" href="loop_8cpp_source.html#l00079">Loop::addRecDependency()</a>, <a class="el" href="loop_8hh_source.html#l00059">Loop::fBackwardLoopDependencies</a>, <a class="el" href="compile_8hh_source.html#l00053">Compiler::fClass</a>, <a class="el" href="loop_8cpp_source.html#l00091">Loop::findRecDefinition()</a>, <a class="el" href="compile__vect_8cpp_source.html#l00113">generateCode()</a>, <a class="el" href="compile__scal_8cpp_source.html#l00180">ScalarCompiler::getCompiledExpression()</a>, <a class="el" href="klass_8cpp_source.html#l00080">Klass::getLoopProperty()</a>, <a class="el" href="signals_8cpp_source.html#l00151">isProj()</a>, <a class="el" href="compile__scal_8cpp_source.html#l00191">ScalarCompiler::setCompiledExpression()</a>, <a class="el" href="list_8hh_source.html#l00134">tl()</a>, and <a class="el" href="klass_8hh_source.html#l00118">Klass::topLoop()</a>.</p>

<p>Referenced by <a class="el" href="compile__vect_8cpp_source.html#l00032">compileMultiSignal()</a>, and <a class="el" href="compile__vect_8cpp_source.html#l00288">generateFixDelay()</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00082"></a>00082 {
<a name="l00083"></a>00083     <span class="keywordtype">int</span>         i;
<a name="l00084"></a>00084     <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>        x;
<a name="l00085"></a>00085     <span class="keywordtype">string</span>      code;
<a name="l00086"></a>00086 
<a name="l00087"></a>00087     <span class="keywordflow">if</span> (!<a class="code" href="classScalarCompiler.html#ab9526b36f9f5c40e5780c6015312eed4" title="Test if a signal is already compiled.">getCompiledExpression</a>(sig, code)) {
<a name="l00088"></a>00088         code = <a class="code" href="classVectorCompiler.html#af8918246b8ae134504d606b1ee65da59" title="Compile a signal.">generateCode</a>(sig);
<a name="l00089"></a>00089         <span class="comment">//cerr &lt;&lt; &quot;CS : &quot; &lt;&lt; code &lt;&lt; &quot; for &quot; &lt;&lt; ppsig(sig) &lt;&lt; endl;</span>
<a name="l00090"></a>00090         <a class="code" href="classScalarCompiler.html#a47e098af6e5857d4577371e459cd6df4" title="Set the string of a compiled expression is already compiled.">setCompiledExpression</a>(sig, code);
<a name="l00091"></a>00091     } <span class="keywordflow">else</span> {
<a name="l00092"></a>00092         <span class="comment">// check for recursive dependencies</span>
<a name="l00093"></a>00093         <a class="code" href="structLoop.html">Loop</a>*   ls;
<a name="l00094"></a>00094         <a class="code" href="structLoop.html">Loop</a>*   <a class="code" href="list_8hh.html#a4075748f5c7156306ec898795313a2e0">tl</a> = <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a7460f9d1e2ad11be5abc9acdbbbf0277">topLoop</a>();
<a name="l00095"></a>00095         <span class="keywordflow">if</span> (<a class="code" href="signals_8cpp.html#a9b54e9177bb3726e06700649c3e5c05d">isProj</a>(sig, &amp;i, x) &amp;&amp; tl-&gt;<a class="code" href="structLoop.html#a9e74faad0e7d3bb55619d3d90203219b" title="indicates a dependency with an enclosing loop">findRecDefinition</a>(x)) {
<a name="l00096"></a>00096             tl-&gt;<a class="code" href="structLoop.html#a9412652d16b9aaa7ca21541cc0aa0229" title="Check for a recursive dependecy and add it if needed.">addRecDependency</a>(x);
<a name="l00097"></a>00097         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a8e1da4c0525a993e38749160f3fc2aa5" title="Returns the loop used to compute a signal.">getLoopProperty</a>(sig,ls)) {
<a name="l00098"></a>00098             <span class="comment">//cerr &lt;&lt; &quot;in CS : fBackwardLoopDependencies.insert : &quot; &lt;&lt; tl &lt;&lt; &quot; --dependson--&gt; &quot; &lt;&lt; ls &lt;&lt; endl;</span>
<a name="l00099"></a>00099             tl-&gt;<a class="code" href="structLoop.html#a73f599daabab6c3669355713ca914e83" title="Loops that must be computed before this one.">fBackwardLoopDependencies</a>.insert(ls);
<a name="l00100"></a>00100         } <span class="keywordflow">else</span> {
<a name="l00101"></a>00101            <span class="comment">//cerr &lt;&lt; &quot;in CS :  no loop property for : &quot; &lt;&lt; ppsig(sig) &lt;&lt; endl;</span>
<a name="l00102"></a>00102 
<a name="l00103"></a>00103         }
<a name="l00104"></a>00104     }
<a name="l00105"></a>00105     <span class="keywordflow">return</span> code;
<a name="l00106"></a>00106 }
</pre></div></p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dynsection">
</div>
</p>

</div>
</div>
<a class="anchor" id="a446965617480f2c52ad9cc6e474395bb"></a><!-- doxytag: member="VectorCompiler::generateCacheCode" ref="a446965617480f2c52ad9cc6e474395bb" args="(Tree sig, const string &amp;exp)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string VectorCompiler::generateCacheCode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classCTree.html">Tree</a>&nbsp;</td>
          <td class="paramname"> <em>sig</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const string &amp;&nbsp;</td>
          <td class="paramname"> <em>exp</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Generate cache code for a signal if needed. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sig</em>&nbsp;</td><td>the signal expression. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>exp</em>&nbsp;</td><td>the corresponding C code. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the cached C code </dd></dl>

<p>Reimplemented from <a class="el" href="classScalarCompiler.html#a96c58f44c4a1d1ac3bd648b542bd0afa">ScalarCompiler</a>.</p>

<p>Definition at line <a class="el" href="compile__vect_8cpp_source.html#l00155">155</a> of file <a class="el" href="compile__vect_8cpp_source.html">compile_vect.cpp</a>.</p>

<p>References <a class="el" href="compile__scal_8hh_source.html#l00047">ScalarCompiler::fOccMarkup</a>, <a class="el" href="compile__vect_8cpp_source.html#l00258">generateDelayLine()</a>, <a class="el" href="occurences_8cpp_source.html#l00054">Occurences::getMaxDelay()</a>, <a class="el" href="sharing_8cpp_source.html#l00062">ScalarCompiler::getSharingCount()</a>, <a class="el" href="sigtyperules_8cpp_source.html#l00082">getSigType()</a>, <a class="el" href="compile__scal_8cpp_source.html#l00401">ScalarCompiler::getTypedNames()</a>, <a class="el" href="sigtype_8hh_source.html#l00055">kSamp</a>, <a class="el" href="occurences_8cpp_source.html#l00081">OccMarkup::retrieve()</a>, <a class="el" href="compile__scal_8cpp_source.html#l01041">ScalarCompiler::setVectorNameProperty()</a>, <a class="el" href="Text_8cpp_source.html#l00060">subst()</a>, and <a class="el" href="signals_8cpp_source.html#l00412">verySimple()</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00156"></a>00156 {
<a name="l00157"></a>00157     <span class="keywordtype">string</span>      vname, ctype;
<a name="l00158"></a>00158     <span class="keywordtype">int</span>         sharing = <a class="code" href="classScalarCompiler.html#a7bf169572df60b9383297d85f36e2506">getSharingCount</a>(sig);
<a name="l00159"></a>00159     <a class="code" href="classP.html">Type</a>        t = <a class="code" href="sigtyperules_8cpp.html#a1f41188e4150f54b2fb2caf28a948785" title="retrieve the type annotation of sig">getSigType</a>(sig);
<a name="l00160"></a>00160     <a class="code" href="classOccurences.html">Occurences</a>* o = <a class="code" href="classScalarCompiler.html#a01d66ece3660a3151f270d7e7a79cb77">fOccMarkup</a>.<a class="code" href="classOccMarkup.html#ade9cb60264fd5e727cfb69568cb49efa" title="occurences of subtree t within root tree">retrieve</a>(sig);
<a name="l00161"></a>00161     <span class="keywordtype">int</span>         d = o-&gt;<a class="code" href="classOccurences.html#ae7a8f070a5ad9597882c9e813b801cd7" title="return the maximal delay collected">getMaxDelay</a>();
<a name="l00162"></a>00162 
<a name="l00163"></a>00163     <span class="keywordflow">if</span> (t-&gt;variability() &lt; <a class="code" href="sigtype_8hh.html#a726ca809ffd3d67ab4b8476646f26635a415bf3edc164c8f259f328ff6dc0529a">kSamp</a>) {
<a name="l00164"></a>00164         <span class="keywordflow">if</span> (d==0) {
<a name="l00165"></a>00165             <span class="comment">// non-sample, not delayed : same as scalar cache</span>
<a name="l00166"></a>00166             <span class="keywordflow">return</span> <a class="code" href="classVectorCompiler.html#a446965617480f2c52ad9cc6e474395bb" title="Generate cache code for a signal if needed.">ScalarCompiler::generateCacheCode</a>(sig,exp);
<a name="l00167"></a>00167 
<a name="l00168"></a>00168         } <span class="keywordflow">else</span> {
<a name="l00169"></a>00169             <span class="comment">// it is a non-sample but used delayed</span>
<a name="l00170"></a>00170             <span class="comment">// we need a delay line</span>
<a name="l00171"></a>00171             <a class="code" href="classScalarCompiler.html#ac33a3eb7d6bb601ab957871bd860b632">getTypedNames</a>(<a class="code" href="sigtyperules_8cpp.html#a1f41188e4150f54b2fb2caf28a948785" title="retrieve the type annotation of sig">getSigType</a>(sig), <span class="stringliteral">&quot;Xec&quot;</span>, ctype, vname);
<a name="l00172"></a>00172             <a class="code" href="classVectorCompiler.html#a4a78b541b4c01df34c128aff55489675" title="Generate code for the delay mecchanism without using temporary variables.">generateDelayLine</a>(ctype, vname, d, exp);
<a name="l00173"></a>00173             <a class="code" href="classScalarCompiler.html#a81c64ccef445fdf557fc7b3ce6a786a7" title="Set the vector name property of a signal, the name of the vector used to store the...">setVectorNameProperty</a>(sig, vname);
<a name="l00174"></a>00174             <span class="keywordflow">if</span> (<a class="code" href="signals_8cpp.html#a3dfe37829af796260959bedfc9ca5c08" title="Test if exp is very simple that is it can&amp;#39;t be considered a real component.">verySimple</a>(sig)) {
<a name="l00175"></a>00175                 <span class="keywordflow">return</span> exp;
<a name="l00176"></a>00176             } <span class="keywordflow">else</span> {
<a name="l00177"></a>00177                 <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0[i]&quot;</span>, vname);
<a name="l00178"></a>00178             }
<a name="l00179"></a>00179         }
<a name="l00180"></a>00180     } <span class="keywordflow">else</span> {
<a name="l00181"></a>00181         <span class="comment">// sample-rate signal</span>
<a name="l00182"></a>00182         <span class="keywordflow">if</span> (d &gt; 0) {
<a name="l00183"></a>00183             <span class="comment">// used delayed : we need a delay line</span>
<a name="l00184"></a>00184             <a class="code" href="classScalarCompiler.html#ac33a3eb7d6bb601ab957871bd860b632">getTypedNames</a>(<a class="code" href="sigtyperules_8cpp.html#a1f41188e4150f54b2fb2caf28a948785" title="retrieve the type annotation of sig">getSigType</a>(sig), <span class="stringliteral">&quot;Yec&quot;</span>, ctype, vname);
<a name="l00185"></a>00185             <a class="code" href="classVectorCompiler.html#a4a78b541b4c01df34c128aff55489675" title="Generate code for the delay mecchanism without using temporary variables.">generateDelayLine</a>(ctype, vname, d, exp);
<a name="l00186"></a>00186             <a class="code" href="classScalarCompiler.html#a81c64ccef445fdf557fc7b3ce6a786a7" title="Set the vector name property of a signal, the name of the vector used to store the...">setVectorNameProperty</a>(sig, vname);
<a name="l00187"></a>00187 
<a name="l00188"></a>00188             <span class="keywordflow">if</span> (<a class="code" href="signals_8cpp.html#a3dfe37829af796260959bedfc9ca5c08" title="Test if exp is very simple that is it can&amp;#39;t be considered a real component.">verySimple</a>(sig)) {
<a name="l00189"></a>00189                 <span class="keywordflow">return</span> exp;
<a name="l00190"></a>00190             } <span class="keywordflow">else</span> {
<a name="l00191"></a>00191                 <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0[i]&quot;</span>, vname);
<a name="l00192"></a>00192             }
<a name="l00193"></a>00193         } <span class="keywordflow">else</span> {
<a name="l00194"></a>00194             <span class="comment">// not delayed</span>
<a name="l00195"></a>00195             <span class="keywordflow">if</span> ( sharing &gt; 1 &amp;&amp; ! <a class="code" href="signals_8cpp.html#a3dfe37829af796260959bedfc9ca5c08" title="Test if exp is very simple that is it can&amp;#39;t be considered a real component.">verySimple</a>(sig) ) {
<a name="l00196"></a>00196                 <span class="comment">// shared and not simple : we need a vector</span>
<a name="l00197"></a>00197                <span class="comment">// cerr &lt;&lt; &quot;ZEC : &quot; &lt;&lt; ppsig(sig) &lt;&lt; endl;</span>
<a name="l00198"></a>00198                 <a class="code" href="classScalarCompiler.html#ac33a3eb7d6bb601ab957871bd860b632">getTypedNames</a>(<a class="code" href="sigtyperules_8cpp.html#a1f41188e4150f54b2fb2caf28a948785" title="retrieve the type annotation of sig">getSigType</a>(sig), <span class="stringliteral">&quot;Zec&quot;</span>, ctype, vname);
<a name="l00199"></a>00199                 <a class="code" href="classVectorCompiler.html#a4a78b541b4c01df34c128aff55489675" title="Generate code for the delay mecchanism without using temporary variables.">generateDelayLine</a>(ctype, vname, d, exp);
<a name="l00200"></a>00200                 <a class="code" href="classScalarCompiler.html#a81c64ccef445fdf557fc7b3ce6a786a7" title="Set the vector name property of a signal, the name of the vector used to store the...">setVectorNameProperty</a>(sig, vname);
<a name="l00201"></a>00201                 <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0[i]&quot;</span>, vname);
<a name="l00202"></a>00202            } <span class="keywordflow">else</span> {
<a name="l00203"></a>00203                 <span class="comment">// not shared or simple : no cache needed</span>
<a name="l00204"></a>00204                 <span class="keywordflow">return</span> exp;
<a name="l00205"></a>00205             }
<a name="l00206"></a>00206         }
<a name="l00207"></a>00207     }
<a name="l00208"></a>00208 }
</pre></div></p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
</div>
</p>

</div>
</div>
<a class="anchor" id="af8918246b8ae134504d606b1ee65da59"></a><!-- doxytag: member="VectorCompiler::generateCode" ref="af8918246b8ae134504d606b1ee65da59" args="(Tree sig)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string VectorCompiler::generateCode </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classCTree.html">Tree</a>&nbsp;</td>
          <td class="paramname"> <em>sig</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Compile a signal. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sig</em>&nbsp;</td><td>the signal expression to compile. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the C code translation of sig as a string </dd></dl>

<p>Reimplemented from <a class="el" href="classScalarCompiler.html#a312d1e036e59631cfc976ad1346d93c9">ScalarCompiler</a>.</p>

<p>Definition at line <a class="el" href="compile__vect_8cpp_source.html#l00113">113</a> of file <a class="el" href="compile__vect_8cpp_source.html">compile_vect.cpp</a>.</p>

<p>References <a class="el" href="loop_8cpp_source.html#l00079">Loop::addRecDependency()</a>, <a class="el" href="klass_8cpp_source.html#l00109">Klass::closeLoop()</a>, <a class="el" href="compile_8hh_source.html#l00053">Compiler::fClass</a>, <a class="el" href="loop_8cpp_source.html#l00091">Loop::findRecDefinition()</a>, <a class="el" href="signals_8cpp_source.html#l00151">isProj()</a>, <a class="el" href="compile__vect_8cpp_source.html#l00218">needSeparateLoop()</a>, <a class="el" href="klass_8cpp_source.html#l00089">Klass::openLoop()</a>, and <a class="el" href="klass_8hh_source.html#l00118">Klass::topLoop()</a>.</p>

<p>Referenced by <a class="el" href="compile__vect_8cpp_source.html#l00081">CS()</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00114"></a>00114 {
<a name="l00115"></a>00115     <span class="keywordtype">int</span>     i;
<a name="l00116"></a>00116     <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>    x;
<a name="l00117"></a>00117     <a class="code" href="structLoop.html">Loop</a>*   l;
<a name="l00118"></a>00118 
<a name="l00119"></a>00119     l = <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a7460f9d1e2ad11be5abc9acdbbbf0277">topLoop</a>();
<a name="l00120"></a>00120     assert(l);
<a name="l00121"></a>00121 
<a name="l00122"></a>00122     <span class="keywordflow">if</span> (<a class="code" href="classVectorCompiler.html#a41f6414f75499ea54aafb110c3b203b4" title="Test if a signal need to be compiled in a separate loop.">needSeparateLoop</a>(sig)) {
<a name="l00123"></a>00123         <span class="comment">// we need a separate loop unless it&#39;s an old recursion</span>
<a name="l00124"></a>00124         <span class="keywordflow">if</span> (<a class="code" href="signals_8cpp.html#a9b54e9177bb3726e06700649c3e5c05d">isProj</a>(sig, &amp;i, x)) {
<a name="l00125"></a>00125             <span class="comment">// projection of a recursive group x</span>
<a name="l00126"></a>00126             <span class="keywordflow">if</span> (l-&gt;<a class="code" href="structLoop.html#a9e74faad0e7d3bb55619d3d90203219b" title="indicates a dependency with an enclosing loop">findRecDefinition</a>(x)) {
<a name="l00127"></a>00127                 <span class="comment">// x is already in the loop stack</span>
<a name="l00128"></a>00128                 l-&gt;<a class="code" href="structLoop.html#a9412652d16b9aaa7ca21541cc0aa0229" title="Check for a recursive dependecy and add it if needed.">addRecDependency</a>(x);
<a name="l00129"></a>00129                 <span class="keywordflow">return</span> <a class="code" href="classVectorCompiler.html#af8918246b8ae134504d606b1ee65da59" title="Compile a signal.">ScalarCompiler::generateCode</a>(sig);
<a name="l00130"></a>00130             } <span class="keywordflow">else</span> {
<a name="l00131"></a>00131                 <span class="comment">// x must be defined</span>
<a name="l00132"></a>00132                 <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a393c343f0a6fe7d0cf16d6e91f243398" title="Open a non-recursive loop on top of the stack of open loops.">openLoop</a>(x, <span class="stringliteral">&quot;count&quot;</span>);
<a name="l00133"></a>00133                 <span class="keywordtype">string</span> c = <a class="code" href="classVectorCompiler.html#af8918246b8ae134504d606b1ee65da59" title="Compile a signal.">ScalarCompiler::generateCode</a>(sig);
<a name="l00134"></a>00134                 <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a4d19081c50e9ce7300f9b220df6fce76" title="Close the top loop and either keep it or absorb it within its enclosing loop.">closeLoop</a>(sig);
<a name="l00135"></a>00135                 <span class="keywordflow">return</span> c;
<a name="l00136"></a>00136             }
<a name="l00137"></a>00137         } <span class="keywordflow">else</span> {
<a name="l00138"></a>00138             <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a393c343f0a6fe7d0cf16d6e91f243398" title="Open a non-recursive loop on top of the stack of open loops.">openLoop</a>(<span class="stringliteral">&quot;count&quot;</span>);
<a name="l00139"></a>00139             <span class="keywordtype">string</span> c = <a class="code" href="classVectorCompiler.html#af8918246b8ae134504d606b1ee65da59" title="Compile a signal.">ScalarCompiler::generateCode</a>(sig);
<a name="l00140"></a>00140             <a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>-&gt;<a class="code" href="classKlass.html#a4d19081c50e9ce7300f9b220df6fce76" title="Close the top loop and either keep it or absorb it within its enclosing loop.">closeLoop</a>(sig);
<a name="l00141"></a>00141             <span class="keywordflow">return</span> c;
<a name="l00142"></a>00142         }
<a name="l00143"></a>00143     } <span class="keywordflow">else</span> {
<a name="l00144"></a>00144         <span class="keywordflow">return</span> <a class="code" href="classVectorCompiler.html#af8918246b8ae134504d606b1ee65da59" title="Compile a signal.">ScalarCompiler::generateCode</a>(sig);
<a name="l00145"></a>00145     }
<a name="l00146"></a>00146 }
</pre></div></p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dynsection">
</div>
</p>

</div>
</div>
<a class="anchor" id="a4a78b541b4c01df34c128aff55489675"></a><!-- doxytag: member="VectorCompiler::generateDelayLine" ref="a4a78b541b4c01df34c128aff55489675" args="(const string &amp;ctype, const string &amp;vname, int mxd, const string &amp;exp)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void VectorCompiler::generateDelayLine </td>
          <td>(</td>
          <td class="paramtype">const string &amp;&nbsp;</td>
          <td class="paramname"> <em>ctype</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const string &amp;&nbsp;</td>
          <td class="paramname"> <em>vname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>mxd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const string &amp;&nbsp;</td>
          <td class="paramname"> <em>exp</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Generate code for the delay mecchanism without using temporary variables. </p>

<p>Reimplemented from <a class="el" href="classScalarCompiler.html#a0fee342e1ab991f0f75169290afe36cd">ScalarCompiler</a>.</p>

<p>Definition at line <a class="el" href="compile__vect_8cpp_source.html#l00258">258</a> of file <a class="el" href="compile__vect_8cpp_source.html">compile_vect.cpp</a>.</p>

<p>References <a class="el" href="delayline_8cpp_source.html#l00051">dlineLoop()</a>, <a class="el" href="compile_8hh_source.html#l00053">Compiler::fClass</a>, and <a class="el" href="delayline_8cpp_source.html#l00025">vectorLoop()</a>.</p>

<p>Referenced by <a class="el" href="compile__vect_8cpp_source.html#l00155">generateCacheCode()</a>, and <a class="el" href="compile__vect_8cpp_source.html#l00342">generateDelayVec()</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00259"></a>00259 {
<a name="l00260"></a>00260     <span class="keywordflow">if</span> (mxd == 0) {
<a name="l00261"></a>00261         <a class="code" href="delayline_8cpp.html#a4105777e2d8b59892f42b9a157002e9e" title="Generate the code for a (short) delay line.">vectorLoop</a>(<a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>, ctype, vname, exp);
<a name="l00262"></a>00262     } <span class="keywordflow">else</span> {
<a name="l00263"></a>00263         <a class="code" href="delayline_8cpp.html#aeeff01069783bf9c6ec3f18fda583a42" title="Generate the code for a (short) delay line.">dlineLoop</a>(<a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>, ctype, vname, mxd, exp);
<a name="l00264"></a>00264     }
<a name="l00265"></a>00265 }
</pre></div></p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dynsection">
</div>
</p>

</div>
</div>
<a class="anchor" id="a905e49bf887c9689e72ab0bb73afbb80"></a><!-- doxytag: member="VectorCompiler::generateDelayVec" ref="a905e49bf887c9689e72ab0bb73afbb80" args="(Tree sig, const string &amp;exp, const string &amp;ctype, const string &amp;vname, int mxd)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string VectorCompiler::generateDelayVec </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classCTree.html">Tree</a>&nbsp;</td>
          <td class="paramname"> <em>sig</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const string &amp;&nbsp;</td>
          <td class="paramname"> <em>exp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const string &amp;&nbsp;</td>
          <td class="paramname"> <em>ctype</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const string &amp;&nbsp;</td>
          <td class="paramname"> <em>vname</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>mxd</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Generate code for the delay mecchanism. </p>
<p>The generated code depend of the maximum delay attached to exp and the "less temporaries" switch </p>

<p>Reimplemented from <a class="el" href="classScalarCompiler.html#adec9012e0c7e1c27b0144e53fcdc4734">ScalarCompiler</a>.</p>

<p>Definition at line <a class="el" href="compile__vect_8cpp_source.html#l00342">342</a> of file <a class="el" href="compile__vect_8cpp_source.html">compile_vect.cpp</a>.</p>

<p>References <a class="el" href="compile__vect_8cpp_source.html#l00258">generateDelayLine()</a>, <a class="el" href="compile__scal_8cpp_source.html#l01041">ScalarCompiler::setVectorNameProperty()</a>, <a class="el" href="Text_8cpp_source.html#l00060">subst()</a>, and <a class="el" href="signals_8cpp_source.html#l00412">verySimple()</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00343"></a>00343 {
<a name="l00344"></a>00344     <span class="comment">// it is a non-sample but used delayed</span>
<a name="l00345"></a>00345     <span class="comment">// we need a delay line</span>
<a name="l00346"></a>00346     <a class="code" href="classVectorCompiler.html#a4a78b541b4c01df34c128aff55489675" title="Generate code for the delay mecchanism without using temporary variables.">generateDelayLine</a>(ctype, vname, mxd, exp);
<a name="l00347"></a>00347     <a class="code" href="classScalarCompiler.html#a81c64ccef445fdf557fc7b3ce6a786a7" title="Set the vector name property of a signal, the name of the vector used to store the...">setVectorNameProperty</a>(sig, vname);
<a name="l00348"></a>00348     <span class="keywordflow">if</span> (<a class="code" href="signals_8cpp.html#a3dfe37829af796260959bedfc9ca5c08" title="Test if exp is very simple that is it can&amp;#39;t be considered a real component.">verySimple</a>(sig)) {
<a name="l00349"></a>00349         <span class="keywordflow">return</span> exp;
<a name="l00350"></a>00350     } <span class="keywordflow">else</span> {
<a name="l00351"></a>00351         <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0[i]&quot;</span>, vname);
<a name="l00352"></a>00352     }
<a name="l00353"></a>00353 }
</pre></div></p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
</div>
</p>

</div>
</div>
<a class="anchor" id="a38318c939418370575a9b49707109655"></a><!-- doxytag: member="VectorCompiler::generateFixDelay" ref="a38318c939418370575a9b49707109655" args="(Tree sig, Tree exp, Tree delay)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string VectorCompiler::generateFixDelay </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classCTree.html">Tree</a>&nbsp;</td>
          <td class="paramname"> <em>sig</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classCTree.html">Tree</a>&nbsp;</td>
          <td class="paramname"> <em>exp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classCTree.html">Tree</a>&nbsp;</td>
          <td class="paramname"> <em>delay</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Generate code for accessing a delayed signal. </p>
<p>The generated code depend of the maximum delay attached to exp and the gLessTempSwitch. </p>

<p>Reimplemented from <a class="el" href="classScalarCompiler.html#a114a804894cbeb775c205de2410fb5a9">ScalarCompiler</a>.</p>

<p>Definition at line <a class="el" href="compile__vect_8cpp_source.html#l00288">288</a> of file <a class="el" href="compile__vect_8cpp_source.html">compile_vect.cpp</a>.</p>

<p>References <a class="el" href="compile__vect_8cpp_source.html#l00081">CS()</a>, <a class="el" href="compile__scal_8hh_source.html#l00047">ScalarCompiler::fOccMarkup</a>, <a class="el" href="occurences_8cpp_source.html#l00054">Occurences::getMaxDelay()</a>, <a class="el" href="compile__scal_8cpp_source.html#l01055">ScalarCompiler::getVectorNameProperty()</a>, <a class="el" href="main_8cpp_source.html#l00124">gMaxCopyDelay</a>, <a class="el" href="main_8cpp_source.html#l00133">gVecSize</a>, <a class="el" href="signals_8cpp_source.html#l00041">isSigInt()</a>, <a class="el" href="compile__scal_8cpp_source.html#l01065">ScalarCompiler::pow2limit()</a>, <a class="el" href="occurences_8cpp_source.html#l00081">OccMarkup::retrieve()</a>, <a class="el" href="Text_8cpp_source.html#l00060">subst()</a>, and <a class="el" href="Text_8cpp_source.html#l00163">T()</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00289"></a>00289 {
<a name="l00290"></a>00290     <span class="keywordtype">int</span>     mxd, d; 
<a name="l00291"></a>00291     <span class="keywordtype">string</span>  vecname;
<a name="l00292"></a>00292  
<a name="l00293"></a>00293     <span class="comment">//cerr &lt;&lt; &quot;VectorCompiler::generateFixDelay &quot; &lt;&lt; ppsig(sig) &lt;&lt; endl;</span>
<a name="l00294"></a>00294 
<a name="l00295"></a>00295     <a class="code" href="classVectorCompiler.html#a00dc47a1dd180a4c2a36494a5e9d0273" title="Compile a signal.">CS</a>(exp); <span class="comment">// ensure exp is compiled to have a vector name</span>
<a name="l00296"></a>00296 
<a name="l00297"></a>00297     mxd = <a class="code" href="classScalarCompiler.html#a01d66ece3660a3151f270d7e7a79cb77">fOccMarkup</a>.<a class="code" href="classOccMarkup.html#ade9cb60264fd5e727cfb69568cb49efa" title="occurences of subtree t within root tree">retrieve</a>(exp)-&gt;<a class="code" href="classOccurences.html#ae7a8f070a5ad9597882c9e813b801cd7" title="return the maximal delay collected">getMaxDelay</a>();
<a name="l00298"></a>00298 
<a name="l00299"></a>00299     <span class="keywordflow">if</span> (! <a class="code" href="classScalarCompiler.html#a12cd9487cf729b06cbece49552bc632e" title="Get the vector name property of a signal, the name of the vector used to store the...">getVectorNameProperty</a>(exp, vecname)) {
<a name="l00300"></a>00300         cerr &lt;&lt; <span class="stringliteral">&quot;no vector name for &quot;</span> &lt;&lt; <a class="code" href="classppsig.html">ppsig</a>(exp) &lt;&lt; endl;
<a name="l00301"></a>00301         exit(1);
<a name="l00302"></a>00302     }
<a name="l00303"></a>00303 
<a name="l00304"></a>00304     <span class="keywordflow">if</span> (mxd == 0) {
<a name="l00305"></a>00305         <span class="comment">// not a real vector name but a scalar name</span>
<a name="l00306"></a>00306         <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0[i]&quot;</span>, vecname);
<a name="l00307"></a>00307 
<a name="l00308"></a>00308     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (mxd &lt; <a class="code" href="doc__compile_8cpp.html#a278e0cda879c0108aff047853ab0214c">gMaxCopyDelay</a>){
<a name="l00309"></a>00309         <span class="keywordflow">if</span> (<a class="code" href="signals_8cpp.html#a75cc925deac1e031e75ae72271dd5995">isSigInt</a>(delay, &amp;d)) {
<a name="l00310"></a>00310             <span class="keywordflow">if</span> (d == 0) {
<a name="l00311"></a>00311                 <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0[i]&quot;</span>, vecname);
<a name="l00312"></a>00312             } <span class="keywordflow">else</span> {
<a name="l00313"></a>00313                 <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0[i-$1]&quot;</span>, vecname, <a class="code" href="Text_8cpp.html#a16bacb907294be37af81cdf9aff4449a">T</a>(d));
<a name="l00314"></a>00314             }
<a name="l00315"></a>00315         } <span class="keywordflow">else</span> {
<a name="l00316"></a>00316             <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0[i-$1]&quot;</span>, vecname, <a class="code" href="classVectorCompiler.html#a00dc47a1dd180a4c2a36494a5e9d0273" title="Compile a signal.">CS</a>(delay));
<a name="l00317"></a>00317         }
<a name="l00318"></a>00318 
<a name="l00319"></a>00319     } <span class="keywordflow">else</span> {
<a name="l00320"></a>00320 
<a name="l00321"></a>00321         <span class="comment">// long delay : we use a ring buffer of size 2^x</span>
<a name="l00322"></a>00322         <span class="keywordtype">int</span>     N   = <a class="code" href="classScalarCompiler.html#ad2a7768ff9ad2157f15a11686fe70366" title="Compute the minimal power of 2 greater than x.">pow2limit</a>( mxd+<a class="code" href="compile__vect_8cpp.html#a6913f43c820ecbf6076c31d40598b7ee">gVecSize</a> );
<a name="l00323"></a>00323 
<a name="l00324"></a>00324         <span class="keywordflow">if</span> (<a class="code" href="signals_8cpp.html#a75cc925deac1e031e75ae72271dd5995">isSigInt</a>(delay, &amp;d)) {
<a name="l00325"></a>00325             <span class="keywordflow">if</span> (d == 0) {
<a name="l00326"></a>00326                 <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0[($0_idx+i)&amp;$1]&quot;</span>, vecname, <a class="code" href="Text_8cpp.html#a16bacb907294be37af81cdf9aff4449a">T</a>(N-1));
<a name="l00327"></a>00327             } <span class="keywordflow">else</span> {
<a name="l00328"></a>00328                 <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0[($0_idx+i-$2)&amp;$1]&quot;</span>, vecname, <a class="code" href="Text_8cpp.html#a16bacb907294be37af81cdf9aff4449a">T</a>(N-1), <a class="code" href="Text_8cpp.html#a16bacb907294be37af81cdf9aff4449a">T</a>(d));
<a name="l00329"></a>00329             }
<a name="l00330"></a>00330         } <span class="keywordflow">else</span> {
<a name="l00331"></a>00331             <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0[($0_idx+i-$2)&amp;$1]&quot;</span>, vecname, <a class="code" href="Text_8cpp.html#a16bacb907294be37af81cdf9aff4449a">T</a>(N-1), <a class="code" href="classVectorCompiler.html#a00dc47a1dd180a4c2a36494a5e9d0273" title="Compile a signal.">CS</a>(delay));
<a name="l00332"></a>00332         }
<a name="l00333"></a>00333     }
<a name="l00334"></a>00334 }
</pre></div></p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
</div>
</p>

</div>
</div>
<a class="anchor" id="a37bb71786922656262d3452a85e12c9d"></a><!-- doxytag: member="VectorCompiler::generateVariableStore" ref="a37bb71786922656262d3452a85e12c9d" args="(Tree sig, const string &amp;exp)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">string VectorCompiler::generateVariableStore </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classCTree.html">Tree</a>&nbsp;</td>
          <td class="paramname"> <em>sig</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const string &amp;&nbsp;</td>
          <td class="paramname"> <em>exp</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td><code> [protected, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reimplemented from <a class="el" href="classScalarCompiler.html#a6774794b9cc217001586c0eb7b4ebb80">ScalarCompiler</a>.</p>

<p>Definition at line <a class="el" href="compile__vect_8cpp_source.html#l00268">268</a> of file <a class="el" href="compile__vect_8cpp_source.html">compile_vect.cpp</a>.</p>

<p>References <a class="el" href="compile_8hh_source.html#l00053">Compiler::fClass</a>, <a class="el" href="sigtyperules_8cpp_source.html#l00082">getSigType()</a>, <a class="el" href="compile__scal_8cpp_source.html#l00401">ScalarCompiler::getTypedNames()</a>, <a class="el" href="sigtype_8hh_source.html#l00055">kSamp</a>, <a class="el" href="Text_8cpp_source.html#l00060">subst()</a>, and <a class="el" href="delayline_8cpp_source.html#l00025">vectorLoop()</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00269"></a>00269 {
<a name="l00270"></a>00270     <a class="code" href="classP.html">Type</a>        t = <a class="code" href="sigtyperules_8cpp.html#a1f41188e4150f54b2fb2caf28a948785" title="retrieve the type annotation of sig">getSigType</a>(sig);
<a name="l00271"></a>00271 
<a name="l00272"></a>00272     <span class="keywordflow">if</span> (<a class="code" href="sigtyperules_8cpp.html#a1f41188e4150f54b2fb2caf28a948785" title="retrieve the type annotation of sig">getSigType</a>(sig)-&gt;variability() == <a class="code" href="sigtype_8hh.html#a726ca809ffd3d67ab4b8476646f26635a415bf3edc164c8f259f328ff6dc0529a">kSamp</a>) {
<a name="l00273"></a>00273         <span class="keywordtype">string</span>      vname, ctype;
<a name="l00274"></a>00274         <a class="code" href="classScalarCompiler.html#ac33a3eb7d6bb601ab957871bd860b632">getTypedNames</a>(t, <span class="stringliteral">&quot;Vector&quot;</span>, ctype, vname);
<a name="l00275"></a>00275         <a class="code" href="delayline_8cpp.html#a4105777e2d8b59892f42b9a157002e9e" title="Generate the code for a (short) delay line.">vectorLoop</a>(<a class="code" href="classCompiler.html#abd99a780b9c082000158f15f20439a20">fClass</a>, ctype, vname, exp);
<a name="l00276"></a>00276         <span class="keywordflow">return</span> <a class="code" href="Text_8cpp.html#af50e951c134c2c98c4c75d687f8fca7a">subst</a>(<span class="stringliteral">&quot;$0[i]&quot;</span>, vname);
<a name="l00277"></a>00277     } <span class="keywordflow">else</span> {
<a name="l00278"></a>00278         <span class="keywordflow">return</span> <a class="code" href="classVectorCompiler.html#a37bb71786922656262d3452a85e12c9d">ScalarCompiler::generateVariableStore</a>(sig, exp);
<a name="l00279"></a>00279     }
<a name="l00280"></a>00280 }
</pre></div></p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
</div>
</p>

</div>
</div>
<a class="anchor" id="a41f6414f75499ea54aafb110c3b203b4"></a><!-- doxytag: member="VectorCompiler::needSeparateLoop" ref="a41f6414f75499ea54aafb110c3b203b4" args="(Tree sig)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool VectorCompiler::needSeparateLoop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classCTree.html">Tree</a>&nbsp;</td>
          <td class="paramname"> <em>sig</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Test if a signal need to be compiled in a separate loop. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>sig</em>&nbsp;</td><td>the signal expression to test. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if a separate loop is needed </dd></dl>

<p>Definition at line <a class="el" href="compile__vect_8cpp_source.html#l00218">218</a> of file <a class="el" href="compile__vect_8cpp_source.html">compile_vect.cpp</a>.</p>

<p>References <a class="el" href="compile__scal_8hh_source.html#l00047">ScalarCompiler::fOccMarkup</a>, <a class="el" href="occurences_8cpp_source.html#l00054">Occurences::getMaxDelay()</a>, <a class="el" href="sharing_8cpp_source.html#l00062">ScalarCompiler::getSharingCount()</a>, <a class="el" href="sigtyperules_8cpp_source.html#l00082">getSigType()</a>, <a class="el" href="signals_8cpp_source.html#l00151">isProj()</a>, <a class="el" href="signals_8cpp_source.html#l00062">isSigFixDelay()</a>, <a class="el" href="sigtype_8hh_source.html#l00055">kSamp</a>, <a class="el" href="occurences_8cpp_source.html#l00081">OccMarkup::retrieve()</a>, and <a class="el" href="signals_8cpp_source.html#l00412">verySimple()</a>.</p>

<p>Referenced by <a class="el" href="compile__vect_8cpp_source.html#l00113">generateCode()</a>.</p>

<p><div class="fragment"><pre class="fragment"><a name="l00219"></a>00219 {
<a name="l00220"></a>00220     <a class="code" href="classOccurences.html">Occurences</a>* o = <a class="code" href="classScalarCompiler.html#a01d66ece3660a3151f270d7e7a79cb77">fOccMarkup</a>.<a class="code" href="classOccMarkup.html#ade9cb60264fd5e727cfb69568cb49efa" title="occurences of subtree t within root tree">retrieve</a>(sig);
<a name="l00221"></a>00221     <a class="code" href="classP.html">Type</a>        t = <a class="code" href="sigtyperules_8cpp.html#a1f41188e4150f54b2fb2caf28a948785" title="retrieve the type annotation of sig">getSigType</a>(sig);
<a name="l00222"></a>00222     <span class="keywordtype">int</span>         c = <a class="code" href="classScalarCompiler.html#a7bf169572df60b9383297d85f36e2506">getSharingCount</a>(sig);
<a name="l00223"></a>00223     <span class="keywordtype">bool</span>        b;
<a name="l00224"></a>00224 
<a name="l00225"></a>00225     <span class="keywordtype">int</span>         i;
<a name="l00226"></a>00226     <a class="code" href="classCTree.html" title="A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches...">Tree</a>        x,y;
<a name="l00227"></a>00227 
<a name="l00228"></a>00228 
<a name="l00229"></a>00229     <span class="keywordflow">if</span> (o-&gt;<a class="code" href="classOccurences.html#ae7a8f070a5ad9597882c9e813b801cd7" title="return the maximal delay collected">getMaxDelay</a>()&gt;0) {
<a name="l00230"></a>00230         <span class="comment">//cerr &lt;&lt; &quot;DLY &quot;; // delayed expressions require a separate loop</span>
<a name="l00231"></a>00231         b = <span class="keyword">true</span>;
<a name="l00232"></a>00232     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="signals_8cpp.html#a3dfe37829af796260959bedfc9ca5c08" title="Test if exp is very simple that is it can&amp;#39;t be considered a real component.">verySimple</a>(sig) || t-&gt;variability()&lt;<a class="code" href="sigtype_8hh.html#a726ca809ffd3d67ab4b8476646f26635a415bf3edc164c8f259f328ff6dc0529a">kSamp</a>) {
<a name="l00233"></a>00233         b = <span class="keyword">false</span>;      <span class="comment">// non sample computation never require a loop</span>
<a name="l00234"></a>00234     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="signals_8cpp.html#af55cdefee258834b3b8f6c070d4970c9">isSigFixDelay</a>(sig, x, y)) {
<a name="l00235"></a>00235         b = <span class="keyword">false</span>;      <span class="comment">// </span>
<a name="l00236"></a>00236     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="signals_8cpp.html#a9b54e9177bb3726e06700649c3e5c05d">isProj</a>(sig, &amp;i ,x)) {
<a name="l00237"></a>00237         <span class="comment">//cerr &lt;&lt; &quot;REC &quot;; // recursive expressions require a separate loop</span>
<a name="l00238"></a>00238         b = <span class="keyword">true</span>;
<a name="l00239"></a>00239     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (c &gt; 1) {
<a name="l00240"></a>00240         <span class="comment">//cerr &lt;&lt; &quot;SHA(&quot; &lt;&lt; c &lt;&lt; &quot;) &quot;; // expressions used several times required a separate loop</span>
<a name="l00241"></a>00241         b = <span class="keyword">true</span>;
<a name="l00242"></a>00242     } <span class="keywordflow">else</span> {
<a name="l00243"></a>00243         <span class="comment">// sample expressions that are not recursive, not delayed</span>
<a name="l00244"></a>00244         <span class="comment">// and not shared, doesn&#39;t require a separate loop.</span>
<a name="l00245"></a>00245         b = <span class="keyword">false</span>;
<a name="l00246"></a>00246     }
<a name="l00247"></a>00247 <span class="comment">/*    if (b) {</span>
<a name="l00248"></a>00248 <span class="comment">        cerr &lt;&lt; &quot;Separate Loop for &quot; &lt;&lt; ppsig(sig) &lt;&lt; endl;</span>
<a name="l00249"></a>00249 <span class="comment">    } else {</span>
<a name="l00250"></a>00250 <span class="comment">        cerr &lt;&lt; &quot;Same Loop for &quot; &lt;&lt; ppsig(sig) &lt;&lt; endl;</span>
<a name="l00251"></a>00251 <span class="comment">    }*/</span>
<a name="l00252"></a>00252     <span class="keywordflow">return</span> b;
<a name="l00253"></a>00253 }
</pre></div></p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dynsection">
</div>
</p>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dynsection">
</div>
</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="compile__vect_8hh_source.html">compile_vect.hh</a></li>
<li><a class="el" href="compile__vect_8cpp_source.html">compile_vect.cpp</a></li>
</ul>
</div>
<hr class="footer"/><address style="text-align: right;"><small>Generated on Thu Apr 29 00:00:24 2010 for FAUST compiler by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>