本文整理汇总了C++中AstVar::isParam方法的典型用法代码示例。如果您正苦于以下问题:C++ AstVar::isParam方法的具体用法?C++ AstVar::isParam怎么用?C++ AstVar::isParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AstVar
的用法示例。
在下文中一共展示了AstVar::isParam方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: warnAlwCombOrder
void warnAlwCombOrder(AstVarRef* nodep) {
AstVar* varp = nodep->varp();
if (!varp->isParam() && !varp->isGenVar() && !varp->isUsedLoopIdx()
&& !varp->fileline()->warnIsOff(V3ErrorCode::ALWCOMBORDER)) { // Warn only once per variable
nodep->v3warn(ALWCOMBORDER, "Always_comb variable driven after use: "<<nodep->prettyName());
varp->fileline()->modifyWarnOff(V3ErrorCode::ALWCOMBORDER, true); // Complain just once for any usage
}
}
示例2: reportViolations
void reportViolations() {
// Combine bits into overall state
AstVar* nodep = m_varp;
if (!nodep->isParam() && !nodep->isGenVar()) {
bool allU=true;
bool allD=true;
bool anyU=m_usedWhole;
bool anyD=m_drivenWhole;
bool anyUnotD=false;
bool anyDnotU=false;
bool anynotDU=false;
for (unsigned bit=0; bit<m_flags.size()/FLAGS_PER_BIT; bit++) {
bool used = usedFlag(bit);
bool driv = drivenFlag(bit);
allU &= used;
anyU |= used;
allD &= driv;
anyD |= driv;
anyUnotD |= used && !driv;
anyDnotU |= !used && driv;
anynotDU |= !used && !driv;
}
if (allU) m_usedWhole = true;
if (allD) m_drivenWhole = true;
// Test results
if (allU && allD) {
// It's fine
} else if (!anyD && !anyU) {
// UNDRIVEN is considered more serious - as is more likely a bug,
// thus undriven+unused bits get UNUSED warnings, as they're not as buggy.
if (!unusedMatch(nodep)) {
nodep->v3warn(UNUSED, "Signal is not driven, nor used: "<<nodep->prettyName());
nodep->fileline()->modifyWarnOff(V3ErrorCode::UNUSED, true); // Warn only once
}
} else if (allD && !anyU) {
if (!unusedMatch(nodep)) {
nodep->v3warn(UNUSED, "Signal is not used: "<<nodep->prettyName());
nodep->fileline()->modifyWarnOff(V3ErrorCode::UNUSED, true); // Warn only once
}
} else if (!anyD && allU) {
nodep->v3warn(UNDRIVEN, "Signal is not driven: "<<nodep->prettyName());
nodep->fileline()->modifyWarnOff(V3ErrorCode::UNDRIVEN, true); // Warn only once
} else {
// Bits have different dispositions
bool setU=false;
bool setD=false;
if (anynotDU && !unusedMatch(nodep)) {
nodep->v3warn(UNUSED, "Bits of signal are not driven, nor used: "<<nodep->prettyName()
<<bitNames(BN_BOTH));
setU=true;
}
if (anyDnotU && !unusedMatch(nodep)) {
nodep->v3warn(UNUSED, "Bits of signal are not used: "<<nodep->prettyName()
<<bitNames(BN_UNUSED));
setU=true;
}
if (anyUnotD) {
nodep->v3warn(UNDRIVEN, "Bits of signal are not driven: "<<nodep->prettyName()
<<bitNames(BN_UNDRIVEN));
setD=true;
}
if (setU) nodep->fileline()->modifyWarnOff(V3ErrorCode::UNUSED, true); // Warn only once
if (setD) nodep->fileline()->modifyWarnOff(V3ErrorCode::UNDRIVEN, true); // Warn only once
}
}
}