50 #define kMaxCategory 32
87 list<string> fSlowDecl;
88 list<string> fSharedDecl;
89 list<string> fCommonCode;
90 list<string> fSlowCode;
91 list<string> fEndCode;
109 Klass (
const string&
name,
const string& super,
int numInputs,
int numOutputs,
bool __vec =
false)
110 : fParentKlass(0), fKlassName(name), fSuperKlassName(super), fNumInputs(numInputs), fNumOutputs(numOutputs),
111 fNumActives(0), fNumPassives(0),
112 fTopLoop(new
Loop(0,
"count")), fVec(__vec)
117 void setParentKlass(
Klass* parent) { std::cerr <<
this <<
" setParentKlass(" << parent <<
")" << std::endl;
118 fParentKlass=parent; }
121 string getFullClassName() {
return (fParentKlass!=0) ? fParentKlass->getFullClassName() +
"::" + getClassName() : getClassName(); }
124 void openLoop(
const string& size);
125 void openLoop(
Tree recsymbol,
const string& size);
126 void closeLoop(
Tree sig);
128 void setLoopProperty(
Tree sig,
Loop* l);
129 bool getLoopProperty(
Tree sig,
Loop*& l);
135 void buildTasksList();
139 void addLibrary (
const string& str) { fLibrarySet.insert(str); }
143 void collectIncludeFile(set<string>& S);
145 void collectLibrary(set<string>& S);
149 void addDeclCode (
const string& str) { fDeclCode.push_back(str); }
151 void addInitCode (
const string& str) { fInitCode.push_back(str); }
157 void addUICode (
const string& str) { fUICode.push_back(str); }
159 void addUIMacro (
const string& str) { fUIMacro.push_back(str); }
168 void addZone1 (
const string& str) { fZone1Code.push_back(str); }
169 void addZone2 (
const string& str) { fZone2Code.push_back(str); }
170 void addZone2b (
const string& str) { fZone2bCode.push_back(str); }
171 void addZone2c (
const string& str) { fZone2cCode.push_back(str); }
172 void addZone3 (
const string& str) { fZone3Code.push_back(str); }
174 void addPreCode (
const string& str) { fTopLoop->addPreCode(str); }
175 void addExecCode (
const string& str) { fTopLoop->addExecCode(str); }
176 void addPostCode (
const string& str) { fTopLoop->addPostCode(str); }
178 virtual void println(
int n, ostream& fout);
180 virtual void printComputeMethod (
int n, ostream& fout);
181 virtual void printComputeMethodScalar (
int n, ostream& fout);
182 virtual void printComputeMethodVectorFaster (
int n, ostream& fout);
183 virtual void printComputeMethodVectorSimple (
int n, ostream& fout);
184 virtual void printComputeMethodOpenMP (
int n, ostream& fout);
185 virtual void printComputeMethodScheduler (
int n, ostream& fout);
187 virtual void printLoopGraphScalar(
int n, ostream& fout);
188 virtual void printLoopGraphVector(
int n, ostream& fout);
189 virtual void printLoopGraphOpenMP(
int n, ostream& fout);
190 virtual void printLoopGraphScheduler(
int n, ostream& fout);
191 virtual void printLoopGraphInternal(
int n, ostream& fout);
192 virtual void printGraphDotFormat(ostream& fout);
195 virtual void printLoopDeepFirst(
int n, ostream& fout,
Loop* l, set<Loop*>& visited);
197 virtual void printLastLoopLevelScheduler(
int n,
int lnum,
const lset& L, ostream& fout);
198 virtual void printLoopLevelScheduler(
int n,
int lnum,
const lset& L, ostream& fout);
199 virtual void printOneLoopScheduler(lset::const_iterator p,
int n, ostream& fout);
200 virtual void printLoopLevelOpenMP(
int n,
int lnum,
const lset& L, ostream& fout);
202 virtual void printMetadata(
int n,
const map<
Tree, set<Tree> >& S, ostream& fout);
204 virtual void printIncludeFile(ostream& fout);
206 virtual void printLibrary(ostream& fout);
207 virtual void printAdditionalCode(ostream& fout);
219 virtual void println(
int n, ostream& fout);
228 virtual void println(
int n, ostream& fout);
void addSharedDecl(const string &str)
void addZone2c(const string &str)
void addLibrary(const string &str)
void addIncludeFile(const string &str)
Loop * fTopLoop
active loops currently open
string getFullClassName()
Returns the name of the class.
list< string > fZone3Code
private every sub block
list< string > fZone2Code
first private
void addExecCode(const string &str)
list< string > fZone2bCode
single once per block
A CTree = (Node x [CTree]) is a Node associated with a list of subtrees called branches.
void addStaticInitCode(const string &str)
static bool fNeedPowerDef
true when faustpower definition is needed
list< string > fStaticFields
static fields after class
Klass(const string &name, const string &super, int numInputs, int numOutputs, bool __vec=false)
SigIntGenKlass(Klass *parent, const string &name)
void addZone2b(const string &str)
list< string > fZone2cCode
single once per block
void addInitCode(const string &str)
void addUIMacro(const string &str)
int fNumActives
number of active controls in the UI (sliders, buttons, etc.)
void addSubKlass(Klass *son)
void addFirstPrivateDecl(const string &str)
const string & getClassName() const
Returns the name of the class.
list< string > fFirstPrivateDecl
first private declarations
void addPreCode(const string &str)
void addZone2(const string &str)
set< string > fLibrarySet
list< string > fSharedDecl
shared declarations
void addStaticFields(const string &str)
int fNumPassives
number of passive widgets in the UI (bargraphs, etc.)
Klass * getTopParentKlass()
SigFloatGenKlass(Klass *parent, const string &name)
void setParentKlass(Klass *parent)
void addZone1(const string &str)
Klass * fParentKlass
Klass in which this Klass is embedded, void if toplevel Klass.
const char * name(Symbol *sym)
Returns the name of a symbol.
void rememberNeedPowerDef()
void addPostCode(const string &str)
void addUICode(const string &str)
list< string > fStaticInitCode
static init code for class constant tables
property< Loop * > fLoopProperty
loops used to compute some signals
list< Klass * > fSubClassList
set< string > fIncludeFileSet
void addZone3(const string &str)
list< string > fZone1Code
shared vectors
void addDeclCode(const string &str)