forked from github/verilator
Internals: cpplint cleanups. No functional change.
This commit is contained in:
parent
441ecfedc9
commit
15b32dc140
@ -180,7 +180,7 @@ public:
|
||||
}
|
||||
|
||||
// Internal class access
|
||||
inline VerilatedFst* spTrace() { return &m_sptrace; };
|
||||
inline VerilatedFst* spTrace() { return &m_sptrace; }
|
||||
};
|
||||
|
||||
#endif // guard
|
||||
|
@ -849,8 +849,8 @@ template <class T_Value, std::size_t T_Depth> struct VlUnpacked final {
|
||||
WData* data() { return &m_storage[0]; }
|
||||
const WData* data() const { return &m_storage[0]; }
|
||||
|
||||
T_Value& operator[](size_t index) { return m_storage[index]; };
|
||||
const T_Value& operator[](size_t index) const { return m_storage[index]; };
|
||||
T_Value& operator[](size_t index) { return m_storage[index]; }
|
||||
const T_Value& operator[](size_t index) const { return m_storage[index]; }
|
||||
|
||||
// Dumping. Verilog: str = $sformatf("%p", assoc)
|
||||
std::string to_string() const {
|
||||
|
@ -1697,7 +1697,7 @@ void vl_get_value(const VerilatedVar* varp, void* varDatap, p_vpi_value valuep,
|
||||
// Maximum required size is for binary string, one byte per bit plus null termination
|
||||
static VL_THREAD_LOCAL char t_outStr[VL_VALUE_STRING_MAX_WORDS * VL_EDATASIZE + 1];
|
||||
// cppcheck-suppress variableScope
|
||||
const static VL_THREAD_LOCAL int t_outStrSz = sizeof(t_outStr) - 1;
|
||||
static const VL_THREAD_LOCAL int t_outStrSz = sizeof(t_outStr) - 1;
|
||||
// We used to presume vpiValue.format = vpiIntVal or if single bit vpiScalarVal
|
||||
// This may cause backward compatibility issues with older code.
|
||||
if (valuep->format == vpiVectorVal) {
|
||||
|
@ -163,9 +163,9 @@ public:
|
||||
LatchDetectGraphVertex* outVertexp;
|
||||
if (!nodep->varp()->user1p()) { // Not seen this output before
|
||||
outVertexp = addOutputVertex(nodep);
|
||||
} else
|
||||
} else {
|
||||
outVertexp = castVertexp(nodep->varp()->user1p());
|
||||
|
||||
}
|
||||
new V3GraphEdge(this, m_curVertexp, outVertexp, 1);
|
||||
}
|
||||
// Run latchCheckInternal on each variable assigned by the always block to see if all control
|
||||
|
@ -27,8 +27,12 @@
|
||||
#include "V3Broken.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <type_traits>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "V3Ast__gen_classes.h" // From ./astgen
|
||||
// Things like:
|
||||
|
@ -225,7 +225,7 @@ private:
|
||||
while (nodep) {
|
||||
processAndIterate(nodep);
|
||||
nodep = nodep->nextp();
|
||||
};
|
||||
}
|
||||
}
|
||||
void pushLocalScope() {
|
||||
if (m_cfuncp) m_localsStack.emplace_back();
|
||||
|
@ -118,7 +118,7 @@ public:
|
||||
rootFuncp->addStmtsp(callp);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private:
|
||||
VL_UNCOPYABLE(V3CCtorsBuilder);
|
||||
|
@ -951,8 +951,9 @@ private:
|
||||
} else if (VN_IS(nodep->rhsp(), And)) {
|
||||
andp = VN_AS(nodep->rhsp(), And);
|
||||
ap = nodep->lhsp();
|
||||
} else
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
const AstNodeUniop* notp;
|
||||
AstNode* cp;
|
||||
if (VN_IS(andp->lhsp(), Not)) {
|
||||
@ -3204,11 +3205,11 @@ private:
|
||||
// Non-zero on one side or the other
|
||||
TREEOP ("AstAnd {$lhsp.isAllOnes, $rhsp}", "replaceWRhs(nodep)");
|
||||
TREEOP ("AstLogAnd{$lhsp.isNeqZero, $rhsp}", "replaceWRhs(nodep)");
|
||||
TREEOP ("AstOr {$lhsp.isAllOnes, $rhsp, isTPure($rhsp)}", "replaceWLhs(nodep)"); //->allOnes
|
||||
TREEOP ("AstOr {$lhsp.isAllOnes, $rhsp, isTPure($rhsp)}", "replaceWLhs(nodep)"); // ->allOnes
|
||||
TREEOP ("AstLogOr {$lhsp.isNeqZero, $rhsp}", "replaceNum(nodep,1)");
|
||||
TREEOP ("AstAnd {$lhsp, $rhsp.isAllOnes}", "replaceWLhs(nodep)");
|
||||
TREEOP ("AstLogAnd{$lhsp, $rhsp.isNeqZero}", "replaceWLhs(nodep)");
|
||||
TREEOP ("AstOr {$lhsp, $rhsp.isAllOnes, isTPure($lhsp)}", "replaceWRhs(nodep)"); //->allOnes
|
||||
TREEOP ("AstOr {$lhsp, $rhsp.isAllOnes, isTPure($lhsp)}", "replaceWRhs(nodep)"); // ->allOnes
|
||||
TREEOP ("AstLogOr {$lhsp, $rhsp.isNeqZero, isTPure($lhsp), nodep->isPure()}", "replaceNum(nodep,1)");
|
||||
TREEOP ("AstXor {$lhsp.isAllOnes, $rhsp}", "AstNot{$rhsp}");
|
||||
TREEOP ("AstMul {$lhsp.isOne, $rhsp}", "replaceWRhs(nodep)");
|
||||
|
@ -79,8 +79,9 @@ void EmitCFunc::emitOpName(AstNode* nodep, const string& format, AstNode* lhsp,
|
||||
if (needComma) {
|
||||
if (pos[1] == ' ') {
|
||||
nextComma = ", ";
|
||||
} else
|
||||
} else {
|
||||
nextComma = ",";
|
||||
}
|
||||
needComma = false;
|
||||
}
|
||||
if (pos[1] == ' ') ++pos; // Must do even if no nextComma
|
||||
|
@ -55,7 +55,7 @@
|
||||
// clang-format on
|
||||
|
||||
// If change this code, run a test with the below size set very small
|
||||
//#define INFILTER_IPC_BUFSIZ 16
|
||||
// #define INFILTER_IPC_BUFSIZ 16
|
||||
constexpr int INFILTER_IPC_BUFSIZ = (64 * 1024); // For debug, try this as a small number
|
||||
constexpr int INFILTER_CACHE_MAX = (64 * 1024); // Maximum bytes to cache if same file read twice
|
||||
|
||||
|
@ -37,7 +37,8 @@
|
||||
// FileLineSingleton class functions
|
||||
|
||||
string FileLineSingleton::filenameLetters(int fileno) {
|
||||
const int size = 1 + (64 / 4); // Each letter retires more than 4 bits of a > 64 bit number
|
||||
constexpr int size
|
||||
= 1 + (64 / 4); // Each letter retires more than 4 bits of a > 64 bit number
|
||||
char out[size];
|
||||
char* op = out + size - 1;
|
||||
*--op = '\0'; // We build backwards
|
||||
|
@ -371,7 +371,7 @@ void V3Graph::dumpDotFile(const string& filename, bool colorAsSubgraph) const {
|
||||
*logp << "\tn" << edgep->fromp()->dotName() << fromVnum << " -> n"
|
||||
<< edgep->top()->dotName() << toVnum
|
||||
<< " ["
|
||||
//<<"fontsize=8 label=\""<<(edgep->name()!="" ? edgep->name() : "\\E")<<"\""
|
||||
// <<"fontsize=8 label=\""<<(edgep->name()!="" ? edgep->name() : "\\E")<<"\""
|
||||
<< "fontsize=8 label=\""
|
||||
<< (edgep->dotLabel() != "" ? edgep->dotLabel() : "") << "\""
|
||||
<< " weight=" << edgep->weight() << " color=" << edgep->dotColor();
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
#include "V3Graph.h"
|
||||
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <unordered_map>
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
|
@ -512,8 +512,9 @@ public:
|
||||
if (it2 != m_scopeAliasMap[samn].end()) {
|
||||
srcp = it2->second;
|
||||
continue;
|
||||
} else
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
UINFO(9, " iiasa: Insert alias se" << lhsp << " (" << lhsp->nodep()->typeName()
|
||||
<< ") <- se" << srcp << " " << srcp->nodep()
|
||||
@ -623,8 +624,9 @@ public:
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!lookupSymp) return nullptr; // Not found
|
||||
}
|
||||
|
@ -23,6 +23,8 @@
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
//============================================================================
|
||||
|
||||
class V3LinkLevel final {
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "V3Error.h"
|
||||
#include "V3Hash.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
|
@ -99,8 +99,9 @@ void test(const string& lhss, const string& op, const string& rhss, const string
|
||||
gotnum.opLogAnd(lhnum, rhnum);
|
||||
} else if (op == "||") {
|
||||
gotnum.opLogOr(lhnum, rhnum);
|
||||
} else
|
||||
} else {
|
||||
v3fatalSrc("Bad opcode: " << op);
|
||||
}
|
||||
|
||||
UINFO(0, "------- Test:\n"
|
||||
<< " " << lhnum << " " << op << endl
|
||||
|
10
src/V3Os.cpp
10
src/V3Os.cpp
@ -52,16 +52,16 @@
|
||||
// These macros taken from gdbsupport/gdb_wait.h in binutils-gdb
|
||||
# ifndef WIFEXITED
|
||||
# ifdef __MINGW32__
|
||||
# define WIFEXITED(w) (((w) & 0xC0000000) == 0)
|
||||
# define WEXITSTATUS(w) ((w) & ~0xC0000000)
|
||||
# define WIFEXITED(w) (((w) & 0xC0000000) == 0)
|
||||
# define WEXITSTATUS(w) ((w) & ~0xC0000000)
|
||||
# else
|
||||
# define WIFEXITED(w) (((w) & 0377) == 0)
|
||||
# define WEXITSTATUS(w) (((w) >> 8) & 0377)
|
||||
# define WIFEXITED(w) (((w) & 0377) == 0)
|
||||
# define WEXITSTATUS(w) (((w) >> 8) & 0377)
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
# include <sys/time.h>
|
||||
# include <sys/wait.h> // Needed on FreeBSD for WIFEXITED
|
||||
# include <sys/wait.h> // Needed on FreeBSD for WIFEXITED
|
||||
# include <unistd.h> // usleep
|
||||
#endif
|
||||
// clang-format on
|
||||
|
@ -271,8 +271,9 @@ string V3ParseGrammar::deQuote(FileLine* fileline, string text) {
|
||||
} else if (isalnum(*cp)) {
|
||||
fileline->v3error("Unknown escape sequence: \\" << *cp);
|
||||
break;
|
||||
} else
|
||||
} else {
|
||||
newtext += *cp;
|
||||
}
|
||||
}
|
||||
} else if (*cp == '\\') {
|
||||
quoted = true;
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "V3SymTable.h"
|
||||
|
||||
#include <deque>
|
||||
#include <vector>
|
||||
|
||||
//######################################################################
|
||||
// Symbol table for parsing
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "V3OrderGraph.h"
|
||||
|
||||
#include <list>
|
||||
#include <unordered_map>
|
||||
|
||||
class LogicMTask;
|
||||
using Vx2MTaskMap = std::unordered_map<const MTaskMoveVertex*, LogicMTask*>;
|
||||
|
@ -29,8 +29,9 @@
|
||||
|
||||
#include "V3Error.h"
|
||||
|
||||
#include <set>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <unordered_map>
|
||||
|
||||
//######################################################################
|
||||
|
@ -42,6 +42,8 @@
|
||||
|
||||
#include <deque>
|
||||
#include <sstream>
|
||||
#include <stack>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
//============================================================================
|
||||
|
@ -117,7 +117,7 @@ public:
|
||||
m_words[word].m_complex = true;
|
||||
}
|
||||
void assignComplex() { m_whole.m_complex = true; }
|
||||
void consumeWhole() { //==consumeComplex as we don't know the difference
|
||||
void consumeWhole() { // ==consumeComplex as we don't know the difference
|
||||
m_whole.m_use = true;
|
||||
}
|
||||
void consumeWord(int word) {
|
||||
|
@ -26,9 +26,11 @@
|
||||
#include "V3String.h"
|
||||
|
||||
#include <cstdarg>
|
||||
#include <map>
|
||||
#include <iomanip>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
class VSymGraph;
|
||||
class VSymEnt;
|
||||
|
@ -23,6 +23,8 @@
|
||||
|
||||
#include "V3Error.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace V3TSP {
|
||||
// Perform a "Traveling Salesman Problem" optimizing sort
|
||||
// on any type you like -- so long as inherits from TspStateBase.
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "V3Error.h"
|
||||
#include "V3Ast.h"
|
||||
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
//============================================================================
|
||||
|
@ -276,13 +276,13 @@ private:
|
||||
UINFO(4, " COUNTBITS(" << dropop[0] << dropop[1] << dropop[2] << " " << nodep << endl);
|
||||
|
||||
AstNode* nonXp = nullptr;
|
||||
if (!dropop[0])
|
||||
if (!dropop[0]) {
|
||||
nonXp = nodep->rhsp();
|
||||
else if (!dropop[1])
|
||||
} else if (!dropop[1]) {
|
||||
nonXp = nodep->thsp();
|
||||
else if (!dropop[2])
|
||||
} else if (!dropop[2]) {
|
||||
nonXp = nodep->fhsp();
|
||||
else { // Was all X-s
|
||||
} else { // Was all X-s
|
||||
UINFO(4, " COUNTBITS('x)->0 " << nodep << endl);
|
||||
AstConst* const newp = new AstConst(nodep->fileline(), AstConst::BitFalse());
|
||||
nodep->replaceWith(newp);
|
||||
|
@ -246,7 +246,7 @@ static void process() {
|
||||
}
|
||||
}
|
||||
|
||||
//--PRE-FLAT OPTIMIZATIONS------------------
|
||||
// --PRE-FLAT OPTIMIZATIONS------------------
|
||||
|
||||
// Initial const/dead to reduce work for ordering code
|
||||
V3Const::constifyAll(v3Global.rootp());
|
||||
@ -257,7 +257,7 @@ static void process() {
|
||||
|
||||
V3Error::abortIfErrors();
|
||||
|
||||
//--FLATTENING---------------
|
||||
// --FLATTENING---------------
|
||||
|
||||
if (!(v3Global.opt.xmlOnly() && !v3Global.opt.flatten())) {
|
||||
// We're going to flatten the hierarchy, so as many optimizations that
|
||||
@ -277,7 +277,7 @@ static void process() {
|
||||
V3Class::classAll(v3Global.rootp());
|
||||
}
|
||||
|
||||
//--SCOPE BASED OPTIMIZATIONS--------------
|
||||
// --SCOPE BASED OPTIMIZATIONS--------------
|
||||
|
||||
if (!(v3Global.opt.xmlOnly() && !v3Global.opt.flatten())) {
|
||||
// Cleanup
|
||||
@ -412,7 +412,7 @@ static void process() {
|
||||
if (v3Global.opt.stats()) V3Stats::statsStageAll(v3Global.rootp(), "Scoped");
|
||||
}
|
||||
|
||||
//--MODULE OPTIMIZATIONS--------------
|
||||
// --MODULE OPTIMIZATIONS--------------
|
||||
|
||||
if (!v3Global.opt.xmlOnly()) {
|
||||
// Split deep blocks to appease MSVC++. Must be before Localize.
|
||||
@ -435,7 +435,7 @@ static void process() {
|
||||
|
||||
V3Error::abortIfErrors();
|
||||
|
||||
//--GENERATION------------------
|
||||
// --GENERATION------------------
|
||||
|
||||
if (!v3Global.opt.xmlOnly()) {
|
||||
// Remove unused vars
|
||||
@ -580,7 +580,7 @@ static void verilate(const string& argString) {
|
||||
v3fatalSrc("VERILATOR_DEBUG_SKIP_IDENTICAL w/ --skip-identical: Changes found\n");
|
||||
} // LCOV_EXCL_STOP
|
||||
|
||||
//--FRONTEND------------------
|
||||
// --FRONTEND------------------
|
||||
|
||||
// Cleanup
|
||||
V3Os::unlinkRegexp(v3Global.opt.hierTopDataDir(), v3Global.opt.prefix() + "_*.tree");
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "verilatedos.h"
|
||||
|
||||
#include <map>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
//********************************************************************
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
//######################################################################
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user