|
FAUST compiler
0.9.9.6b8
|
Compile a list of FAUST signals into a vector C++ class. More...
#include <compile_vect.hh>


Public Member Functions | |
| VectorCompiler (const string &name, const string &super, int numInputs, int numOutputs) | |
| VectorCompiler (Klass *k) | |
| virtual void | compileMultiSignal (Tree L) |
Public Member Functions inherited from ScalarCompiler | |
| ScalarCompiler (const string &name, const string &super, int numInputs, int numOutputs) | |
| ScalarCompiler (Klass *k) | |
| virtual void | compileSingleSignal (Tree lsig) |
Public Member Functions inherited from Compiler | |
| Compiler (const string &name, const string &super, int numInputs, int numOutputs, bool vec) | |
| Compiler (Klass *k) | |
| virtual | ~Compiler () |
| Klass * | getClass () |
| void | setDescription (Description *descr) |
| Description * | getDescription () |
Protected Member Functions | |
| virtual string | CS (Tree sig) |
| Compile a signal. More... | |
| virtual string | generateCode (Tree sig) |
| Main code generator dispatch. More... | |
| virtual void | generateCodeRecursions (Tree sig) |
| virtual string | generateCodeNonRec (Tree sig) |
| virtual string | generateLoopCode (Tree sig) |
| Compile a signal. More... | |
| virtual string | generateCacheCode (Tree sig, const string &exp) |
| Generate cache code for a signal if needed. More... | |
| virtual void | generateDelayLine (const string &ctype, const string &vname, int mxd, const string &exp) |
| Generate code for the delay mecchanism without using temporary variables. More... | |
| virtual string | generateVariableStore (Tree sig, const string &exp) |
| virtual string | generateFixDelay (Tree sig, Tree exp, Tree delay) |
| Generate code for accessing a delayed signal. More... | |
| virtual string | generateDelayVec (Tree sig, const string &exp, const string &ctype, const string &vname, int mxd) |
| Generate code for the delay mecchanism. More... | |
| virtual void | vectorLoop (const string &tname, const string &dlname, const string &cexp) |
| Generate the code for a (short) delay line. More... | |
| virtual void | dlineLoop (const string &tname, const string &dlname, int delay, const string &cexp) |
| Generate the code for a (short) delay line. More... | |
| virtual string | generateWaveform (Tree sig) |
| bool | needSeparateLoop (Tree sig) |
| Test if a signal need to be compiled in a separate loop. More... | |
Protected Member Functions inherited from ScalarCompiler | |
| virtual string | forceCacheCode (Tree sig, const string &exp) |
| string | getFreshID (const string &prefix) |
| void | compilePreparedSignalList (Tree lsig) |
| Tree | prepare (Tree L0) |
| Tree | prepare2 (Tree L0) |
| bool | getCompiledExpression (Tree sig, string &name) |
| Test if a signal is already compiled. More... | |
| string | setCompiledExpression (Tree sig, const string &name) |
| Set the string of a compiled expression is already compiled. More... | |
| void | setVectorNameProperty (Tree sig, const string &vecname) |
| Set the vector name property of a signal, the name of the vector used to store the previous values of the signal to implement a delay. More... | |
| bool | getVectorNameProperty (Tree sig, string &vecname) |
| Get the vector name property of a signal, the name of the vector used to store the previous values of the signal to implement a delay. More... | |
| int | getSharingCount (Tree t) |
| void | setSharingCount (Tree t, int count) |
| void | sharingAnalysis (Tree t) |
| void | sharingAnnotation (int vctxt, Tree t) |
| string | generateXtended (Tree sig) |
| retrieve the type annotation of sig More... | |
| string | generatePrefix (Tree sig, Tree x, Tree e) |
| string | generateIota (Tree sig, Tree arg) |
| string | generateBinOp (Tree sig, int opcode, Tree arg1, Tree arg2) |
| string | generateFFun (Tree sig, Tree ff, Tree largs) |
| string | generateInput (Tree sig, const string &idx) |
| string | generateOutput (Tree sig, const string &idx, const string &arg1) |
| string | generateTable (Tree sig, Tree tsize, Tree content) |
| string | generateStaticTable (Tree sig, Tree tsize, Tree content) |
| string | generateWRTbl (Tree sig, Tree tbl, Tree idx, Tree data) |
| string | generateRDTbl (Tree sig, Tree tbl, Tree idx) |
| string | generateSigGen (Tree sig, Tree content) |
| string | generateStaticSigGen (Tree sig, Tree content) |
| string | generateSelect2 (Tree sig, Tree sel, Tree s1, Tree s2) |
| Generate a select2 code. More... | |
| string | generateSelect3 (Tree sig, Tree sel, Tree s1, Tree s2, Tree s3) |
| Generate a select3 code (using if-then-else) ((int n = sel==0)? s0 : ((sel==1)? s1 : s2)) int nn; ((nn=sel) ? ((nn==1)? s1 : s2) : s0);. More... | |
| string | generateRecProj (Tree sig, Tree exp, int i) |
| Generate code for a projection of a group of mutually recursive definitions. More... | |
| void | generateRec (Tree sig, Tree var, Tree le) |
| Generate code for a group of mutually recursive definitions. More... | |
| string | generateIntCast (Tree sig, Tree x) |
| string | generateFloatCast (Tree sig, Tree x) |
| string | generateButton (Tree sig, Tree label) |
| string | generateCheckbox (Tree sig, Tree label) |
| string | generateVSlider (Tree sig, Tree label, Tree cur, Tree min, Tree max, Tree step) |
| string | generateHSlider (Tree sig, Tree label, Tree cur, Tree min, Tree max, Tree step) |
| string | generateNumEntry (Tree sig, Tree label, Tree cur, Tree min, Tree max, Tree step) |
| string | generateVBargraph (Tree sig, Tree label, Tree min, Tree max, const string &exp) |
| string | generateHBargraph (Tree sig, Tree label, Tree min, Tree max, const string &exp) |
| string | generateNumber (Tree sig, const string &exp) |
| string | generateFConst (Tree sig, const string &file, const string &name) |
| string | generateFVar (Tree sig, const string &file, const string &name) |
| string | generateDelayVecNoTemp (Tree sig, const string &exp, const string &ctype, const string &vname, int mxd) |
| Generate code for the delay mecchanism without using temporary variables. More... | |
| void | getTypedNames (Type t, const string &prefix, string &ctype, string &vname) |
| void | ensureIotaCode () |
| Generate code for a unique IOTA variable increased at each sample and used to index ring buffers. More... | |
| int | pow2limit (int x) |
| Compute the minimal power of 2 greater than x. More... | |
| void | declareWaveform (Tree sig, string &vname, int &size) |
| Generate code for a waveform. More... | |
Protected Member Functions inherited from Compiler | |
| void | addIncludeFile (const string &str) |
| void | addLibrary (const string &str) |
| void | addUIWidget (Tree path, Tree widget) |
| Add a widget with a certain path to the user interface tree. More... | |
| void | generateWidgetCode (Tree fulllabel, Tree varname, Tree sig) |
| Generate buildUserInterface C++ lines of code corresponding to user interface widget t. More... | |
| void | generateUserInterfaceTree (Tree t) |
| Generate buildUserInterface C++ lines of code corresponding to user interface element t. More... | |
| void | generateUserInterfaceElements (Tree elements) |
| Iterate generateUserInterfaceTree on a list of user interface elements. More... | |
| Tree | prepareUserInterfaceTree (Tree t) |
| Remove fake root folder if not needed (that is if the UI is completely enclosed in one folder. More... | |
| void | generateMacroInterfaceTree (const string &pathname, Tree t) |
| Generate user interface macros corresponding to user interface element t. More... | |
| void | generateMacroInterfaceElements (const string &pathname, Tree elements) |
| Iterate generateMacroInterfaceTree on a list of user interface elements. More... | |
| void | generateWidgetMacro (const string &pathname, Tree fulllabel, Tree varname, Tree sig) |
| Generate user interface macros corresponding to a user interface widget. More... | |
Additional Inherited Members | |
Protected Attributes inherited from ScalarCompiler | |
| property< string > | fCompileProperty |
| property< string > | fVectorProperty |
| property< pair< string, string > > | fStaticInitProperty |
| property< pair< string, string > > | fInstanceInitProperty |
| Tree | fSharingKey |
| OccMarkup | fOccMarkup |
| bool | fHasIota |
Protected Attributes inherited from Compiler | |
| Klass * | fClass |
| bool | fNeedToDeleteClass |
| Tree | fUIRoot |
| Description * | fDescription |
Static Protected Attributes inherited from ScalarCompiler | |
| static map< string, int > | fIDCounters |
Compile a list of FAUST signals into a vector C++ class.
Definition at line 39 of file compile_vect.hh.
|
inline |
Definition at line 44 of file compile_vect.hh.
|
inline |
Definition at line 48 of file compile_vect.hh.
|
virtual |
Reimplemented from ScalarCompiler.
Reimplemented in SchedulerCompiler.
Definition at line 30 of file compile_vect.cpp.
References Klass::addExecCode(), Klass::addSharedDecl(), Klass::addZone3(), Klass::closeLoop(), CS(), Compiler::fClass, Compiler::fDescription, Compiler::fUIRoot, Compiler::generateMacroInterfaceTree(), Compiler::generateUserInterfaceTree(), hd(), Klass::inputs(), isList(), Klass::openLoop(), Klass::outputs(), ScalarCompiler::prepare(), Compiler::prepareUserInterfaceTree(), subst(), T(), tl(), Description::ui(), xcast(), and xfloat().

|
protectedvirtual |
Compile a signal.
| sig | the signal expression to compile. |
Reimplemented from ScalarCompiler.
Definition at line 66 of file compile_vect.cpp.
References Loop::fBackwardLoopDependencies, Compiler::fClass, generateCode(), getCertifiedSigType(), ScalarCompiler::getCompiledExpression(), Klass::getLoopProperty(), isProj(), isSigFixDelay(), kSamp, ScalarCompiler::setCompiledExpression(), tl(), and Klass::topLoop().
Referenced by SchedulerCompiler::compileMultiSignal(), compileMultiSignal(), and generateFixDelay().


|
protectedvirtual |
Generate the code for a (short) delay line.
| k | the c++ class where the delay line will be placed. |
| l | the loop where the code will be placed. |
| tname | the name of the C++ type (float or int) |
| dlname | the name of the delay line (vector) to be used. |
| delay | the maximum delay |
| cexp | the content of the signal as a C++ expression |
Reimplemented in SchedulerCompiler.
Definition at line 449 of file compile_vect.cpp.
References Klass::addDeclCode(), Klass::addExecCode(), Klass::addFirstPrivateDecl(), Klass::addInitCode(), Klass::addPostCode(), Klass::addPreCode(), Klass::addSharedDecl(), Klass::addZone1(), Klass::addZone2(), Compiler::fClass, gMaxCopyDelay, gVecSize, ScalarCompiler::pow2limit(), subst(), and T().
Referenced by generateDelayLine().


|
protectedvirtual |
Generate cache code for a signal if needed.
| sig | the signal expression. |
| exp | the corresponding C code. |
Reimplemented from ScalarCompiler.
Definition at line 203 of file compile_vect.cpp.
References ScalarCompiler::fOccMarkup, ScalarCompiler::generateCacheCode(), generateDelayLine(), generateVariableStore(), getCertifiedSigType(), Occurences::getMaxDelay(), ScalarCompiler::getSharingCount(), ScalarCompiler::getTypedNames(), gMaxCopyDelay, gVecSize, kSamp, ScalarCompiler::pow2limit(), OccMarkup::retrieve(), ScalarCompiler::setVectorNameProperty(), subst(), T(), and verySimple().
Referenced by generateWaveform().


|
protectedvirtual |
Main code generator dispatch.
| sig | the signal expression to compile. |
Reimplemented from ScalarCompiler.
Definition at line 115 of file compile_vect.cpp.
References generateCodeNonRec(), and generateCodeRecursions().
Referenced by CS().


|
protectedvirtual |
Definition at line 143 of file compile_vect.cpp.
References generateLoopCode(), ScalarCompiler::getCompiledExpression(), and ScalarCompiler::setCompiledExpression().
Referenced by generateCode().


|
protectedvirtual |
Definition at line 121 of file compile_vect.cpp.
References Klass::closeLoop(), Compiler::fClass, ScalarCompiler::generateRec(), ScalarCompiler::getCompiledExpression(), getSubSignals(), isRec(), Klass::openLoop(), and ScalarCompiler::setCompiledExpression().
Referenced by generateCode().


|
protectedvirtual |
Generate code for the delay mecchanism without using temporary variables.
Reimplemented from ScalarCompiler.
Definition at line 313 of file compile_vect.cpp.
References dlineLoop(), and vectorLoop().
Referenced by generateCacheCode(), and generateDelayVec().


|
protectedvirtual |
Generate code for the delay mecchanism.
The generated code depend of the maximum delay attached to exp and the "less temporaries" switch
Reimplemented from ScalarCompiler.
Definition at line 396 of file compile_vect.cpp.
References generateDelayLine(), ScalarCompiler::setVectorNameProperty(), subst(), and verySimple().

Generate code for accessing a delayed signal.
The generated code depend of the maximum delay attached to exp and the gLessTempSwitch.
Reimplemented from ScalarCompiler.
Definition at line 342 of file compile_vect.cpp.
References CS(), ScalarCompiler::fOccMarkup, Occurences::getMaxDelay(), ScalarCompiler::getVectorNameProperty(), gMaxCopyDelay, gVecSize, isSigInt(), ScalarCompiler::pow2limit(), OccMarkup::retrieve(), subst(), and T().

|
protectedvirtual |
Compile a signal.
| sig | the signal expression to compile. |
Definition at line 162 of file compile_vect.cpp.
References Klass::closeLoop(), Compiler::fClass, ScalarCompiler::generateCode(), Loop::hasRecDependencyIn(), isProj(), needSeparateLoop(), Klass::openLoop(), singleton(), and Klass::topLoop().
Referenced by generateCodeNonRec().


|
protectedvirtual |
Reimplemented from ScalarCompiler.
Definition at line 322 of file compile_vect.cpp.
References ScalarCompiler::generateVariableStore(), getCertifiedSigType(), ScalarCompiler::getTypedNames(), kSamp, subst(), and vectorLoop().
Referenced by generateCacheCode().


|
protectedvirtual |
Reimplemented from ScalarCompiler.
Definition at line 524 of file compile_vect.cpp.
References Klass::addPostCode(), ScalarCompiler::declareWaveform(), Compiler::fClass, generateCacheCode(), subst(), and T().

|
protected |
Test if a signal need to be compiled in a separate loop.
| sig | the signal expression to test. |
Definition at line 276 of file compile_vect.cpp.
References ScalarCompiler::fOccMarkup, getCertifiedSigType(), Occurences::getMaxDelay(), ScalarCompiler::getSharingCount(), isProj(), isSigFixDelay(), kSamp, OccMarkup::retrieve(), and verySimple().
Referenced by generateLoopCode().


|
protectedvirtual |
Generate the code for a (short) delay line.
| k | the c++ class where the delay line will be placed. |
| l | the loop where the code will be placed. |
| tname | the name of the C++ type (float or int) |
| dlname | the name of the delay line (vector) to be used. |
| delay | the maximum delay |
| cexp | the content of the signal as a C++ expression |
Reimplemented in SchedulerCompiler.
Definition at line 427 of file compile_vect.cpp.
References Klass::addExecCode(), Klass::addSharedDecl(), Klass::addZone1(), Compiler::fClass, gVecSize, subst(), and T().
Referenced by generateDelayLine(), and generateVariableStore().


1.8.7