mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Internals: Fix cppcheck warnings. No functional change.
This commit is contained in:
parent
f71d904a9b
commit
5de83c9805
@ -472,7 +472,7 @@ Verilator will mark the signal as clocker and propagate the clocker attribute
|
||||
automatically to other signals derived from that. In this way, Verilator will
|
||||
try to avoid taking the clocker signal into checking list.
|
||||
|
||||
Note signal-name is specified by the RTL hiearchy path. For example, v.foo.bar.
|
||||
Note signal-name is specified by the RTL hierarchy path. For example, v.foo.bar.
|
||||
If the signal is the input to top-module, the directly the signal name. If you
|
||||
find it difficult to find the exact name, try to use C</*verilator clocker*/> in
|
||||
RTL file to mark the signal directly.
|
||||
|
@ -225,7 +225,7 @@ inline VerilatedSerialize& operator<<(VerilatedSerialize& os, string& rhs) {
|
||||
return os.write(rhs.data(), len);
|
||||
}
|
||||
inline VerilatedDeserialize& operator>>(VerilatedDeserialize& os, string& rhs) {
|
||||
vluint32_t len;
|
||||
vluint32_t len=0;
|
||||
os>>len;
|
||||
rhs.resize(len);
|
||||
return os.read((void*)rhs.data(), len);
|
||||
|
@ -318,7 +318,6 @@ class VerilatedVpi {
|
||||
|
||||
struct product_info {
|
||||
PLI_BYTE8* product;
|
||||
PLI_BYTE8* version;
|
||||
};
|
||||
|
||||
VpioCbList m_cbObjLists[CB_ENUM_MAX_VALUE]; // Callbacks for each supported reason
|
||||
|
@ -363,7 +363,7 @@ private:
|
||||
}
|
||||
return out;
|
||||
}
|
||||
// cppcheck-suppress unusedFunction
|
||||
// cppcheck-suppress unusedFunction unusedPrivateFunction
|
||||
string readFilterLine() {
|
||||
// Slow, but we don't need it much
|
||||
UINFO(9,"readFilterLine\n");
|
||||
@ -381,7 +381,7 @@ private:
|
||||
UINFO(6,"filter-line-in: "<<line);
|
||||
return line;
|
||||
}
|
||||
// cppcheck-suppress unusedFunction
|
||||
// cppcheck-suppress unusedFunction unusedPrivateFunction
|
||||
void writeFilter(const string& out) {
|
||||
if (debug()>=6) { UINFO(6,"filter-out: "<<out); if (out[out.length()-1]!='\n') cout<<endl; }
|
||||
if (!m_pid) { v3error("--pipe-filter: write to closed file\n"); m_readEof = true; stop(); }
|
||||
|
@ -446,17 +446,19 @@ class SliceVisitor : public AstNVisitor {
|
||||
if ((int)(dim - varDim.second) < 0) {
|
||||
// Unpacked dimensions are referenced first, make sure we have them all
|
||||
nodep->v3error("Unary operator used across unpacked dimensions");
|
||||
} else if ((int)(dim - (varDim.second)) < 0) {
|
||||
// Implicit packed dimensions are allowed, make them explicit
|
||||
uint32_t newDim = (varDim.second) - dim;
|
||||
AstNode* clonep = nodep->lhsp()->cloneTree(false);
|
||||
clonep->user1p(refp);
|
||||
AstNode* newp = insertImplicit(clonep, dim+1, newDim);
|
||||
nodep->lhsp()->replaceWith(newp); refp = NULL;
|
||||
int clones = countClones(nodep->lhsp()->castArraySel());
|
||||
nodep->user2(clones);
|
||||
SliceCloneVisitor scv(nodep);
|
||||
}
|
||||
//Dead code
|
||||
//else if ((int)(dim - (varDim.second)) < 0) {
|
||||
// // Implicit packed dimensions are allowed, make them explicit
|
||||
// uint32_t newDim = (varDim.second) - dim;
|
||||
// AstNode* clonep = nodep->lhsp()->cloneTree(false);
|
||||
// clonep->user1p(refp);
|
||||
// AstNode* newp = insertImplicit(clonep, dim+1, newDim);
|
||||
// nodep->lhsp()->replaceWith(newp); VL_DANGLING(refp);
|
||||
// int clones = countClones(nodep->lhsp()->castArraySel());
|
||||
// nodep->user2(clones);
|
||||
// SliceCloneVisitor scv(nodep);
|
||||
//}
|
||||
}
|
||||
}
|
||||
virtual void visit(AstRedOr* nodep, AstNUser*) {
|
||||
|
@ -2820,6 +2820,7 @@ private:
|
||||
underp = underp->acceptSubtreeReturnEdits(*this,WidthVP(SELF,PRELIM).p());
|
||||
AstNodeDType* expDTypep = underp->findUInt32DType();
|
||||
underp = iterateCheck(nodep,"file_descriptor",underp,SELF,FINAL,expDTypep,EXTEND_EXP);
|
||||
if (underp) {} // cppcheck
|
||||
}
|
||||
void iterateCheckReal (AstNode* nodep, const char* side, AstNode* underp, Stage stage) {
|
||||
// Coerce child to real if not already. Child is self-determined
|
||||
@ -2835,6 +2836,7 @@ private:
|
||||
AstNodeDType* expDTypep = nodep->findDoubleDType();
|
||||
underp = iterateCheck(nodep,side,underp,SELF,FINAL,expDTypep,EXTEND_EXP);
|
||||
}
|
||||
if (underp) {} // cppcheck
|
||||
}
|
||||
void iterateCheckString (AstNode* nodep, const char* side, AstNode* underp, Stage stage) {
|
||||
if (stage & PRELIM) {
|
||||
@ -2844,6 +2846,7 @@ private:
|
||||
AstNodeDType* expDTypep = nodep->findStringDType();
|
||||
underp = iterateCheck(nodep,side,underp,SELF,FINAL,expDTypep,EXTEND_EXP);
|
||||
}
|
||||
if (underp) {} // cppcheck
|
||||
}
|
||||
void iterateCheckSizedSelf (AstNode* nodep, const char* side, AstNode* underp,
|
||||
Determ determ, Stage stage) {
|
||||
@ -2856,6 +2859,7 @@ private:
|
||||
underp = checkCvtUS(underp);
|
||||
AstNodeDType* expDTypep = underp->dtypep();
|
||||
underp = iterateCheck(nodep,side,underp,SELF,FINAL,expDTypep,EXTEND_EXP);
|
||||
if (underp) {} // cppcheck
|
||||
}
|
||||
void iterateCheckAssign(AstNode* nodep, const char* side,
|
||||
AstNode* rhsp, Stage stage, AstNodeDType* lhsDTypep) {
|
||||
@ -2867,6 +2871,7 @@ private:
|
||||
&& nodep->castNodeAssign()->lhsp()->castNodeStream());
|
||||
rhsp = iterateCheck(nodep,side,rhsp,ASSIGN,FINAL,lhsDTypep,lhsStream?EXTEND_OFF:EXTEND_LHS);
|
||||
//if (debug()) nodep->dumpTree(cout,"-checkout: ");
|
||||
if (rhsp) {} // cppcheck
|
||||
}
|
||||
|
||||
void iterateCheckBool (AstNode* nodep, const char* side, AstNode* underp, Stage stage) {
|
||||
|
@ -70,6 +70,8 @@ sub process {
|
||||
# Output
|
||||
if ($line =~ /^cppcheck --/) {
|
||||
print $line if $Debug;
|
||||
} elsif ($line =~ m!^\d+/\d+ files checked!) {
|
||||
print $line;
|
||||
} else {
|
||||
my $suppress;
|
||||
if ($line =~ /file="([^"]+)"\s+line="(\d+)"\s+id="([^"]+)"/) {
|
||||
|
Loading…
Reference in New Issue
Block a user