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


Public Member Functions | |
| ScalarCompiler (const string &name, const string &super, int numInputs, int numOutputs) | |
| ScalarCompiler (Klass *k) | |
| virtual void | compileMultiSignal (Tree lsig) |
| 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 string | generateCacheCode (Tree sig, const string &exp) |
| virtual string | forceCacheCode (Tree sig, const string &exp) |
| virtual string | generateVariableStore (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... | |
| virtual string | generateFixDelay (Tree sig, Tree arg, Tree size) |
| Generate code for accessing a delayed signal. 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) |
| virtual string | generateWaveform (Tree sig) |
| 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) |
| virtual string | generateDelayVec (Tree sig, const string &exp, const string &ctype, const string &vname, int mxd) |
| Generate code for the delay mecchanism. More... | |
| 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... | |
| 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... | |
| 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... | |
Protected Attributes | |
| 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 | |
| static map< string, int > | fIDCounters |
Compile a list of FAUST signals into a scalar C++ class.
Definition at line 40 of file compile_scal.hh.
|
inline |
Definition at line 56 of file compile_scal.hh.
|
inline |
Definition at line 61 of file compile_scal.hh.
|
virtual |
Implements Compiler.
Reimplemented in VectorCompiler, and SchedulerCompiler.
Definition at line 156 of file compile_scal.cpp.
References gInPlace, hd(), isList(), sigInput(), subst(), T(), tl(), xcast(), and xfloat().

|
protected |
|
virtual |
Implements Compiler.
Definition at line 187 of file compile_scal.cpp.
References subst().
Referenced by signal2klass().


|
protectedvirtual |
Compile a signal.
| sig | the signal expression to compile. |
Reimplemented in VectorCompiler.
Definition at line 237 of file compile_scal.cpp.
|
protected |
Generate code for a waveform.
The waveform will be declared as a static field. The name of the waveform is returned in vname and its size in size.
Definition at line 1334 of file compile_scal.cpp.
References CTree::arity(), CTree::branch(), getCertifiedSigType(), subst(), and T().
Referenced by VectorCompiler::generateWaveform().


|
protected |
Generate code for a unique IOTA variable increased at each sample and used to index ring buffers.
Definition at line 1320 of file compile_scal.cpp.
|
protectedvirtual |
Definition at line 499 of file compile_scal.cpp.
References getCertifiedSigType(), and Occurences::getMaxDelay().

Definition at line 404 of file compile_scal.cpp.
References gBinOpTable, getCertifiedSigType(), ifloat(), kDiv, kInt, kReal, and subst().

Definition at line 573 of file compile_scal.cpp.
References hd(), ifloat(), reverse(), subst(), tl(), tree(), uiWidget(), and xfloat().

|
protectedvirtual |
Reimplemented in VectorCompiler.
Definition at line 461 of file compile_scal.cpp.
References getCertifiedSigType(), and Occurences::getMaxDelay().
Referenced by VectorCompiler::generateCacheCode().


Definition at line 584 of file compile_scal.cpp.
References hd(), ifloat(), reverse(), subst(), tl(), tree(), uiWidget(), and xfloat().

|
protectedvirtual |
Main code generator dispatch.
| sig | the signal expression to compile. |
Reimplemented in VectorCompiler.
Definition at line 262 of file compile_scal.cpp.
References getUserData(), isProj(), isSigAttach(), isSigBinOp(), isSigButton(), isSigCheckbox(), isSigFConst(), isSigFFun(), isSigFixDelay(), isSigFloatCast(), isSigFVar(), isSigGen(), isSigHBargraph(), isSigHSlider(), isSigInput(), isSigInt(), isSigIntCast(), isSigIota(), isSigNumEntry(), isSigOutput(), isSigPrefix(), isSigRDTbl(), isSigReal(), isSigSelect2(), isSigSelect3(), isSigTable(), isSigVBargraph(), isSigVSlider(), isSigWaveform(), isSigWRTbl(), name(), print(), printSignal(), T(), and tree2str().
Referenced by VectorCompiler::generateLoopCode().


|
protectedvirtual |
Generate code for the delay mecchanism without using temporary variables.
Reimplemented in VectorCompiler.
Definition at line 1273 of file compile_scal.cpp.
References gMaxCopyDelay, subst(), and T().

|
protectedvirtual |
Generate code for the delay mecchanism.
The generated code depend of the maximum delay attached to exp and the "less temporaries" switch
Reimplemented in VectorCompiler.
Definition at line 1211 of file compile_scal.cpp.
References getCertifiedSigType(), and kSamp.

|
protected |
Generate code for the delay mecchanism without using temporary variables.
Definition at line 1225 of file compile_scal.cpp.
References gMaxCopyDelay, subst(), and T().

|
protected |
Definition at line 349 of file compile_scal.cpp.
References getCertifiedSigType(), and Occurences::getMaxDelay().

Definition at line 430 of file compile_scal.cpp.
References ffarity(), ffincfile(), fflibfile(), ffname(), and nth().

Generate code for accessing a delayed signal.
The generated code depend of the maximum delay attached to exp and the gLessTempSwitch.
Reimplemented in VectorCompiler.
Definition at line 1168 of file compile_scal.cpp.
References gMaxCopyDelay, isSigInt(), subst(), and T().

Definition at line 564 of file compile_scal.cpp.
References ifloat(), and subst().

|
protected |
Definition at line 368 of file compile_scal.cpp.
|
protected |
Definition at line 657 of file compile_scal.cpp.
References getCertifiedSigType(), hd(), kBlock, kKonst, kSamp, reverse(), subst(), tl(), tree(), uiWidget(), and xfloat().

|
protected |
Definition at line 607 of file compile_scal.cpp.
References hd(), ifloat(), reverse(), subst(), T(), tl(), tree(), tree2float(), uiWidget(), and xfloat().

|
protected |
Definition at line 381 of file compile_scal.cpp.
References gInPlace, icast(), and subst().

Definition at line 559 of file compile_scal.cpp.
References subst().

Definition at line 959 of file compile_scal.cpp.
References isPowerOf2(), isSigInt(), subst(), and T().

|
protected |
Definition at line 331 of file compile_scal.cpp.
References getCertifiedSigType(), and Occurences::getMaxDelay().

|
protected |
Definition at line 618 of file compile_scal.cpp.
References hd(), ifloat(), reverse(), subst(), T(), tl(), tree(), tree2float(), uiWidget(), and xfloat().

|
protected |
Definition at line 392 of file compile_scal.cpp.
References subst(), and xcast().

Definition at line 933 of file compile_scal.cpp.
References cType(), getCertifiedSigType(), and subst().

Definition at line 847 of file compile_scal.cpp.
References isSigTable(), and subst().

Generate code for a group of mutually recursive definitions.
Definition at line 895 of file compile_scal.cpp.
References getCertifiedSigType(), len(), nth(), and sigProj().
Referenced by VectorCompiler::generateCodeRecursions().


Generate code for a projection of a group of mutually recursive definitions.
Definition at line 878 of file compile_scal.cpp.
References isRec().

Generate a select2 code.
Definition at line 986 of file compile_scal.cpp.
References subst().

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);.
Definition at line 997 of file compile_scal.cpp.
References subst().

Definition at line 696 of file compile_scal.cpp.
References signal2klass(), and subst().

Definition at line 708 of file compile_scal.cpp.
References signal2klass(), and subst().

Definition at line 775 of file compile_scal.cpp.
References getCertifiedSigType(), ifloat(), isSigGen(), isSigInt(), kInt, subst(), and T().

Definition at line 725 of file compile_scal.cpp.
References getCertifiedSigType(), ifloat(), isSigGen(), isSigInt(), kInt, subst(), and T().

|
protectedvirtual |
Reimplemented in VectorCompiler.
Definition at line 523 of file compile_scal.cpp.
References getCertifiedSigType(), kBlock, kKonst, kSamp, and subst().
Referenced by VectorCompiler::generateVariableStore().


|
protected |
Definition at line 630 of file compile_scal.cpp.
References getCertifiedSigType(), hd(), kBlock, kKonst, kSamp, reverse(), subst(), tl(), tree(), uiWidget(), and xfloat().

|
protected |
Definition at line 596 of file compile_scal.cpp.
References hd(), ifloat(), reverse(), subst(), T(), tl(), tree(), tree2float(), uiWidget(), and xfloat().

|
protectedvirtual |
Reimplemented in VectorCompiler.
Definition at line 1361 of file compile_scal.cpp.

Definition at line 835 of file compile_scal.cpp.
References subst().

|
protected |
retrieve the type annotation of sig
| sig | the signal we want to know the type |
Definition at line 1077 of file compile_scal.cpp.
References CTree::arity(), CTree::branch(), xtended::generateCode(), getCertifiedSigType(), getUserData(), and xtended::needCache().

|
protected |
Test if a signal is already compiled.
| sig | the signal expression to compile. |
| name | the string representing the compiled expression. |
Definition at line 210 of file compile_scal.cpp.
Referenced by VectorCompiler::CS(), VectorCompiler::generateCodeNonRec(), and VectorCompiler::generateCodeRecursions().

|
protected |
Definition at line 90 of file compile_scal.cpp.

|
protected |
Definition at line 62 of file sharing.cpp.
References fSharingKey, Node::getInt(), getProperty(), and CTree::node().
Referenced by VectorCompiler::generateCacheCode(), VectorCompiler::needSeparateLoop(), and sharingAnnotation().


|
protected |
Definition at line 452 of file compile_scal.cpp.
References ifloat(), kInt, and subst().
Referenced by VectorCompiler::generateCacheCode(), and VectorCompiler::generateVariableStore().


|
protected |
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.
| sig | the signal expression. |
| vecname | the string where to store the vector name. |
Definition at line 1125 of file compile_scal.cpp.
Referenced by VectorCompiler::generateFixDelay().

|
protected |
Compute the minimal power of 2 greater than x.
Definition at line 1135 of file compile_scal.cpp.
Referenced by SchedulerCompiler::dlineLoop(), VectorCompiler::dlineLoop(), VectorCompiler::generateCacheCode(), and VectorCompiler::generateFixDelay().

Implements Compiler.
Definition at line 107 of file compile_scal.cpp.
References deBruijn2Sym(), endTiming(), gDrawSignals, gDumpNorm, makeDrawPath(), privatise(), recursivnessAnnotation(), sigToGraph(), simplify(), startTiming(), subst(), and typeAnnotation().
Referenced by SchedulerCompiler::compileMultiSignal(), and VectorCompiler::compileMultiSignal().


Implements Compiler.
Definition at line 140 of file compile_scal.cpp.
References endTiming(), recursivnessAnnotation(), startTiming(), and typeAnnotation().

|
protected |
Set the string of a compiled expression is already compiled.
| sig | the signal expression to compile. |
| cexp | the string representing the compiled expression. |
Definition at line 221 of file compile_scal.cpp.
Referenced by VectorCompiler::CS(), VectorCompiler::generateCodeNonRec(), and VectorCompiler::generateCodeRecursions().

|
protected |
Definition at line 75 of file sharing.cpp.
References fSharingKey, setProperty(), and tree().
Referenced by sharingAnnotation().


|
protected |
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.
| sig | the signal expression. |
| vecname | the string representing the vector name. |
Definition at line 1111 of file compile_scal.cpp.
Referenced by VectorCompiler::generateCacheCode(), and VectorCompiler::generateDelayVec().

|
protected |
Definition at line 88 of file sharing.cpp.
References fSharingKey, hd(), isList(), kSamp, sharingAnnotation(), shprkey(), and tl().

|
protected |
Definition at line 106 of file sharing.cpp.
References getCertifiedSigType(), getSharingCount(), getSubSignals(), isSigGen(), isSigSelect3(), and setSharingCount().
Referenced by sharingAnalysis().


|
protected |
Definition at line 43 of file compile_scal.hh.
|
protected |
Definition at line 51 of file compile_scal.hh.
|
staticprotected |
Definition at line 48 of file compile_scal.hh.
|
protected |
Definition at line 46 of file compile_scal.hh.
|
protected |
Definition at line 50 of file compile_scal.hh.
Referenced by VectorCompiler::generateCacheCode(), VectorCompiler::generateFixDelay(), and VectorCompiler::needSeparateLoop().
|
protected |
Definition at line 49 of file compile_scal.hh.
Referenced by getSharingCount(), setSharingCount(), and sharingAnalysis().
|
protected |
Definition at line 45 of file compile_scal.hh.
|
protected |
Definition at line 44 of file compile_scal.hh.
1.8.7