diff --git a/bin/verilator b/bin/verilator index e0f000a35..c57f7c2c5 100755 --- a/bin/verilator +++ b/bin/verilator @@ -1500,8 +1500,12 @@ silicon. =item How do I generate waveforms (traces)? Add the --trace switch to Verilator, and make sure the SystemPerl package -is installed (SystemC itself isn't required for C++ only tracing.) In your -top level C code, call Verilated::traceEverOn(true). +is installed (SystemC itself does not need to be installed for C++ only +tracing. You do not even need to compile SystemPerl; you may simply untar +the SystemPerl kit and point the SYSTEMPERL enviornment variable to the +untarred directory.) + +In your top level C code, call Verilated::traceEverOn(true). Then, in SystemC mode, create a SpTraceFile object. For an example, see the call to SpTraceFile in the test_sp/sc_main.cpp file of the diff --git a/bin/verilator_difftree b/bin/verilator_difftree index 742a8d543..010916da1 100755 --- a/bin/verilator_difftree +++ b/bin/verilator_difftree @@ -192,5 +192,5 @@ C ###################################################################### ### Local Variables: -### compile-command: "$V4/bin/verilator_difftree ~/SandBox/workwsnyder/verilator/test_c/obj_dir/V*_03_*.tree $V4/test_c/obj_dir/V*_03_*.tree" +### compile-command: "$V4/bin/verilator_difftree $V4/test_c/obj_dir/V*_03_*.tree $V4N/test_c/obj_dir/V*_03_*.tree" ### End: diff --git a/src/V3Active.cpp b/src/V3Active.cpp index 47112b181..b900cc0ac 100644 --- a/src/V3Active.cpp +++ b/src/V3Active.cpp @@ -298,8 +298,10 @@ private: // OPTIMIZE: We could substitute a constant for things in the sense list, for example // always (posedge RESET) { if (RESET).... } we know RESET is true. // Summarize a long list of combo inputs as just "combo" +#ifndef __COVERITY__ // Else dead code on next line. if (combo) nodep->sensesp()->addSensesp (new AstSenItem(nodep->fileline(),AstSenItem::Combo())); +#endif wantactivep = m_namer.getActive(nodep->fileline(), nodep->sensesp()); } diff --git a/src/V3Descope.cpp b/src/V3Descope.cpp index 7e195eac2..9643beebc 100644 --- a/src/V3Descope.cpp +++ b/src/V3Descope.cpp @@ -224,12 +224,13 @@ private: if (m_scopep) { nodep->unlinkFrBack(); m_modp->addStmtp(nodep); - } - if (nodep->funcPublic()) { - // There may be multiple public functions by the same name; - // record for later correction or making of shells - m_modFuncs.insert(make_pair(nodep->name(), nodep)); - nodep->name(m_scopep->nameDotless() +"__" + nodep->name()); + + if (nodep->funcPublic()) { + // There may be multiple public functions by the same name; + // record for later correction or making of shells + m_modFuncs.insert(make_pair(nodep->name(), nodep)); + nodep->name(m_scopep->nameDotless() +"__" + nodep->name()); + } } } } diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 45317202b..88733b7c8 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -948,10 +948,7 @@ void EmitCStmts::displayArg(AstDisplay* dispp, AstNode** elistp, string fmt, cha } else { string func; string nfmt = displayFormat(*elistp, fmt, fmtLetter, true, false); - if ((*elistp)->isQuad() && (fmtLetter=='d')) { - nfmt+="ll"; - func="(long long)("; // Must match %ll to avoid warnings - } + // We don't need to check for fmtLetter=='d', as it is above. if ((*elistp)->isQuad() && (fmtLetter=='u'||fmtLetter=='o'||fmtLetter=='x')) { nfmt+="ll"; func="(unsigned long long)("; // Must match %ull to avoid warnings diff --git a/src/V3Error.cpp b/src/V3Error.cpp index 0eb6f8840..c99335f18 100644 --- a/src/V3Error.cpp +++ b/src/V3Error.cpp @@ -236,6 +236,9 @@ void V3Error::v3abort () { } void V3Error::v3errorEnd (ostringstream& sstr) { +#ifdef __COVERITY__ + if (s_errorCode==V3ErrorCode::FATAL) __coverity_panic__(x); +#endif if (s_errorCode!=V3ErrorCode::SUPPRESS || debug()) { cerr<name(), nodep->modp()->origName()); m_modp->addInlinesp(inlinep); // Must be parsed before any AstCells // Create assignments to the pins - AstNode* assignlistsp = NULL; for (AstPin* pinp = nodep->pinsp(); pinp; pinp=pinp->nextp()->castPin()) { UINFO(6," Pin change from "<modVarp()<iterateAndNext(*this); - if (assignlistsp) assignlistsp->iterateAndNext(*this); // And cleanup any varrefs under assigns we created... m_cellp = NULL; // Move statements to top module if (debug()>=9) { newmodp->dumpTree(cout,"fixmod:"); } AstNode* stmtsp = newmodp->stmtsp(); if (stmtsp) stmtsp->unlinkFrBackWithNext(); - if (assignlistsp) m_modp->addStmtp(assignlistsp); if (stmtsp) m_modp->addStmtp(stmtsp); // Remove the cell newmodp->deleteTree(); newmodp=NULL; // Clear any leftover ports, etc diff --git a/src/V3LinkResolve.cpp b/src/V3LinkResolve.cpp index 642fadcb9..2784461c3 100644 --- a/src/V3LinkResolve.cpp +++ b/src/V3LinkResolve.cpp @@ -104,7 +104,7 @@ private: nodep->v3error("Arrayed variables may not be inputs nor outputs"); } if (m_ftaskp) nodep->funcLocal(true); - if (nodep && nodep->isSigPublic()) m_modp->modPublic(true); // Avoid flattening if signals are exposed + if (nodep->isSigPublic()) m_modp->modPublic(true); // Avoid flattening if signals are exposed } virtual void visit(AstNodeVarRef* nodep, AstNUser*) { diff --git a/src/V3Unroll.cpp b/src/V3Unroll.cpp index a23a4b19b..fcc32bdf7 100644 --- a/src/V3Unroll.cpp +++ b/src/V3Unroll.cpp @@ -298,9 +298,9 @@ private: initp = NULL; if (nodep->backp()->nextp() == nodep) initp=nodep->backp(); // Grab assignment AstNode* incp = NULL; // Should be last statement - for (incp = nodep->bodysp(); incp->nextp(); incp = incp->nextp()) {} + for (incp = nodep->bodysp(); incp && incp->nextp(); incp = incp->nextp()) {} if (incp) V3Const::constifyTree(incp); - for (incp = nodep->bodysp(); incp->nextp(); incp = incp->nextp()) {} // Again, as may have changed + for (incp = nodep->bodysp(); incp && incp->nextp(); incp = incp->nextp()) {} // Again, as may have changed // And check it if (forUnrollCheck(nodep, initp, nodep->precondsp(), nodep->condp(),