Internals: Use newline instead of endl to avoid unneeded flush.

This commit is contained in:
Wilson Snyder 2020-11-18 21:03:23 -05:00
parent fa77141519
commit c0888c1b0f
37 changed files with 203 additions and 215 deletions

View File

@ -1045,7 +1045,7 @@ IData _vl_vsscanf(FILE* fp, // If a fscanf
const char* pos = formatp; const char* pos = formatp;
for (; *pos && !_vl_vsss_eof(fp, floc); ++pos) { for (; *pos && !_vl_vsss_eof(fp, floc); ++pos) {
// VL_DBG_MSGF("_vlscan fmt='"<<pos[0]<<"' floc="<<floc<<" file='"<<_vl_vsss_peek(fp, floc, // VL_DBG_MSGF("_vlscan fmt='"<<pos[0]<<"' floc="<<floc<<" file='"<<_vl_vsss_peek(fp, floc,
// fromp, fstr)<<"'"<<endl); // fromp, fstr)<<"'\n");
if (!inPct && pos[0] == '%') { if (!inPct && pos[0] == '%') {
inPct = true; inPct = true;
inIgnore = false; inIgnore = false;

View File

@ -399,7 +399,7 @@ public:
os << i.first; os << i.first;
if (!i.second.first.empty()) os << keyValueFormatter(VL_CIK_HIER, i.second.first); if (!i.second.first.empty()) os << keyValueFormatter(VL_CIK_HIER, i.second.first);
os << "' " << i.second.second; os << "' " << i.second.second;
os << std::endl; os << '\n';
} }
} }
}; };

View File

@ -1088,14 +1088,14 @@ void AstNode::dumpPtrs(std::ostream& os) const {
void AstNode::dumpTree(std::ostream& os, const string& indent, int maxDepth) const { void AstNode::dumpTree(std::ostream& os, const string& indent, int maxDepth) const {
static int s_debugFileline = v3Global.opt.debugSrcLevel("fileline"); // --debugi-fileline 9 static int s_debugFileline = v3Global.opt.debugSrcLevel("fileline"); // --debugi-fileline 9
os << indent << " " << this << endl; os << indent << " " << this << '\n';
if (debug() > 8) { if (debug() > 8) {
os << indent << " "; os << indent << " ";
dumpPtrs(os); dumpPtrs(os);
} }
if (s_debugFileline >= 9) { os << fileline()->warnContextSecondary(); } if (s_debugFileline >= 9) { os << fileline()->warnContextSecondary(); }
if (maxDepth == 1) { if (maxDepth == 1) {
if (op1p() || op2p() || op3p() || op4p()) { os << indent << "1: ...(maxDepth)" << endl; } if (op1p() || op2p() || op3p() || op4p()) os << indent << "1: ...(maxDepth)\n";
} else { } else {
for (const AstNode* nodep = op1p(); nodep; nodep = nodep->nextp()) { for (const AstNode* nodep = op1p(); nodep; nodep = nodep->nextp()) {
nodep->dumpTree(os, indent + "1:", maxDepth - 1); nodep->dumpTree(os, indent + "1:", maxDepth - 1);
@ -1127,9 +1127,9 @@ void AstNode::dumpTreeFile(const string& filename, bool append, bool doDump, boo
const std::unique_ptr<std::ofstream> logsp(V3File::new_ofstream(filename, append)); const std::unique_ptr<std::ofstream> logsp(V3File::new_ofstream(filename, append));
if (logsp->fail()) v3fatal("Can't write " << filename); if (logsp->fail()) v3fatal("Can't write " << filename);
*logsp << "Verilator Tree Dump (format 0x3900) from <e" << std::dec << editCountLast(); *logsp << "Verilator Tree Dump (format 0x3900) from <e" << std::dec << editCountLast();
*logsp << "> to <e" << std::dec << editCountGbl() << ">" << endl; *logsp << "> to <e" << std::dec << editCountGbl() << ">\n";
if (editCountGbl() == editCountLast() && !(v3Global.opt.dumpTree() >= 9)) { if (editCountGbl() == editCountLast() && !(v3Global.opt.dumpTree() >= 9)) {
*logsp << endl; *logsp << '\n';
*logsp << "No changes since last dump!\n"; *logsp << "No changes since last dump!\n";
} else { } else {
dumpTree(*logsp); dumpTree(*logsp);
@ -1199,7 +1199,7 @@ void AstNode::v3errorEnd(std::ostringstream& str) const {
std::ostringstream nsstr; std::ostringstream nsstr;
nsstr << str.str(); nsstr << str.str();
if (debug()) { if (debug()) {
nsstr << endl; nsstr << '\n';
nsstr << "-node: "; nsstr << "-node: ";
const_cast<AstNode*>(this)->dump(nsstr); const_cast<AstNode*>(this)->dump(nsstr);
nsstr << endl; nsstr << endl;

View File

@ -1397,7 +1397,7 @@ void AstTypeTable::dump(std::ostream& str) const {
this->AstNode::dump(str); this->AstNode::dump(str);
for (int i = 0; i < static_cast<int>(AstBasicDTypeKwd::_ENUM_MAX); ++i) { for (int i = 0; i < static_cast<int>(AstBasicDTypeKwd::_ENUM_MAX); ++i) {
if (AstBasicDType* subnodep = m_basicps[i]) { if (AstBasicDType* subnodep = m_basicps[i]) {
str << endl; // Newline from caller, so newline first str << '\n'; // Newline from caller, so newline first
str << "\t\t" << std::setw(8) << AstBasicDTypeKwd(i).ascii(); str << "\t\t" << std::setw(8) << AstBasicDTypeKwd(i).ascii();
str << " -> "; str << " -> ";
subnodep->dump(str); subnodep->dump(str);
@ -1407,7 +1407,7 @@ void AstTypeTable::dump(std::ostream& str) const {
const DetailedMap& mapr = m_detailedMap; const DetailedMap& mapr = m_detailedMap;
for (const auto& itr : mapr) { for (const auto& itr : mapr) {
AstBasicDType* dtypep = itr.second; AstBasicDType* dtypep = itr.second;
str << endl; // Newline from caller, so newline first str << '\n'; // Newline from caller, so newline first
str << "\t\tdetailed -> "; str << "\t\tdetailed -> ";
dtypep->dump(str); dtypep->dump(str);
} }

View File

@ -150,7 +150,7 @@ private:
} else { } else {
*m_ofp << " "; *m_ofp << " ";
} }
*m_ofp << nodep->prettyTypeName() << " " << endl; *m_ofp << nodep->prettyTypeName() << "\n";
string lastPrefix = m_prefix; string lastPrefix = m_prefix;
m_prefix = lastPrefix + "1:"; m_prefix = lastPrefix + "1:";
iterateAndNextNull(nodep->op1p()); iterateAndNextNull(nodep->op1p());
@ -292,7 +292,7 @@ private:
told_file = true; told_file = true;
std::cerr << V3Error::msgPrefix() << " See details in " << m_ofFilename << endl; std::cerr << V3Error::msgPrefix() << " See details in " << m_ofFilename << endl;
} }
*m_ofp << "%Warning-" << code.ascii() << ": " << nodep->fileline() << " " << msg << endl; *m_ofp << "%Warning-" << code.ascii() << ": " << nodep->fileline() << " " << msg << '\n';
} }
void setNodeHazard(AstNode* nodep) { void setNodeHazard(AstNode* nodep) {
@ -462,7 +462,7 @@ private:
string front string front
= pad(filelineWidth(), nodep->fileline()->ascii() + ":") + " " + prefix + " +- "; = pad(filelineWidth(), nodep->fileline()->ascii() + ":") + " " + prefix + " +- ";
if (VN_IS(nodep, VarScope)) { if (VN_IS(nodep, VarScope)) {
*m_ofp << front << "Variable: " << nodep->prettyName() << endl; *m_ofp << front << "Variable: " << nodep->prettyName() << '\n';
} else { } else {
V3EmitV::verilogPrefixedTree(nodep, *m_ofp, prefix + " +- ", filelineWidth(), V3EmitV::verilogPrefixedTree(nodep, *m_ofp, prefix + " +- ", filelineWidth(),
vertexp->srcDomainp(), true); vertexp->srcDomainp(), true);
@ -509,7 +509,7 @@ private:
string filename = v3Global.opt.makeDir() + "/" + v3Global.opt.prefix() + "__cdc_edges.txt"; string filename = v3Global.opt.makeDir() + "/" + v3Global.opt.prefix() + "__cdc_edges.txt";
const std::unique_ptr<std::ofstream> ofp(V3File::new_ofstream(filename)); const std::unique_ptr<std::ofstream> ofp(V3File::new_ofstream(filename));
if (ofp->fail()) v3fatal("Can't write " << filename); if (ofp->fail()) v3fatal("Can't write " << filename);
*ofp << "Edge Report for " << v3Global.opt.prefix() << endl; *ofp << "Edge Report for " << v3Global.opt.prefix() << '\n';
std::deque<string> report; // Sort output by name std::deque<string> report; // Sort output by name
for (V3GraphVertex* itp = m_graph.verticesBeginp(); itp; itp = itp->verticesNextp()) { for (V3GraphVertex* itp = m_graph.verticesBeginp(); itp; itp = itp->verticesNextp()) {
@ -536,7 +536,7 @@ private:
V3EmitV::verilogForTree(vvertexp->dstDomainp(), os); V3EmitV::verilogForTree(vvertexp->dstDomainp(), os);
} }
os << std::setw(0); os << std::setw(0);
os << endl; os << '\n';
report.push_back(os.str()); report.push_back(os.str());
} }
} }
@ -732,7 +732,7 @@ public:
m_ofp = V3File::new_ofstream(filename); m_ofp = V3File::new_ofstream(filename);
if (m_ofp->fail()) v3fatal("Can't write " << filename); if (m_ofp->fail()) v3fatal("Can't write " << filename);
m_ofFilename = filename; m_ofFilename = filename;
*m_ofp << "CDC Report for " << v3Global.opt.prefix() << endl; *m_ofp << "CDC Report for " << v3Global.opt.prefix() << '\n';
*m_ofp *m_ofp
<< "Each dump below traces logic from inputs/source flops to destination flop(s).\n"; << "Each dump below traces logic from inputs/source flops to destination flop(s).\n";
*m_ofp << "First source logic is listed, then a variable that logic generates,\n"; *m_ofp << "First source logic is listed, then a variable that logic generates,\n";
@ -745,7 +745,7 @@ public:
if (false) { if (false) {
*m_ofp << "\nDBG-test-dumper\n"; *m_ofp << "\nDBG-test-dumper\n";
V3EmitV::verilogPrefixedTree(nodep, *m_ofp, "DBG ", 40, nullptr, true); V3EmitV::verilogPrefixedTree(nodep, *m_ofp, "DBG ", 40, nullptr, true);
*m_ofp << endl; *m_ofp << '\n';
} }
} }
virtual ~CdcVisitor() override { virtual ~CdcVisitor() override {

View File

@ -117,10 +117,9 @@ private:
"Unsupported: Can't detect more than " "Unsupported: Can't detect more than "
<< cvtToStr(DETECTARRAY_MAX_INDEXES) << cvtToStr(DETECTARRAY_MAX_INDEXES)
<< " array indexes (probably with UNOPTFLAT warning suppressed): " << " array indexes (probably with UNOPTFLAT warning suppressed): "
<< m_vscp->prettyName() << endl << m_vscp->prettyName() << '\n'
<< m_vscp->warnMore() << m_vscp->warnMore()
<< "... Could recompile with DETECTARRAY_MAX_INDEXES increased" << "... Could recompile with DETECTARRAY_MAX_INDEXES increased");
<< endl);
return; return;
} }
m_statep->maybeCreateChgFuncp(); m_statep->maybeCreateChgFuncp();

View File

@ -405,7 +405,7 @@ void V3Config::addInline(FileLine* fl, const string& module, const string& ftask
V3ConfigResolver::s().modules().at(module).setInline(on); V3ConfigResolver::s().modules().at(module).setInline(on);
} else { } else {
if (!on) { if (!on) {
fl->v3error("no_inline not supported for tasks" << endl); fl->v3error("no_inline not supported for tasks");
} else { } else {
V3ConfigResolver::s().modules().at(module).ftasks().at(ftask).setNoInline(on); V3ConfigResolver::s().modules().at(module).ftasks().at(ftask).setNoInline(on);
} }
@ -416,15 +416,14 @@ void V3Config::addVarAttr(FileLine* fl, const string& module, const string& ftas
const string& var, AstAttrType attr, AstSenTree* sensep) { const string& var, AstAttrType attr, AstSenTree* sensep) {
// Semantics: sensep only if public_flat_rw // Semantics: sensep only if public_flat_rw
if ((attr != AstAttrType::VAR_PUBLIC_FLAT_RW) && sensep) { if ((attr != AstAttrType::VAR_PUBLIC_FLAT_RW) && sensep) {
sensep->v3error("sensitivity not expected for attribute" << endl); sensep->v3error("sensitivity not expected for attribute");
return; return;
} }
// Semantics: Most of the attributes operate on signals // Semantics: Most of the attributes operate on signals
if (var.empty()) { if (var.empty()) {
if (attr == AstAttrType::VAR_ISOLATE_ASSIGNMENTS) { if (attr == AstAttrType::VAR_ISOLATE_ASSIGNMENTS) {
if (ftask.empty()) { if (ftask.empty()) {
fl->v3error("isolate_assignments only applies to signals or functions/tasks" fl->v3error("isolate_assignments only applies to signals or functions/tasks");
<< endl);
} else { } else {
V3ConfigResolver::s().modules().at(module).ftasks().at(ftask).setIsolate(true); V3ConfigResolver::s().modules().at(module).ftasks().at(ftask).setIsolate(true);
} }
@ -437,7 +436,7 @@ void V3Config::addVarAttr(FileLine* fl, const string& module, const string& ftas
V3ConfigResolver::s().modules().at(module).ftasks().at(ftask).setPublic(true); V3ConfigResolver::s().modules().at(module).ftasks().at(ftask).setPublic(true);
} }
} else { } else {
fl->v3error("missing -signal" << endl); fl->v3error("missing -signal");
} }
} else { } else {
V3ConfigModule& mod = V3ConfigResolver::s().modules().at(module); V3ConfigModule& mod = V3ConfigResolver::s().modules().at(module);

View File

@ -1262,7 +1262,7 @@ private:
AstNode* errorp = simvis.whyNotNodep(); AstNode* errorp = simvis.whyNotNodep();
if (!errorp) errorp = nodep; if (!errorp) errorp = nodep;
nodep->v3error("Expecting expression to be constant, but can't determine constant for " nodep->v3error("Expecting expression to be constant, but can't determine constant for "
<< nodep->prettyTypeName() << endl << nodep->prettyTypeName() << '\n'
<< errorp->warnOther() << "... Location of non-constant " << errorp->warnOther() << "... Location of non-constant "
<< errorp->prettyTypeName() << ": " << simvis.whyNotMessage()); << errorp->prettyTypeName() << ": " << simvis.whyNotMessage());
VL_DO_DANGLING(replaceZero(nodep), nodep); VL_DO_DANGLING(replaceZero(nodep), nodep);
@ -1930,8 +1930,9 @@ private:
nodep->replaceWith(ifp); nodep->replaceWith(ifp);
VL_DO_DANGLING(nodep->deleteTree(), nodep); VL_DO_DANGLING(nodep->deleteTree(), nodep);
} else if (ifSameAssign(nodep)) { } else if (ifSameAssign(nodep)) {
UINFO(4, "IF({a}) ASSIGN({b},{c}) else ASSIGN({b},{d}) => ASSIGN({b}, {a}?{c}:{d})" UINFO(
<< endl); 4,
"IF({a}) ASSIGN({b},{c}) else ASSIGN({b},{d}) => ASSIGN({b}, {a}?{c}:{d})\n");
AstNodeAssign* ifp = VN_CAST(nodep->ifsp(), NodeAssign); AstNodeAssign* ifp = VN_CAST(nodep->ifsp(), NodeAssign);
AstNodeAssign* elsep = VN_CAST(nodep->elsesp(), NodeAssign); AstNodeAssign* elsep = VN_CAST(nodep->elsesp(), NodeAssign);
ifp->unlinkFrBack(); ifp->unlinkFrBack();

View File

@ -160,10 +160,10 @@ private:
varrefp->varp()->v3warn( varrefp->varp()->v3warn(
MULTIDRIVEN, MULTIDRIVEN,
"Signal has multiple driving blocks with different clocking: " "Signal has multiple driving blocks with different clocking: "
<< varrefp->varp()->prettyNameQ() << endl << varrefp->varp()->prettyNameQ() << '\n'
<< varrefp->warnOther() << "... Location of first driving block" << endl << varrefp->warnOther() << "... Location of first driving block\n"
<< varrefp->warnContextPrimary() << endl << varrefp->warnContextPrimary() << '\n'
<< oldactivep->warnOther() << "... Location of other driving block" << endl << oldactivep->warnOther() << "... Location of other driving block\n"
<< oldactivep->warnContextSecondary()); << oldactivep->warnContextSecondary());
varrefp->varp()->user2(true); varrefp->varp()->user2(true);
} }

View File

@ -234,7 +234,7 @@ void V3Error::v3errorEnd(std::ostringstream& sstr, const string& locationStr) {
s_describedWarnings = true; s_describedWarnings = true;
} }
if (s_errorCode.dangerous()) { if (s_errorCode.dangerous()) {
std::cerr << warnMore() << "*** See the manual before disabling this," << endl; std::cerr << warnMore() << "*** See the manual before disabling this,\n";
std::cerr << warnMore() << "else you may end up with different sim results." std::cerr << warnMore() << "else you may end up with different sim results."
<< endl; << endl;
} }

View File

@ -159,12 +159,12 @@ inline void V3FileDependImp::writeDepend(const string& filename) {
if (!i.target()) *ofp << i.filename() << " "; if (!i.target()) *ofp << i.filename() << " ";
} }
*ofp << endl; *ofp << '\n';
if (v3Global.opt.makePhony()) { if (v3Global.opt.makePhony()) {
*ofp << endl; *ofp << '\n';
for (const DependFile& i : m_filenameList) { for (const DependFile& i : m_filenameList) {
if (!i.target()) *ofp << i.filename() << ":" << endl; if (!i.target()) *ofp << i.filename() << ":\n";
} }
} }
} }
@ -183,9 +183,8 @@ inline void V3FileDependImp::writeTimes(const string& filename, const string& cm
string cmdline = stripQuotes(cmdlineIn); string cmdline = stripQuotes(cmdlineIn);
*ofp << "# DESCR" *ofp << "# DESCR"
<< "IPTION: Verilator output: Timestamp data for --skip-identical. Delete at will." << "IPTION: Verilator output: Timestamp data for --skip-identical. Delete at will.\n";
<< endl; *ofp << "C \"" << cmdline << "\"\n";
*ofp << "C \"" << cmdline << "\"" << endl;
for (std::set<DependFile>::iterator iter = m_filenameList.begin(); for (std::set<DependFile>::iterator iter = m_filenameList.begin();
iter != m_filenameList.end(); ++iter) { iter != m_filenameList.end(); ++iter) {
@ -209,7 +208,7 @@ inline void V3FileDependImp::writeTimes(const string& filename, const string& cm
*ofp << " " << std::setw(11) << iter->mstime(); *ofp << " " << std::setw(11) << iter->mstime();
*ofp << " " << std::setw(11) << iter->mnstime(); *ofp << " " << std::setw(11) << iter->mnstime();
*ofp << " \"" << iter->filename() << "\""; *ofp << " \"" << iter->filename() << "\"";
*ofp << endl; *ofp << '\n';
} }
} }

View File

@ -810,10 +810,10 @@ void GateVisitor::warnSignals() {
vscp->varp()->user2(true); // Warn only once per signal vscp->varp()->user2(true); // Warn only once per signal
vscp->v3warn(SYNCASYNCNET, vscp->v3warn(SYNCASYNCNET,
"Signal flopped as both synchronous and async: " "Signal flopped as both synchronous and async: "
<< vscp->prettyNameQ() << endl << vscp->prettyNameQ() << '\n'
<< ap->warnOther() << "... Location of async usage" << endl << ap->warnOther() << "... Location of async usage\n"
<< ap->warnContextPrimary() << endl << ap->warnContextPrimary() << '\n'
<< sp->warnOther() << "... Location of sync usage" << endl << sp->warnOther() << "... Location of sync usage\n"
<< sp->warnContextSecondary()); << sp->warnContextSecondary());
} }
} }

View File

@ -279,7 +279,7 @@ void V3Graph::dump(std::ostream& os) {
for (V3GraphVertex* vertexp = verticesBeginp(); vertexp; vertexp = vertexp->verticesNextp()) { for (V3GraphVertex* vertexp = verticesBeginp(); vertexp; vertexp = vertexp->verticesNextp()) {
os << "\tNode: " << vertexp->name(); os << "\tNode: " << vertexp->name();
if (vertexp->color()) os << " color=" << vertexp->color(); if (vertexp->color()) os << " color=" << vertexp->color();
os << endl; os << '\n';
// Print edges // Print edges
for (V3GraphEdge* edgep = vertexp->inBeginp(); edgep; edgep = edgep->inNextp()) { for (V3GraphEdge* edgep = vertexp->inBeginp(); edgep; edgep = edgep->inNextp()) {
dumpEdge(os, vertexp, edgep); dumpEdge(os, vertexp, edgep);
@ -296,7 +296,7 @@ void V3Graph::dumpEdge(std::ostream& os, V3GraphVertex* vertexp, V3GraphEdge* ed
if (edgep->fromp() == vertexp) os << "-> " << edgep->top()->name(); if (edgep->fromp() == vertexp) os << "-> " << edgep->top()->name();
if (edgep->top() == vertexp) os << "<- " << edgep->fromp()->name(); if (edgep->top() == vertexp) os << "<- " << edgep->fromp()->name();
if (edgep->cutable()) os << " [CUTABLE]"; if (edgep->cutable()) os << " [CUTABLE]";
os << endl; os << '\n';
} }
} }

View File

@ -59,7 +59,7 @@ private:
typedef std::list<V3GraphEdge*> OrigEdgeList; // List of orig edges, see also GraphAcyc's decl typedef std::list<V3GraphEdge*> OrigEdgeList; // List of orig edges, see also GraphAcyc's decl
V3GraphEdge* origEdgep() const { V3GraphEdge* origEdgep() const {
OrigEdgeList* oEListp = static_cast<OrigEdgeList*>(userp()); OrigEdgeList* oEListp = static_cast<OrigEdgeList*>(userp());
if (!oEListp) v3fatalSrc("No original edge associated with acyc edge " << this << endl); if (!oEListp) v3fatalSrc("No original edge associated with acyc edge " << this);
return (oEListp->front()); return (oEListp->front());
} }
@ -155,7 +155,7 @@ private:
breakEdgep->cut(); breakEdgep->cut();
OrigEdgeList* oEListp = static_cast<OrigEdgeList*>(breakEdgep->userp()); OrigEdgeList* oEListp = static_cast<OrigEdgeList*>(breakEdgep->userp());
if (!oEListp) { if (!oEListp) {
v3fatalSrc("No original edge associated with cutting edge " << breakEdgep << endl); v3fatalSrc("No original edge associated with cutting edge " << breakEdgep);
} }
// The breakGraph edge may represent multiple real edges; cut them all // The breakGraph edge may represent multiple real edges; cut them all
for (const auto& origEdgep : *oEListp) { for (const auto& origEdgep : *oEListp) {

View File

@ -172,19 +172,19 @@ void V3Hashed::dumpFile(const string& filename, bool tree) {
if (it == end()) break; if (it == end()) break;
num_in_bucket++; num_in_bucket++;
} }
*logp << "\n*** STATS:\n" << endl; *logp << "\n*** STATS:\n\n";
*logp << " #InBucket Occurrences\n"; *logp << " #InBucket Occurrences\n";
for (const auto& i : dist) { for (const auto& i : dist) {
*logp << " " << std::setw(9) << i.first << " " << std::setw(12) << i.second << endl; *logp << " " << std::setw(9) << i.first << " " << std::setw(12) << i.second << '\n';
} }
*logp << "\n*** Dump:\n" << endl; *logp << "\n*** Dump:\n\n";
for (const auto& itr : *this) { for (const auto& itr : *this) {
if (lasthash != itr.first) { if (lasthash != itr.first) {
lasthash = itr.first; lasthash = itr.first;
*logp << " " << itr.first << endl; *logp << " " << itr.first << '\n';
} }
*logp << "\t" << itr.second << endl; *logp << "\t" << itr.second << '\n';
// Dumping the entire tree may make nearly N^2 sized dumps, // Dumping the entire tree may make nearly N^2 sized dumps,
// because the nodes under this one may also be in the hash table! // because the nodes under this one may also be in the hash table!
if (tree) itr.second->dumpTree(*logp, " "); if (tree) itr.second->dumpTree(*logp, " ");

View File

@ -284,7 +284,7 @@ private:
++m_depth; ++m_depth;
if (unsigned costPlus1 = nodep->user4()) { if (unsigned costPlus1 = nodep->user4()) {
*m_osp << " " << indent() << "cost " << std::setw(6) << std::left << (costPlus1 - 1) *m_osp << " " << indent() << "cost " << std::setw(6) << std::left << (costPlus1 - 1)
<< " " << nodep << endl; << " " << nodep << '\n';
iterateChildren(nodep); iterateChildren(nodep);
} }
--m_depth; --m_depth;

View File

@ -78,7 +78,7 @@ void LinkCellsGraph::loopsMessageCb(V3GraphVertex* vertexp) {
vvertexp->modp()->v3warn(E_UNSUPPORTED, vvertexp->modp()->v3warn(E_UNSUPPORTED,
"Unsupported: Recursive multiple modules (module instantiates " "Unsupported: Recursive multiple modules (module instantiates "
"something leading back to itself): " "something leading back to itself): "
<< vvertexp->modp()->prettyNameQ() << endl << vvertexp->modp()->prettyNameQ() << '\n'
<< V3Error::warnMore() << V3Error::warnMore()
<< "... note: self-recursion (module instantiating itself " << "... note: self-recursion (module instantiating itself "
"directly) is supported."); "directly) is supported.");
@ -482,10 +482,10 @@ private:
|| nodep->fileline()->warnIsOff(V3ErrorCode::MODDUP) || nodep->fileline()->warnIsOff(V3ErrorCode::MODDUP)
|| hierBlocks.find(nodep->name()) != hierBlocks.end())) { || hierBlocks.find(nodep->name()) != hierBlocks.end())) {
nodep->v3warn(MODDUP, "Duplicate declaration of module: " nodep->v3warn(MODDUP, "Duplicate declaration of module: "
<< nodep->prettyNameQ() << endl << nodep->prettyNameQ() << '\n'
<< nodep->warnContextPrimary() << endl << nodep->warnContextPrimary() << '\n'
<< foundp->warnOther() << foundp->warnOther()
<< "... Location of original declaration" << endl << "... Location of original declaration\n"
<< foundp->warnContextSecondary()); << foundp->warnContextSecondary());
} }
nodep->unlinkFrBack(); nodep->unlinkFrBack();

View File

@ -180,7 +180,7 @@ public:
// left side is what we will import into // left side is what we will import into
os << "\t" << samn << "\t" << it->first << " (" os << "\t" << samn << "\t" << it->first << " ("
<< it->first->nodep()->typeName() << ") <- " << it->second << " " << it->first->nodep()->typeName() << ") <- " << it->second << " "
<< it->second->nodep() << endl; << it->second->nodep() << '\n';
} }
} }
} }
@ -269,15 +269,15 @@ public:
UINFO(4, "Var2 " << fnodep << endl); UINFO(4, "Var2 " << fnodep << endl);
if (nodep->type() == fnodep->type()) { if (nodep->type() == fnodep->type()) {
nodep->v3error("Duplicate declaration of " nodep->v3error("Duplicate declaration of "
<< nodeTextType(fnodep) << ": " << nodep->prettyNameQ() << endl << nodeTextType(fnodep) << ": " << nodep->prettyNameQ() << '\n'
<< nodep->warnContextPrimary() << endl << nodep->warnContextPrimary() << '\n'
<< fnodep->warnOther() << "... Location of original declaration\n" << fnodep->warnOther() << "... Location of original declaration\n"
<< fnodep->warnContextSecondary()); << fnodep->warnContextSecondary());
} else { } else {
nodep->v3error("Unsupported in C: " nodep->v3error("Unsupported in C: "
<< ucfirst(nodeTextType(nodep)) << " has the same name as " << ucfirst(nodeTextType(nodep)) << " has the same name as "
<< nodeTextType(fnodep) << ": " << nodep->prettyNameQ() << endl << nodeTextType(fnodep) << ": " << nodep->prettyNameQ() << '\n'
<< nodep->warnContextPrimary() << endl << nodep->warnContextPrimary() << '\n'
<< fnodep->warnOther() << "... Location of original declaration\n" << fnodep->warnOther() << "... Location of original declaration\n"
<< fnodep->warnContextSecondary()); << fnodep->warnContextSecondary());
} }
@ -481,7 +481,7 @@ public:
ifacerefp->modportFileline()->v3error( ifacerefp->modportFileline()->v3error(
"Modport not found under interface " "Modport not found under interface "
<< ifacerefp->prettyNameQ(ifacerefp->ifaceName()) << ": " << ifacerefp->prettyNameQ(ifacerefp->ifaceName()) << ": "
<< ifacerefp->prettyNameQ(ifacerefp->modportName()) << endl << ifacerefp->prettyNameQ(ifacerefp->modportName()) << '\n'
<< (suggest.empty() ? "" : ifacerefp->warnMore() + suggest)); << (suggest.empty() ? "" : ifacerefp->warnMore() + suggest));
} }
} }
@ -1081,15 +1081,15 @@ class LinkDotFindVisitor : public AstNVisitor {
if (didAnsiWarn++) ansiWarn = false; if (didAnsiWarn++) ansiWarn = false;
} }
nodep->v3error("Duplicate declaration of signal: " nodep->v3error("Duplicate declaration of signal: "
<< nodep->prettyNameQ() << endl << nodep->prettyNameQ() << '\n'
<< (ansiWarn ? nodep->warnMore() << (ansiWarn ? nodep->warnMore()
+ "... note: ANSI ports must have" + "... note: ANSI ports must have"
" type declared with the I/O (IEEE " " type declared with the I/O (IEEE "
"1800-2017 23.2.2.2)\n" "1800-2017 23.2.2.2)\n"
: "") : "")
<< nodep->warnContextPrimary() << endl << nodep->warnContextPrimary() << '\n'
<< findvarp->warnOther() << findvarp->warnOther()
<< "... Location of original declaration" << endl << "... Location of original declaration\n"
<< findvarp->warnContextSecondary()); << findvarp->warnContextSecondary());
// Combining most likely reduce other errors // Combining most likely reduce other errors
findvarp->combineType(nodep); findvarp->combineType(nodep);
@ -1119,8 +1119,8 @@ class LinkDotFindVisitor : public AstNVisitor {
&& !foundp->nodep()->fileline()->warnIsOff(V3ErrorCode::VARHIDDEN)) { && !foundp->nodep()->fileline()->warnIsOff(V3ErrorCode::VARHIDDEN)) {
nodep->v3warn(VARHIDDEN, nodep->v3warn(VARHIDDEN,
"Declaration of signal hides declaration in upper scope: " "Declaration of signal hides declaration in upper scope: "
<< nodep->prettyNameQ() << endl << nodep->prettyNameQ() << '\n'
<< nodep->warnContextPrimary() << endl << nodep->warnContextPrimary() << '\n'
<< foundp->nodep()->warnOther() << foundp->nodep()->warnOther()
<< "... Location of original declaration\n" << "... Location of original declaration\n"
<< foundp->nodep()->warnContextSecondary()); << foundp->nodep()->warnContextSecondary());
@ -1204,8 +1204,8 @@ class LinkDotFindVisitor : public AstNVisitor {
if (foundp->parentp() == m_curSymp // Only when on same level if (foundp->parentp() == m_curSymp // Only when on same level
&& !foundp->imported()) { // and not from package && !foundp->imported()) { // and not from package
nodep->v3error("Duplicate declaration of enum value: " nodep->v3error("Duplicate declaration of enum value: "
<< nodep->prettyName() << endl << nodep->prettyName() << '\n'
<< nodep->warnContextPrimary() << endl << nodep->warnContextPrimary() << '\n'
<< foundp->nodep()->warnOther() << foundp->nodep()->warnOther()
<< "... Location of original declaration\n" << "... Location of original declaration\n"
<< foundp->nodep()->warnContextSecondary()); << foundp->nodep()->warnContextSecondary());
@ -1215,8 +1215,8 @@ class LinkDotFindVisitor : public AstNVisitor {
&& !foundp->nodep()->fileline()->warnIsOff(V3ErrorCode::VARHIDDEN)) { && !foundp->nodep()->fileline()->warnIsOff(V3ErrorCode::VARHIDDEN)) {
nodep->v3warn(VARHIDDEN, nodep->v3warn(VARHIDDEN,
"Declaration of enum value hides declaration in upper scope: " "Declaration of enum value hides declaration in upper scope: "
<< nodep->prettyName() << endl << nodep->prettyName() << '\n'
<< nodep->warnContextPrimary() << endl << nodep->warnContextPrimary() << '\n'
<< foundp->nodep()->warnOther() << foundp->nodep()->warnOther()
<< "... Location of original declaration\n" << "... Location of original declaration\n"
<< nodep->warnContextSecondary()); << nodep->warnContextSecondary());
@ -1417,8 +1417,8 @@ private:
} else { } else {
if (refp->user4()) { if (refp->user4()) {
nodep->v3error("Duplicate declaration of port: " nodep->v3error("Duplicate declaration of port: "
<< nodep->prettyNameQ() << endl << nodep->prettyNameQ() << '\n'
<< nodep->warnContextPrimary() << endl << nodep->warnContextPrimary() << '\n'
<< refp->warnOther() << "... Location of original declaration\n" << refp->warnOther() << "... Location of original declaration\n"
<< refp->warnContextSecondary()); << refp->warnContextSecondary());
} }
@ -1811,7 +1811,7 @@ private:
LinkNodeMatcherVar()); LinkNodeMatcherVar());
nodep->v3error("Signal definition not found, and implicit disabled with " nodep->v3error("Signal definition not found, and implicit disabled with "
"`default_nettype: " "`default_nettype: "
<< nodep->prettyNameQ() << endl << nodep->prettyNameQ() << '\n'
<< (suggest.empty() ? "" : nodep->warnMore() + suggest)); << (suggest.empty() ? "" : nodep->warnMore() + suggest));
} }
@ -1822,7 +1822,7 @@ private:
LinkNodeMatcherVar()); LinkNodeMatcherVar());
nodep->v3warn(IMPLICIT, nodep->v3warn(IMPLICIT,
"Signal definition not found, creating implicitly: " "Signal definition not found, creating implicitly: "
<< nodep->prettyNameQ() << endl << nodep->prettyNameQ() << '\n'
<< (suggest.empty() ? "" : nodep->warnMore() + suggest)); << (suggest.empty() ? "" : nodep->warnMore() + suggest));
} }
} }
@ -1876,8 +1876,8 @@ private:
} }
void markAndCheckPinDup(AstNode* nodep, AstNode* refp, const char* whatp) { void markAndCheckPinDup(AstNode* nodep, AstNode* refp, const char* whatp) {
if (refp->user5p() && refp->user5p() != nodep) { if (refp->user5p() && refp->user5p() != nodep) {
nodep->v3error("Duplicate " << whatp << " connection: " << nodep->prettyNameQ() << endl nodep->v3error("Duplicate " << whatp << " connection: " << nodep->prettyNameQ() << '\n'
<< nodep->warnContextPrimary() << endl << nodep->warnContextPrimary() << '\n'
<< refp->user5p()->warnOther() << refp->user5p()->warnOther()
<< "... Location of original " << whatp << " connection\n" << "... Location of original " << whatp << " connection\n"
<< refp->user5p()->warnContextSecondary()); << refp->user5p()->warnContextSecondary());
@ -1973,7 +1973,7 @@ private:
: m_statep->suggestSymFlat(m_pinSymp, nodep->name(), : m_statep->suggestSymFlat(m_pinSymp, nodep->name(),
LinkNodeMatcherVarIO())); LinkNodeMatcherVarIO()));
nodep->v3error(ucfirst(whatp) nodep->v3error(ucfirst(whatp)
<< " not found: " << nodep->prettyNameQ() << endl << " not found: " << nodep->prettyNameQ() << '\n'
<< (suggest.empty() ? "" : nodep->warnMore() + suggest)); << (suggest.empty() ? "" : nodep->warnMore() + suggest));
} else if (AstVar* refp = VN_CAST(foundp->nodep(), Var)) { } else if (AstVar* refp = VN_CAST(foundp->nodep(), Var)) {
if (!refp->isIO() && !refp->isParam() && !refp->isIfaceRef()) { if (!refp->isIO() && !refp->isParam() && !refp->isIfaceRef()) {
@ -2327,7 +2327,7 @@ private:
string suggest = m_statep->suggestSymFallback( string suggest = m_statep->suggestSymFallback(
m_ds.m_dotSymp, nodep->name(), VNodeMatcher()); m_ds.m_dotSymp, nodep->name(), VNodeMatcher());
nodep->v3error("Can't find definition of " nodep->v3error("Can't find definition of "
<< expectWhat << ": " << nodep->prettyNameQ() << endl << expectWhat << ": " << nodep->prettyNameQ() << '\n'
<< (suggest.empty() ? "" : nodep->warnMore() + suggest)); << (suggest.empty() ? "" : nodep->warnMore() + suggest));
} else { } else {
nodep->v3error("Can't find definition of " nodep->v3error("Can't find definition of "
@ -2605,14 +2605,14 @@ private:
VL_DO_DANGLING(nodep->deleteTree(), nodep); VL_DO_DANGLING(nodep->deleteTree(), nodep);
return; return;
} else { } else {
nodep->v3error("Unsupported or unknown PLI call: " nodep->v3error(
<< nodep->prettyNameQ() << endl); "Unsupported or unknown PLI call: " << nodep->prettyNameQ());
} }
} else { } else {
string suggest = m_statep->suggestSymFallback(dotSymp, nodep->name(), string suggest = m_statep->suggestSymFallback(dotSymp, nodep->name(),
LinkNodeMatcherFTask()); LinkNodeMatcherFTask());
nodep->v3error("Can't find definition of task/function: " nodep->v3error("Can't find definition of task/function: "
<< nodep->prettyNameQ() << endl << nodep->prettyNameQ() << '\n'
<< (suggest.empty() ? "" : nodep->warnMore() + suggest)); << (suggest.empty() ? "" : nodep->warnMore() + suggest));
} }
} else { } else {
@ -2773,7 +2773,7 @@ private:
m_curSymp, cpackagerefp->name(), LinkNodeMatcherClass{}); m_curSymp, cpackagerefp->name(), LinkNodeMatcherClass{});
cpackagerefp->v3error( cpackagerefp->v3error(
"Class to extend not found: " "Class to extend not found: "
<< cpackagerefp->prettyNameQ() << endl << cpackagerefp->prettyNameQ() << '\n'
<< (suggest.empty() ? "" : cpackagerefp->warnMore() + suggest)); << (suggest.empty() ? "" : cpackagerefp->warnMore() + suggest));
} }
} }
@ -2810,7 +2810,7 @@ private:
if (!VN_IS(nodep->packagep(), Class) && !VN_IS(nodep->packagep(), Package)) { if (!VN_IS(nodep->packagep(), Class) && !VN_IS(nodep->packagep(), Package)) {
cpackagerefp->v3error( cpackagerefp->v3error(
"'::' expected to reference a class/package but referenced " "'::' expected to reference a class/package but referenced "
<< nodep->packagep()->prettyTypeName() << endl << nodep->packagep()->prettyTypeName() << '\n'
<< cpackagerefp->warnMore() + "... Suggest '.' instead of '::'"); << cpackagerefp->warnMore() + "... Suggest '.' instead of '::'");
} }
} }

View File

@ -227,7 +227,7 @@ void V3Number::V3NumberCreate(AstNode* nodep, const char* sourcep, FileLine* fl)
if (product.bitsValue(width(), 4)) { // Overflowed if (product.bitsValue(width(), 4)) { // Overflowed
static int warned = 0; static int warned = 0;
v3error("Too many digits for " v3error("Too many digits for "
<< width() << " bit number: " << sourcep << std::endl << width() << " bit number: " << sourcep << '\n'
<< ((!m_sized && !warned++) ? ( << ((!m_sized && !warned++) ? (
V3Error::warnMore() + "... As that number was unsized" V3Error::warnMore() + "... As that number was unsized"
+ " ('d...) it is limited to 32 bits (IEEE 1800-2017 " + " ('d...) it is limited to 32 bits (IEEE 1800-2017 "

View File

@ -547,8 +547,7 @@ void V3Options::filePathLookedMsg(FileLine* fl, const string& modname) {
} else if (!shown_notfound_msg) { } else if (!shown_notfound_msg) {
shown_notfound_msg = true; shown_notfound_msg = true;
if (m_impp->m_incDirUsers.empty()) { if (m_impp->m_incDirUsers.empty()) {
fl->v3error("This may be because there's no search path specified with -I<dir>." fl->v3error("This may be because there's no search path specified with -I<dir>.");
<< endl);
} }
std::cerr << V3Error::warnMore() << "... Looked in:" << endl; std::cerr << V3Error::warnMore() << "... Looked in:" << endl;
for (const string& dir : m_impp->m_incDirUsers) { for (const string& dir : m_impp->m_incDirUsers) {

View File

@ -113,7 +113,7 @@ static bool domainsExclusive(const AstSenTree* fromp, const AstSenTree* top);
// Functions for above graph classes // Functions for above graph classes
void OrderGraph::loopsVertexCb(V3GraphVertex* vertexp) { void OrderGraph::loopsVertexCb(V3GraphVertex* vertexp) {
if (debug()) cout << "-Info-Loop: " << vertexp << " " << endl; if (debug()) cout << "-Info-Loop: " << vertexp << "\n";
if (OrderLogicVertex* vvertexp = dynamic_cast<OrderLogicVertex*>(vertexp)) { if (OrderLogicVertex* vvertexp = dynamic_cast<OrderLogicVertex*>(vertexp)) {
std::cerr << vvertexp->nodep()->fileline()->warnOther() std::cerr << vvertexp->nodep()->fileline()->warnOther()
<< " Example path: " << vvertexp->nodep()->typeName() << endl; << " Example path: " << vvertexp->nodep()->typeName() << endl;
@ -273,7 +273,7 @@ private:
if (m_inClocked) { if (m_inClocked) {
varrefp->v3warn( varrefp->v3warn(
CLKDATA, "Clock used as data (on rhs of assignment) in sequential block " CLKDATA, "Clock used as data (on rhs of assignment) in sequential block "
<< varrefp->prettyNameQ() << endl); << varrefp->prettyNameQ());
} else { } else {
m_hasClk = true; m_hasClk = true;
UINFO(5, "node is already marked as clocker " << varrefp << endl); UINFO(5, "node is already marked as clocker " << varrefp << endl);
@ -290,8 +290,8 @@ private:
// do the marking // do the marking
if (m_hasClk) { if (m_hasClk) {
if (nodep->lhsp()->width() > m_rightClkWidth) { if (nodep->lhsp()->width() > m_rightClkWidth) {
nodep->v3warn(CLKDATA, "Clock is assigned to part of data signal " << nodep->lhsp() nodep->v3warn(CLKDATA,
<< endl); "Clock is assigned to part of data signal " << nodep->lhsp());
UINFO(4, "CLKDATA: lhs with width " << nodep->lhsp()->width() << endl); UINFO(4, "CLKDATA: lhs with width " << nodep->lhsp()->width() << endl);
UINFO(4, " but rhs clock with width " << m_rightClkWidth << endl); UINFO(4, " but rhs clock with width " << m_rightClkWidth << endl);
return; // skip the marking return; // skip the marking
@ -870,7 +870,7 @@ private:
m_graph.userClearVertices(); m_graph.userClearVertices();
// May be very large vector, so only report the "most important" // May be very large vector, so only report the "most important"
// elements. Up to 10 of the widest // elements. Up to 10 of the widest
std::cerr << V3Error::warnMore() << "... Widest candidate vars to split:" << endl; std::cerr << V3Error::warnMore() << "... Widest candidate vars to split:\n";
std::stable_sort(m_unoptflatVars.begin(), m_unoptflatVars.end(), OrderVarWidthCmp()); std::stable_sort(m_unoptflatVars.begin(), m_unoptflatVars.end(), OrderVarWidthCmp());
std::unordered_set<const AstVar*> canSplitList; std::unordered_set<const AstVar*> canSplitList;
int lim = m_unoptflatVars.size() < 10 ? m_unoptflatVars.size() : 10; int lim = m_unoptflatVars.size() < 10 ? m_unoptflatVars.size() : 10;
@ -885,10 +885,10 @@ private:
std::cerr << ", can split_var"; std::cerr << ", can split_var";
canSplitList.insert(varp); canSplitList.insert(varp);
} }
std::cerr << std::endl; std::cerr << '\n';
} }
// Up to 10 of the most fanned out // Up to 10 of the most fanned out
std::cerr << V3Error::warnMore() << "... Most fanned out candidate vars to split:" << endl; std::cerr << V3Error::warnMore() << "... Most fanned out candidate vars to split:\n";
std::stable_sort(m_unoptflatVars.begin(), m_unoptflatVars.end(), OrderVarFanoutCmp()); std::stable_sort(m_unoptflatVars.begin(), m_unoptflatVars.end(), OrderVarFanoutCmp());
lim = m_unoptflatVars.size() < 10 ? m_unoptflatVars.size() : 10; lim = m_unoptflatVars.size() < 10 ? m_unoptflatVars.size() : 10;
for (int i = 0; i < lim; i++) { for (int i = 0; i < lim; i++) {
@ -902,7 +902,7 @@ private:
std::cerr << ", can split_var"; std::cerr << ", can split_var";
canSplitList.insert(varp); canSplitList.insert(varp);
} }
std::cerr << endl; std::cerr << '\n';
} }
if (!canSplitList.empty()) { if (!canSplitList.empty()) {
std::cerr << V3Error::warnMore() std::cerr << V3Error::warnMore()
@ -1573,9 +1573,9 @@ void OrderVisitor::processEdgeReport() {
} }
} }
*logp << "Signals and their clock domains:" << endl; *logp << "Signals and their clock domains:\n";
stable_sort(report.begin(), report.end()); stable_sort(report.begin(), report.end());
for (const string& i : report) *logp << i << endl; for (const string& i : report) *logp << i << '\n';
} }
void OrderVisitor::processMoveClear() { void OrderVisitor::processMoveClear() {

View File

@ -663,7 +663,7 @@ public:
// Dump // Dump
for (const LogicMTask* mtaskp : path) { for (const LogicMTask* mtaskp : path) {
*osp << "begin mtask with cost " << mtaskp->cost() << endl; *osp << "begin mtask with cost " << mtaskp->cost() << '\n';
for (VxList::const_iterator lit = mtaskp->vertexListp()->begin(); for (VxList::const_iterator lit = mtaskp->vertexListp()->begin();
lit != mtaskp->vertexListp()->end(); ++lit) { lit != mtaskp->vertexListp()->end(); ++lit) {
const OrderLogicVertex* logicp = (*lit)->logicp(); const OrderLogicVertex* logicp = (*lit)->logicp();

View File

@ -855,7 +855,7 @@ void V3PreProcImp::dumpDefines(std::ostream& os) {
// No need to print "()" below as already part of params() // No need to print "()" below as already part of params()
if (!it->second.params().empty()) os << it->second.params(); if (!it->second.params().empty()) os << it->second.params();
if (!it->second.value().empty()) os << " " << it->second.value(); if (!it->second.value().empty()) os << " " << it->second.value();
os << endl; os << '\n';
} }
} }

View File

@ -39,13 +39,12 @@ class StatsReport {
static StatColl s_allStats; ///< All statistics static StatColl s_allStats; ///< All statistics
void header() { void header() {
os << "Verilator Statistics Report\n"; os << "Verilator Statistics Report\n\n";
os << endl;
os << "Information:" << endl; os << "Information:\n";
os << " " << V3Options::version() << endl; os << " " << V3Options::version() << '\n';
os << " Arguments: " << v3Global.opt.allArgsString() << endl; os << " Arguments: " << v3Global.opt.allArgsString() << '\n';
os << endl; os << '\n';
} }
void sumit() { void sumit() {
@ -85,28 +84,26 @@ class StatsReport {
} }
// Print organized by stage // Print organized by stage
os << "Global Statistics:\n"; os << "Global Statistics:\n\n";
os << endl;
for (const auto& itr : byName) { for (const auto& itr : byName) {
const V3Statistic* repp = itr.second; const V3Statistic* repp = itr.second;
if (repp->perf()) continue; if (repp->perf()) continue;
os << " " << std::left << std::setw(maxWidth) << repp->name(); os << " " << std::left << std::setw(maxWidth) << repp->name();
repp->dump(os); repp->dump(os);
os << endl; os << '\n';
} }
os << endl; os << '\n';
// Print organized by stage // Print organized by stage
os << "Performance Statistics:\n"; os << "Performance Statistics:\n\n";
os << endl;
for (const auto& itr : byName) { for (const auto& itr : byName) {
const V3Statistic* repp = itr.second; const V3Statistic* repp = itr.second;
if (!repp->perf()) continue; if (!repp->perf()) continue;
os << " " << std::left << std::setw(maxWidth) << repp->name(); os << " " << std::left << std::setw(maxWidth) << repp->name();
repp->dump(os); repp->dump(os);
os << endl; os << '\n';
} }
os << endl; os << '\n';
} }
void stages() { void stages() {
@ -136,7 +133,7 @@ class StatsReport {
// Header // Header
os << " Stat " << std::left << std::setw(maxWidth - 5 - 2) << ""; os << " Stat " << std::left << std::setw(maxWidth - 5 - 2) << "";
for (const string& i : stages) os << " " << std::left << std::setw(9) << i; for (const string& i : stages) os << " " << std::left << std::setw(9) << i;
os << endl; os << '\n';
os << " -------- " << std::left << std::setw(maxWidth - 5 - 2) << ""; os << " -------- " << std::left << std::setw(maxWidth - 5 - 2) << "";
for (auto it = stages.begin(); it != stages.end(); ++it) { for (auto it = stages.begin(); it != stages.end(); ++it) {
os << " " << std::left << std::setw(9) << "-------"; os << " " << std::left << std::setw(9) << "-------";
@ -157,10 +154,10 @@ class StatsReport {
if ((pos = commaName.find(',')) != string::npos) commaName.erase(pos); if ((pos = commaName.find(',')) != string::npos) commaName.erase(pos);
if (lastCommaName != commaName) { if (lastCommaName != commaName) {
lastCommaName = commaName; lastCommaName = commaName;
os << endl; os << '\n';
} }
} }
os << endl; os << '\n';
col = 0; col = 0;
os << " " << std::left << std::setw(maxWidth) << repp->name(); os << " " << std::left << std::setw(maxWidth) << repp->name();
} }
@ -171,7 +168,7 @@ class StatsReport {
repp->dump(os); repp->dump(os);
col++; col++;
} }
os << endl; os << '\n';
} }
public: public:

View File

@ -345,13 +345,13 @@ void VHashSha256::selfTestOne(const string& data, const string& data2, const str
VHashSha256 digest(data); VHashSha256 digest(data);
if (data2 != "") digest.insert(data2); if (data2 != "") digest.insert(data2);
if (VL_UNCOVERABLE(digest.digestHex() != exp)) { if (VL_UNCOVERABLE(digest.digestHex() != exp)) {
std::cerr << "%Error: When hashing '" << data + data2 << "'" << endl // LCOV_EXCL_LINE std::cerr << "%Error: When hashing '" << data + data2 << "'\n" // LCOV_EXCL_LINE
<< " ... got=" << digest.digestHex() << endl // LCOV_EXCL_LINE << " ... got=" << digest.digestHex() << '\n' // LCOV_EXCL_LINE
<< " ... exp=" << exp << endl; // LCOV_EXCL_LINE << " ... exp=" << exp << endl; // LCOV_EXCL_LINE
} }
if (VL_UNCOVERABLE(digest.digestSymbol() != exp64)) { if (VL_UNCOVERABLE(digest.digestSymbol() != exp64)) {
std::cerr << "%Error: When hashing '" << data + data2 << "'" << endl // LCOV_EXCL_LINE std::cerr << "%Error: When hashing '" << data + data2 << "'\n" // LCOV_EXCL_LINE
<< " ... got=" << digest.digestSymbol() << endl // LCOV_EXCL_LINE << " ... got=" << digest.digestSymbol() << '\n' // LCOV_EXCL_LINE
<< " ... exp=" << exp64 << endl; // LCOV_EXCL_LINE << " ... exp=" << exp64 << endl; // LCOV_EXCL_LINE
} }
} }

View File

@ -72,7 +72,7 @@ public:
os << " fallb=se" << cvtToHex(m_fallbackp); os << " fallb=se" << cvtToHex(m_fallbackp);
if (m_symPrefix != "") os << " symPrefix=" << m_symPrefix; if (m_symPrefix != "") os << " symPrefix=" << m_symPrefix;
os << " n=" << nodep(); os << " n=" << nodep();
os << endl; os << '\n';
if (VL_UNCOVERABLE(doneSymsr.find(this) != doneSymsr.end())) { if (VL_UNCOVERABLE(doneSymsr.find(this) != doneSymsr.end())) {
os << indent << "| ^ duplicate, so no children printed\n"; // LCOV_EXCL_LINE os << indent << "| ^ duplicate, so no children printed\n"; // LCOV_EXCL_LINE
} else { } else {
@ -126,8 +126,7 @@ public:
if (name != "" && m_idNameMap.find(name) != m_idNameMap.end()) { if (name != "" && m_idNameMap.find(name) != m_idNameMap.end()) {
if (!V3Error::errorCount()) { // Else may have just reported warning if (!V3Error::errorCount()) { // Else may have just reported warning
if (debug() >= 9 || V3Error::debugDefault()) dump(cout, "- err-dump: ", 1); if (debug() >= 9 || V3Error::debugDefault()) dump(cout, "- err-dump: ", 1);
entp->nodep()->v3fatalSrc("Inserting two symbols with same name: " << name entp->nodep()->v3fatalSrc("Inserting two symbols with same name: " << name);
<< endl);
} }
} else { } else {
m_idNameMap.insert(make_pair(name, entp)); m_idNameMap.insert(make_pair(name, entp));

View File

@ -346,10 +346,10 @@ public:
os << "At " << nameComment << ", dumping graph. Keys:\n"; os << "At " << nameComment << ", dumping graph. Keys:\n";
for (V3GraphVertex* vxp = verticesBeginp(); vxp; vxp = vxp->verticesNextp()) { for (V3GraphVertex* vxp = verticesBeginp(); vxp; vxp = vxp->verticesNextp()) {
Vertex* tspvp = castVertexp(vxp); Vertex* tspvp = castVertexp(vxp);
os << " " << tspvp->key() << endl; os << " " << tspvp->key() << '\n';
for (V3GraphEdge* edgep = tspvp->outBeginp(); edgep; edgep = edgep->outNextp()) { for (V3GraphEdge* edgep = tspvp->outBeginp(); edgep; edgep = edgep->outNextp()) {
Vertex* neighborp = castVertexp(edgep->top()); Vertex* neighborp = castVertexp(edgep->top());
os << " has edge " << edgep->user() << " to " << neighborp->key() << endl; os << " has edge " << edgep->user() << " to " << neighborp->key() << '\n';
} }
} }
} }

View File

@ -146,11 +146,11 @@ public:
if (!vxp->pure()) { if (!vxp->pure()) {
nodep->v3warn( nodep->v3warn(
IMPURE, "Unsupported: External variable referenced by non-inlined function/task: " IMPURE, "Unsupported: External variable referenced by non-inlined function/task: "
<< nodep->prettyNameQ() << endl << nodep->prettyNameQ() << '\n'
<< nodep->warnContextPrimary() << endl << nodep->warnContextPrimary() << '\n'
<< vxp->impureNode()->warnOther() << vxp->impureNode()->warnOther()
<< "... Location of the external reference: " << "... Location of the external reference: "
<< vxp->impureNode()->prettyNameQ() << endl << vxp->impureNode()->prettyNameQ() << '\n'
<< vxp->impureNode()->warnContextSecondary()); << vxp->impureNode()->warnContextSecondary());
} }
// And, we need to check all tasks this task calls // And, we need to check all tasks this task calls
@ -837,11 +837,11 @@ private:
} else if (iter->second.second != dpiproto) { } else if (iter->second.second != dpiproto) {
nodep->v3error( nodep->v3error(
"Duplicate declaration of DPI function with different formal arguments: " "Duplicate declaration of DPI function with different formal arguments: "
<< nodep->prettyNameQ() << endl << nodep->prettyNameQ() << '\n'
<< nodep->warnContextPrimary() << endl << nodep->warnContextPrimary() << '\n'
<< nodep->warnMore() << "... New prototype: " << dpiproto << endl << nodep->warnMore() << "... New prototype: " << dpiproto << '\n'
<< iter->second.first->warnOther() << iter->second.first->warnOther()
<< "... Original prototype: " << iter->second.second << endl << "... Original prototype: " << iter->second.second << '\n'
<< iter->second.first->warnContextSecondary()); << iter->second.first->warnContextSecondary());
return true; return true;
} else { } else {
@ -862,7 +862,7 @@ private:
portp->v3warn( portp->v3warn(
E_UNSUPPORTED, E_UNSUPPORTED,
"Unsupported: DPI argument of type " "Unsupported: DPI argument of type "
<< portp->basicp()->prettyTypeName() << endl << portp->basicp()->prettyTypeName() << '\n'
<< portp->warnMore() << portp->warnMore()
<< "... For best portability, use bit, byte, int, or longint"); << "... For best portability, use bit, byte, int, or longint");
// We don't warn on logic either, although the 4-stateness is lost. // We don't warn on logic either, although the 4-stateness is lost.

View File

@ -449,7 +449,7 @@ class TristateVisitor : public TristateBaseVisitor {
} else { } else {
if (oldpullp->direction() != pullp->direction()) { if (oldpullp->direction() != pullp->direction()) {
pullp->v3warn(E_UNSUPPORTED, "Unsupported: Conflicting pull directions.\n" pullp->v3warn(E_UNSUPPORTED, "Unsupported: Conflicting pull directions.\n"
<< pullp->warnContextPrimary() << endl << pullp->warnContextPrimary() << '\n'
<< oldpullp->warnOther() << oldpullp->warnOther()
<< "... Location of conflicting pull.\n" << "... Location of conflicting pull.\n"
<< oldpullp->warnContextSecondary()); << oldpullp->warnContextSecondary());

View File

@ -118,11 +118,10 @@ private:
m_forVarp = VN_CAST(initAssp->lhsp(), VarRef)->varp(); m_forVarp = VN_CAST(initAssp->lhsp(), VarRef)->varp();
m_forVscp = VN_CAST(initAssp->lhsp(), VarRef)->varScopep(); m_forVscp = VN_CAST(initAssp->lhsp(), VarRef)->varScopep();
if (VN_IS(nodep, GenFor) && !m_forVarp->isGenVar()) { if (VN_IS(nodep, GenFor) && !m_forVarp->isGenVar()) {
nodep->v3error("Non-genvar used in generate for: " // nodep->v3error("Non-genvar used in generate for: " << m_forVarp->prettyNameQ());
<< m_forVarp->prettyNameQ() << endl);
} else if (!VN_IS(nodep, GenFor) && m_forVarp->isGenVar()) { } else if (!VN_IS(nodep, GenFor) && m_forVarp->isGenVar()) {
nodep->v3error("Genvar not legal in non-generate for (IEEE 1800-2017 27.4): " nodep->v3error("Genvar not legal in non-generate for (IEEE 1800-2017 27.4): "
<< m_forVarp->prettyNameQ() << endl << m_forVarp->prettyNameQ() << '\n'
<< nodep->warnMore() << nodep->warnMore()
<< "... Suggest move for loop upwards to generate-level scope."); << "... Suggest move for loop upwards to generate-level scope.");
} }

View File

@ -34,20 +34,18 @@ void V3Waiver::write(const std::string& filename) {
if (ofp->fail()) v3fatal("Can't write " << filename); if (ofp->fail()) v3fatal("Can't write " << filename);
*ofp << "// DESCR" *ofp << "// DESCR"
"IPTION: Verilator output: Waivers generated with --waiver-output" "IPTION: Verilator output: Waivers generated with --waiver-output\n\n";
<< std::endl
<< endl;
*ofp << "`verilator_config" << endl << endl; *ofp << "`verilator_config\n\n";
*ofp << "// Below you find suggested waivers. You have three options:" << endl; *ofp << "// Below you find suggested waivers. You have three options:\n";
*ofp << "// 1. Fix the reason for the linter warning" << endl; *ofp << "// 1. Fix the reason for the linter warning\n";
*ofp << "// 2. Keep the waiver permanently if you are sure this is okay" << endl; *ofp << "// 2. Keep the waiver permanently if you are sure this is okay\n";
*ofp << "// 3. Keep the waiver temporarily to suppress the output" << endl << endl; *ofp << "// 3. Keep the waiver temporarily to suppress the output\n\n";
if (s_waiverList.size() == 0) { *ofp << "// No waivers needed - great!" << endl; } if (s_waiverList.empty()) *ofp << "// No waivers needed - great!\n";
for (const auto& i : s_waiverList) *ofp << "// " << i << std::endl << endl; for (const auto& i : s_waiverList) *ofp << "// " << i << "\n\n";
} }
V3Waiver::WaiverList V3Waiver::s_waiverList; V3Waiver::WaiverList V3Waiver::s_waiverList;

View File

@ -1605,10 +1605,10 @@ private:
virtual void visit(AstTypedef* nodep) override { virtual void visit(AstTypedef* nodep) override {
if (nodep->didWidthAndSet()) return; // This node is a dtype & not both PRELIMed+FINALed if (nodep->didWidthAndSet()) return; // This node is a dtype & not both PRELIMed+FINALed
if (auto* refp = checkRefToTypedefRecurse(nodep, nodep)) { if (auto* refp = checkRefToTypedefRecurse(nodep, nodep)) {
nodep->v3error("Typedef has self-reference: " << nodep->prettyNameQ() << endl nodep->v3error("Typedef has self-reference: " << nodep->prettyNameQ() << '\n'
<< nodep->warnContextPrimary() << endl << nodep->warnContextPrimary() << '\n'
<< refp->warnOther() << refp->warnOther()
<< "... Location of reference" << endl << "... Location of reference\n"
<< refp->warnContextSecondary()); << refp->warnContextSecondary());
// May cause internel error but avoids infinite loop on dump // May cause internel error but avoids infinite loop on dump
refp->typedefp(nullptr); refp->typedefp(nullptr);
@ -1959,8 +1959,8 @@ private:
if (inits.find(num) != inits.end()) { // IEEE says illegal if (inits.find(num) != inits.end()) { // IEEE says illegal
AstNode* otherp = inits.find(num)->second; AstNode* otherp = inits.find(num)->second;
itemp->v3error("Overlapping enumeration value: " itemp->v3error("Overlapping enumeration value: "
<< itemp->prettyNameQ() << endl << itemp->prettyNameQ() << '\n'
<< itemp->warnContextPrimary() << endl << itemp->warnContextPrimary() << '\n'
<< otherp->warnOther() << "... Location of original declaration\n" << otherp->warnOther() << "... Location of original declaration\n"
<< otherp->warnContextSecondary()); << otherp->warnContextSecondary());
} else { } else {
@ -2249,7 +2249,7 @@ private:
} }
UINFO(1, "found object " << foundp << endl); UINFO(1, "found object " << foundp << endl);
nodep->v3fatalSrc("MemberSel of non-variable\n" nodep->v3fatalSrc("MemberSel of non-variable\n"
<< nodep->warnContextPrimary() << endl << nodep->warnContextPrimary() << '\n'
<< foundp->warnOther() << "... Location of found object\n" << foundp->warnOther() << "... Location of found object\n"
<< foundp->warnContextSecondary()); << foundp->warnContextSecondary());
} }
@ -4079,7 +4079,7 @@ private:
<< " requires matching types;" << " requires matching types;"
<< " ref requires " << pinDTypep->prettyDTypeNameQ() << " ref requires " << pinDTypep->prettyDTypeNameQ()
<< " data type but connection is " << " data type but connection is "
<< conDTypep->prettyDTypeNameQ() << " data type." << endl); << conDTypep->prettyDTypeNameQ() << " data type.");
} else if (nodep->modVarp()->isTristate()) { } else if (nodep->modVarp()->isTristate()) {
if (pinwidth != conwidth) { if (pinwidth != conwidth) {
nodep->v3warn(E_UNSUPPORTED, nodep->v3warn(E_UNSUPPORTED,
@ -5411,9 +5411,7 @@ private:
case AstType::atMulS: newp = new AstMul(fl, lhsp, rhsp); break; case AstType::atMulS: newp = new AstMul(fl, lhsp, rhsp); break;
case AstType::atShiftR: newp = new AstShiftRS(fl, lhsp, rhsp); break; case AstType::atShiftR: newp = new AstShiftRS(fl, lhsp, rhsp); break;
case AstType::atShiftRS: newp = new AstShiftR(fl, lhsp, rhsp); break; case AstType::atShiftRS: newp = new AstShiftR(fl, lhsp, rhsp); break;
default: default: nodep->v3fatalSrc("Node needs sign change, but bad case: " << nodep); break;
nodep->v3fatalSrc("Node needs sign change, but bad case: " << nodep << endl);
break;
} }
UINFO(6, " ReplaceWithUOrSVersion: " << nodep << " w/ " << newp << endl); UINFO(6, " ReplaceWithUOrSVersion: " << nodep << " w/ " << newp << endl);
nodep->replaceWith(newp); nodep->replaceWith(newp);
@ -5451,7 +5449,7 @@ private:
case AstType::atMul: case AstType::atMul:
case AstType::atMulS: newp = new AstMulD(fl, lhsp, rhsp); break; case AstType::atMulS: newp = new AstMulD(fl, lhsp, rhsp); break;
default: default:
nodep->v3fatalSrc("Node needs conversion to double, but bad case: " << nodep << endl); nodep->v3fatalSrc("Node needs conversion to double, but bad case: " << nodep);
break; break;
} }
UINFO(6, " ReplaceWithDVersion: " << nodep << " w/ " << newp << endl); UINFO(6, " ReplaceWithDVersion: " << nodep << " w/ " << newp << endl);
@ -5483,7 +5481,7 @@ private:
case AstType::atLte: case AstType::atLte:
case AstType::atLteS: newp = new AstLteN(fl, lhsp, rhsp); break; case AstType::atLteS: newp = new AstLteN(fl, lhsp, rhsp); break;
default: default:
nodep->v3fatalSrc("Node needs conversion to string, but bad case: " << nodep << endl); nodep->v3fatalSrc("Node needs conversion to string, but bad case: " << nodep);
break; break;
} }
UINFO(6, " ReplaceWithNVersion: " << nodep << " w/ " << newp << endl); UINFO(6, " ReplaceWithNVersion: " << nodep << " w/ " << newp << endl);
@ -5502,7 +5500,7 @@ private:
switch (nodep->type()) { switch (nodep->type()) {
case AstType::atNegate: newp = new AstNegateD(fl, lhsp); break; case AstType::atNegate: newp = new AstNegateD(fl, lhsp); break;
default: default:
nodep->v3fatalSrc("Node needs conversion to double, but bad case: " << nodep << endl); nodep->v3fatalSrc("Node needs conversion to double, but bad case: " << nodep);
break; break;
} }
UINFO(6, " ReplaceWithDVersion: " << nodep << " w/ " << newp << endl); UINFO(6, " ReplaceWithDVersion: " << nodep << " w/ " << newp << endl);

View File

@ -77,13 +77,13 @@ public:
} }
static void dumpHeader() { static void dumpHeader() {
cout << "Points:\n"; cout << "Points:\n";
cout << " Num, TestsCover, Count, Name" << endl; cout << " Num, TestsCover, Count, Name\n";
} }
void dump() const { void dump() const {
cout << " " << std::setw(8) << std::setfill('0') << pointNum(); cout << " " << std::setw(8) << std::setfill('0') << pointNum();
cout << ", " << std::setw(7) << std::setfill(' ') << testsCovering(); cout << ", " << std::setw(7) << std::setfill(' ') << testsCovering();
cout << ", " << std::setw(7) << std::setfill(' ') << count(); cout << ", " << std::setw(7) << std::setfill(' ') << count();
cout << ", \"" << name() << "\"" << endl; cout << ", \"" << name() << "\"\n";
} }
}; };

View File

@ -65,7 +65,7 @@ public:
static void dumpHeader() { static void dumpHeader() {
cout << "Tests:\n"; cout << "Tests:\n";
// cout<<" Testrun, Computrons,"; // Currently not loaded // cout<<" Testrun, Computrons,"; // Currently not loaded
cout << " Covered, Rank, RankPts, Filename" << endl; cout << " Covered, Rank, RankPts, Filename\n";
} }
void dump(bool bucketsToo) { void dump(bool bucketsToo) {
if (testrun() || computrons() != 0.0) { // currently unused // LCOV_EXCL_LINE if (testrun() || computrons() != 0.0) { // currently unused // LCOV_EXCL_LINE
@ -76,7 +76,7 @@ public:
cout << " " << std::setw(7) << std::setfill(' ') << bucketsCovered(); cout << " " << std::setw(7) << std::setfill(' ') << bucketsCovered();
cout << ", " << std::setw(7) << std::setfill(' ') << rank(); cout << ", " << std::setw(7) << std::setfill(' ') << rank();
cout << ", " << std::setw(7) << std::setfill(' ') << rankPoints(); cout << ", " << std::setw(7) << std::setfill(' ') << rankPoints();
cout << ", \"" << name() << "\"" << endl; cout << ", \"" << name() << "\"\n";
if (bucketsToo) m_buckets.dump(); if (bucketsToo) m_buckets.dump();
} }
}; };

View File

@ -69,10 +69,10 @@ void VlcTop::writeCoverage(const string& filename) {
return; return;
} }
os << "# SystemC::Coverage-3" << endl; os << "# SystemC::Coverage-3\n";
for (const auto& i : m_points) { for (const auto& i : m_points) {
const VlcPoint& point = m_points.pointNumber(i.second); const VlcPoint& point = m_points.pointNumber(i.second);
os << "C '" << point.name() << "' " << point.count() << endl; os << "C '" << point.name() << "' " << point.count() << '\n';
} }
} }
@ -109,7 +109,7 @@ void VlcTop::writeInfo(const string& filename) {
os << "TN:verilator_coverage\n"; os << "TN:verilator_coverage\n";
for (auto& si : m_sources) { for (auto& si : m_sources) {
VlcSource& source = si.second; VlcSource& source = si.second;
os << "SF:" << source.name() << endl; os << "SF:" << source.name() << '\n';
VlcSource::LinenoMap& lines = source.lines(); VlcSource::LinenoMap& lines = source.lines();
for (auto& li : lines) { for (auto& li : lines) {
int lineno = li.first; int lineno = li.first;
@ -206,7 +206,7 @@ void VlcTop::annotateCalc() {
unsigned thresh = (!threshStr.empty()) ? atoi(threshStr.c_str()) : opt.annotateMin(); unsigned thresh = (!threshStr.empty()) ? atoi(threshStr.c_str()) : opt.annotateMin();
bool ok = (point.count() >= thresh); bool ok = (point.count() >= thresh);
UINFO(9, "AnnoCalc count " << filename << ":" << lineno << ":" << point.column() << " " UINFO(9, "AnnoCalc count " << filename << ":" << lineno << ":" << point.column() << " "
<< point.count() << " " << point.linescov() << endl); << point.count() << " " << point.linescov() << '\n');
// Base coverage // Base coverage
source.incCount(lineno, point.column(), point.count(), ok); source.incCount(lineno, point.column(), point.count(), ok);
// Additional lines covered by this statement // Additional lines covered by this statement
@ -263,8 +263,8 @@ void VlcTop::annotateCalcNeeded() {
} }
float pct = totCases ? (100 * totOk / totCases) : 0; float pct = totCases ? (100 * totOk / totCases) : 0;
cout << "Total coverage (" << totOk << "/" << totCases << ") "; cout << "Total coverage (" << totOk << "/" << totCases << ") ";
cout << std::fixed << std::setw(3) << std::setprecision(2) << pct << "%" << endl; cout << std::fixed << std::setw(3) << std::setprecision(2) << pct << "%\n";
if (totOk != totCases) cout << "See lines with '%00' in " << opt.annotateOut() << endl; if (totOk != totCases) cout << "See lines with '%00' in " << opt.annotateOut() << '\n';
} }
void VlcTop::annotateOutputFiles(const string& dirname) { void VlcTop::annotateOutputFiles(const string& dirname) {
@ -290,7 +290,7 @@ void VlcTop::annotateOutputFiles(const string& dirname) {
return; return;
} }
os << "\t// verilator_coverage annotation" << endl; os << "\t// verilator_coverage annotation\n";
int lineno = 0; int lineno = 0;
while (!is.eof()) { while (!is.eof()) {
@ -308,7 +308,7 @@ void VlcTop::annotateOutputFiles(const string& dirname) {
// UINFO(0,"Source // UINFO(0,"Source
// "<<source.name()<<":"<<col.lineno()<<":"<<col.column()<<endl); // "<<source.name()<<":"<<col.lineno()<<":"<<col.column()<<endl);
os << (col.ok() ? " " : "%") << std::setfill('0') << std::setw(6) os << (col.ok() ? " " : "%") << std::setfill('0') << std::setw(6)
<< col.count() << "\t" << line << endl; << col.count() << "\t" << line << '\n';
if (first) { if (first) {
first = false; first = false;
// Multiple columns on same line; print line just once // Multiple columns on same line; print line just once
@ -322,7 +322,7 @@ void VlcTop::annotateOutputFiles(const string& dirname) {
} }
} }
if (first) os << "\t" << line << endl; if (first) os << "\t" << line << '\n';
} }
} }
} }

View File

@ -6266,7 +6266,7 @@ vltItem:
{ V3Config::addIgnore($1, false, *$3, $5->toUInt(), $7->toUInt()+1); } { V3Config::addIgnore($1, false, *$3, $5->toUInt(), $7->toUInt()+1); }
| vltOffFront yVLT_D_FILE yaSTRING yVLT_D_MATCH yaSTRING | vltOffFront yVLT_D_FILE yaSTRING yVLT_D_MATCH yaSTRING
{ if (($1==V3ErrorCode::I_COVERAGE) || ($1==V3ErrorCode::I_TRACING)) { { if (($1==V3ErrorCode::I_COVERAGE) || ($1==V3ErrorCode::I_TRACING)) {
$<fl>1->v3error("Argument -match only supported for lint_off"<<endl); $<fl>1->v3error("Argument -match only supported for lint_off");
} else { } else {
V3Config::addWaiver($1,*$3,*$5); V3Config::addWaiver($1,*$3,*$5);
}} }}
@ -6305,11 +6305,11 @@ vltOffFront<errcodeen>:
| yVLT_LINT_OFF { $$ = V3ErrorCode::I_LINT; } | yVLT_LINT_OFF { $$ = V3ErrorCode::I_LINT; }
| yVLT_LINT_OFF yVLT_D_MSG idAny | yVLT_LINT_OFF yVLT_D_MSG idAny
{ $$ = V3ErrorCode((*$3).c_str()); { $$ = V3ErrorCode((*$3).c_str());
if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: "<<*$3<<endl); } if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: " << *$3); }
$2->v3warn(DEPRECATED, "Deprecated -msg in configuration files, use -rule instead."<<endl); } $2->v3warn(DEPRECATED, "Deprecated -msg in configuration files, use -rule instead."); }
| yVLT_LINT_OFF yVLT_D_RULE idAny | yVLT_LINT_OFF yVLT_D_RULE idAny
{ $$ = V3ErrorCode((*$3).c_str()); { $$ = V3ErrorCode((*$3).c_str());
if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: "<<*$3<<endl); } } if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: " << *$3); } }
; ;
vltOnFront<errcodeen>: vltOnFront<errcodeen>:
@ -6318,11 +6318,11 @@ vltOnFront<errcodeen>:
| yVLT_LINT_ON { $$ = V3ErrorCode::I_LINT; } | yVLT_LINT_ON { $$ = V3ErrorCode::I_LINT; }
| yVLT_LINT_ON yVLT_D_MSG idAny | yVLT_LINT_ON yVLT_D_MSG idAny
{ $$ = V3ErrorCode((*$3).c_str()); { $$ = V3ErrorCode((*$3).c_str());
if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: "<<*$3<<endl); } if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: " << *$3); }
$2->v3warn(DEPRECATED, "Deprecated -msg in configuration files, use -rule instead."<<endl); } $2->v3warn(DEPRECATED, "Deprecated -msg in configuration files, use -rule instead."); }
| yVLT_LINT_ON yVLT_D_RULE idAny | yVLT_LINT_ON yVLT_D_RULE idAny
{ $$ = V3ErrorCode((*$3).c_str()); { $$ = V3ErrorCode((*$3).c_str());
if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: "<<*$3<<endl); } } if ($$ == V3ErrorCode::EC_ERROR) { $1->v3error("Unknown Error Code: " << *$3); } }
; ;
vltDModuleE<strp>: vltDModuleE<strp>:

View File

@ -69,8 +69,8 @@ int main() {
dut->eval(); dut->eval();
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << "Initial DPI values" << endl; cout << "Initial DPI values\n";
cout << "==================" << endl; cout << "==================\n";
#endif #endif
int a = (int)a_read(); int a = (int)a_read();
@ -106,8 +106,8 @@ int main() {
// Check we can read a scalar register. // Check we can read a scalar register.
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << "Test of scalar register reading" << endl; cout << "Test of scalar register reading\n";
cout << "===============================" << endl; cout << "===============================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -132,8 +132,8 @@ int main() {
// Check we can read a vector register. // Check we can read a vector register.
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << "Test of vector register reading" << endl; cout << "Test of vector register reading\n";
cout << "===============================" << endl; cout << "===============================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -156,8 +156,8 @@ int main() {
// Test we can read an array element // Test we can read an array element
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << endl; cout << endl;
cout << "Test of array element reading" << endl; cout << "Test of array element reading\n";
cout << "=============================" << endl; cout << "=============================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -180,8 +180,8 @@ int main() {
// Check we can read a scalar wire // Check we can read a scalar wire
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << endl; cout << endl;
cout << "Test of scalar wire reading" << endl; cout << "Test of scalar wire reading\n";
cout << "===========================" << endl; cout << "===========================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -209,8 +209,8 @@ int main() {
// Check we can read a vector wire // Check we can read a vector wire
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << endl; cout << endl;
cout << "Test of vector wire reading" << endl; cout << "Test of vector wire reading\n";
cout << "===========================" << endl; cout << "===========================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -239,8 +239,8 @@ int main() {
// Check we can write a scalar register // Check we can write a scalar register
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << endl; cout << endl;
cout << "Test of scalar register writing" << endl; cout << "Test of scalar register writing\n";
cout << "===============================" << endl; cout << "===============================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -268,8 +268,8 @@ int main() {
// Check we can write a vector register // Check we can write a vector register
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << endl; cout << endl;
cout << "Test of vector register writing" << endl; cout << "Test of vector register writing\n";
cout << "===============================" << endl; cout << "===============================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -297,8 +297,8 @@ int main() {
// Test we can write an array element // Test we can write an array element
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << endl; cout << endl;
cout << "Test of array element writing" << endl; cout << "Test of array element writing\n";
cout << "=============================" << endl; cout << "=============================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -326,8 +326,8 @@ int main() {
// Check we can read a vector register slice // Check we can read a vector register slice
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << endl; cout << endl;
cout << "Test of vector register slice reading" << endl; cout << "Test of vector register slice reading\n";
cout << "=====================================" << endl; cout << "=====================================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -353,8 +353,8 @@ int main() {
// Test we can read an array element slice // Test we can read an array element slice
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << endl; cout << endl;
cout << "Test of array element slice reading" << endl; cout << "Test of array element slice reading\n";
cout << "===================================" << endl; cout << "===================================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -382,8 +382,8 @@ int main() {
// Check we can read a vector wire slice // Check we can read a vector wire slice
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << endl; cout << endl;
cout << "Test of vector wire slice reading" << endl; cout << "Test of vector wire slice reading\n";
cout << "=================================" << endl; cout << "=================================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -413,8 +413,8 @@ int main() {
// Check we can write a vector register slice // Check we can write a vector register slice
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << endl; cout << endl;
cout << "Test of vector register slice writing" << endl; cout << "Test of vector register slice writing\n";
cout << "=====================================" << endl; cout << "=====================================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -452,8 +452,8 @@ int main() {
// Test we can write an array element slice // Test we can write an array element slice
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << endl; cout << endl;
cout << "Test of array element slice writing" << endl; cout << "Test of array element slice writing\n";
cout << "===================================" << endl; cout << "===================================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -497,8 +497,8 @@ int main() {
// Check we can read complex registers // Check we can read complex registers
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << endl; cout << endl;
cout << "Test of complex register reading" << endl; cout << "Test of complex register reading\n";
cout << "================================" << endl; cout << "================================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -577,8 +577,8 @@ int main() {
// Test we can write a complex register // Test we can write a complex register
#ifdef TEST_VERBOSE #ifdef TEST_VERBOSE
cout << endl; cout << endl;
cout << "Test of complex register writing" << endl; cout << "Test of complex register writing\n";
cout << "================================" << endl; cout << "================================\n";
#endif #endif
for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) { for (int i = 0; !Verilated::gotFinish() && (i < 4); i++) {
@ -674,7 +674,7 @@ int main() {
// Tidy up // Tidy up
dut->final(); dut->final();
VL_DO_DANGLING(delete dut, dut); VL_DO_DANGLING(delete dut, dut);
cout << "*-* All Finished *-*" << endl; cout << "*-* All Finished *-*\n";
} }
// Local Variables: // Local Variables: