#include "tlib.hh"
#include "binop.hh"
#include <assert.h>
#include <vector>
Go to the source code of this file.
Definition at line 290 of file signals.cpp.
References addNode(), CTree::node(), and tree().
Referenced by mterm::operator+=(), and simplifyingAdd().
00291 { 00292 Tree r = tree(addNode(a->node(),b->node())); 00293 //cerr.flags(ios::showpoint); cerr << "addNums " << *a << "+" << *b << " -> " << *r << endl; 00294 return r; 00295 }
Definition at line 318 of file signals.cpp.
References divExtendedNode(), CTree::node(), and tree().
Referenced by mterm::operator/=().
00319 { 00320 Tree r = tree(divExtendedNode(a->node(),b->node())); 00321 //cerr.flags(ios::showpoint); cerr << "divExtendeNums " << *a << "/" << *b << " -> " << *r << endl; 00322 return r; 00323 }
Definition at line 311 of file signals.cpp.
References divNode(), CTree::node(), and tree().
00312 { 00313 Tree r = tree(divNode(a->node(),b->node())); 00314 //cerr.flags(ios::showpoint); cerr << "divNums " << *a << "/" << *b << " -> " << *r << endl; 00315 return r; 00316 }
Extract the sub signals of a signal expression, that is not necesseraly all the subtrees.
sig | the signals | |
vsigs | a reference to the vector where the subsignals will be placed |
Definition at line 10 of file subsignals.cpp.
References CTree::arity(), CTree::branch(), getUserData(), hd(), isList(), isNil(), isProj(), isRec(), isSigAttach(), isSigBinOp(), isSigButton(), isSigCheckbox(), isSigDelay1(), isSigDocAccessTbl(), isSigDocConstantTbl(), isSigDocWriteTbl(), isSigFConst(), isSigFFun(), isSigFixDelay(), isSigFloatCast(), isSigFVar(), isSigGen(), isSigHBargraph(), isSigHSlider(), isSigInput(), isSigInt(), isSigIntCast(), isSigIota(), isSigNumEntry(), isSigOutput(), isSigPrefix(), isSigRDTbl(), isSigReal(), isSigSelect2(), isSigSelect3(), isSigTable(), isSigVBargraph(), isSigVSlider(), isSigWRTbl(), name(), and tl().
Referenced by annotate(), colorize(), OccMarkup::incOcc(), listMultiColoredExp(), ScalarCompiler::sharingAnnotation(), DocCompiler::sharingAnnotation(), and uncolorize().
00011 { 00012 vsigs.clear(); 00013 00014 int i; 00015 double r; 00016 Tree c, sel, x, y, z, u, v, var, le, label, id, ff, largs, type, name, file; 00017 00018 if ( getUserData(sig) ) { for (int i=0; i<sig->arity(); i++) { vsigs.push_back(sig->branch(i)); } 00019 return sig->arity(); } 00020 else if ( isSigInt(sig, &i) ) { return 0; } 00021 else if ( isSigReal(sig, &r) ) { return 0; } 00022 else if ( isSigInput(sig, &i) ) { return 0; } 00023 else if ( isSigOutput(sig, &i, x) ) { vsigs.push_back(x); return 1; } 00024 00025 else if ( isSigDelay1(sig, x) ) { vsigs.push_back(x); return 1; } 00026 00027 else if ( isSigFixDelay(sig, x, y) ) { vsigs.push_back(x); vsigs.push_back(y); return 2; } 00028 else if ( isSigPrefix(sig, x, y) ) { vsigs.push_back(x); vsigs.push_back(y); return 2; } 00029 else if ( isSigIota(sig, x) ) { vsigs.push_back(x); return 1; } 00030 00031 else if ( isSigBinOp(sig, &i, x, y) ) { vsigs.push_back(x); vsigs.push_back(y); return 2; } 00032 else if ( isSigFFun(sig, ff, largs) ) { int n = 0; while (!isNil(largs)) { vsigs.push_back(hd(largs)); largs = tl(largs); n++; } return n; } 00033 else if ( isSigFConst(sig, type, name, file) ) { return 0; } 00034 else if ( isSigFVar(sig, type, name, file) ) { return 0; } 00035 00036 else if ( isSigTable(sig, id, x, y) ) { vsigs.push_back(x); vsigs.push_back(y); return 2; } 00037 else if ( isSigWRTbl(sig, id, x, y, z) ) { vsigs.push_back(x); vsigs.push_back(y); vsigs.push_back(z); return 3; } 00038 else if ( isSigRDTbl(sig, x, y) ) { vsigs.push_back(x); vsigs.push_back(y); return 2; } 00039 00040 else if ( isSigDocConstantTbl(sig, x, y) ) { vsigs.push_back(x); vsigs.push_back(y); return 2; } 00041 else if ( isSigDocWriteTbl(sig, x, y, u, v) ) { vsigs.push_back(x); vsigs.push_back(y); vsigs.push_back(u); vsigs.push_back(v); return 4; } 00042 else if ( isSigDocAccessTbl(sig, x, y) ) { vsigs.push_back(x); vsigs.push_back(y); return 2; } 00043 00044 00045 else if ( isSigSelect2(sig, sel, x, y) ) { vsigs.push_back(sel); vsigs.push_back(x); vsigs.push_back(y); return 3; } 00046 else if ( isSigSelect3(sig, sel, x, y, z) ) { vsigs.push_back(sel); vsigs.push_back(x); vsigs.push_back(y); vsigs.push_back(z); return 4; } 00047 00048 else if ( isSigGen(sig, x) ) { if (visitgen) { vsigs.push_back(x); return 1;} else { return 0; } } 00049 00050 else if ( isProj(sig, &i, x) ) { vsigs.push_back(x); return 1; } 00051 else if ( isRec(sig, var, le) ) { vsigs.push_back(le); return 1; } 00052 00053 else if ( isSigIntCast(sig, x) ) { vsigs.push_back(x); return 1; } 00054 else if ( isSigFloatCast(sig, x) ) { vsigs.push_back(x); return 1; } 00055 00056 else if ( isSigButton(sig, label) ) { return 0; } 00057 else if ( isSigCheckbox(sig, label) ) { return 0; } 00058 else if ( isSigVSlider(sig, label,c,x,y,z) ) { return 0; } 00059 else if ( isSigHSlider(sig, label,c,x,y,z) ) { return 0; } 00060 else if ( isSigNumEntry(sig, label,c,x,y,z) ) { return 0; } 00061 00062 else if ( isSigVBargraph(sig, label,x,y,z) ) { vsigs.push_back(z); return 1; } 00063 else if ( isSigHBargraph(sig, label,x,y,z) ) { vsigs.push_back(z); return 1; } 00064 else if ( isSigAttach(sig, x, y) ) { vsigs.push_back(x); vsigs.push_back(y); return 2; } 00065 else if ( isList(sig) ) { int n = 0; while (!isNil(sig)) { vsigs.push_back(hd(sig)); sig = tl(sig); n++; } return n; } 00066 00067 else { 00068 cerr << "ERROR, unrecognized signal : " << *sig << endl; 00069 exit(1); 00070 } 00071 return 0; 00072 }
Definition at line 332 of file signals.cpp.
References inverseNode(), CTree::node(), and tree().
00333 { 00334 Tree r = tree(inverseNode(a->node())); 00335 //cerr.flags(ios::showpoint); cerr << "inverseNum " << *a << " -> " << *r << endl; 00336 return r; 00337 }
bool isGEZero | ( | Tree | a | ) | [inline] |
Definition at line 187 of file signals.hh.
References CTree::node().
Referenced by mterm::isNegative().
bool isGTZero | ( | Tree | a | ) | [inline] |
Definition at line 186 of file signals.hh.
References CTree::node().
bool isMinusOne | ( | Tree | a | ) | [inline] |
Definition at line 189 of file signals.hh.
References CTree::node().
Referenced by mterm::normalizedTree().
00189 { assert(a); return isMinusOne(a->node()); }
Definition at line 195 of file signals.hh.
References isDouble(), isInt(), and CTree::node().
00196 { 00197 double f; 00198 int i; 00199 00200 if (isDouble(t->node(), &f)) { n = f; return true; } 00201 if (isInt(t->node(), &i)) { n = i; return true; } 00202 return false; 00203 }
bool isNum | ( | Tree | a | ) | [inline] |
Definition at line 184 of file signals.hh.
References CTree::node().
Referenced by TanPrim::computeSigOutput(), SqrtPrim::computeSigOutput(), SinPrim::computeSigOutput(), RintPrim::computeSigOutput(), RemainderPrim::computeSigOutput(), PowPrim::computeSigOutput(), LogPrim::computeSigOutput(), Log10Prim::computeSigOutput(), FmodPrim::computeSigOutput(), FloorPrim::computeSigOutput(), ExpPrim::computeSigOutput(), CosPrim::computeSigOutput(), CeilPrim::computeSigOutput(), AtanPrim::computeSigOutput(), Atan2Prim::computeSigOutput(), AsinPrim::computeSigOutput(), AcosPrim::computeSigOutput(), mterm::operator*=(), mterm::operator/=(), simplification(), and simplifyingAdd().
bool isOne | ( | Tree | a | ) | [inline] |
Definition at line 188 of file signals.hh.
References CTree::node().
Referenced by mterm::complexity(), mterm::normalizedTree(), and mterm::print().
Definition at line 151 of file signals.cpp.
References isInt(), isTree(), and CTree::node().
Referenced by VectorCompiler::CS(), DocCompiler::generateCode(), VectorCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), VectorCompiler::needSeparateLoop(), normalizeFixedDelayTerm(), ppsig::print(), printSignal(), and sigvisitor::visit().
Definition at line 339 of file signals.cpp.
References isSigBinOp(), and kAdd.
00340 { 00341 int op; 00342 return isSigBinOp(a, &op, x, y) && (op == kAdd); 00343 }
Definition at line 286 of file signals.cpp.
References isTree().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), printSignal(), and sigvisitor::visit().
bool isSigAttach | ( | Tree | s | ) |
Definition at line 126 of file signals.cpp.
References isInt(), isTree(), and CTree::node().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), isSigAdd(), isSigDiv(), isSigMul(), isSigSub(), mterm::operator*=(), aterm::operator+=(), aterm::operator-=(), mterm::operator/=(), ppsig::print(), printSignal(), simplification(), and sigvisitor::visit().
Definition at line 200 of file signals.cpp.
References isTree().
bool isSigButton | ( | Tree | s | ) |
Definition at line 199 of file signals.cpp.
References isTree().
Referenced by Description::addWidget(), DocCompiler::generateCode(), ScalarCompiler::generateCode(), Compiler::generateWidgetCode(), Compiler::generateWidgetMacro(), getSubSignals(), infereSigOrder(), infereSigType(), isVerySimpleFormula(), ppsig::print(), and sigvisitor::visit().
Definition at line 206 of file signals.cpp.
References isTree().
00206 { return isTree(s, SIGCHECKBOX, lbl); }
bool isSigCheckbox | ( | Tree | s | ) |
Definition at line 205 of file signals.cpp.
References isTree().
Referenced by Description::addWidget(), DocCompiler::generateCode(), ScalarCompiler::generateCode(), Compiler::generateWidgetCode(), Compiler::generateWidgetMacro(), getSubSignals(), infereSigOrder(), infereSigType(), isVerySimpleFormula(), ppsig::print(), and sigvisitor::visit().
00205 { Tree lbl; return isTree(s, SIGCHECKBOX, lbl); }
Definition at line 58 of file signals.cpp.
References isTree().
Referenced by getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), printSignal(), simplification(), and sigvisitor::visit().
Definition at line 357 of file signals.cpp.
References isSigBinOp(), and kDiv.
Referenced by normalizeFixedDelayTerm().
00358 { 00359 int op; 00360 return isSigBinOp(a, &op, x, y) && (op == kDiv); 00361 }
Definition at line 107 of file signals.cpp.
References isTree().
Referenced by DocCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), printSignal(), and sigvisitor::visit().
00107 { return isTree(t, SIGDOCACCESSTBL, tbl, ridx); }
Definition at line 99 of file signals.cpp.
References isTree().
Referenced by DocCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), printSignal(), and sigvisitor::visit().
00099 { return isTree(t, SIGDOCONSTANTTBL, n, sig); }
Definition at line 103 of file signals.cpp.
References isTree().
Referenced by DocCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), printSignal(), and sigvisitor::visit().
00103 { return isTree(t, SIGDOCWRITETBL, n, sig, widx, wsig); }
Definition at line 139 of file signals.cpp.
References isTree().
bool isSigFConst | ( | Tree | s | ) |
Definition at line 138 of file signals.cpp.
References isTree().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), isVerySimpleFormula(), ppsig::print(), verySimple(), and sigvisitor::visit().
Definition at line 133 of file signals.cpp.
References isTree().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), and sigvisitor::visit().
Definition at line 62 of file signals.cpp.
References isTree().
Referenced by VectorCompiler::CS(), DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), OccMarkup::incOcc(), infereSigOrder(), infereSigType(), VectorCompiler::needSeparateLoop(), normalizeFixedDelayTerm(), ppsig::print(), printSignal(), setSigNickname(), simplification(), and sigvisitor::visit().
00062 { return isTree(t, SIGFIXDELAY, t0, t1); }
Definition at line 188 of file signals.cpp.
References isTree().
00188 { return isTree(t, SIGFLOATCAST, x); }
bool isSigFloatCast | ( | Tree | t | ) |
Definition at line 187 of file signals.cpp.
References isTree().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), printSignal(), sigFloatCast(), simplification(), and sigvisitor::visit().
00187 { Tree x; return isTree(t, SIGFLOATCAST, x);}
Definition at line 145 of file signals.cpp.
References isTree().
bool isSigFVar | ( | Tree | s | ) |
Definition at line 144 of file signals.cpp.
References isTree().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), and sigvisitor::visit().
bool isSigGen | ( | Tree | t | ) |
Definition at line 92 of file signals.cpp.
References CTree::node().
Definition at line 91 of file signals.cpp.
References isTree().
Referenced by computePrivatisation(), docTableConverter(), ScalarCompiler::generateCode(), ScalarCompiler::generateStaticTable(), getSubSignals(), OccMarkup::incOcc(), infereSigOrder(), infereSigType(), ppsig::print(), printSignal(), ScalarCompiler::sharingAnnotation(), DocCompiler::sharingAnnotation(), and sigvisitor::visit().
Definition at line 275 of file signals.cpp.
References isTree().
00275 { return isTree(s, SIGHBARGRAPH, lbl, min, max, x); }
bool isSigHBargraph | ( | Tree | s | ) |
Definition at line 274 of file signals.cpp.
References isTree(), max(), and min().
Referenced by Description::addWidget(), DocCompiler::generateCode(), ScalarCompiler::generateCode(), Compiler::generateWidgetCode(), Compiler::generateWidgetMacro(), getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), and sigvisitor::visit().
00274 { Tree lbl, min, max, x; return isTree(s, SIGHBARGRAPH, lbl, min, max, x); }
Definition at line 214 of file signals.cpp.
References isTree(), and nth().
00215 { 00216 Tree params; 00217 if (isTree(s, SIGHSLIDER, lbl, params)) { 00218 cur = nth(params, 0); 00219 min = nth(params, 1); 00220 max = nth(params, 2); 00221 step= nth(params, 3); 00222 return true; 00223 } else { 00224 return false; 00225 } 00226 }
bool isSigHSlider | ( | Tree | s | ) |
Definition at line 212 of file signals.cpp.
References isTree().
Referenced by Description::addWidget(), DocCompiler::generateCode(), ScalarCompiler::generateCode(), Compiler::generateWidgetCode(), Compiler::generateWidgetMacro(), getSubSignals(), infereSigOrder(), infereSigType(), isVerySimpleFormula(), ppsig::print(), and sigvisitor::visit().
00212 { Tree lbl, params; return isTree(s, SIGHSLIDER, lbl, params); }
bool isSigInput | ( | Tree | t, | |
int * | i | |||
) |
Definition at line 48 of file signals.cpp.
References isInt(), isTree(), and CTree::node().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), isVerySimpleFormula(), ppsig::print(), printSignal(), sigFloatCast(), verySimple(), and sigvisitor::visit().
bool isSigInt | ( | Tree | t, | |
int * | i | |||
) |
Definition at line 41 of file signals.cpp.
References isInt(), and CTree::node().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), DocCompiler::generateDocConstantTbl(), DocCompiler::generateDocWriteTbl(), DocCompiler::generateFixDelay(), VectorCompiler::generateFixDelay(), ScalarCompiler::generateFixDelay(), DocCompiler::generateIota(), ScalarCompiler::generateIota(), ScalarCompiler::generateStaticTable(), ScalarCompiler::generateTable(), getSubSignals(), infereSigOrder(), infereSigType(), isBoxNumeric(), isSigPow(), isVerySimpleFormula(), ppsig::print(), ppsig::printFixDelay(), printSignal(), replaceBoxNumeric(), verySimple(), and sigvisitor::visit().
Definition at line 185 of file signals.cpp.
References isTree().
00185 { return isTree(t, SIGINTCAST, x); }
bool isSigIntCast | ( | Tree | t | ) |
Definition at line 184 of file signals.cpp.
References isTree().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), printSignal(), sigIntCast(), simplification(), and sigvisitor::visit().
00184 { Tree x; return isTree(t, SIGINTCAST, x); }
Definition at line 70 of file signals.cpp.
References isTree().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), and ppsig::print().
Definition at line 345 of file signals.cpp.
References isSigBinOp(), and kMul.
Referenced by normalizeFixedDelayTerm().
00346 { 00347 int op; 00348 return isSigBinOp(a, &op, x, y) && (op == kMul); 00349 }
Definition at line 254 of file signals.cpp.
References isTree(), and nth().
00255 { 00256 Tree params; 00257 if (isTree(s, SIGNUMENTRY, lbl, params)) { 00258 cur = nth(params, 0); 00259 min = nth(params, 1); 00260 max = nth(params, 2); 00261 step= nth(params, 3); 00262 return true; 00263 } else { 00264 return false; 00265 } 00266 }
bool isSigNumEntry | ( | Tree | s | ) |
Definition at line 252 of file signals.cpp.
References isTree().
Referenced by Description::addWidget(), DocCompiler::generateCode(), ScalarCompiler::generateCode(), Compiler::generateWidgetCode(), Compiler::generateWidgetMacro(), getSubSignals(), infereSigOrder(), infereSigType(), isVerySimpleFormula(), ppsig::print(), and sigvisitor::visit().
00252 { Tree lbl, params; return isTree(s, SIGNUMENTRY, lbl, params); }
Definition at line 52 of file signals.cpp.
References isInt(), isTree(), and CTree::node().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), printSignal(), and sigvisitor::visit().
Definition at line 66 of file signals.cpp.
References isTree().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), OccMarkup::incOcc(), infereSigOrder(), infereSigType(), ppsig::print(), printSignal(), and sigvisitor::visit().
Definition at line 77 of file signals.cpp.
References isTree().
Referenced by docTableConverter(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), printSignal(), and sigvisitor::visit().
bool isSigReal | ( | Tree | t, | |
double * | r | |||
) |
Definition at line 44 of file signals.cpp.
References isDouble(), and CTree::node().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), isBoxNumeric(), isVerySimpleFormula(), ppsig::print(), printSignal(), replaceBoxNumeric(), verySimple(), and sigvisitor::visit().
Definition at line 116 of file signals.cpp.
References isTree().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), and sigvisitor::visit().
00116 { return isTree(t, SIGSELECT2, selector, s1, s2); }
Definition at line 119 of file signals.cpp.
References isTree().
Referenced by DocCompiler::generateCode(), ScalarCompiler::generateCode(), getSubSignals(), OccMarkup::incOcc(), infereSigOrder(), infereSigType(), ppsig::print(), ScalarCompiler::sharingAnnotation(), and sigvisitor::visit().
00119 { return isTree(t, SIGSELECT3, selector, s1, s2, s3); }
Definition at line 351 of file signals.cpp.
References isSigBinOp(), and kSub.
00352 { 00353 int op; 00354 return isSigBinOp(a, &op, x, y) && (op == kSub); 00355 }
Definition at line 85 of file signals.cpp.
References isTree().
Referenced by computePrivatisation(), docTableConverter(), ScalarCompiler::generateCode(), ScalarCompiler::generateRDTbl(), getSubSignals(), infereSigOrder(), infereSigType(), labelize(), ppsig::print(), printSignal(), and sigvisitor::visit().
Definition at line 375 of file signals.cpp.
References isInt(), isTree(), and CTree::node().
Referenced by sigCartesianProd(), and sigvisitor::visit().
Definition at line 380 of file signals.cpp.
References isTree().
Referenced by sigvisitor::visit().
00380 { return isTree(s, SIGTUPLEACCESS, ts, idx); }
Definition at line 281 of file signals.cpp.
References isTree().
00281 { return isTree(s, SIGVBARGRAPH, lbl, min, max, x); }
bool isSigVBargraph | ( | Tree | s | ) |
Definition at line 280 of file signals.cpp.
References isTree(), max(), and min().
Referenced by Description::addWidget(), DocCompiler::generateCode(), ScalarCompiler::generateCode(), Compiler::generateWidgetCode(), Compiler::generateWidgetMacro(), getSubSignals(), infereSigOrder(), infereSigType(), ppsig::print(), and sigvisitor::visit().
00280 { Tree lbl, min, max, x; return isTree(s, SIGVBARGRAPH, lbl, min, max, x); }
Definition at line 234 of file signals.cpp.
References isTree(), and nth().
00235 { 00236 Tree params; 00237 if (isTree(s, SIGVSLIDER, lbl, params)) { 00238 cur = nth(params, 0); 00239 min = nth(params, 1); 00240 max = nth(params, 2); 00241 step= nth(params, 3); 00242 return true; 00243 } else { 00244 return false; 00245 } 00246 }
bool isSigVSlider | ( | Tree | s | ) |
Definition at line 232 of file signals.cpp.
References isTree().
Referenced by Description::addWidget(), DocCompiler::generateCode(), ScalarCompiler::generateCode(), Compiler::generateWidgetCode(), Compiler::generateWidgetMacro(), getSubSignals(), infereSigOrder(), infereSigType(), isVerySimpleFormula(), ppsig::print(), and sigvisitor::visit().
00232 { Tree lbl, params; return isTree(s, SIGVSLIDER, lbl, params); }
Definition at line 81 of file signals.cpp.
References isTree().
Referenced by computePrivatisation(), docTableConverter(), ScalarCompiler::generateCode(), getSubSignals(), infereSigOrder(), infereSigType(), labelize(), ppsig::print(), printSignal(), and sigvisitor::visit().
bool isZero | ( | Tree | a | ) | [inline] |
Definition at line 185 of file signals.hh.
References CTree::node().
Referenced by mterm::cleanup(), mterm::isNotZero(), mterm::normalizedTree(), aterm::normalizedTree(), normalizeFixedDelayTerm(), mterm::operator+=(), mterm::operator-=(), setSigNickname(), and simplifyingAdd().
Definition at line 325 of file signals.cpp.
References minusNode(), CTree::node(), and tree().
Referenced by mterm::normalizedTree(), and mterm::operator-=().
00326 { 00327 Tree r = tree(minusNode(a->node())); 00328 //cerr.flags(ios::showpoint); cerr << "minusNum " << *a << " -> " << *r << endl; 00329 return r; 00330 }
Definition at line 304 of file signals.cpp.
References mulNode(), CTree::node(), and tree().
Referenced by mterm::operator*=().
00305 { 00306 Tree r = tree(mulNode(a->node(),b->node())); 00307 //cerr.flags(ios::showpoint); cerr << "mulNums " << *a << "*" << *b << " -> " << *r << endl; 00308 return r; 00309 }
Definition at line 148 of file signals.hh.
References kAdd, and sigBinOp().
Referenced by iterateSum(), mix(), normalizeFixedDelayTerm(), prim2name(), simplifyingAdd(), and yyparse().
Definition at line 154 of file signals.hh.
References kAND, and sigBinOp().
Referenced by prim2name(), and yyparse().
Definition at line 285 of file signals.cpp.
References tree().
Referenced by prim2name(), and yyparse().
Definition at line 125 of file signals.cpp.
References tree().
Referenced by sigAdd(), sigAND(), sigDiv(), sigEQ(), sigGE(), sigGT(), sigLE(), sigLeftShift(), sigLT(), sigMul(), sigNE(), sigOR(), sigRem(), sigRightShift(), sigSub(), and sigXOR().
Definition at line 198 of file signals.cpp.
References tree().
Referenced by propagate().
Definition at line 383 of file signals.cpp.
References concat(), isSigTuple(), list1(), and sigTuple().
00384 { 00385 Tree l1, l2; 00386 int m1, m2; 00387 00388 if (isSigTuple(s1, &m1, l1) && (m1 == 0)) { 00389 // nothing to do 00390 } else { 00391 l1 = list1(s1); 00392 } 00393 00394 if (isSigTuple(s2, &m2, l2) && (m2 == 0)) { 00395 // nothing to do 00396 } else { 00397 l2 = list1(s2); 00398 } 00399 00400 00401 return sigTuple(0, concat(l1,l2)); 00402 }
Definition at line 204 of file signals.cpp.
References tree().
Referenced by propagate().
00204 { return tree(SIGCHECKBOX, lbl); }
Definition at line 55 of file signals.cpp.
References sigFixDelay(), and sigInt().
Referenced by makeSigProjList().
00055 { return sigFixDelay(t0, sigInt(0));}
Definition at line 57 of file signals.cpp.
References tree().
Referenced by makeMemSigProjList(), prim1name(), and yyparse().
Definition at line 151 of file signals.hh.
References kDiv, and sigBinOp().
Referenced by combineDivLeft(), mterm::normalizedTree(), normalizeFixedDelayTerm(), prim2name(), and yyparse().
Definition at line 106 of file signals.cpp.
References tree().
Referenced by docTableConverter().
00106 { return tree(SIGDOCACCESSTBL, tbl, ridx); }
Definition at line 98 of file signals.cpp.
References tree().
Referenced by docTableConverter().
00098 { return tree(SIGDOCONSTANTTBL, n, sig); }
Definition at line 102 of file signals.cpp.
References tree().
Referenced by docTableConverter().
00102 { return tree(SIGDOCWRITETBL, n, sig, widx, wsig); }
Definition at line 165 of file signals.hh.
References kEQ, and sigBinOp().
Referenced by prim2name(), and yyparse().
Definition at line 137 of file signals.cpp.
References tree().
Referenced by propagate().
Definition at line 132 of file signals.cpp.
References tree().
Referenced by propagate().
Definition at line 61 of file signals.cpp.
References sigIntCast(), and tree().
Referenced by normalizeFixedDelayTerm(), prim2name(), sigDelay0(), and yyparse().
00061 { return tree(SIGFIXDELAY, t0, sigIntCast(t1)); }
Definition at line 170 of file signals.cpp.
References isDouble(), isInt(), isSigFloatCast(), isSigInput(), CTree::node(), and tree().
Referenced by prim1name(), and yyparse().
00171 { 00172 Node n = t->node(); 00173 00174 int i; if (isInt(n, &i)) return tree(double(i)); 00175 double x; if (isDouble(n, &x)) return t; 00176 if (isSigFloatCast(t)) return t; 00177 if (isSigInput(t, &i)) return t; 00178 00179 return tree(SIGFLOATCAST, t); 00180 }
Definition at line 143 of file signals.cpp.
References tree().
Referenced by propagate().
Definition at line 163 of file signals.hh.
References kGE, and sigBinOp().
Referenced by prim2name(), and yyparse().
Definition at line 90 of file signals.cpp.
References tree().
Referenced by sigReadOnlyTable(), and sigWriteReadTable().
Definition at line 161 of file signals.hh.
References kGT, and sigBinOp().
Referenced by prim2name(), and yyparse().
Definition at line 273 of file signals.cpp.
References tree().
Referenced by propagate().
00273 { return tree(SIGHBARGRAPH, lbl, min, max, x); }
Definition at line 210 of file signals.cpp.
References list4(), and tree().
Referenced by propagate().
00211 { return tree(SIGHSLIDER, lbl, list4(cur,min,max,step)); }
Tree sigInput | ( | int | i | ) |
Definition at line 47 of file signals.cpp.
References tree().
Referenced by makeSigInputList(), and propagate().
Tree sigInt | ( | int | i | ) |
Signals Block-diagrams are converted into signal expressions via symbolic propagation.
Definition at line 40 of file signals.cpp.
References tree().
Referenced by mix(), propagate(), sigDelay0(), and sigPow().
00040 { return tree(i); }
Definition at line 159 of file signals.cpp.
References isDouble(), isInt(), isSigIntCast(), CTree::node(), and tree().
Referenced by prim1name(), sigFixDelay(), sigSelect2(), sigSelect3(), and yyparse().
00160 { 00161 Node n = t->node(); 00162 00163 int i; if (isInt(n, &i)) return t; 00164 double x; if (isDouble(n, &x)) return tree(int(x)); 00165 if (isSigIntCast(t)) return t; 00166 00167 return tree(SIGINTCAST, t); 00168 }
Definition at line 69 of file signals.cpp.
References tree().
Definition at line 164 of file signals.hh.
References kLE, and sigBinOp().
Referenced by prim2name(), and yyparse().
Definition at line 158 of file signals.hh.
References kLsh, and sigBinOp().
Referenced by prim2name(), and yyparse().
Definition at line 162 of file signals.hh.
References kLT, and sigBinOp().
Referenced by prim2name(), and yyparse().
Definition at line 150 of file signals.hh.
References kMul, and sigBinOp().
Referenced by combineMulLeft(), aterm::factorize(), iterateProd(), normalizeFixedDelayTerm(), prim2name(), and yyparse().
Definition at line 166 of file signals.hh.
References kNE, and sigBinOp().
Referenced by prim2name(), and yyparse().
Definition at line 250 of file signals.cpp.
References list4(), and tree().
Referenced by propagate().
00251 { return tree(SIGNUMENTRY, lbl, list4(cur,min,max,step)); }
Definition at line 155 of file signals.hh.
References kOR, and sigBinOp().
Referenced by prim2name(), and yyparse().
Definition at line 65 of file signals.cpp.
References tree().
Referenced by applyList(), prim2name(), and yyparse().
Definition at line 150 of file signals.cpp.
References tree().
Referenced by DocCompiler::generateRec(), ScalarCompiler::generateRec(), makeMemSigProjList(), and makeSigProjList().
Definition at line 76 of file signals.cpp.
References tree().
Referenced by sigReadOnlyTable(), and sigWriteReadTable().
Definition at line 100 of file signals.hh.
References nil, sigGen(), sigRDTbl(), and sigTable().
Referenced by prim3name(), and yyparse().
Tree sigReal | ( | double | n | ) |
Definition at line 43 of file signals.cpp.
References tree().
Referenced by propagate().
00043 { return tree(r); }
Definition at line 152 of file signals.hh.
References kRem, and sigBinOp().
Referenced by prim2name(), and yyparse().
Definition at line 159 of file signals.hh.
References kRsh, and sigBinOp().
Referenced by prim2name(), and yyparse().
Definition at line 115 of file signals.cpp.
References sigIntCast(), and tree().
Referenced by prim3name(), and yyparse().
00115 { return tree(SIGSELECT2, sigIntCast(selector), s1, s2); }
Definition at line 118 of file signals.cpp.
References sigIntCast(), and tree().
Referenced by prim4name(), and yyparse().
00118 { return tree(SIGSELECT3, sigIntCast(selector), s1, s2, s3); }
Definition at line 149 of file signals.hh.
References kSub, and sigBinOp().
Referenced by aterm::normalizedTree(), prim2name(), and yyparse().
Definition at line 84 of file signals.cpp.
References tree().
Referenced by labelize(), sigReadOnlyTable(), and sigWriteReadTable().
Definition at line 374 of file signals.cpp.
References tree().
Referenced by sigCartesianProd().
Definition at line 379 of file signals.cpp.
References tree().
00379 { return tree(SIGTUPLEACCESS, ts, idx); }
Definition at line 279 of file signals.cpp.
References tree().
Referenced by propagate().
00279 { return tree(SIGVBARGRAPH, lbl, min, max, x); }
Definition at line 230 of file signals.cpp.
References list4(), and tree().
Referenced by propagate().
00231 { return tree(SIGVSLIDER, lbl, list4(cur,min,max,step)); }
Definition at line 95 of file signals.hh.
References nil, sigGen(), sigRDTbl(), sigTable(), and sigWRTbl().
Referenced by prim5name(), and yyparse().
00096 { 00097 return sigRDTbl(sigWRTbl(nil, sigTable(nil, n, sigGen(init)), widx, wsig), ridx); 00098 }
Definition at line 80 of file signals.cpp.
References tree().
Referenced by computePrivatisation(), labelize(), and sigWriteReadTable().
Definition at line 156 of file signals.hh.
References kXOR, and sigBinOp().
Referenced by prim2name(), and yyparse().
Definition at line 297 of file signals.cpp.
References CTree::node(), subNode(), and tree().
Referenced by mterm::operator-=().
00298 { 00299 Tree r = tree(subNode(a->node(),b->node())); 00300 //cerr.flags(ios::showpoint); cerr << "subNums " << *a << "-" << *b << " -> " << *r << endl; 00301 return r; 00302 }
bool verySimple | ( | Tree | exp | ) |
Test if exp is very simple that is it can't be considered a real component.
exp | the signal we want to test |
Definition at line 412 of file signals.cpp.
References isSigFConst(), isSigInput(), isSigInt(), isSigReal(), and name().
Referenced by VectorCompiler::generateCacheCode(), VectorCompiler::generateDelayVec(), and VectorCompiler::needSeparateLoop().
00413 { 00414 int i; 00415 double r; 00416 Tree type, name, file; 00417 00418 return isSigInt(exp, &i) 00419 || isSigReal(exp, &r) 00420 || isSigInput(exp, &i) 00421 || isSigFConst(exp, type, name, file); 00422 }