|
FAUST compiler
0.9.9.6b8
|
#include <klass.hh>


Public Member Functions | |
| Klass (const string &name, const string &super, int numInputs, int numOutputs, bool __vec=false) | |
| virtual | ~Klass () |
| void | setParentKlass (Klass *parent) |
| Klass * | getParentKlass () |
| Klass * | getTopParentKlass () |
| string | getFullClassName () |
| Returns the name of the class. More... | |
| void | openLoop (const string &size) |
| Open a non-recursive loop on top of the stack of open loops. More... | |
| void | openLoop (Tree recsymbol, const string &size) |
| Open a recursive loop on top of the stack of open loops. More... | |
| void | closeLoop (Tree sig) |
| Close the top loop and either keep it or absorb it within its enclosing loop. More... | |
| void | setLoopProperty (Tree sig, Loop *l) |
| Store the loop used to compute a signal. More... | |
| bool | getLoopProperty (Tree sig, Loop *&l) |
| Returns the loop used to compute a signal. More... | |
| const string & | getClassName () const |
| Returns the name of the class. More... | |
| Loop * | topLoop () |
| void | buildTasksList () |
| void | addIncludeFile (const string &str) |
| void | addLibrary (const string &str) |
| void | rememberNeedPowerDef () |
| void | collectIncludeFile (set< string > &S) |
| void | collectLibrary (set< string > &S) |
| void | addSubKlass (Klass *son) |
| void | addDeclCode (const string &str) |
| void | addInitCode (const string &str) |
| void | addStaticInitCode (const string &str) |
| void | addStaticFields (const string &str) |
| void | addUICode (const string &str) |
| void | addUIMacro (const string &str) |
| void | incUIActiveCount () |
| void | incUIPassiveCount () |
| void | addSharedDecl (const string &str) |
| void | addFirstPrivateDecl (const string &str) |
| void | addZone1 (const string &str) |
| void | addZone2 (const string &str) |
| void | addZone2b (const string &str) |
| void | addZone2c (const string &str) |
| void | addZone3 (const string &str) |
| void | addPreCode (const string &str) |
| void | addExecCode (const string &str) |
| void | addPostCode (const string &str) |
| virtual void | println (int n, ostream &fout) |
| Print a full C++ class corresponding to a Faust dsp. More... | |
| virtual void | printComputeMethod (int n, ostream &fout) |
| Print Compute() method according to the various switch. More... | |
| virtual void | printComputeMethodScalar (int n, ostream &fout) |
| virtual void | printComputeMethodVectorFaster (int n, ostream &fout) |
| Uses loops of constant gVecSize boundary in order to provide the C compiler with more optimisation opportunities. More... | |
| virtual void | printComputeMethodVectorSimple (int n, ostream &fout) |
| Simple loop layout, generally less efficient than printComputeMethodVectorFaster. More... | |
| virtual void | printComputeMethodOpenMP (int n, ostream &fout) |
| virtual void | printComputeMethodScheduler (int n, ostream &fout) |
| virtual void | printLoopGraphScalar (int n, ostream &fout) |
| Print the loop graph (scalar mode) More... | |
| virtual void | printLoopGraphVector (int n, ostream &fout) |
| Print the loop graph (used for vector code) More... | |
| virtual void | printLoopGraphOpenMP (int n, ostream &fout) |
| Print the loop graph as a serie of parallel loops. More... | |
| virtual void | printLoopGraphScheduler (int n, ostream &fout) |
| Print the loop graph as a serie of parallel loops. More... | |
| virtual void | printLoopGraphInternal (int n, ostream &fout) |
| Print the loop graph (used for internals classes) More... | |
| virtual void | printGraphDotFormat (ostream &fout) |
| Print the loop graph in dot format. More... | |
| virtual void | printLoopDeepFirst (int n, ostream &fout, Loop *l, set< Loop * > &visited) |
| Print a loop graph deep first. More... | |
| virtual void | printLastLoopLevelScheduler (int n, int lnum, const lset &L, ostream &fout) |
| Print the 'level' of the loop graph as a set of parallel loops. More... | |
| virtual void | printLoopLevelScheduler (int n, int lnum, const lset &L, ostream &fout) |
| Print the 'level' of the loop graph as a set of parallel loops. More... | |
| virtual void | printOneLoopScheduler (lset::const_iterator p, int n, ostream &fout) |
| virtual void | printLoopLevelOpenMP (int n, int lnum, const lset &L, ostream &fout) |
| Print the 'level' of the loop graph as a set of parallel loops. More... | |
| virtual void | printMetadata (int n, const map< Tree, set< Tree > > &S, ostream &fout) |
| Print metadata declaration. More... | |
| virtual void | printIncludeFile (ostream &fout) |
| Print the required include files. More... | |
| virtual void | printLibrary (ostream &fout) |
| Print the required C++ libraries as comments in source code. More... | |
| virtual void | printAdditionalCode (ostream &fout) |
| Print additional functions required by the generated code. More... | |
| int | inputs () |
| int | outputs () |
Protected Attributes | |
| Klass * | fParentKlass |
| Klass in which this Klass is embedded, void if toplevel Klass. More... | |
| string | fKlassName |
| string | fSuperKlassName |
| int | fNumInputs |
| int | fNumOutputs |
| int | fNumActives |
| number of active controls in the UI (sliders, buttons, etc.) More... | |
| int | fNumPassives |
| number of passive widgets in the UI (bargraphs, etc.) More... | |
| set< string > | fIncludeFileSet |
| set< string > | fLibrarySet |
| list< Klass * > | fSubClassList |
| list< string > | fDeclCode |
| list< string > | fStaticInitCode |
| static init code for class constant tables More... | |
| list< string > | fStaticFields |
| static fields after class More... | |
| list< string > | fInitCode |
| list< string > | fUICode |
| list< string > | fUIMacro |
| list< string > | fSharedDecl |
| shared declarations More... | |
| list< string > | fFirstPrivateDecl |
| first private declarations More... | |
| list< string > | fZone1Code |
| shared vectors More... | |
| list< string > | fZone2Code |
| first private More... | |
| list< string > | fZone2bCode |
| single once per block More... | |
| list< string > | fZone2cCode |
| single once per block More... | |
| list< string > | fZone3Code |
| private every sub block More... | |
| Loop * | fTopLoop |
| active loops currently open More... | |
| property< Loop * > | fLoopProperty |
| loops used to compute some signals More... | |
| bool | fVec |
Static Protected Attributes | |
| static bool | fNeedPowerDef = false |
| true when faustpower definition is needed More... | |
|
inline |
Definition at line 109 of file klass.hh.
|
inline |
Definition at line 149 of file klass.hh.
Referenced by buildTasksList(), SchedulerCompiler::dlineLoop(), VectorCompiler::dlineLoop(), and SchedulerCompiler::vectorLoop().

|
inline |
Definition at line 175 of file klass.hh.
Referenced by SchedulerCompiler::compileMultiSignal(), VectorCompiler::compileMultiSignal(), SchedulerCompiler::dlineLoop(), VectorCompiler::dlineLoop(), SchedulerCompiler::vectorLoop(), and VectorCompiler::vectorLoop().

|
inline |
Definition at line 166 of file klass.hh.
Referenced by SchedulerCompiler::dlineLoop(), and VectorCompiler::dlineLoop().

|
inline |
Definition at line 137 of file klass.hh.
Referenced by Compiler::addIncludeFile().

|
inline |
Definition at line 151 of file klass.hh.
Referenced by buildTasksList(), SchedulerCompiler::dlineLoop(), and VectorCompiler::dlineLoop().

|
inline |
Definition at line 139 of file klass.hh.
Referenced by Compiler::addLibrary().

|
inline |
Definition at line 176 of file klass.hh.
Referenced by SchedulerCompiler::dlineLoop(), VectorCompiler::dlineLoop(), and VectorCompiler::generateWaveform().

|
inline |
Definition at line 174 of file klass.hh.
Referenced by SchedulerCompiler::dlineLoop(), and VectorCompiler::dlineLoop().

|
inline |
Definition at line 165 of file klass.hh.
Referenced by SchedulerCompiler::compileMultiSignal(), VectorCompiler::compileMultiSignal(), SchedulerCompiler::dlineLoop(), VectorCompiler::dlineLoop(), SchedulerCompiler::vectorLoop(), and VectorCompiler::vectorLoop().

|
inline |
Definition at line 153 of file klass.hh.
|
inline |
Definition at line 157 of file klass.hh.
Referenced by Compiler::generateUserInterfaceTree(), and Compiler::generateWidgetCode().

|
inline |
Definition at line 159 of file klass.hh.
Referenced by Compiler::generateWidgetMacro().

|
inline |
Definition at line 168 of file klass.hh.
Referenced by VectorCompiler::dlineLoop(), and VectorCompiler::vectorLoop().

|
inline |
Definition at line 169 of file klass.hh.
Referenced by SchedulerCompiler::dlineLoop(), and VectorCompiler::dlineLoop().

|
inline |
Definition at line 171 of file klass.hh.
Referenced by buildTasksList().

|
inline |
Definition at line 172 of file klass.hh.
Referenced by buildTasksList(), SchedulerCompiler::compileMultiSignal(), and VectorCompiler::compileMultiSignal().

| void Klass::buildTasksList | ( | ) |
Definition at line 328 of file klass.cpp.
References addDeclCode(), addInitCode(), addZone2c(), addZone3(), computeUseCount(), Loop::fIndex, fTopLoop, gGroupTaskSwitch, groupSeqLoops(), gTaskCount, LAST_TASK_INDEX, sortGraph(), START_TASK_INDEX, START_TASK_MAX, subst(), and T().
Referenced by SchedulerCompiler::compileMultiSignal().


| void Klass::closeLoop | ( | Tree | sig | ) |
Close the top loop and either keep it or absorb it within its enclosing loop.
Definition at line 117 of file klass.cpp.
References Loop::absorb(), Loop::fBackwardLoopDependencies, Loop::fEnclosingLoop, Loop::fRecSymbolSet, fTopLoop, Loop::hasRecDependencyIn(), hd(), Loop::isEmpty(), isNil(), setLoopProperty(), symlist(), and tl().
Referenced by SchedulerCompiler::compileMultiSignal(), VectorCompiler::compileMultiSignal(), VectorCompiler::generateCodeRecursions(), and VectorCompiler::generateLoopCode().


| void Klass::collectIncludeFile | ( | set< string > & | S | ) |
Definition at line 1209 of file klass.cpp.
References fIncludeFileSet, fSubClassList, and merge().
Referenced by printIncludeFile().


| void Klass::collectLibrary | ( | set< string > & | S | ) |
Definition at line 1217 of file klass.cpp.
References fLibrarySet, fSubClassList, and merge().
Referenced by printLibrary().


|
inline |
|
inline |
Returns the loop used to compute a signal.
Definition at line 87 of file klass.cpp.
References fLoopProperty, and property< P >::get().
Referenced by VectorCompiler::CS().


|
inline |
Definition at line 119 of file klass.hh.
|
inline |
Definition at line 120 of file klass.hh.
References getTopParentKlass().
Referenced by getTopParentKlass().


|
inline |
Definition at line 161 of file klass.hh.
Referenced by Compiler::generateWidgetCode().

|
inline |
Definition at line 162 of file klass.hh.
Referenced by Compiler::generateWidgetCode().

|
inline |
Definition at line 209 of file klass.hh.
Referenced by SchedulerCompiler::compileMultiSignal(), VectorCompiler::compileMultiSignal(), and main().

| void Klass::openLoop | ( | const string & | size | ) |
Open a non-recursive loop on top of the stack of open loops.
| size | the number of iterations of the loop |
Definition at line 96 of file klass.cpp.
References fTopLoop.
Referenced by SchedulerCompiler::compileMultiSignal(), VectorCompiler::compileMultiSignal(), VectorCompiler::generateCodeRecursions(), and VectorCompiler::generateLoopCode().

| void Klass::openLoop | ( | Tree | recsymbol, |
| const string & | size | ||
| ) |
Open a recursive loop on top of the stack of open loops.
| recsymbol | the recursive symbol defined in this loop |
| size | the number of iterations of the loop |
Definition at line 107 of file klass.cpp.
References fTopLoop.
|
inline |
Definition at line 210 of file klass.hh.
Referenced by SchedulerCompiler::compileMultiSignal(), VectorCompiler::compileMultiSignal(), and main().

|
virtual |
Print additional functions required by the generated code.
Definition at line 217 of file klass.cpp.
References fNeedPowerDef, and gFloatSize.
Referenced by main().

|
virtual |
Print Compute() method according to the various switch.
Definition at line 820 of file klass.cpp.
References gOpenMPSwitch, gSchedulerSwitch, gVectorLoopVariant, gVectorSwitch, printComputeMethodOpenMP(), printComputeMethodScalar(), printComputeMethodScheduler(), printComputeMethodVectorFaster(), and printComputeMethodVectorSimple().
Referenced by println().


|
virtual |
Definition at line 953 of file klass.cpp.
References fFirstPrivateDecl, fZone1Code, fZone2bCode, fZone2Code, fZone3Code, gVecSize, printdecllist(), printlines(), printLoopGraphOpenMP(), subst(), tab(), and xfloat().
Referenced by printComputeMethod().


|
virtual |
Definition at line 837 of file klass.cpp.
References fZone1Code, fZone2bCode, fZone2Code, fZone3Code, printlines(), printLoopGraphScalar(), subst(), tab(), and xfloat().
Referenced by printComputeMethod().


|
virtual |
Definition at line 1052 of file klass.cpp.
References fZone1Code, fZone2cCode, fZone2Code, fZone3Code, gTaskCount, gVecSize, printlines(), printLoopGraphScheduler(), START_TASK_INDEX, subst(), tab(), and xfloat().
Referenced by printComputeMethod().


|
virtual |
Uses loops of constant gVecSize boundary in order to provide the C compiler with more optimisation opportunities.
Improves performances in general, but not always
Definition at line 853 of file klass.cpp.
References fZone1Code, fZone2bCode, fZone2Code, fZone3Code, gVecSize, printlines(), printLoopGraphVector(), subst(), tab(), and xfloat().
Referenced by printComputeMethod().


|
virtual |
Simple loop layout, generally less efficient than printComputeMethodVectorFaster.
Definition at line 882 of file klass.cpp.
References fZone1Code, fZone2bCode, fZone2Code, fZone3Code, gVecSize, printlines(), printLoopGraphVector(), subst(), tab(), and xfloat().
Referenced by printComputeMethod().


|
virtual |
Print the loop graph in dot format.
Definition at line 522 of file klass.cpp.
References fTopLoop, and sortGraph().
Referenced by main().


|
virtual |
Print the required include files.
Definition at line 199 of file klass.cpp.
References collectIncludeFile(), and gOpenMPSwitch.
Referenced by main().


|
virtual |
Print the 'level' of the loop graph as a set of parallel loops.
Definition at line 628 of file klass.cpp.
References gTaskCount, nonRecursiveLevel(), and tab().
Referenced by printLoopGraphScheduler().


|
virtual |
Print the required C++ libraries as comments in source code.
Definition at line 182 of file klass.cpp.
References collectLibrary().
Referenced by main().


|
virtual |
Print a full C++ class corresponding to a Faust dsp.
Reimplemented in SigFloatGenKlass, and SigIntGenKlass.
Definition at line 737 of file klass.cpp.
References fDeclCode, fInitCode, fKlassName, fNumActives, fNumInputs, fNumOutputs, fNumPassives, fStaticFields, fStaticInitCode, fSubClassList, fSuperKlassName, fUICode, fUIMacro, gMetaDataSet, gSchedulerSwitch, gUIMacroSwitch, printComputeMethod(), printlines(), printMetadata(), and tab().
Referenced by main().


Print a loop graph deep first.
Definition at line 267 of file klass.cpp.
References Loop::fBackwardLoopDependencies, Loop::fOrder, isElement(), Loop::println(), and tab().
Referenced by printLoopGraphVector().


|
virtual |
Print the loop graph (used for internals classes)
Definition at line 551 of file klass.cpp.
References fTopLoop, gVectorSwitch, sortGraph(), and tab().
Referenced by SigIntGenKlass::println(), and SigFloatGenKlass::println().


|
virtual |
Print the loop graph as a serie of parallel loops.
Definition at line 479 of file klass.cpp.
References computeUseCount(), fTopLoop, gGroupTaskSwitch, groupSeqLoops(), printLoopLevelOpenMP(), sortGraph(), and tab().
Referenced by printComputeMethodOpenMP().


|
virtual |
Print the loop graph (scalar mode)
Definition at line 568 of file klass.cpp.
References fTopLoop, and Loop::printoneln().
Referenced by printComputeMethodScalar().


|
virtual |
Print the loop graph as a serie of parallel loops.
Definition at line 499 of file klass.cpp.
References computeUseCount(), fTopLoop, gGroupTaskSwitch, groupSeqLoops(), printLastLoopLevelScheduler(), printLoopLevelScheduler(), sortGraph(), and tab().
Referenced by printComputeMethodScheduler().


|
virtual |
Print the loop graph (used for vector code)
Definition at line 448 of file klass.cpp.
References computeUseCount(), fTopLoop, gDeepFirstSwitch, gGroupTaskSwitch, groupSeqLoops(), gVectorSwitch, printLoopDeepFirst(), sortGraph(), and tab().
Referenced by printComputeMethodVectorFaster(), and printComputeMethodVectorSimple().


|
virtual |
Print the 'level' of the loop graph as a set of parallel loops.
Definition at line 588 of file klass.cpp.
References gOpenMPLoop, nonRecursiveLevel(), and tab().
Referenced by printLoopGraphOpenMP().


|
virtual |
Print the 'level' of the loop graph as a set of parallel loops.
Definition at line 721 of file klass.cpp.
References nonRecursiveLevel(), and printOneLoopScheduler().
Referenced by printLoopGraphScheduler().


Print metadata declaration.
Definition at line 238 of file klass.cpp.
References gMetaDataSet, tab(), and tree().
Referenced by println().


|
virtual |
Definition at line 661 of file klass.cpp.
References Loop::fIndex, gTaskCount, subst(), T(), and tab().
Referenced by printLoopLevelScheduler().


|
inline |
Definition at line 141 of file klass.hh.
Referenced by PowPrim::generateCode().

Store the loop used to compute a signal.
Definition at line 79 of file klass.cpp.
References fLoopProperty, and property< P >::set().
Referenced by closeLoop().


|
inline |
Definition at line 117 of file klass.hh.
|
inline |
Definition at line 133 of file klass.hh.
Referenced by VectorCompiler::CS(), and VectorCompiler::generateLoopCode().

|
protected |
Definition at line 79 of file klass.hh.
Referenced by println(), SigIntGenKlass::println(), and SigFloatGenKlass::println().
|
protected |
first private declarations
Definition at line 94 of file klass.hh.
Referenced by printComputeMethodOpenMP().
|
protected |
Definition at line 74 of file klass.hh.
Referenced by collectIncludeFile().
|
protected |
Definition at line 82 of file klass.hh.
Referenced by println(), SigIntGenKlass::println(), and SigFloatGenKlass::println().
|
protected |
Definition at line 67 of file klass.hh.
Referenced by println(), SigIntGenKlass::println(), and SigFloatGenKlass::println().
|
protected |
Definition at line 75 of file klass.hh.
Referenced by collectLibrary().
loops used to compute some signals
Definition at line 103 of file klass.hh.
Referenced by getLoopProperty(), and setLoopProperty().
|
staticprotected |
true when faustpower definition is needed
Definition at line 61 of file klass.hh.
Referenced by printAdditionalCode().
|
protected |
|
protected |
Definition at line 69 of file klass.hh.
Referenced by println(), SigIntGenKlass::println(), and SigFloatGenKlass::println().
|
protected |
Definition at line 70 of file klass.hh.
Referenced by println(), SigIntGenKlass::println(), and SigFloatGenKlass::println().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 77 of file klass.hh.
Referenced by collectIncludeFile(), collectLibrary(), println(), SigIntGenKlass::println(), and SigFloatGenKlass::println().
|
protected |
|
protected |
active loops currently open
Definition at line 102 of file klass.hh.
Referenced by buildTasksList(), closeLoop(), openLoop(), printGraphDotFormat(), printLoopGraphInternal(), printLoopGraphOpenMP(), printLoopGraphScalar(), printLoopGraphScheduler(), and printLoopGraphVector().
|
protected |
|
protected |
|
protected |
shared vectors
Definition at line 96 of file klass.hh.
Referenced by printComputeMethodOpenMP(), printComputeMethodScalar(), printComputeMethodScheduler(), printComputeMethodVectorFaster(), printComputeMethodVectorSimple(), SigIntGenKlass::println(), and SigFloatGenKlass::println().
|
protected |
single once per block
Definition at line 98 of file klass.hh.
Referenced by printComputeMethodOpenMP(), printComputeMethodScalar(), printComputeMethodVectorFaster(), printComputeMethodVectorSimple(), SigIntGenKlass::println(), and SigFloatGenKlass::println().
|
protected |
single once per block
Definition at line 99 of file klass.hh.
Referenced by printComputeMethodScheduler().
|
protected |
first private
Definition at line 97 of file klass.hh.
Referenced by printComputeMethodOpenMP(), printComputeMethodScalar(), printComputeMethodScheduler(), printComputeMethodVectorFaster(), printComputeMethodVectorSimple(), SigIntGenKlass::println(), and SigFloatGenKlass::println().
|
protected |
private every sub block
Definition at line 100 of file klass.hh.
Referenced by printComputeMethodOpenMP(), printComputeMethodScalar(), printComputeMethodScheduler(), printComputeMethodVectorFaster(), printComputeMethodVectorSimple(), SigIntGenKlass::println(), and SigFloatGenKlass::println().
1.8.7