Internals: Use explicit std:: instead of using namespace std. No functional change intended.

This commit is contained in:
Wilson Snyder 2018-02-01 21:24:41 -05:00
parent 33d6205e20
commit 94e8cf1de9
81 changed files with 640 additions and 631 deletions

View File

@ -4,6 +4,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
* Verilator 4.000 devel
**** Fix internals to avoid 'using namespace std'.
* Verilator 3.921 devel

View File

@ -66,7 +66,7 @@ private:
AstScope* m_scopep; // Current scope to add statement to
AstActive* m_iActivep; // For current scope, the IActive we're building
AstActive* m_cActivep; // For current scope, the SActive(combo) we're building
vector<AstActive*> m_activeVec; // List of sensitive actives, for folding
std::vector<AstActive*> m_activeVec; // List of sensitive actives, for folding
// METHODS
void addActive(AstActive* nodep) {
if (!m_scopep) nodep->v3fatalSrc("NULL scope");
@ -119,7 +119,7 @@ public:
// Not the fastest, but scopes tend to have few clocks
AstActive* activep = NULL;
//sitemsp->dumpTree(cout," Lookingfor: ");
for (vector<AstActive*>::iterator it = m_activeVec.begin(); it!=m_activeVec.end(); ++it) {
for (std::vector<AstActive*>::iterator it = m_activeVec.begin(); it!=m_activeVec.end(); ++it) {
activep = *it;
if (activep) { // Not deleted
// Compare the list

View File

@ -58,7 +58,7 @@ int AstNodeDType::s_uniqueNum = 0;
//######################################################################
// V3AstType
ostream& operator<<(ostream& os, AstType rhs);
std::ostream& operator<<(std::ostream& os, AstType rhs);
//######################################################################
// Creators
@ -417,7 +417,7 @@ void AstNode::replaceWith(AstNode* newp) {
repHandle.relink(newp);
}
void AstNRelinker::dump(ostream& str) const {
void AstNRelinker::dump(std::ostream& str) const {
str<<" BK="<<(uint32_t*)m_backp;
str<<" ITER="<<(uint32_t*)m_iterpp;
str<<" CHG="<<(m_chg==RELINK_NEXT?"[NEXT] ":"");
@ -906,9 +906,9 @@ bool AstNode::sameTreeIter(AstNode* node1p, AstNode* node2p, bool ignNext, bool
//======================================================================
// Static utilities
ostream& operator<<(ostream& os, const V3Hash& rhs) {
return os<<hex<<setw(2)<<setfill('0')<<rhs.depth()
<<"_"<<setw(6)<<setfill('0')<<rhs.hshval();
std::ostream& operator<<(std::ostream& os, const V3Hash& rhs) {
return os<<std::hex<<std::setw(2)<<std::setfill('0')<<rhs.depth()
<<"_"<<std::setw(6)<<std::setfill('0')<<rhs.hshval();
}
V3Hash::V3Hash(const string& name) {
@ -991,7 +991,7 @@ void AstNode::checkIter() const {
}
}
void AstNode::dumpPtrs(ostream& os) const {
void AstNode::dumpPtrs(std::ostream& os) const {
os<<"This="<<typeName()<<" "<<(void*)this;
os<<" back="<<(void*)backp();
if (nextp()) os<<" next="<<(void*)nextp();
@ -1013,7 +1013,7 @@ void AstNode::dumpPtrs(ostream& os) const {
os<<endl;
}
void AstNode::dumpTree(ostream& os, const string& indent, int maxDepth) {
void AstNode::dumpTree(std::ostream& os, const string& indent, int maxDepth) {
os<<indent<<" "<<this<<endl;
if (debug()>8) { os<<indent<<" "; dumpPtrs(os); }
if (maxDepth==1) {
@ -1026,7 +1026,7 @@ void AstNode::dumpTree(ostream& os, const string& indent, int maxDepth) {
}
}
void AstNode::dumpTreeAndNext(ostream& os, const string& indent, int maxDepth) {
void AstNode::dumpTreeAndNext(std::ostream& os, const string& indent, int maxDepth) {
// Audited to make sure this is never NULL
for (AstNode* nodep=this; nodep; nodep=nodep->nextp()) {
nodep->dumpTree(os, indent, maxDepth);
@ -1037,10 +1037,10 @@ void AstNode::dumpTreeFile(const string& filename, bool append, bool doDump) {
if (doDump) {
{ // Write log & close
UINFO(2,"Dumping "<<filename<<endl);
const vl_unique_ptr<ofstream> logsp (V3File::new_ofstream(filename, append));
const vl_unique_ptr<std::ofstream> logsp (V3File::new_ofstream(filename, append));
if (logsp->fail()) v3fatalSrc("Can't write "<<filename);
*logsp<<"Verilator Tree Dump (format 0x3900) from <e"<<dec<<editCountLast()<<">";
*logsp<<" to <e"<<dec<<editCountGbl()<<">"<<endl;
*logsp<<"Verilator Tree Dump (format 0x3900) from <e"<<std::dec<<editCountLast()<<">";
*logsp<<" to <e"<<std::dec<<editCountGbl()<<">"<<endl;
if (editCountGbl()==editCountLast()
&& !(v3Global.opt.dumpTree()>=9)) {
*logsp<<endl;
@ -1061,9 +1061,9 @@ void AstNode::dumpTreeFile(const string& filename, bool append, bool doDump) {
editCountSetLast();
}
void AstNode::v3errorEndFatal(ostringstream& str) const { v3errorEnd(str); assert(0); }
void AstNode::v3errorEndFatal(std::ostringstream& str) const { v3errorEnd(str); assert(0); }
void AstNode::v3errorEnd(ostringstream& str) const {
void AstNode::v3errorEnd(std::ostringstream& str) const {
if (!dynamic_cast<const AstNode*>(this)) {
// No known cases cause this, but better than a core dump
if (debug()) UINFO(0, "-node: NULL. Please report this along with a --gdbbt backtrace as a Verilator bug.\n");
@ -1071,7 +1071,7 @@ void AstNode::v3errorEnd(ostringstream& str) const {
} else if (!m_fileline) {
V3Error::v3errorEnd(str);
} else {
ostringstream nsstr;
std::ostringstream nsstr;
nsstr<<str.str();
if (debug()) {
nsstr<<endl;
@ -1142,7 +1142,7 @@ AstBasicDType* AstNode::findInsertSameDType(AstBasicDType* nodep) {
// AstNVisitor
void AstNVisitor::doDeletes() {
for (vector<AstNode*>::iterator it = m_deleteps.begin(); it != m_deleteps.end(); ++it) {
for (std::vector<AstNode*>::iterator it = m_deleteps.begin(); it != m_deleteps.end(); ++it) {
(*it)->deleteTree();
}
m_deleteps.clear();

View File

@ -61,7 +61,7 @@ public:
inline bool operator== (AstType lhs, AstType rhs) { return (lhs.m_e == rhs.m_e); }
inline bool operator== (AstType lhs, AstType::en rhs) { return (lhs.m_e == rhs); }
inline bool operator== (AstType::en lhs, AstType rhs) { return (lhs == rhs.m_e); }
inline ostream& operator<<(ostream& os, const AstType& rhs) { return os<<rhs.ascii(); }
inline std::ostream& operator<<(std::ostream& os, const AstType& rhs) { return os<<rhs.ascii(); }
//######################################################################
@ -107,7 +107,7 @@ public:
inline bool operator== (AstNumeric lhs, AstNumeric rhs) { return (lhs.m_e == rhs.m_e); }
inline bool operator== (AstNumeric lhs, AstNumeric::en rhs) { return (lhs.m_e == rhs); }
inline bool operator== (AstNumeric::en lhs, AstNumeric rhs) { return (lhs == rhs.m_e); }
inline ostream& operator<<(ostream& os, const AstNumeric& rhs) { return os<<rhs.ascii(); }
inline std::ostream& operator<<(std::ostream& os, const AstNumeric& rhs) { return os<<rhs.ascii(); }
//######################################################################
@ -497,7 +497,7 @@ public:
inline bool operator== (AstVarType lhs, AstVarType rhs) { return (lhs.m_e == rhs.m_e); }
inline bool operator== (AstVarType lhs, AstVarType::en rhs) { return (lhs.m_e == rhs); }
inline bool operator== (AstVarType::en lhs, AstVarType rhs) { return (lhs == rhs.m_e); }
inline ostream& operator<<(ostream& os, const AstVarType& rhs) { return os<<rhs.ascii(); }
inline std::ostream& operator<<(std::ostream& os, const AstVarType& rhs) { return os<<rhs.ascii(); }
//######################################################################
@ -529,7 +529,7 @@ public:
inline bool operator== (AstBranchPred lhs, AstBranchPred rhs) { return (lhs.m_e == rhs.m_e); }
inline bool operator== (AstBranchPred lhs, AstBranchPred::en rhs) { return (lhs.m_e == rhs); }
inline bool operator== (AstBranchPred::en lhs, AstBranchPred rhs) { return (lhs == rhs.m_e); }
inline ostream& operator<<(ostream& os, const AstBranchPred& rhs) { return os<<rhs.ascii(); }
inline std::ostream& operator<<(std::ostream& os, const AstBranchPred& rhs) { return os<<rhs.ascii(); }
//######################################################################
@ -562,7 +562,7 @@ public:
inline bool operator== (AstVarAttrClocker lhs, AstVarAttrClocker rhs) { return (lhs.m_e == rhs.m_e); }
inline bool operator== (AstVarAttrClocker lhs, AstVarAttrClocker::en rhs) { return (lhs.m_e == rhs); }
inline bool operator== (AstVarAttrClocker::en lhs, AstVarAttrClocker rhs) { return (lhs == rhs.m_e); }
inline ostream& operator<<(ostream& os, const AstVarAttrClocker& rhs) { return os<<rhs.ascii(); }
inline std::ostream& operator<<(std::ostream& os, const AstVarAttrClocker& rhs) { return os<<rhs.ascii(); }
//######################################################################
@ -661,7 +661,7 @@ public:
inline bool operator== (AstParseRefExp lhs, AstParseRefExp rhs) { return (lhs.m_e == rhs.m_e); }
inline bool operator== (AstParseRefExp lhs, AstParseRefExp::en rhs) { return (lhs.m_e == rhs); }
inline bool operator== (AstParseRefExp::en lhs, AstParseRefExp rhs) { return (lhs == rhs.m_e); }
inline ostream& operator<<(ostream& os, const AstParseRefExp& rhs) { return os<<rhs.ascii(); }
inline std::ostream& operator<<(std::ostream& os, const AstParseRefExp& rhs) { return os<<rhs.ascii(); }
//######################################################################
// VNumRange - Structure containing numberic range information
@ -715,9 +715,9 @@ struct VNumRange {
int hiMaxSelect() const { return (lo()<0 ? hi()-lo() : hi()); } // Maximum value a [] select may index
bool representableByWidth() const // Could be represented by just width=1, or [width-1:0]
{ return (!m_ranged || (m_lo==0 && m_hi>=1 && !m_littleEndian)); }
void dump(ostream& str) const { if (ranged()) str<<"["<<left()<<":"<<right()<<"]"; else str<<"[norg]"; }
void dump(std::ostream& str) const { if (ranged()) str<<"["<<left()<<":"<<right()<<"]"; else str<<"[norg]"; }
};
inline ostream& operator<<(ostream& os, const VNumRange& rhs) { rhs.dump(os); return os; }
inline std::ostream& operator<<(std::ostream& os, const VNumRange& rhs) { rhs.dump(os); return os; }
//######################################################################
@ -891,7 +891,7 @@ public:
class AstNVisitor {
private:
vector<AstNode*> m_deleteps; // Nodes to delete when doDeletes() called
std::vector<AstNode*> m_deleteps; // Nodes to delete when doDeletes() called
protected:
friend class AstNode;
public:
@ -932,9 +932,9 @@ public:
AstNRelinker() { m_oldp=NULL; m_backp=NULL; m_chg=RELINK_BAD; m_iterpp=NULL;}
void relink(AstNode* newp);
AstNode* oldp() const { return m_oldp; }
void dump(ostream& str=cout) const;
void dump(std::ostream& str=std::cout) const;
};
inline ostream& operator<<(ostream& os, const AstNRelinker& rhs) { rhs.dump(os); return os;}
inline std::ostream& operator<<(std::ostream& os, const AstNRelinker& rhs) { rhs.dump(os); return os;}
//######################################################################
// V3Hash -- Node hashing for V3Combine
@ -984,7 +984,7 @@ public:
V3Hash(V3Hash h1, V3Hash h2, V3Hash h3, V3Hash h4) {
setBoth(1,((h1.hshval()*31+h2.hshval())*31+h3.hshval())*31+h4.hshval()); }
};
ostream& operator<<(ostream& os, const V3Hash& rhs);
std::ostream& operator<<(std::ostream& os, const V3Hash& rhs);
//######################################################################
// AstNode -- Base type of all Ast types
@ -1275,10 +1275,10 @@ public:
AstBasicDType* findInsertSameDType(AstBasicDType* nodep);
// METHODS - dump and error
void v3errorEnd(ostringstream& str) const;
void v3errorEndFatal(ostringstream& str) const VL_ATTR_NORETURN;
void v3errorEnd(std::ostringstream& str) const;
void v3errorEndFatal(std::ostringstream& str) const VL_ATTR_NORETURN;
string warnMore() const;
virtual void dump(ostream& str=cout);
virtual void dump(std::ostream& str=std::cout);
void dumpGdb(); // For GDB only
void dumpGdbHeader() const;
@ -1309,11 +1309,11 @@ public:
void checkTree(); // User Interface version
void checkIter() const;
void clearIter() { m_iterpp=NULL; }
void dumpPtrs(ostream& str=cout) const;
void dumpTree(ostream& str=cout, const string& indent=" ", int maxDepth=0);
void dumpPtrs(std::ostream& str=std::cout) const;
void dumpTree(std::ostream& str=std::cout, const string& indent=" ", int maxDepth=0);
void dumpTree(const string& indent, int maxDepth=0) { dumpTree(cout,indent,maxDepth); }
void dumpTreeGdb(); // For GDB only
void dumpTreeAndNext(ostream& str=cout, const string& indent=" ", int maxDepth=0);
void dumpTreeAndNext(std::ostream& str=std::cout, const string& indent=" ", int maxDepth=0);
void dumpTreeFile(const string& filename, bool append=false, bool doDump=true);
static void dumpTreeFileGdb(const char* filenamep=NULL);
@ -1350,7 +1350,7 @@ public:
// AstAlways* castAlways();
};
inline ostream& operator<<(ostream& os, AstNode* rhs) { if (!rhs) os<<"NULL"; else rhs->dump(os); return os; }
inline std::ostream& operator<<(std::ostream& os, AstNode* rhs) { if (!rhs) os<<"NULL"; else rhs->dump(os); return os; }
inline void AstNRelinker::relink(AstNode* newp) { newp->AstNode::relink(this); }
//######################################################################
@ -1687,7 +1687,7 @@ public:
m_text = textp; // Copy it
}
ASTNODE_BASE_FUNCS(NodeText)
virtual void dump(ostream& str=cout);
virtual void dump(std::ostream& str=std::cout);
virtual V3Hash sameHash() const { return V3Hash(text()); }
virtual bool same(const AstNode* samep) const {
const AstNodeText* asamep = static_cast<const AstNodeText*>(samep);
@ -1713,8 +1713,8 @@ public:
}
ASTNODE_BASE_FUNCS(NodeDType)
// ACCESSORS
virtual void dump(ostream& str);
virtual void dumpSmall(ostream& str);
virtual void dump(std::ostream& str);
virtual void dumpSmall(std::ostream& str);
virtual bool hasDType() const { return true; }
virtual AstBasicDType* basicp() const = 0; // (Slow) recurse down to find basic data type
virtual AstNodeDType* skipRefp() const = 0; // recurses over typedefs/const/enum to next non-typeref type
@ -1747,7 +1747,7 @@ public:
bool generic() const { return m_generic; }
void generic(bool flag) { m_generic = flag; }
AstNodeDType* dtypeDimensionp(int depth);
pair<uint32_t,uint32_t> dimensions(bool includeBasic);
std::pair<uint32_t,uint32_t> dimensions(bool includeBasic);
uint32_t arrayUnpackedElements(); // 1, or total multiplication of all dimensions
static int uniqueNumInc() { return ++s_uniqueNum; }
const char* charIQWN() const { return (isString() ? "N" : isWide() ? "W" : isQuad() ? "Q" : "I"); }
@ -1756,7 +1756,7 @@ public:
class AstNodeClassDType : public AstNodeDType {
private:
// TYPES
typedef map<string,AstMemberDType*> MemberNameMap;
typedef std::map<string,AstMemberDType*> MemberNameMap;
// MEMBERS
bool m_packed;
bool m_isFourstate;
@ -1771,7 +1771,7 @@ public:
}
ASTNODE_BASE_FUNCS(NodeClassDType)
virtual const char* broken() const;
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
// For basicp() we reuse the size to indicate a "fake" basic type of same size
virtual AstBasicDType* basicp() const {
return (isFourstate() ? findLogicDType(width(),width(),numeric())->castBasicDType()
@ -1814,8 +1814,8 @@ public:
m_refDTypep = NULL;
}
ASTNODE_BASE_FUNCS(NodeArrayDType)
virtual void dump(ostream& str);
virtual void dumpSmall(ostream& str);
virtual void dump(std::ostream& str);
virtual void dumpSmall(std::ostream& str);
virtual const char* broken() const { BROKEN_RTN(!((m_refDTypep && !childDTypep() && m_refDTypep->brokeExists())
|| (!m_refDTypep && childDTypep()))); return NULL; }
virtual void cloneRelink() { if (m_refDTypep && m_refDTypep->clonep()) {
@ -1911,7 +1911,7 @@ public:
cname(name); // Might be overridden by dpi import/export
}
ASTNODE_BASE_FUNCS(NodeFTask)
virtual void dump(ostream& str=cout);
virtual void dump(std::ostream& str=std::cout);
virtual string name() const { return m_name; } // * = Var name
virtual bool maybePointedTo() const { return true; }
virtual bool isGateOptimizable() const { return !((m_dpiExport || m_dpiImport) && !m_pure); }
@ -1977,7 +1977,7 @@ public:
virtual void cloneRelink() { if (m_taskp && m_taskp->clonep()) {
m_taskp = m_taskp->clonep();
}}
virtual void dump(ostream& str=cout);
virtual void dump(std::ostream& str=std::cout);
virtual string name() const { return m_name; } // * = Var name
virtual bool isGateOptimizable() const { return m_taskp && m_taskp->isGateOptimizable(); }
string dotted() const { return m_dotted; } // * = Scope name or ""
@ -2025,7 +2025,7 @@ public:
,m_internal(false), m_recursive(false), m_recursiveClone(false)
,m_level(0), m_varNum(0), m_typeNum(0) { }
ASTNODE_BASE_FUNCS(NodeModule)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual bool maybePointedTo() const { return true; }
virtual string name() const { return m_name; }
AstNode* stmtsp() const { return op2p(); } // op2 = List of statements

View File

@ -504,7 +504,7 @@ uint32_t AstNodeDType::arrayUnpackedElements() {
return entries;
}
pair<uint32_t,uint32_t> AstNodeDType::dimensions(bool includeBasic) {
std::pair<uint32_t,uint32_t> AstNodeDType::dimensions(bool includeBasic) {
// How many array dimensions (packed,unpacked) does this Var have?
uint32_t packed = 0;
uint32_t unpacked = 0;
@ -688,7 +688,7 @@ AstBasicDType* AstTypeTable::findLogicBitDType(FileLine* fl, AstBasicDTypeKwd kw
if (kwd == AstBasicDTypeKwd::LOGIC) idx = IDX0_LOGIC;
else if (kwd == AstBasicDTypeKwd::BIT) idx = IDX0_BIT;
else fl->v3fatalSrc("Bad kwd for findLogicBitDType");
pair<int,int> widths = make_pair(width,widthMin);
std::pair<int,int> widths = make_pair(width,widthMin);
LogicMap& mapr = m_logicMap[idx][(int)numeric];
LogicMap::const_iterator it = mapr.find(widths);
if (it != mapr.end()) return it->second;
@ -791,12 +791,12 @@ void AstWhile::addNextStmt(AstNode* newp, AstNode* belowp) {
//======================================================================
// Per-type Debugging
void AstNode::dump(ostream& str) {
void AstNode::dump(std::ostream& str) {
str<<typeName()<<" "<<(void*)this
//<<" "<<(void*)this->m_backp
<<" <e"<<dec<<editCount()
<<" <e"<<std::dec<<editCount()
<<((editCount()>=editCountLast())?"#>":">")
<<" {"<<fileline()->filenameLetters()<<dec<<fileline()->lineno()<<"}";
<<" {"<<fileline()->filenameLetters()<<std::dec<<fileline()->lineno()<<"}";
if (user1p()) str<<" u1="<<(void*)user1p();
if (user2p()) str<<" u2="<<(void*)user2p();
if (user3p()) str<<" u3="<<(void*)user3p();
@ -817,45 +817,45 @@ void AstNode::dump(ostream& str) {
}
}
void AstAlways::dump(ostream& str) {
void AstAlways::dump(std::ostream& str) {
this->AstNode::dump(str);
if (keyword() != VAlwaysKwd::ALWAYS) str<<" ["<<keyword().ascii()<<"]";
}
void AstAttrOf::dump(ostream& str) {
void AstAttrOf::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" ["<<attrType().ascii()<<"]";
}
void AstBasicDType::dump(ostream& str) {
void AstBasicDType::dump(std::ostream& str) {
this->AstNodeDType::dump(str);
str<<" kwd="<<keyword().ascii();
if (isRanged() && !rangep()) str<<" range=["<<left()<<":"<<right()<<"]";
}
void AstCCast::dump(ostream& str) {
void AstCCast::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" sz"<<size();
}
void AstCell::dump(ostream& str) {
void AstCell::dump(std::ostream& str) {
this->AstNode::dump(str);
if (recursive()) str<<" [RECURSIVE]";
if (modp()) { str<<" -> "; modp()->dump(str); }
else { str<<" ->UNLINKED:"<<modName(); }
}
void AstCellInline::dump(ostream& str) {
void AstCellInline::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" -> "<<origModName();
}
void AstDisplay::dump(ostream& str) {
void AstDisplay::dump(std::ostream& str) {
this->AstNode::dump(str);
//str<<" "<<displayType().ascii();
}
void AstEnumItemRef::dump(ostream& str) {
void AstEnumItemRef::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" -> ";
if (itemp()) { itemp()->dump(str); }
else { str<<"UNLINKED"; }
}
void AstIfaceRefDType::dump(ostream& str) {
void AstIfaceRefDType::dump(std::ostream& str) {
this->AstNode::dump(str);
if (cellName()!="") { str<<" cell="<<cellName(); }
if (ifaceName()!="") { str<<" if="<<ifaceName(); }
@ -864,54 +864,54 @@ void AstIfaceRefDType::dump(ostream& str) {
else if (ifacep()) { str<<" -> "; ifacep()->dump(str); }
else { str<<" -> UNLINKED"; }
}
void AstIfaceRefDType::dumpSmall(ostream& str) {
void AstIfaceRefDType::dumpSmall(std::ostream& str) {
this->AstNodeDType::dumpSmall(str);
str<<"iface";
}
void AstJumpGo::dump(ostream& str) {
void AstJumpGo::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" -> ";
if (labelp()) { labelp()->dump(str); }
else { str<<"%Error:UNLINKED"; }
}
void AstModportFTaskRef::dump(ostream& str) {
void AstModportFTaskRef::dump(std::ostream& str) {
this->AstNode::dump(str);
if (isExport()) str<<" EXPORT";
if (isImport()) str<<" IMPORT";
if (ftaskp()) { str<<" -> "; ftaskp()->dump(str); }
else { str<<" -> UNLINKED"; }
}
void AstModportVarRef::dump(ostream& str) {
void AstModportVarRef::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" "<<varType();
if (varp()) { str<<" -> "; varp()->dump(str); }
else { str<<" -> UNLINKED"; }
}
void AstPin::dump(ostream& str) {
void AstPin::dump(std::ostream& str) {
this->AstNode::dump(str);
if (modVarp()) { str<<" -> "; modVarp()->dump(str); }
else { str<<" ->UNLINKED"; }
if (svImplicit()) str<<" [.SV]";
}
void AstTypedef::dump(ostream& str) {
void AstTypedef::dump(std::ostream& str) {
this->AstNode::dump(str);
if (attrPublic()) str<<" [PUBLIC]";
}
void AstRange::dump(ostream& str) {
void AstRange::dump(std::ostream& str) {
this->AstNode::dump(str);
if (littleEndian()) str<<" [LITTLE]";
}
void AstRefDType::dump(ostream& str) {
void AstRefDType::dump(std::ostream& str) {
this->AstNodeDType::dump(str);
if (defp()) { str<<" -> "; defp()->dump(str); }
else { str<<" -> UNLINKED"; }
}
void AstNodeClassDType::dump(ostream& str) {
void AstNodeClassDType::dump(std::ostream& str) {
this->AstNode::dump(str);
if (packed()) str<<" [PACKED]";
if (isFourstate()) str<<" [4STATE]";
}
void AstNodeDType::dump(ostream& str) {
void AstNodeDType::dump(std::ostream& str) {
this->AstNode::dump(str);
if (generic()) str<<" [GENERIC]";
if (AstNodeDType* dtp = virtRefDTypep()) {
@ -919,7 +919,7 @@ void AstNodeDType::dump(ostream& str) {
dtp->dumpSmall(str);
}
}
void AstNodeDType::dumpSmall(ostream& str) {
void AstNodeDType::dumpSmall(std::ostream& str) {
str<<"("
<<(generic()?"G/":"")
<<((isSigned()&&!isDouble())?"s":"")
@ -932,16 +932,16 @@ void AstNodeDType::dumpSmall(ostream& str) {
if (!widthSized()) str<<"/"<<widthMin();
str<<")";
}
void AstNodeArrayDType::dumpSmall(ostream& str) {
void AstNodeArrayDType::dumpSmall(std::ostream& str) {
this->AstNodeDType::dumpSmall(str);
if (castPackArrayDType()) str<<"p"; else str<<"u";
str<<declRange();
}
void AstNodeArrayDType::dump(ostream& str) {
void AstNodeArrayDType::dump(std::ostream& str) {
this->AstNodeDType::dump(str);
str<<" "<<declRange();
}
void AstNodeModule::dump(ostream& str) {
void AstNodeModule::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" L"<<level();
if (modPublic()) str<<" [P]";
@ -950,33 +950,33 @@ void AstNodeModule::dump(ostream& str) {
if (recursiveClone()) str<<" [RECURSIVE-CLONE]";
else if (recursive()) str<<" [RECURSIVE]";
}
void AstPackageExport::dump(ostream& str) {
void AstPackageExport::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" -> "<<packagep();
}
void AstPackageImport::dump(ostream& str) {
void AstPackageImport::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" -> "<<packagep();
}
void AstSel::dump(ostream& str) {
void AstSel::dump(std::ostream& str) {
this->AstNode::dump(str);
if (declRange().ranged()) {
str<<" decl"<<declRange()<<"]";
if (declElWidth()!=1) str<<"/"<<declElWidth();
}
}
void AstSliceSel::dump(ostream& str) {
void AstSliceSel::dump(std::ostream& str) {
this->AstNode::dump(str);
if (declRange().ranged()) {
str<<" decl"<<declRange();
}
}
void AstTypeTable::dump(ostream& str) {
void AstTypeTable::dump(std::ostream& str) {
this->AstNode::dump(str);
for (int i=0; i<(int)(AstBasicDTypeKwd::_ENUM_MAX); ++i) {
if (AstBasicDType* subnodep=m_basicps[i]) {
str<<endl; // Newline from caller, so newline first
str<<"\t\t"<<setw(8)<<AstBasicDTypeKwd(i).ascii();
str<<"\t\t"<<std::setw(8)<<AstBasicDTypeKwd(i).ascii();
str<<" -> ";
subnodep->dump(str);
}
@ -987,10 +987,10 @@ void AstTypeTable::dump(ostream& str) {
for (LogicMap::const_iterator it = mapr.begin(); it != mapr.end(); ++it) {
AstBasicDType* dtypep = it->second;
str<<endl; // Newline from caller, so newline first
stringstream nsstr;
std::stringstream nsstr;
nsstr<<(isbit?"bw":"lw")
<<it->first.first<<"/"<<it->first.second;
str<<"\t\t"<<setw(8)<<nsstr.str();
str<<"\t\t"<<std::setw(8)<<nsstr.str();
if (issigned) str<<" s"; else str<<" u";
str<<" -> ";
dtypep->dump(str);
@ -1008,17 +1008,17 @@ void AstTypeTable::dump(ostream& str) {
}
// Note get newline from caller too.
}
void AstUnsizedArrayDType::dumpSmall(ostream& str) {
void AstUnsizedArrayDType::dumpSmall(std::ostream& str) {
this->AstNodeDType::dumpSmall(str);
str<<"[]";
}
void AstVarScope::dump(ostream& str) {
void AstVarScope::dump(std::ostream& str) {
this->AstNode::dump(str);
if (isCircular()) str<<" [CIRC]";
if (varp()) { str<<" -> "; varp()->dump(str); }
else { str<<" ->UNLINKED"; }
}
void AstVarXRef::dump(ostream& str) {
void AstVarXRef::dump(std::ostream& str) {
this->AstNode::dump(str);
if (packagep()) { str<<" pkg="<<(void*)packagep(); }
if (lvalue()) str<<" [LV] => ";
@ -1029,7 +1029,7 @@ void AstVarXRef::dump(ostream& str) {
else if (varp()) { varp()->dump(str); }
else { str<<"UNLINKED"; }
}
void AstVarRef::dump(ostream& str) {
void AstVarRef::dump(std::ostream& str) {
this->AstNode::dump(str);
if (packagep()) { str<<" pkg="<<(void*)packagep(); }
if (lvalue()) str<<" [LV] => ";
@ -1038,7 +1038,7 @@ void AstVarRef::dump(ostream& str) {
else if (varp()) { varp()->dump(str); }
else { str<<"UNLINKED"; }
}
void AstVar::dump(ostream& str) {
void AstVar::dump(std::ostream& str) {
this->AstNode::dump(str);
if (isSc()) str<<" [SC]";
if (isPrimaryIO()) str<<(isInout()?" [PIO]":(isInput()?" [PI]":" [PO]"));
@ -1062,35 +1062,35 @@ void AstVar::dump(ostream& str) {
if (!attrClocker().unknown()) str<<" ["<<attrClocker().ascii()<<"] ";
str<<" "<<varType();
}
void AstSenTree::dump(ostream& str) {
void AstSenTree::dump(std::ostream& str) {
this->AstNode::dump(str);
if (isMulti()) str<<" [MULTI]";
}
void AstSenItem::dump(ostream& str) {
void AstSenItem::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" ["<<edgeType().ascii()<<"]";
}
void AstParseRef::dump(ostream& str) {
void AstParseRef::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" ["<<expect().ascii()<<"]";
}
void AstPackageRef::dump(ostream& str) {
void AstPackageRef::dump(std::ostream& str) {
this->AstNode::dump(str);
if (packagep()) { str<<" pkg="<<(void*)packagep(); }
str<<" -> ";
if (packagep()) { packagep()->dump(str); }
else { str<<"UNLINKED"; }
}
void AstDot::dump(ostream& str) {
void AstDot::dump(std::ostream& str) {
this->AstNode::dump(str);
}
void AstActive::dump(ostream& str) {
void AstActive::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" => ";
if (sensesp()) { sensesp()->dump(str); }
else { str<<"UNLINKED"; }
}
void AstNodeFTaskRef::dump(ostream& str) {
void AstNodeFTaskRef::dump(std::ostream& str) {
this->AstNode::dump(str);
if (packagep()) { str<<" pkg="<<(void*)packagep(); }
str<<" -> ";
@ -1098,7 +1098,7 @@ void AstNodeFTaskRef::dump(ostream& str) {
if (taskp()) { taskp()->dump(str); }
else { str<<"UNLINKED"; }
}
void AstNodeFTask::dump(ostream& str) {
void AstNodeFTask::dump(std::ostream& str) {
this->AstNode::dump(str);
if (taskPublic()) str<<" [PUBLIC]";
if (prototype()) str<<" [PROTOTYPE]";
@ -1108,34 +1108,34 @@ void AstNodeFTask::dump(ostream& str) {
if (dpiOpenParent()) str<<" [DPIOPENPARENT]";
if ((dpiImport() || dpiExport()) && cname()!=name()) str<<" [c="<<cname()<<"]";
}
void AstBegin::dump(ostream& str) {
void AstBegin::dump(std::ostream& str) {
this->AstNode::dump(str);
if (unnamed()) str<<" [UNNAMED]";
if (generate()) str<<" [GEN]";
if (genforp()) str<<" [GENFOR]";
}
void AstCoverDecl::dump(ostream& str) {
void AstCoverDecl::dump(std::ostream& str) {
this->AstNode::dump(str);
if (this->dataDeclNullp()) {
str<<" -> ";
this->dataDeclNullp()->dump(str);
} else {
if (binNum()) { str<<" bin"<<dec<<binNum(); }
if (binNum()) { str<<" bin"<<std::dec<<binNum(); }
}
}
void AstCoverInc::dump(ostream& str) {
void AstCoverInc::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" -> ";
if (declp()) { declp()->dump(str); }
else { str<<"%Error:UNLINKED"; }
}
void AstTraceInc::dump(ostream& str) {
void AstTraceInc::dump(std::ostream& str) {
this->AstNode::dump(str);
str<<" -> ";
if (declp()) { declp()->dump(str); }
else { str<<"%Error:UNLINKED"; }
}
void AstNodeText::dump(ostream& str) {
void AstNodeText::dump(std::ostream& str) {
this->AstNode::dump(str);
string out = text();
string::size_type pos;
@ -1146,19 +1146,19 @@ void AstNodeText::dump(ostream& str) {
str<<" \""<<out<<"\"";
}
void AstCFile::dump(ostream& str) {
void AstCFile::dump(std::ostream& str) {
this->AstNode::dump(str);
if (source()) str<<" [SRC]";
if (slow()) str<<" [SLOW]";
}
void AstCCall::dump(ostream& str) {
void AstCCall::dump(std::ostream& str) {
this->AstNode::dump(str);
if (funcp()) {
str<<" "<<funcp()->name()<<" => ";
funcp()->dump(str);
}
}
void AstCFunc::dump(ostream& str) {
void AstCFunc::dump(std::ostream& str) {
this->AstNode::dump(str);
if (slow()) str<<" [SLOW]";
if (pure()) str<<" [PURE]";

View File

@ -140,7 +140,7 @@ public:
int leftToRightInc() const { return littleEndian()?1:-1; }
bool littleEndian() const { return m_littleEndian; }
void littleEndian(bool flag) { m_littleEndian=flag; }
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual string emitC() { V3ERROR_NA; return ""; }
virtual V3Hash sameHash() const { return V3Hash(); }
virtual bool same(const AstNode* samep) const { return true; }
@ -225,7 +225,7 @@ public:
m_attrPublic = false;
}
ASTNODE_NODE_FUNCS(Typedef)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
AstNodeDType* getChildDTypep() const { return childDTypep(); }
AstNodeDType* childDTypep() const { return op1p()->castNodeDType(); } // op1 = Type assigning to
void childDTypep(AstNodeDType* nodep) { setOp1p(nodep); }
@ -370,7 +370,7 @@ public:
const AstNodeArrayDType* asamep = static_cast<const AstNodeArrayDType*>(samep);
return (subDTypep()->skipRefp()->similarDType(asamep->subDTypep()->skipRefp()));
}
virtual void dumpSmall(ostream& str);
virtual void dumpSmall(std::ostream& str);
virtual V3Hash sameHash() const { return V3Hash(m_refDTypep); }
AstNodeDType* getChildDTypep() const { return childDTypep(); }
AstNodeDType* childDTypep() const { return op1p()->castNodeDType(); } // op1 = Range of variable
@ -457,7 +457,7 @@ private:
}
public:
ASTNODE_NODE_FUNCS(BasicDType)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual V3Hash sameHash() const { return V3Hash(V3Hash(m.m_keyword), V3Hash(m.m_nrange.hi())); }
virtual bool same(const AstNode* samep) const { // width/widthMin/numeric compared elsewhere
const AstBasicDType* sp = static_cast<const AstBasicDType*>(samep);
@ -568,8 +568,8 @@ public:
ASTNODE_NODE_FUNCS(IfaceRefDType)
// METHODS
virtual const char* broken() const;
virtual void dump(ostream& str=cout);
virtual void dumpSmall(ostream& str);
virtual void dump(std::ostream& str=std::cout);
virtual void dumpSmall(std::ostream& str);
virtual void cloneRelink();
virtual AstBasicDType* basicp() const { return NULL; }
virtual AstNodeDType* skipRefp() const { return (AstNodeDType*)this; }
@ -621,7 +621,7 @@ public:
virtual bool similarDType(AstNodeDType* samep) const {
return skipRefp()->similarDType(samep->skipRefp()); }
virtual V3Hash sameHash() const { return V3Hash(V3Hash(m_refDTypep),V3Hash(m_packagep)); }
virtual void dump(ostream& str=cout);
virtual void dump(std::ostream& str=std::cout);
virtual string name() const { return m_name; }
virtual AstBasicDType* basicp() const { return subDTypep() ? subDTypep()->basicp() : NULL; }
virtual AstNodeDType* skipRefp() const {
@ -750,7 +750,7 @@ public:
dtypeFrom(m_itemp);
}
ASTNODE_NODE_FUNCS(EnumItemRef)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual string name() const { return itemp()->name(); }
virtual const char* broken() const { BROKEN_RTN(!itemp()); return NULL; }
virtual int instrCount() const { return 0; }
@ -958,7 +958,7 @@ public:
dtypeSetLogicSized(bitwidth,bitwidth,AstNumeric::UNSIGNED);
}
ASTNODE_NODE_FUNCS(Sel)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual void numberOperate(V3Number& out, const V3Number& from, const V3Number& bit, const V3Number& width) {
out.opSel(from, bit.toUInt()+width.toUInt()-1, bit.toUInt()); }
virtual string emitVerilog() { V3ERROR_NA; return ""; } // Implemented specially
@ -999,7 +999,7 @@ public:
new AstConst(fl, declRange.elements()))
, m_declRange(declRange) { }
ASTNODE_NODE_FUNCS(SliceSel)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual void numberOperate(V3Number& out, const V3Number& from, const V3Number& lo, const V3Number& width) {
V3ERROR_NA; }
virtual string emitVerilog() { V3ERROR_NA; return ""; } // Implemented specially
@ -1170,7 +1170,7 @@ public:
dtypeFrom(examplep);
}
ASTNODE_NODE_FUNCS(Var)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual string name() const { return m_name; } // * = Var name
virtual bool hasDType() const { return true; }
virtual bool maybePointedTo() const { return true; }
@ -1427,7 +1427,7 @@ public:
BROKEN_RTN(m_scopep && !m_scopep->brokeExists()); return NULL; }
virtual bool maybePointedTo() const { return true; }
virtual string name() const {return scopep()->name()+"->"+varp()->name();} // * = Var name
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual bool hasDType() const { return true; }
AstVar* varp() const { return m_varp; } // [After Link] Pointer to variable
AstScope* scopep() const { return m_scopep; } // Pointer to scope it's under
@ -1451,7 +1451,7 @@ public:
varScopep(varscp);
}
ASTNODE_NODE_FUNCS(VarRef)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual V3Hash sameHash() const { return V3Hash(V3Hash(varp()->name()),V3Hash(hiername())); }
virtual bool same(const AstNode* samep) const {
return same(static_cast<const AstVarRef*>(samep)); }
@ -1487,7 +1487,7 @@ public:
dtypeFrom(varp);
}
ASTNODE_NODE_FUNCS(VarXRef)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
string dotted() const { return m_dotted; }
void dotted(const string& dotted) { m_dotted = dotted; }
string prettyDotted() const { return prettyName(dotted()); }
@ -1533,7 +1533,7 @@ public:
setNOp1p(exprp);
}
ASTNODE_NODE_FUNCS(Pin)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual const char* broken() const {
BROKEN_RTN(m_modVarp && !m_modVarp->brokeExists());
BROKEN_RTN(m_modPTypep && !m_modPTypep->brokeExists());
@ -1634,7 +1634,7 @@ public:
ASTNODE_NODE_FUNCS(PackageExport)
virtual const char* broken() const { BROKEN_RTN(!m_packagep || !m_packagep->brokeExists()); return NULL; }
virtual void cloneRelink() { if (m_packagep && m_packagep->clonep()) m_packagep = m_packagep->clonep(); }
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual string name() const { return m_name; }
AstPackage* packagep() const { return m_packagep; }
void packagep(AstPackage* nodep) { m_packagep=nodep; }
@ -1651,7 +1651,7 @@ public:
ASTNODE_NODE_FUNCS(PackageImport)
virtual const char* broken() const { BROKEN_RTN(!m_packagep || !m_packagep->brokeExists()); return NULL; }
virtual void cloneRelink() { if (m_packagep && m_packagep->clonep()) m_packagep = m_packagep->clonep(); }
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual string name() const { return m_name; }
AstPackage* packagep() const { return m_packagep; }
void packagep(AstPackage* nodep) { m_packagep=nodep; }
@ -1678,7 +1678,7 @@ public:
: AstNode(fl), m_name(name), m_export(isExport), m_ftaskp(NULL) { }
ASTNODE_NODE_FUNCS(ModportFTaskRef)
virtual const char* broken() const { BROKEN_RTN(m_ftaskp && !m_ftaskp->brokeExists()); return NULL; }
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual string name() const { return m_name; }
virtual void cloneRelink() { if (m_ftaskp && m_ftaskp->clonep()) m_ftaskp = m_ftaskp->clonep(); }
bool isImport() const { return !m_export; }
@ -1700,7 +1700,7 @@ public:
: AstNode(fl), m_name(name), m_type(type), m_varp(NULL) { }
ASTNODE_NODE_FUNCS(ModportVarRef)
virtual const char* broken() const { BROKEN_RTN(m_varp && !m_varp->brokeExists()); return NULL; }
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual void cloneRelink() { if (m_varp && m_varp->clonep()) m_varp = m_varp->clonep(); }
virtual string name() const { return m_name; }
AstVarType varType() const { return m_type; } // * = Type of variable
@ -1743,7 +1743,7 @@ public:
addNOp1p(pinsp); addNOp2p(paramsp); setNOp3p(rangep); }
ASTNODE_NODE_FUNCS(Cell)
// No cloneRelink, we presume cloneee's want the same module linkages
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual const char* broken() const { BROKEN_RTN(m_modp && !m_modp->brokeExists()); return NULL; }
virtual bool maybePointedTo() const { return true; }
// ACCESSORS
@ -1780,7 +1780,7 @@ public:
: AstNode(fl)
, m_name(name), m_origModName(origModName) {}
ASTNODE_NODE_FUNCS(CellInline)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
// ACCESSORS
virtual string name() const { return m_name; } // * = Cell name
string origModName() const { return m_origModName; } // * = modp()->origName() before inlining
@ -1901,7 +1901,7 @@ public:
AstParseRef(FileLine* fl, AstParseRefExp expect, const string& name, AstNode* lhsp, AstNodeFTaskRef* ftaskrefp)
:AstNode(fl), m_expect(expect), m_name(name) { setNOp1p(lhsp); setNOp2p(ftaskrefp); }
ASTNODE_NODE_FUNCS(ParseRef)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual string name() const { return m_name; } // * = Var name
virtual V3Hash sameHash() const { return V3Hash(V3Hash(m_expect),V3Hash(m_name)); }
virtual bool same(const AstNode* samep) const {
@ -1934,7 +1934,7 @@ public:
virtual bool same(const AstNode* samep) const {
return (m_packagep==static_cast<const AstPackageRef*>(samep)->m_packagep); }
virtual V3Hash sameHash() const { return V3Hash(m_packagep); }
virtual void dump(ostream& str=cout);
virtual void dump(std::ostream& str=std::cout);
AstPackage* packagep() const { return m_packagep; }
void packagep(AstPackage* nodep) { m_packagep=nodep; }
};
@ -1950,7 +1950,7 @@ public:
if (!packagep) return rhsp;
return new AstDot(fl, new AstPackageRef(fl, packagep), rhsp);
}
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual string emitVerilog() { V3ERROR_NA; return ""; }
virtual string emitC() { V3ERROR_NA; return ""; }
AstNode* lhsp() const { return op1p(); }
@ -2054,7 +2054,7 @@ public:
m_edgeType = AstEdgeType::ET_NEVER;
}
ASTNODE_NODE_FUNCS(SenItem)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual V3Hash sameHash() const { return V3Hash(edgeType()); }
virtual bool same(const AstNode* samep) const {
return edgeType()==static_cast<const AstSenItem*>(samep)->edgeType(); }
@ -2107,7 +2107,7 @@ public:
addNOp1p(sensesp);
}
ASTNODE_NODE_FUNCS(SenTree)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual bool maybePointedTo() const { return true; }
bool isMulti() const { return m_multi; }
AstNodeSenItem* sensesp() const { return op1p()->castNodeSenItem(); } // op1 = Sensitivity list
@ -2129,7 +2129,7 @@ public:
}
ASTNODE_NODE_FUNCS(Always)
//
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
AstSenTree* sensesp() const { return op1p()->castSenTree(); } // op1 = Sensitivity list
AstNode* bodysp() const { return op2p(); } // op2 = Statements to evaluate
void addStmtp(AstNode* nodep) { addOp2p(nodep); }
@ -2334,7 +2334,7 @@ public:
if (m_dataDeclp && m_dataDeclp->m_dataDeclp) v3fatalSrc("dataDeclp should point to real data, not be a list"); // Avoid O(n^2) accessing
return NULL; }
virtual void cloneRelink() { if (m_dataDeclp && m_dataDeclp->clonep()) m_dataDeclp = m_dataDeclp->clonep(); }
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual int instrCount() const { return 1+2*instrCountLd(); }
virtual bool maybePointedTo() const { return true; }
int column() const { return m_column; }
@ -2373,7 +2373,7 @@ public:
ASTNODE_NODE_FUNCS(CoverInc)
virtual const char* broken() const { BROKEN_RTN(!declp()->brokeExists()); return NULL; }
virtual void cloneRelink() { if (m_declp->clonep()) m_declp = m_declp->clonep(); }
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual int instrCount() const { return 1+2*instrCountLd(); }
virtual V3Hash sameHash() const { return V3Hash(declp()); }
virtual bool same(const AstNode* samep) const {
@ -2543,7 +2543,7 @@ public:
m_displayType = dispType;
}
ASTNODE_NODE_FUNCS(Display)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual const char* broken() const { BROKEN_RTN(!fmtp()); return NULL; }
virtual string verilogKwd() const { return (filep() ? (string)"$f"+(string)displayType().ascii()
: (string)"$"+(string)displayType().ascii()); }
@ -3027,7 +3027,7 @@ public:
ASTNODE_NODE_FUNCS(JumpGo)
virtual const char* broken() const { BROKEN_RTN(!labelp()->brokeExistsAbove()); return NULL; }
virtual void cloneRelink() { if (m_labelp->clonep()) m_labelp = m_labelp->clonep(); }
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual int instrCount() const { return instrCountBranch(); }
virtual V3Hash sameHash() const { return V3Hash(labelp()); }
virtual bool same(const AstNode* samep) const { // Also same if identical tree structure all the way down, but hard to detect
@ -3119,7 +3119,7 @@ public:
m_generate = generate;
}
ASTNODE_NODE_FUNCS(Begin)
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual string name() const { return m_name; } // * = Block name
virtual void name(const string& name) { m_name = name; }
// op1 = Statements
@ -3191,7 +3191,7 @@ class AstInitArray : public AstNode {
// If default is specified, the vector may be sparse, and not provide each value.
// Parents: ASTVAR::init()
// Children: CONSTs...
deque<uint32_t> m_indices; // Which array index each entry in the list is for (if defaultp)
std::deque<uint32_t> m_indices; // Which array index each entry in the list is for (if defaultp)
public:
AstInitArray(FileLine* fl, AstNodeArrayDType* newDTypep, AstNode* defaultp)
: AstNode(fl) {
@ -3324,7 +3324,7 @@ public:
ASTNODE_NODE_FUNCS(TraceInc)
virtual const char* broken() const { BROKEN_RTN(!declp()->brokeExists()); return NULL; }
virtual void cloneRelink() { if (m_declp->clonep()) m_declp = m_declp->clonep(); }
virtual void dump(ostream& str);
virtual void dump(std::ostream& str);
virtual int instrCount() const { return 10+2*instrCountLd(); }
virtual bool hasDType() const { return true; }
virtual V3Hash sameHash() const { return V3Hash(declp()); }
@ -3357,7 +3357,7 @@ public:
m_sensesp = sensesp;
}
ASTNODE_NODE_FUNCS(Active)
virtual void dump(ostream& str=cout);
virtual void dump(std::ostream& str=std::cout);
virtual string name() const { return m_name; }
virtual const char* broken() const { BROKEN_RTN(m_sensesp && !m_sensesp->brokeExists()); return NULL; }
virtual void cloneRelink() {
@ -3395,7 +3395,7 @@ public:
AstNode* fromp() const { return op1p(); }
AstNode* dimp() const { return op2p(); }
AstAttrType attrType() const { return m_attrType; }
virtual void dump(ostream& str=cout);
virtual void dump(std::ostream& str=std::cout);
};
class AstScopeName : public AstNodeMath {
@ -3898,7 +3898,7 @@ public:
virtual V3Hash sameHash() const { return V3Hash(size()); }
virtual bool same(const AstNode* samep) const {
return size() == static_cast<const AstCCast*>(samep)->size(); }
virtual void dump(ostream& str=cout);
virtual void dump(std::ostream& str=std::cout);
//
int size() const { return m_size; }
};
@ -5244,7 +5244,7 @@ public:
virtual string name() const { return m_name; }
virtual V3Hash sameHash() const { return V3Hash(); }
virtual bool same(const AstNode* samep) const { return true; }
virtual void dump(ostream& str=cout);
virtual void dump(std::ostream& str=std::cout);
bool slow() const { return m_slow; }
void slow(bool flag) { m_slow = flag; }
bool source() const { return m_source; }
@ -5305,7 +5305,7 @@ public:
virtual string name() const { return m_name; }
virtual const char* broken() const { BROKEN_RTN((m_scopep && !m_scopep->brokeExists())); return NULL; }
virtual bool maybePointedTo() const { return true; }
virtual void dump(ostream& str=cout);
virtual void dump(std::ostream& str=std::cout);
virtual V3Hash sameHash() const { return V3Hash(); }
virtual bool same(const AstNode* samep) const {
const AstCFunc* asamep = static_cast<const AstCFunc*>(samep);
@ -5394,7 +5394,7 @@ public:
if (oldp->argsp()) addNOp1p(oldp->argsp()->unlinkFrBackWithNext());
}
ASTNODE_NODE_FUNCS(CCall)
virtual void dump(ostream& str=cout);
virtual void dump(std::ostream& str=std::cout);
virtual void cloneRelink() { if (m_funcp && m_funcp->clonep()) {
m_funcp = m_funcp->clonep();
}}
@ -5506,13 +5506,13 @@ public:
class AstTypeTable : public AstNode {
// Container for hash of standard data types
// Children: NODEDTYPEs
typedef map<pair<int,int>,AstBasicDType*> LogicMap;
typedef std::map<std::pair<int,int>,AstBasicDType*> LogicMap;
AstBasicDType* m_basicps[AstBasicDTypeKwd::_ENUM_MAX];
//
enum { IDX0_LOGIC, IDX0_BIT, _IDX0_MAX };
LogicMap m_logicMap[_IDX0_MAX][AstNumeric::_ENUM_MAX]; // uses above IDX enums
//
typedef map<VBasicTypeKey,AstBasicDType*> DetailedMap;
typedef std::map<VBasicTypeKey,AstBasicDType*> DetailedMap;
DetailedMap m_detailedMap;
public:
explicit AstTypeTable(FileLine* fl) : AstNode(fl) {
@ -5529,7 +5529,7 @@ public:
AstBasicDType* findInsertSameDType(AstBasicDType* nodep);
void clearCache();
void repairCache();
virtual void dump(ostream& str=cout);
virtual void dump(std::ostream& str=std::cout);
};
//######################################################################

View File

@ -49,7 +49,7 @@ private:
AstUser1InUse m_inuser1;
// TYPES
typedef vector<AstCFunc*> CFuncVec;
typedef std::vector<AstCFunc*> CFuncVec;
// STATE
int m_likely; // Excuses for branch likely taken

View File

@ -155,9 +155,9 @@ public:
// Use only AstNode::dump instead of the virtual one, as there
// may be varp() and other cross links that are bad.
if (v3Global.opt.debugCheck()) {
cerr<<"%Error: LeakedNode"<<(it->first->backp()?"Back: ":": ");
((AstNode*)(it->first))->AstNode::dump(cerr);
cerr<<endl;
std::cerr<<"%Error: LeakedNode"<<(it->first->backp()?"Back: ":": ");
((AstNode*)(it->first))->AstNode::dump(std::cerr);
std::cerr<<endl;
V3Error::incErrors();
}
it->second |= FLAG_LEAKED;

View File

@ -30,9 +30,9 @@
// Or, converts to a if/else tree.
// FUTURES:
// Large 16+ bit tables with constants and no masking (address muxes)
// Enter all into multimap, sort by value and use a tree of < and == compares.
// Enter all into std::multimap, sort by value and use a tree of < and == compares.
// "Diagonal" find of {rightmost,leftmost} bit {set,clear}
// Ignoring mask, check each value is unique (using multimap as above?)
// Ignoring mask, check each value is unique (using std::multimap as above?)
// Each branch is then mask-and-compare operation (IE <000000001_000000000 at midpoint.)
//
//*************************************************************************
@ -189,7 +189,7 @@ private:
if (!m_valueItem[i]) {
m_valueItem[i] = itemp;
} else if (!itemp->ignoreOverlap() && !bitched) {
itemp->v3warn(CASEOVERLAP,"Case values overlap (example pattern 0x"<<hex<<i<<")");
itemp->v3warn(CASEOVERLAP,"Case values overlap (example pattern 0x"<<std::hex<<i<<")");
bitched = true;
m_caseNoOverlapsAllCovered = false;
}
@ -206,7 +206,7 @@ private:
}
for (uint32_t i=0; i<(1UL<<m_caseWidth); i++) {
if (!m_valueItem[i]) {
nodep->v3warn(CASEINCOMPLETE,"Case values incompletely covered (example pattern 0x"<<hex<<i<<")");
nodep->v3warn(CASEINCOMPLETE,"Case values incompletely covered (example pattern 0x"<<std::hex<<i<<")");
m_caseNoOverlapsAllCovered = false;
return false;
}
@ -280,7 +280,7 @@ private:
if (debug()>=9) {
for (uint32_t i=0; i<(1UL<<m_caseWidth); i++) {
if (AstNode* itemp = m_valueItem[i]) {
UINFO(9,"Value "<<hex<<i<<" "<<itemp<<endl);
UINFO(9,"Value "<<std::hex<<i<<" "<<itemp<<endl);
}
}
}

View File

@ -135,7 +135,7 @@ private:
// NODE STATE
//Entire netlist:
// {statement}Node::user3 -> bool, indicating not hazard
ofstream* m_ofp; // Output file
std::ofstream* m_ofp; // Output file
string m_prefix;
virtual void visit(AstNode* nodep) {
@ -157,7 +157,7 @@ private:
public:
// CONSTUCTORS
CdcDumpVisitor(AstNode* nodep, ofstream* ofp, const string& prefix) {
CdcDumpVisitor(AstNode* nodep, std::ofstream* ofp, const string& prefix) {
m_ofp = ofp;
m_prefix = prefix;
nodep->accept(*this);
@ -225,7 +225,7 @@ private:
bool m_inDly; // In delayed assign
int m_inSenItem; // Number of senitems
string m_ofFilename; // Output filename
ofstream* m_ofp; // Output file
std::ofstream* m_ofp; // Output file
uint32_t m_userGeneration; // Generation count to avoid slow userClearVertices
int m_filelineWidth; // Characters in longest fileline
@ -284,7 +284,7 @@ private:
nodep->v3warnCode(code,msg);
if (!told_file) {
told_file = 1;
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;
}
@ -496,11 +496,11 @@ private:
}
string filename = v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"__cdc_edges.txt";
const vl_unique_ptr<ofstream> ofp (V3File::new_ofstream(filename));
const vl_unique_ptr<std::ofstream> ofp (V3File::new_ofstream(filename));
if (ofp->fail()) v3fatalSrc("Can't write "<<filename);
*ofp<<"Edge Report for "<<v3Global.opt.prefix()<<endl;
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()) {
if (CdcVarVertex* vvertexp = dynamic_cast<CdcVarVertex*>(itp)) {
AstVar* varp = vvertexp->varScp()->varp();
@ -508,26 +508,26 @@ private:
const char* whatp = "wire";
if (varp->isPrimaryIO()) whatp = (varp->isInout()?"inout":varp->isInput()?"input":"output");
ostringstream os;
os.setf(ios::left);
std::ostringstream os;
os.setf(std::ios::left);
// Module name - doesn't work due to flattening having lost the original
// so we assume the modulename matches the filebasename
string fname = vvertexp->varScp()->fileline()->filebasename() + ":";
os<<" "<<setw(20)<<fname;
os<<" "<<setw(8)<<whatp;
os<<" "<<setw(40)<<vvertexp->varScp()->prettyName();
os<<" "<<std::setw(20)<<fname;
os<<" "<<std::setw(8)<<whatp;
os<<" "<<std::setw(40)<<vvertexp->varScp()->prettyName();
os<<" SRC=";
if (vvertexp->srcDomainp()) V3EmitV::verilogForTree(vvertexp->srcDomainp(), os);
os<<" DST=";
if (vvertexp->dstDomainp()) V3EmitV::verilogForTree(vvertexp->dstDomainp(), os);
os<<setw(0);
os<<std::setw(0);
os<<endl;
report.push_back(os.str());
}
}
}
stable_sort(report.begin(), report.end());
for (deque<string>::iterator it = report.begin(); it!=report.end(); ++it) {
for (std::deque<string>::iterator it = report.begin(); it!=report.end(); ++it) {
*ofp << *it;
}
}
@ -541,7 +541,7 @@ private:
// Variables from flops already are domained
if (traceDests ? vertexp->dstDomainSet() : vertexp->srcDomainSet()) return; // Fully computed
typedef set<AstSenTree*> SenSet;
typedef std::set<AstSenTree*> SenSet;
SenSet senouts; // List of all sensitivities for new signal
if (CdcLogicVertex* vvertexp = dynamic_cast<CdcLogicVertex*>(vertexp)) {
if (vvertexp) {} // Unused

View File

@ -86,7 +86,7 @@ class CombCallVisitor : CombBaseVisitor {
private:
// NODE STATE
bool m_find; // Find mode vs. delete mode
typedef multimap<AstCFunc*,AstCCall*> CallMmap;
typedef std::multimap<AstCFunc*,AstCCall*> CallMmap;
CallMmap m_callMmap; // Associative array of {function}{call}
// METHODS
public:
@ -95,7 +95,7 @@ public:
if (newfuncp) {
UINFO(4, " Replace "<<oldfuncp<<" -WITH-> "<<newfuncp<<endl);
} else UINFO(4, " Remove "<<oldfuncp<<endl);
pair <CallMmap::iterator,CallMmap::iterator> eqrange = m_callMmap.equal_range(oldfuncp);
std::pair <CallMmap::iterator,CallMmap::iterator> eqrange = m_callMmap.equal_range(oldfuncp);
for (CallMmap::iterator nextit = eqrange.first; nextit != eqrange.second;) {
CallMmap::iterator eqit = nextit++;
AstCCall* callp = eqit->second;
@ -121,7 +121,7 @@ public:
m_callMmap.insert(make_pair(nodep->funcp(), nodep));
}
void deleteCall(AstCCall* nodep) {
pair <CallMmap::iterator,CallMmap::iterator> eqrange = m_callMmap.equal_range(nodep->funcp());
std::pair<CallMmap::iterator,CallMmap::iterator> eqrange = m_callMmap.equal_range(nodep->funcp());
for (CallMmap::iterator nextit = eqrange.first; nextit != eqrange.second;) {
CallMmap::iterator eqit = nextit++;
AstCCall* callp = eqit->second;
@ -225,7 +225,7 @@ private:
if (oldfuncp
&& oldfuncp->emptyBody()
&& !oldfuncp->dontCombine()) {
UINFO(5," EmptyFunc "<<hex<<V3Hash(oldfuncp->user4p())<<" "<<oldfuncp<<endl);
UINFO(5," EmptyFunc "<<std::hex<<V3Hash(oldfuncp->user4p())<<" "<<oldfuncp<<endl);
// Mark user3p on entire old tree, so we don't process it more
CombMarkVisitor visitor(oldfuncp);
m_call.replaceFunc(oldfuncp, NULL);
@ -255,8 +255,8 @@ private:
}
}
void replaceFuncWFunc(AstCFunc* oldfuncp, AstCFunc* newfuncp) {
UINFO(5," DupFunc "<<hex<<V3Hash(newfuncp->user4p())<<" "<<newfuncp<<endl);
UINFO(5," and "<<hex<<V3Hash(oldfuncp->user4p())<<" "<<oldfuncp<<endl);
UINFO(5," DupFunc "<<std::hex<<V3Hash(newfuncp->user4p())<<" "<<newfuncp<<endl);
UINFO(5," and "<<std::hex<<V3Hash(oldfuncp->user4p())<<" "<<oldfuncp<<endl);
// Mark user3p on entire old tree, so we don't process it more
++m_statCombs;
CombMarkVisitor visitor(oldfuncp);
@ -288,7 +288,7 @@ private:
AstNode* bestLast1p = NULL;
AstNode* bestLast2p = NULL;
//
pair <V3Hashed::iterator,V3Hashed::iterator> eqrange = m_hashed.mmap().equal_range(hashval);
std::pair<V3Hashed::iterator,V3Hashed::iterator> eqrange = m_hashed.mmap().equal_range(hashval);
for (V3Hashed::iterator eqit = eqrange.first; eqit != eqrange.second; ++eqit) {
AstNode* node2p = eqit->second;
if (node1p==node2p) continue;

View File

@ -47,11 +47,11 @@ public:
return (m_on>rh.m_on);
}
};
ostream& operator<<(ostream& os, V3ConfigLine rhs) { return os<<rhs.m_lineno<<", "<<rhs.m_code<<", "<<rhs.m_on; }
std::ostream& operator<<(std::ostream& os, V3ConfigLine rhs) { return os<<rhs.m_lineno<<", "<<rhs.m_code<<", "<<rhs.m_on; }
class V3ConfigIgnores {
typedef multiset<V3ConfigLine> IgnLines; // list of {line,code,on}
typedef map<string,IgnLines> IgnFiles; // {filename} => list of {line,code,on}
typedef std::multiset<V3ConfigLine> IgnLines; // list of {line,code,on}
typedef std::map<string,IgnLines> IgnFiles; // {filename} => list of {line,code,on}
// MEMBERS
string m_lastFilename; // Last filename looked up

View File

@ -1757,15 +1757,15 @@ private:
if (nextp && !cmp(senp, nextp)) {
// Something's out of order, sort it
senp = NULL;
vector<AstNodeSenItem*> vec;
std::vector<AstNodeSenItem*> vec;
for (AstNodeSenItem* senp = nodep->sensesp()->castNodeSenItem(); senp; senp=senp->nextp()->castNodeSenItem()) {
vec.push_back(senp);
}
stable_sort(vec.begin(), vec.end(), SenItemCmp());
for (vector<AstNodeSenItem*>::iterator it=vec.begin(); it!=vec.end(); ++it) {
for (std::vector<AstNodeSenItem*>::iterator it=vec.begin(); it!=vec.end(); ++it) {
(*it)->unlinkFrBack();
}
for (vector<AstNodeSenItem*>::iterator it=vec.begin(); it!=vec.end(); ++it) {
for (std::vector<AstNodeSenItem*>::iterator it=vec.begin(); it!=vec.end(); ++it) {
nodep->addSensesp(*it);
}
break;

View File

@ -45,7 +45,7 @@
class CoverageVisitor : public AstNVisitor {
private:
// TYPES
typedef map<string,int> FileMap;
typedef std::map<string,int> FileMap;
struct ToggleEnt {
string m_comment; // Comment for coverage dump

View File

@ -46,7 +46,7 @@ private:
//AstUser4InUse In V3Hashed
// TYPES
typedef vector<AstCoverToggle*> ToggleList;
typedef std::vector<AstCoverToggle*> ToggleList;
// STATE
ToggleList m_toggleps; // List of of all AstCoverToggle's

View File

@ -89,15 +89,15 @@ private:
AstUser1InUse m_inuser1;
// TYPES
typedef multimap<AstVarScope*,AstNodeAssign*> AssignMap;
typedef std::multimap<AstVarScope*,AstNodeAssign*> AssignMap;
// STATE
AstNodeModule* m_modp; // Current module
vector<AstVar*> m_varsp; // List of all encountered to avoid another loop through tree
vector<AstNode*> m_dtypesp; // List of all encountered to avoid another loop through tree
vector<AstVarScope*> m_vscsp; // List of all encountered to avoid another loop through tree
vector<AstScope*> m_scopesp; // List of all encountered to avoid another loop through tree
vector<AstCell*> m_cellsp; // List of all encountered to avoid another loop through tree
std::vector<AstVar*> m_varsp; // List of all encountered to avoid another loop through tree
std::vector<AstNode*> m_dtypesp; // List of all encountered to avoid another loop through tree
std::vector<AstVarScope*> m_vscsp; // List of all encountered to avoid another loop through tree
std::vector<AstScope*> m_scopesp; // List of all encountered to avoid another loop through tree
std::vector<AstCell*> m_cellsp; // List of all encountered to avoid another loop through tree
AssignMap m_assignMap; // List of all simple assignments for each variable
bool m_elimUserVars; // Allow removal of user's vars
bool m_elimDTypes; // Allow removal of DTypes
@ -307,7 +307,7 @@ private:
void deadCheckScope() {
for (bool retry=true; retry; ) {
retry = false;
for (vector<AstScope*>::iterator it = m_scopesp.begin(); it != m_scopesp.end();++it) {
for (std::vector<AstScope*>::iterator it = m_scopesp.begin(); it != m_scopesp.end();++it) {
AstScope* scp = *it;
if (!scp)
continue;
@ -326,7 +326,7 @@ private:
}
void deadCheckCells() {
for (vector<AstCell*>::iterator it = m_cellsp.begin(); it!=m_cellsp.end(); ++it) {
for (std::vector<AstCell*>::iterator it = m_cellsp.begin(); it!=m_cellsp.end(); ++it) {
AstCell* cellp = *it;
if (cellp->user1() == 0 && !cellp->modp()->stmtsp()) {
cellp->modp()->user1Inc(-1);
@ -337,11 +337,11 @@ private:
void deadCheckVar() {
// Delete any unused varscopes
for (vector<AstVarScope*>::iterator it = m_vscsp.begin(); it!=m_vscsp.end(); ++it) {
for (std::vector<AstVarScope*>::iterator it = m_vscsp.begin(); it!=m_vscsp.end(); ++it) {
AstVarScope* vscp = *it;
if (vscp->user1() == 0) {
UINFO(4," Dead "<<vscp<<endl);
pair <AssignMap::iterator,AssignMap::iterator> eqrange = m_assignMap.equal_range(vscp);
std::pair<AssignMap::iterator,AssignMap::iterator> eqrange = m_assignMap.equal_range(vscp);
for (AssignMap::iterator itr = eqrange.first; itr != eqrange.second; ++itr) {
AstNodeAssign* assp = itr->second;
UINFO(4," Dead assign "<<assp<<endl);
@ -355,7 +355,7 @@ private:
}
for (bool retry=true; retry; ) {
retry = false;
for (vector<AstVar *>::iterator it = m_varsp.begin(); it != m_varsp.end();++it) {
for (std::vector<AstVar *>::iterator it = m_varsp.begin(); it != m_varsp.end();++it) {
AstVar* varp = *it;
if (!varp)
continue;
@ -370,7 +370,7 @@ private:
}
}
}
for (vector<AstNode*>::iterator it = m_dtypesp.begin(); it != m_dtypesp.end();++it) {
for (std::vector<AstNode*>::iterator it = m_dtypesp.begin(); it != m_dtypesp.end();++it) {
if ((*it)->user1() == 0) {
AstNodeClassDType *classp;
// It's possible that there if a reference to each individual member, but

View File

@ -98,7 +98,7 @@ private:
bool m_inDly; // True in delayed assignments
bool m_inLoop; // True in for loops
bool m_inInitial; // True in intial blocks
typedef std::map<pair<AstNodeModule*,string>,AstVar*> VarMap;
typedef std::map<std::pair<AstNodeModule*,string>,AstVar*> VarMap;
VarMap m_modVarMap; // Table of new var names created under module
V3Double0 m_statSharedSet;// Statistic tracking
typedef std::map<AstVarScope*,int> ScopeVecMap;
@ -200,7 +200,7 @@ private:
UINFO(4,"AssignDlyArray: "<<nodep<<endl);
//
//=== Dimensions: __Vdlyvdim__
deque<AstNode*> dimvalp; // Assignment value for each dimension of assignment
std::deque<AstNode*> dimvalp; // Assignment value for each dimension of assignment
AstNode* dimselp=arrayselp;
for (; dimselp->castArraySel(); dimselp=dimselp->castArraySel()->fromp()) {
AstNode* valp = dimselp->castArraySel()->bitp()->unlinkFrBack();
@ -213,7 +213,7 @@ private:
AstVar* oldvarp = varrefp->varp();
int modVecNum = m_scopeVecMap[varrefp->varScopep()]++;
//
deque<AstNode*> dimreadps; // Read value for each dimension of assignment
std::deque<AstNode*> dimreadps; // Read value for each dimension of assignment
for (unsigned dimension=0; dimension<dimvalp.size(); dimension++) {
AstNode* dimp = dimvalp[dimension];
if (dimp->castConst()) { // bit = const, can just use it

View File

@ -48,7 +48,7 @@ private:
AstUser1InUse m_inuser1;
// TYPES
typedef multimap<string,AstCFunc*> FuncMmap;
typedef std::multimap<string,AstCFunc*> FuncMmap;
// STATE
AstNodeModule* m_modp; // Current module

View File

@ -46,7 +46,7 @@ class EmitCStmts : public EmitCBaseVisitor {
private:
bool m_suppressSemi;
AstVarRef* m_wideTempRefp; // Variable that _WW macros should be setting
vector<AstVar*> m_ctorVarsVec; // All variables in constructor order
std::vector<AstVar*> m_ctorVarsVec; // All variables in constructor order
int m_splitSize; // # of cfunc nodes placed into output file
int m_splitFilenum; // File number being created, 0 = primary
@ -773,7 +773,7 @@ public:
class EmitCImp : EmitCStmts {
// MEMBERS
AstNodeModule* m_modp;
vector<AstChangeDet*> m_blkChangeDetVec; // All encountered changes in block
std::vector<AstChangeDet*> m_blkChangeDetVec; // All encountered changes in block
bool m_slow; // Creating __Slow file
bool m_fast; // Creating non __Slow file (or both)
@ -915,7 +915,7 @@ class EmitCImp : EmitCStmts {
putsDecoration("// Change detection\n");
puts("QData __req = false; // Logically a bool\n"); // But not because it results in faster code
bool gotOne = false;
for (vector<AstChangeDet*>::iterator it = m_blkChangeDetVec.begin();
for (std::vector<AstChangeDet*>::iterator it = m_blkChangeDetVec.begin();
it != m_blkChangeDetVec.end(); ++it) {
AstChangeDet* changep = *it;
if (changep->lhsp()) {
@ -929,7 +929,7 @@ class EmitCImp : EmitCStmts {
if (gotOne) {
puts(");\n");
//puts("VL_DEBUG_IF( if (__req) cout<<\"\tCLOCKREQ );");
for (vector<AstChangeDet*>::iterator it = m_blkChangeDetVec.begin();
for (std::vector<AstChangeDet*>::iterator it = m_blkChangeDetVec.begin();
it != m_blkChangeDetVec.end(); ++it) {
AstChangeDet* nodep = *it;
if (nodep->lhsp()) {
@ -1077,7 +1077,7 @@ void EmitCStmts::emitVarCtors() {
puts("\n");
puts("#if (SYSTEMC_VERSION>20011000)\n"); // SystemC 2.0.1 and newer
bool first = true;
for (vector<AstVar*>::iterator it = m_ctorVarsVec.begin(); it != m_ctorVarsVec.end(); ++it) {
for (std::vector<AstVar*>::iterator it = m_ctorVarsVec.begin(); it != m_ctorVarsVec.end(); ++it) {
AstVar* varp = *it;
bool isArray = !varp->dtypeSkipRefp()->castBasicDType();
if (isArray) {
@ -1210,9 +1210,9 @@ void EmitCStmts::emitOpName(AstNode* nodep, const string& format,
struct EmitDispState {
string m_format; // "%s" and text from user
vector<char> m_argsChar; // Format of each argument to be printed
vector<AstNode*> m_argsp; // Each argument to be printed
vector<string> m_argsFunc; // Function before each argument to be printed
std::vector<char> m_argsChar; // Format of each argument to be printed
std::vector<AstNode*> m_argsp; // Each argument to be printed
std::vector<string> m_argsFunc; // Function before each argument to be printed
EmitDispState() { clear(); }
void clear() {
m_format = "";
@ -1903,7 +1903,7 @@ struct CmpName {
};
void EmitCImp::emitIntFuncDecls(AstNodeModule* modp) {
vector<AstCFunc*> funcsp;
std::vector<AstCFunc*> funcsp;
for (AstNode* nodep=modp->stmtsp(); nodep; nodep = nodep->nextp()) {
if (AstCFunc* funcp = nodep->castCFunc()) {
@ -1915,7 +1915,7 @@ void EmitCImp::emitIntFuncDecls(AstNodeModule* modp) {
stable_sort(funcsp.begin(), funcsp.end(), CmpName());
for (vector<AstCFunc*>::iterator it = funcsp.begin(); it != funcsp.end(); ++it) {
for (std::vector<AstCFunc*>::iterator it = funcsp.begin(); it != funcsp.end(); ++it) {
AstCFunc* funcp = *it;
if (!funcp->dpiImport()) { // DPI is prototyped in __Dpi.h
ofp()->putsPrivate(funcp->declPrivate());

View File

@ -57,11 +57,11 @@ class EmitCSyms : EmitCBaseVisitor {
ScopeVarData(const string& scopeName, const string& varBasePretty, AstVar* varp, AstNodeModule* modp, AstScope* scopep)
: m_scopeName(scopeName), m_varBasePretty(varBasePretty), m_varp(varp), m_modp(modp), m_scopep(scopep) {}
};
typedef map<string,ScopeFuncData> ScopeFuncs;
typedef map<string,ScopeVarData> ScopeVars;
typedef map<string,ScopeNameData> ScopeNames;
typedef pair<AstScope*,AstNodeModule*> ScopeModPair;
typedef pair<AstNodeModule*,AstVar*> ModVarPair;
typedef std::map<string,ScopeFuncData> ScopeFuncs;
typedef std::map<string,ScopeVarData> ScopeVars;
typedef std::map<string,ScopeNameData> ScopeNames;
typedef std::pair<AstScope*,AstNodeModule*> ScopeModPair;
typedef std::pair<AstNodeModule*,AstVar*> ModVarPair;
struct CmpName {
inline bool operator () (const ScopeModPair& lhsp, const ScopeModPair& rhsp) const {
return lhsp.first->name() < rhsp.first->name();
@ -80,9 +80,9 @@ class EmitCSyms : EmitCBaseVisitor {
// STATE
AstCFunc* m_funcp; // Current function
AstNodeModule* m_modp; // Current module
vector<ScopeModPair> m_scopes; // Every scope by module
vector<AstCFunc*> m_dpis; // DPI functions
vector<ModVarPair> m_modVars; // Each public {mod,var}
std::vector<ScopeModPair> m_scopes; // Every scope by module
std::vector<AstCFunc*> m_dpis; // DPI functions
std::vector<ModVarPair> m_modVars; // Each public {mod,var}
ScopeNames m_scopeNames; // Each unique AstScopeName
ScopeFuncs m_scopeFuncs; // Each {scope,dpi-export-func}
ScopeVars m_scopeVars; // Each {scope,public-var}
@ -112,9 +112,9 @@ class EmitCSyms : EmitCBaseVisitor {
// We didn'e have all m_scopes loaded when we encountered variables, so expand them now
// It would be less code if each module inserted its own variables.
// Someday. For now public isn't common.
for (vector<ScopeModPair>::iterator itsc = m_scopes.begin(); itsc != m_scopes.end(); ++itsc) {
for (std::vector<ScopeModPair>::iterator itsc = m_scopes.begin(); itsc != m_scopes.end(); ++itsc) {
AstScope* scopep = itsc->first; AstNodeModule* smodp = itsc->second;
for (vector<ModVarPair>::iterator it = m_modVars.begin(); it != m_modVars.end(); ++it) {
for (std::vector<ModVarPair>::iterator it = m_modVars.begin(); it != m_modVars.end(); ++it) {
AstNodeModule* modp = it->first;
AstVar* varp = it->second;
if (modp == smodp) {
@ -284,7 +284,7 @@ void EmitCSyms::emitSymHdr() {
if (v3Global.dpi()) {
puts ("\n// DPI TYPES for DPI Export callbacks (Internal use)\n");
map<string,int> types; // Remove duplicates and sort
std::map<string,int> types; // Remove duplicates and sort
for (ScopeFuncs::iterator it = m_scopeFuncs.begin(); it != m_scopeFuncs.end(); ++it) {
AstCFunc* funcp = it->second.m_funcp;
if (funcp->dpiExport()) {
@ -292,7 +292,7 @@ void EmitCSyms::emitSymHdr() {
types["typedef void (*"+cbtype+") ("+cFuncArgs(funcp)+");\n"] = 1;
}
}
for (map<string,int>::iterator it = types.begin(); it != types.end(); ++it) {
for (std::map<string,int>::iterator it = types.begin(); it != types.end(); ++it) {
puts(it->first);
}
}
@ -309,7 +309,7 @@ void EmitCSyms::emitSymHdr() {
puts("bool __Vm_didInit;\n");
puts("\n// SUBCELL STATE\n");
for (vector<ScopeModPair>::iterator it = m_scopes.begin(); it != m_scopes.end(); ++it) {
for (std::vector<ScopeModPair>::iterator it = m_scopes.begin(); it != m_scopes.end(); ++it) {
AstScope* scopep = it->first; AstNodeModule* modp = it->second;
if (modp->isTop()) {
ofp()->printf("%-30s ", (modClassName(modp)+"*").c_str());
@ -385,7 +385,7 @@ void EmitCSyms::emitSymImp() {
puts("\t, __Vm_didInit(false)\n");
puts("\t// Setup submodule names\n");
char comma=',';
for (vector<ScopeModPair>::iterator it = m_scopes.begin(); it != m_scopes.end(); ++it) {
for (std::vector<ScopeModPair>::iterator it = m_scopes.begin(); it != m_scopes.end(); ++it) {
AstScope* scopep = it->first; AstNodeModule* modp = it->second;
if (modp->isTop()) {
} else {
@ -403,7 +403,7 @@ void EmitCSyms::emitSymImp() {
puts("// Pointer to top level\n");
puts("TOPp = topp;\n");
puts("// Setup each module's pointers to their submodules\n");
for (vector<ScopeModPair>::iterator it = m_scopes.begin(); it != m_scopes.end(); ++it) {
for (std::vector<ScopeModPair>::iterator it = m_scopes.begin(); it != m_scopes.end(); ++it) {
AstScope* scopep = it->first; AstNodeModule* modp = it->second;
if (!modp->isTop()) {
string arrow = scopep->name();
@ -420,7 +420,7 @@ void EmitCSyms::emitSymImp() {
puts("// Setup each module's pointer back to symbol table (for public functions)\n");
puts("TOPp->__Vconfigure(this, true);\n");
for (vector<ScopeModPair>::iterator it = m_scopes.begin(); it != m_scopes.end(); ++it) {
for (std::vector<ScopeModPair>::iterator it = m_scopes.begin(); it != m_scopes.end(); ++it) {
AstScope* scopep = it->first; AstNodeModule* modp = it->second;
if (!modp->isTop()) {
// first is used by AstCoverDecl's call to __vlCoverInsert
@ -533,7 +533,7 @@ void EmitCSyms::emitSymImp() {
}
puts( "os"+op+"__Vm_didInit;\n");
puts( "// SUBCELL STATE\n");
for (vector<ScopeModPair>::iterator it = m_scopes.begin(); it != m_scopes.end(); ++it) {
for (std::vector<ScopeModPair>::iterator it = m_scopes.begin(); it != m_scopes.end(); ++it) {
AstScope* scopep = it->first; AstNodeModule* modp = it->second;
if (!modp->isTop()) {
puts( scopep->nameDotless()+"."+funcname+"(os);\n");
@ -570,7 +570,7 @@ void EmitCSyms::emitDpiHdr() {
int firstExp = 0;
int firstImp = 0;
for (vector<AstCFunc*>::iterator it = m_dpis.begin(); it != m_dpis.end(); ++it) {
for (std::vector<AstCFunc*>::iterator it = m_dpis.begin(); it != m_dpis.end(); ++it) {
AstCFunc* nodep = *it;
if (nodep->dpiExportWrapper()) {
if (!firstExp++) puts("\n// DPI EXPORTS\n");
@ -618,7 +618,7 @@ void EmitCSyms::emitDpiImp() {
puts("#include \""+topClassName()+".h\"\n");
puts("\n");
for (vector<AstCFunc*>::iterator it = m_dpis.begin(); it != m_dpis.end(); ++it) {
for (std::vector<AstCFunc*>::iterator it = m_dpis.begin(); it != m_dpis.end(); ++it) {
AstCFunc* nodep = *it;
if (nodep->dpiExportWrapper()) {
puts("#ifndef _VL_DPIDECL_"+nodep->name()+"\n");

View File

@ -626,7 +626,7 @@ public:
class EmitVStreamVisitor : public EmitVBaseVisitor {
// MEMBERS
ostream& m_os;
std::ostream& m_os;
// METHODS
virtual void putsNoTracking(const string& str) { m_os<<str; }
virtual void puts(const string& str) { putsNoTracking(str); }
@ -634,7 +634,7 @@ class EmitVStreamVisitor : public EmitVBaseVisitor {
virtual void putfs(AstNode*, const string& str) { putbs(str); }
virtual void putqs(AstNode*, const string& str) { putbs(str); }
public:
EmitVStreamVisitor(AstNode* nodep, ostream& os)
EmitVStreamVisitor(AstNode* nodep, std::ostream& os)
: m_os(os) {
nodep->accept(*this);
}
@ -645,7 +645,7 @@ public:
// Emit to a stream (perhaps stringstream)
class EmitVPrefixedFormatter : public V3OutFormatter {
ostream& m_os;
std::ostream& m_os;
string m_prefix; // What to print at beginning of each line
int m_flWidth; // Padding of fileline
int m_column; // Rough location; need just zero or non-zero
@ -671,7 +671,7 @@ public:
void prefixFl(FileLine* fl) { m_prefixFl = fl; }
FileLine* prefixFl() const { return m_prefixFl; }
int column() const { return m_column; }
EmitVPrefixedFormatter(ostream& os, const string& prefix, int flWidth)
EmitVPrefixedFormatter(std::ostream& os, const string& prefix, int flWidth)
: V3OutFormatter("__STREAM", V3OutFormatter::LA_VERILOG)
, m_os(os), m_prefix(prefix), m_flWidth(flWidth) {
m_column = 0;
@ -703,7 +703,7 @@ class EmitVPrefixedVisitor : public EmitVBaseVisitor {
}
public:
EmitVPrefixedVisitor(AstNode* nodep, ostream& os, const string& prefix, int flWidth,
EmitVPrefixedVisitor(AstNode* nodep, std::ostream& os, const string& prefix, int flWidth,
AstSenTree* domainp, bool user3mark)
: EmitVBaseVisitor(domainp), m_formatter(os, prefix, flWidth) {
if (user3mark) { AstUser3InUse::check(); }
@ -734,11 +734,11 @@ void V3EmitV::emitv() {
}
}
void V3EmitV::verilogForTree(AstNode* nodep, ostream& os) {
void V3EmitV::verilogForTree(AstNode* nodep, std::ostream& os) {
EmitVStreamVisitor(nodep, os);
}
void V3EmitV::verilogPrefixedTree(AstNode* nodep, ostream& os, const string& prefix, int flWidth,
void V3EmitV::verilogPrefixedTree(AstNode* nodep, std::ostream& os, const string& prefix, int flWidth,
AstSenTree* domainp, bool user3mark) {
EmitVPrefixedVisitor(nodep, os, prefix, flWidth, domainp, user3mark);
}

View File

@ -30,8 +30,8 @@
class V3EmitV {
public:
static void emitv();
static void verilogForTree(AstNode* nodep, ostream& os=cout);
static void verilogPrefixedTree(AstNode* nodep, ostream& os, const string& prefix, int flWidth,
static void verilogForTree(AstNode* nodep, std::ostream& os=std::cout);
static void verilogPrefixedTree(AstNode* nodep, std::ostream& os, const string& prefix, int flWidth,
AstSenTree* domainp, bool user3percent);
};

View File

@ -38,7 +38,7 @@ int V3Error::s_debugDefault = 0;
int V3Error::s_errorLimit = V3Error::MAX_ERRORS;
bool V3Error::s_warnFatal = true;
int V3Error::s_tellManual = 0;
ostringstream V3Error::s_errorStr; // Error string being formed
std::ostringstream V3Error::s_errorStr; // Error string being formed
V3ErrorCode V3Error::s_errorCode = V3ErrorCode::EC_FATAL;
bool V3Error::s_errorSuppressed = false;
bool V3Error::s_describedEachWarn[V3ErrorCode::_ENUM_MAX];
@ -81,10 +81,10 @@ void V3Error::init() {
}
string V3Error::lineStr (const char* filename, int lineno) {
ostringstream out;
std::ostringstream out;
const char* fnslashp = strrchr (filename, '/');
if (fnslashp) filename = fnslashp+1;
out<<filename<<":"<<dec<<lineno<<":";
out<<filename<<":"<<std::dec<<lineno<<":";
const char* const spaces = " ";
size_t numsp = out.str().length(); if (numsp>20) numsp = 20;
out<<(spaces + numsp);
@ -101,11 +101,11 @@ void V3Error::incErrors() {
void V3Error::abortIfWarnings() {
bool exwarn = warnFatal() && warnCount();
if (errorCount() && exwarn) {
v3fatal ("Exiting due to "<<dec<<errorCount()<<" error(s), "<<warnCount()<<" warning(s)\n");
v3fatal("Exiting due to "<<std::dec<<errorCount()<<" error(s), "<<warnCount()<<" warning(s)\n");
} else if (errorCount()) {
v3fatal ("Exiting due to "<<dec<<errorCount()<<" error(s)\n");
v3fatal("Exiting due to "<<std::dec<<errorCount()<<" error(s)\n");
} else if (exwarn) {
v3fatal ("Exiting due to "<<dec<<warnCount()<<" warning(s)\n");
v3fatal("Exiting due to "<<std::dec<<warnCount()<<" warning(s)\n");
}
}
@ -139,7 +139,7 @@ string V3Error::msgPrefix() {
void V3Error::vlAbort () {
if (V3Error::debugDefault()) {
cerr<<msgPrefix()<<"Aborting since under --debug"<<endl;
std::cerr<<msgPrefix()<<"Aborting since under --debug"<<endl;
abort();
} else {
exit(10);
@ -162,7 +162,7 @@ string V3Error::warnMore() {
return msgPrefix();
}
void V3Error::v3errorEnd (ostringstream& sstr) {
void V3Error::v3errorEnd (std::ostringstream& sstr) {
#if defined(__COVERITY__) || defined(__cppcheck__)
if (s_errorCode==V3ErrorCode::EC_FATAL) __coverity_panic__(x);
#endif
@ -176,20 +176,20 @@ void V3Error::v3errorEnd (ostringstream& sstr) {
if (s_messages.find(msg) != s_messages.end()) return;
s_messages.insert(msg);
// Output
cerr<<msg;
std::cerr<<msg;
if (!s_errorSuppressed && !(s_errorCode==V3ErrorCode::EC_INFO
|| s_errorCode==V3ErrorCode::USERINFO)) {
if (!s_describedEachWarn[s_errorCode]
&& !s_pretendError[s_errorCode]) {
s_describedEachWarn[s_errorCode] = true;
if (s_errorCode>=V3ErrorCode::EC_FIRST_WARN && !s_describedWarnings) {
cerr<<msgPrefix()<<"Use \"/* verilator lint_off "<<s_errorCode.ascii()
<<" */\" and lint_on around source to disable this message."<<endl;
std::cerr<<msgPrefix()<<"Use \"/* verilator lint_off "<<s_errorCode.ascii()
<<" */\" and lint_on around source to disable this message."<<endl;
s_describedWarnings = true;
}
if (s_errorCode.dangerous()) {
cerr<<msgPrefix()<<"*** See the manual before disabling this,"<<endl;
cerr<<msgPrefix()<<"else you may end up with different sim results."<<endl;
std::cerr<<msgPrefix()<<"*** See the manual before disabling this,"<<endl;
std::cerr<<msgPrefix()<<"else you may end up with different sim results."<<endl;
}
}
// If first warning is not the user's fault (internal/unsupported) then give the website
@ -210,7 +210,7 @@ void V3Error::v3errorEnd (ostringstream& sstr) {
if (!inFatal) {
inFatal = true;
if (s_tellManual==1) {
cerr<<msgPrefix()<<"See the manual and http://www.veripool.org/verilator for more assistance."<<endl;
std::cerr<<msgPrefix()<<"See the manual and http://www.veripool.org/verilator for more assistance."<<endl;
s_tellManual = 2;
}
#ifndef _V3ERROR_NO_GLOBAL_

View File

@ -189,14 +189,14 @@ public:
inline bool operator== (V3ErrorCode lhs, V3ErrorCode rhs) { return (lhs.m_e == rhs.m_e); }
inline bool operator== (V3ErrorCode lhs, V3ErrorCode::en rhs) { return (lhs.m_e == rhs); }
inline bool operator== (V3ErrorCode::en lhs, V3ErrorCode rhs) { return (lhs == rhs.m_e); }
inline ostream& operator<<(ostream& os, V3ErrorCode rhs) { return os<<rhs.ascii(); }
inline std::ostream& operator<<(std::ostream& os, V3ErrorCode rhs) { return os<<rhs.ascii(); }
//######################################################################
class V3Error {
// Base class for any object that wants debugging and error reporting
typedef set<string> MessagesSet;
typedef std::set<string> MessagesSet;
typedef void (*ErrorExitCb)(void);
private:
@ -209,7 +209,7 @@ class V3Error {
static int s_errCount; // Error count
static int s_warnCount; // Warning count
static int s_tellManual; // Tell user to see manual, 0=not yet, 1=doit, 2=disable
static ostringstream s_errorStr; // Error string being formed
static std::ostringstream s_errorStr; // Error string being formed
static V3ErrorCode s_errorCode; // Error string being formed will abort
static bool s_errorSuppressed; // Error being formed should be suppressed
static MessagesSet s_messages; // What errors we've outputted
@ -217,7 +217,7 @@ class V3Error {
enum MaxErrors { MAX_ERRORS = 50 }; // Fatal after this may errors
V3Error() { cerr<<("Static class"); abort(); }
V3Error() { std::cerr<<("Static class"); abort(); }
public:
// CONSTRUCTORS
@ -252,15 +252,15 @@ class V3Error {
// Error end takes the string stream to output, be careful to seek() as needed
static void v3errorPrep(V3ErrorCode code) {
s_errorStr.str(""); s_errorCode=code; s_errorSuppressed=false; }
static ostringstream& v3errorStr() { return s_errorStr; }
static std::ostringstream& v3errorStr() { return s_errorStr; }
static void vlAbort();
static void v3errorEnd(ostringstream& sstr); // static, but often overridden in classes.
static void v3errorEnd(std::ostringstream& sstr); // static, but often overridden in classes.
};
// Global versions, so that if the class doesn't define a operator, we get the functions anyways.
inline int debug() { return V3Error::debugDefault(); }
inline void v3errorEnd(ostringstream& sstr) { V3Error::v3errorEnd(sstr); }
inline void v3errorEndFatal(ostringstream& sstr) { V3Error::v3errorEnd(sstr); assert(0); VL_UNREACHABLE }
inline void v3errorEnd(std::ostringstream& sstr) { V3Error::v3errorEnd(sstr); }
inline void v3errorEndFatal(std::ostringstream& sstr) { V3Error::v3errorEnd(sstr); assert(0); VL_UNREACHABLE }
// Theses allow errors using << operators: v3error("foo"<<"bar");
// Careful, you can't put () around msg, as you would in most macro definitions
@ -273,7 +273,7 @@ inline void v3errorEndFatal(ostringstream& sstr) { V3Error::v3errorEnd(sstr); as
#define v3error(msg) v3warnCode(V3ErrorCode::EC_ERROR, msg)
#define v3fatal(msg) v3warnCodeFatal(V3ErrorCode::EC_FATAL, msg)
// Use this instead of fatal() to mention the source code line.
#define v3fatalSrc(msg) v3warnCodeFatal(V3ErrorCode::EC_FATALSRC, __FILE__<<":"<<dec<<__LINE__<<": "<<msg)
#define v3fatalSrc(msg) v3warnCodeFatal(V3ErrorCode::EC_FATALSRC, __FILE__<<":"<<std::dec<<__LINE__<<": "<<msg)
#define UINFO(level,stmsg) {if(VL_UNLIKELY(debug()>=(level))) { cout<<"- "<<V3Error::lineStr(__FILE__,__LINE__)<<stmsg; }}
#define UINFONL(level,stmsg) {if(VL_UNLIKELY(debug()>=(level))) { cout<<stmsg; } }
@ -286,14 +286,14 @@ inline void v3errorEndFatal(ostringstream& sstr) { V3Error::v3errorEnd(sstr); as
#define UASSERT(condition,stmsg) { if (VL_UNLIKELY(!(condition))) { v3fatalSrc(stmsg); }}
// For use in V3Ast static functions only
#define UASSERT_STATIC(condition,stmsg) { if (VL_UNLIKELY(!(condition))) { cerr<<"Internal Error: "<<__FILE__<<":"<<dec<<__LINE__<<":"<<(stmsg)<<endl; abort(); } }
#define UASSERT_STATIC(condition,stmsg) { if (VL_UNLIKELY(!(condition))) { std::cerr<<"Internal Error: "<<__FILE__<<":"<<std::dec<<__LINE__<<":"<<(stmsg)<<std::endl; abort(); } }
#define V3ERROR_NA { v3error("Internal: Unexpected Call"); v3fatalSrc("Unexpected Call"); }
//----------------------------------------------------------------------
template< class T> std::string cvtToStr (const T& t) {
ostringstream os; os<<t; return os.str();
std::ostringstream os; os<<t; return os.str();
}
inline uint32_t cvtToHash(const void* vp) {

View File

@ -97,8 +97,8 @@ class V3FileDependImp {
};
// MEMBERS
set<string> m_filenameSet; // Files generated (elim duplicates)
set<DependFile> m_filenameList; // Files sourced/generated
std::set<string> m_filenameSet; // Files generated (elim duplicates)
std::set<DependFile> m_filenameList; // Files sourced/generated
static string stripQuotes(const string& in) {
string pretty = in;
@ -134,10 +134,10 @@ V3FileDependImp dependImp; // Depend implementation class
// V3FileDependImp
inline void V3FileDependImp::writeDepend(const string& filename) {
const vl_unique_ptr<ofstream> ofp (V3File::new_ofstream(filename));
const vl_unique_ptr<std::ofstream> ofp (V3File::new_ofstream(filename));
if (ofp->fail()) v3fatalSrc("Can't write "<<filename);
for (set<DependFile>::iterator iter=m_filenameList.begin();
for (std::set<DependFile>::iterator iter=m_filenameList.begin();
iter!=m_filenameList.end(); ++iter) {
if (iter->target()) {
*ofp<<iter->filename()<<" ";
@ -149,7 +149,7 @@ inline void V3FileDependImp::writeDepend(const string& filename) {
*ofp<<V3PreShell::dependFiles();
*ofp<<" ";
for (set<DependFile>::iterator iter=m_filenameList.begin();
for (std::set<DependFile>::iterator iter=m_filenameList.begin();
iter!=m_filenameList.end(); ++iter) {
if (!iter->target()) {
*ofp<<iter->filename()<<" ";
@ -160,7 +160,7 @@ inline void V3FileDependImp::writeDepend(const string& filename) {
if (v3Global.opt.makePhony()) {
*ofp<<endl;
for (set<DependFile>::iterator iter=m_filenameList.begin();
for (std::set<DependFile>::iterator iter=m_filenameList.begin();
iter!=m_filenameList.end(); ++iter) {
if (!iter->target()) {
*ofp<<iter->filename()<<":"<<endl;
@ -170,14 +170,14 @@ inline void V3FileDependImp::writeDepend(const string& filename) {
}
inline void V3FileDependImp::writeTimes(const string& filename, const string& cmdlineIn) {
const vl_unique_ptr<ofstream> ofp (V3File::new_ofstream(filename));
const vl_unique_ptr<std::ofstream> ofp (V3File::new_ofstream(filename));
if (ofp->fail()) v3fatalSrc("Can't write "<<filename);
string cmdline = stripQuotes(cmdlineIn);
*ofp<<"# DESCR"<<"IPTION: Verilator output: Timestamp data for --skip-identical. Delete at will."<<endl;
*ofp<<"C \""<<cmdline<<"\""<<endl;
for (set<DependFile>::iterator iter=m_filenameList.begin();
for (std::set<DependFile>::iterator iter=m_filenameList.begin();
iter!=m_filenameList.end(); ++iter) {
// Read stats of files we create after we're done making them (execpt for this file, of course)
DependFile* dfp = (DependFile*)&(*iter);
@ -188,19 +188,19 @@ inline void V3FileDependImp::writeTimes(const string& filename, const string& cm
if (dfp->filename() == filename) { showSize=0; showIno=0; } // We're writing it, so need to ignore it
*ofp<<(iter->target()?"T":"S")<<" ";
*ofp<<" "<<setw(8)<<showSize;
*ofp<<" "<<setw(8)<<showIno;
*ofp<<" "<<setw(11)<<iter->cstime();
*ofp<<" "<<setw(11)<<iter->cnstime();
*ofp<<" "<<setw(11)<<iter->mstime();
*ofp<<" "<<setw(11)<<iter->mnstime();
*ofp<<" "<<std::setw(8)<<showSize;
*ofp<<" "<<std::setw(8)<<showIno;
*ofp<<" "<<std::setw(11)<<iter->cstime();
*ofp<<" "<<std::setw(11)<<iter->cnstime();
*ofp<<" "<<std::setw(11)<<iter->mstime();
*ofp<<" "<<std::setw(11)<<iter->mnstime();
*ofp<<" \""<<iter->filename()<<"\"";
*ofp<<endl;
}
}
inline bool V3FileDependImp::checkTimes(const string& filename, const string& cmdlineIn) {
const vl_unique_ptr<ifstream> ifp (V3File::new_ifstream_nodepend(filename));
const vl_unique_ptr<std::ifstream> ifp (V3File::new_ifstream_nodepend(filename));
if (ifp->fail()) {
UINFO(2," --check-times failed: no input "<<filename<<endl);
return false;
@ -298,7 +298,7 @@ void V3File::createMakeDir() {
// V3InFilterImp
class V3InFilterImp {
typedef map<string,string> FileContentsMap;
typedef std::map<string,string> FileContentsMap;
typedef V3InFilter::StrList StrList;
FileContentsMap m_contentsMap; // Cache of file contents

View File

@ -34,23 +34,23 @@
class V3File {
public:
static ifstream* new_ifstream(const string& filename) {
static std::ifstream* new_ifstream(const string& filename) {
addSrcDepend(filename);
return new_ifstream_nodepend (filename);
}
static ifstream* new_ifstream_nodepend(const string& filename) {
return new ifstream(filename.c_str());
static std::ifstream* new_ifstream_nodepend(const string& filename) {
return new std::ifstream(filename.c_str());
}
static ofstream* new_ofstream(const string& filename, bool append=false) {
static std::ofstream* new_ofstream(const string& filename, bool append=false) {
addTgtDepend(filename);
return new_ofstream_nodepend (filename, append);
}
static ofstream* new_ofstream_nodepend(const string& filename, bool append=false) {
static std::ofstream* new_ofstream_nodepend(const string& filename, bool append=false) {
if (filename != VL_DEV_NULL) createMakeDir();
if (append) {
return new ofstream(filename.c_str(), ios::app);
return new std::ofstream(filename.c_str(), std::ios::app);
} else {
return new ofstream(filename.c_str());
return new std::ofstream(filename.c_str());
}
}
static FILE* new_fopen_w(const string& filename) {
@ -78,7 +78,7 @@ class V3InFilterImp;
class V3InFilter {
public:
// TYPES
typedef list<string> StrList;
typedef std::list<string> StrList;
private:
V3InFilterImp* m_impp;
@ -123,7 +123,7 @@ private:
int m_nobreak; // Basic operator or begin paren, don't break next
bool m_prependIndent;
int m_indentLevel; // Current {} indentation
stack<int> m_parenVec; // Stack of columns where last ( was
std::stack<int> m_parenVec; // Stack of columns where last ( was
int endLevels(const char* strg);
const char* indentStr(int levels);

View File

@ -71,7 +71,7 @@ int FileLineSingleton::nameToNumber(const string& filename) {
//! Support XML output
//! Experimental. Updated to also put out the language.
void FileLineSingleton::fileNameNumMapDumpXml(ostream& os) {
void FileLineSingleton::fileNameNumMapDumpXml(std::ostream& os) {
os<<"<files>\n";
for (FileNameNumMap::const_iterator it = m_namemap.begin(); it != m_namemap.end(); ++it) {
os<<"<file id=\""<<filenameLetters(it->second)
@ -184,8 +184,8 @@ const string FileLine::profileFuncname() const {
string FileLine::ascii() const {
return filename()+":"+cvtToStr(lineno());
}
ostream& operator<<(ostream& os, FileLine* fileline) {
os <<fileline->ascii()<<": "<<hex;
std::ostream& operator<<(std::ostream& os, FileLine* fileline) {
os <<fileline->ascii()<<": "<<std::hex;
return(os);
}
@ -237,9 +237,9 @@ void FileLine::modifyStateInherit(const FileLine* fromp) {
}
}
void FileLine::v3errorEnd(ostringstream& str) {
void FileLine::v3errorEnd(std::ostringstream& str) {
if (m_lineno) {
ostringstream nsstr;
std::ostringstream nsstr;
nsstr<<this<<str.str();
if (warnIsOff(V3Error::errorCode())) V3Error::suppressThisWarning();
V3Error::v3errorEnd(nsstr);

View File

@ -43,12 +43,12 @@ class FileLine;
//! source file (each with its own unique filename number).
class FileLineSingleton {
// TYPES
typedef map<string,int> FileNameNumMap;
typedef map<string,V3LangCode> FileLangNumMap;
typedef std::map<string,int> FileNameNumMap;
typedef std::map<string,V3LangCode> FileLangNumMap;
// MEMBERS
FileNameNumMap m_namemap; // filenameno for each filename
deque<string> m_names; // filename text for each filenameno
deque<V3LangCode> m_languages; // language for each filenameno
std::deque<string> m_names; // filename text for each filenameno
std::deque<V3LangCode> m_languages; // language for each filenameno
// COSNTRUCTORS
FileLineSingleton() { }
~FileLineSingleton() { }
@ -60,7 +60,7 @@ protected:
const V3LangCode numberToLang(int filenameno) const { return m_languages[filenameno]; }
void numberToLang(int filenameno, const V3LangCode& l) { m_languages[filenameno] = l; }
void clear() { m_namemap.clear(); m_names.clear(); m_languages.clear(); }
void fileNameNumMapDumpXml(ostream& os);
void fileNameNumMapDumpXml(std::ostream& os);
static const string filenameLetters(int fileno);
};
@ -72,7 +72,7 @@ protected:
class FileLine {
int m_lineno;
int m_filenameno;
bitset<V3ErrorCode::_ENUM_MAX> m_warnOn;
std::bitset<V3ErrorCode::_ENUM_MAX> m_warnOn;
private:
struct EmptySecret {};
@ -148,7 +148,7 @@ public:
defaultFileLine().warnOff(code, flag); }
static bool globalWarnOff(const string& code, bool flag) {
return defaultFileLine().warnOff(code, flag); }
static void fileNameNumMapDumpXml(ostream& os) {
static void fileNameNumMapDumpXml(std::ostream& os) {
singleton().fileNameNumMapDumpXml(os); }
// METHODS - Called from netlist
@ -160,17 +160,17 @@ public:
void modifyWarnOff(V3ErrorCode code, bool flag) { warnOff(code,flag); }
// OPERATORS
void v3errorEnd(ostringstream& str);
void v3errorEndFatal(ostringstream& str);
void v3errorEnd(std::ostringstream& str);
void v3errorEndFatal(std::ostringstream& str);
string warnMore() const;
inline bool operator==(FileLine rhs) const {
return (m_lineno==rhs.m_lineno && m_filenameno==rhs.m_filenameno && m_warnOn==rhs.m_warnOn);
}
private:
void v3errorEndFatalGuts(ostringstream& str);
void v3errorEndFatalGuts(std::ostringstream& str);
};
ostream& operator<<(ostream& os, FileLine* fileline);
std::ostream& operator<<(std::ostream& os, FileLine* fileline);
inline void FileLine::v3errorEndFatal(ostringstream& str) { v3errorEnd(str); assert(0); }
inline void FileLine::v3errorEndFatal(std::ostringstream& str) { v3errorEnd(str); assert(0); }
#endif // Guard

View File

@ -45,7 +45,7 @@
#include "V3Stats.h"
#include "V3Hashed.h"
typedef list<AstNodeVarRef*> GateVarRefList;
typedef std::list<AstNodeVarRef*> GateVarRefList;
#define GATE_DEDUP_MAX_DEPTH 20
@ -728,7 +728,7 @@ void GateVisitor::replaceAssigns() {
//if (debug()>9) {vscp->dumpTree(cout, "-vscDone: "); cout<<endl;}
if (!vscp->valuep()->castNodeMath()
|| vscp->valuep()->nextp()) {
vscp->dumpTree(cerr, "vscStrange: ");
vscp->dumpTree(std::cerr, "vscStrange: ");
vscp->v3fatalSrc("Value of varscope not mathematical");
}
}

View File

@ -33,7 +33,7 @@
#include "V3Graph.h"
int V3Graph::s_debug = 0;
int V3Graph::debug() { return max(V3Error::debugDefault(), s_debug); }
int V3Graph::debug() { return std::max(V3Error::debugDefault(), s_debug); }
//######################################################################
//######################################################################
@ -82,7 +82,7 @@ void V3GraphVertex::rerouteEdges(V3Graph* graphp) {
for (V3GraphEdge* iedgep = inBeginp(); iedgep; iedgep=iedgep->inNextp()) {
for (V3GraphEdge* oedgep = outBeginp(); oedgep; oedgep=oedgep->outNextp()) {
new V3GraphEdge (graphp, iedgep->fromp(), oedgep->top(),
min(iedgep->weight(),oedgep->weight()),
std::min(iedgep->weight(),oedgep->weight()),
iedgep->cutable() && oedgep->cutable());
}
}
@ -118,7 +118,7 @@ uint32_t V3GraphVertex::outHash() const {
return hash;
}
ostream& operator<<(ostream& os, V3GraphVertex* vertexp) {
std::ostream& operator<<(std::ostream& os, V3GraphVertex* vertexp) {
os<<" VERTEX="<<vertexp->name();
if (vertexp->rank()) os<<" r"<<vertexp->rank();
if (vertexp->fanout()!=0.0) os<<" f"<<vertexp->fanout();
@ -241,10 +241,10 @@ void V3Graph::clearColors() {
void V3Graph::loopsVertexCb(V3GraphVertex* vertexp) {
// Needed here as V3GraphVertex<< isn't defined until later in header
cerr<<"-Info-Loop: "<<(void*)(vertexp)<<" "<<vertexp<<endl;
std::cerr<<"-Info-Loop: "<<(void*)(vertexp)<<" "<<vertexp<<endl;
}
void V3Graph::dump(ostream& os) {
void V3Graph::dump(std::ostream& os) {
// This generates a file used by graphviz, http://www.graphviz.org
os<<" Graph:\n";
// Print vertices
@ -262,7 +262,7 @@ void V3Graph::dump(ostream& os) {
}
}
void V3Graph::dumpEdge(ostream& os, V3GraphVertex* vertexp, V3GraphEdge* edgep) {
void V3Graph::dumpEdge(std::ostream& os, V3GraphVertex* vertexp, V3GraphEdge* edgep) {
if (edgep->weight()
&& (edgep->fromp() == vertexp
|| edgep->top() == vertexp)) {
@ -288,7 +288,7 @@ void V3Graph::dumpDotFilePrefixedAlways(const string& nameComment, bool colorAsS
void V3Graph::dumpDotFile(const string& filename, bool colorAsSubgraph) const {
// This generates a file used by graphviz, http://www.graphviz.org
// "hardcoded" parameters:
const vl_unique_ptr<ofstream> logp (V3File::new_ofstream(filename));
const vl_unique_ptr<std::ofstream> logp (V3File::new_ofstream(filename));
if (logp->fail()) v3fatalSrc("Can't write "<<filename);
// Header
@ -299,7 +299,7 @@ void V3Graph::dumpDotFile(const string& filename, bool colorAsSubgraph) const {
*logp<<"\t\t rankdir="<<dotRankDir()<<"];\n";
// List of all possible subgraphs
typedef multimap<string,V3GraphVertex*> SubgraphMmap;
typedef std::multimap<string,V3GraphVertex*> SubgraphMmap;
SubgraphMmap subgraphs;
for (V3GraphVertex* vertexp = verticesBeginp(); vertexp; vertexp=vertexp->verticesNextp()) {
string vertexSubgraph = (colorAsSubgraph && vertexp->color()) ? cvtToStr(vertexp->color()) : "";
@ -308,7 +308,7 @@ void V3Graph::dumpDotFile(const string& filename, bool colorAsSubgraph) const {
// We use a map here, as we don't want to corrupt anything (userp) in the graph,
// and we don't care if this is slow.
map<V3GraphVertex*,int> numMap;
std::map<V3GraphVertex*,int> numMap;
// Print vertices
int n=0;

View File

@ -57,7 +57,7 @@ protected:
void acyclicCut();
void acyclicLoop(V3GraphVertex* vertexp, int depth);
double orderDFSIterate(V3GraphVertex* vertexp);
void dumpEdge(ostream& os, V3GraphVertex* vertexp, V3GraphEdge* edgep);
void dumpEdge(std::ostream& os, V3GraphVertex* vertexp, V3GraphEdge* edgep);
void verticesUnlink() { m_vertices.reset(); }
// ACCESSORS
static int debug();
@ -126,7 +126,7 @@ public:
void subtreeLoops(V3EdgeFuncP edgeFuncp, V3GraphVertex* vertexp, V3Graph* loopGraphp);
/// Debugging
void dump(ostream& os=cout);
void dump(std::ostream& os=std::cout);
void dumpDotFile(const string& filename, bool colorAsSubgraph) const;
void dumpDotFilePrefixed(const string& nameComment, bool colorAsSubgraph=false) const;
void dumpDotFilePrefixedAlways(const string& nameComment, bool colorAsSubgraph=false) const;
@ -212,7 +212,7 @@ public:
void rerouteEdges(V3Graph* graphp); ///< Edges are routed around this vertex to point from "from" directly to "to"
};
ostream& operator<<(ostream& os, V3GraphVertex* vertexp);
std::ostream& operator<<(std::ostream& os, V3GraphVertex* vertexp);
//============================================================================

View File

@ -63,7 +63,7 @@ public:
class GraphAcycEdge : public V3GraphEdge {
// userp() is always used to point to the head original graph edge
private:
typedef 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 {
OrigEdgeList* oEListp = ((OrigEdgeList*)userp());
if (!oEListp) v3fatalSrc("No original edge associated with acyc edge "<<this<<endl);
@ -93,7 +93,7 @@ struct GraphAcycEdgeCmp {
// CLASSES
class GraphAcyc {
private:
typedef list<V3GraphEdge*> OrigEdgeList; // List of orig edges, see also GraphAcycEdge's decl
typedef std::list<V3GraphEdge*> OrigEdgeList; // List of orig edges, see also GraphAcycEdge's decl
// GRAPH USERS
// origGraph
// GraphVertex::user() GraphAycVerted* New graph node
@ -104,7 +104,7 @@ private:
V3Graph* m_origGraphp; // Original graph
V3Graph m_breakGraph; // Graph with only breakable edges represented
V3List<GraphAcycVertex*> m_work; // List of vertices with optimization work left
vector<OrigEdgeList*> m_origEdgeDelp; // List of deletions to do when done
std::vector<OrigEdgeList*> m_origEdgeDelp; // List of deletions to do when done
V3EdgeFuncP m_origEdgeFuncp; // Function that says we follow this edge (in original graph)
uint32_t m_placeStep; // Number that user() must be equal to to indicate processing
@ -189,7 +189,7 @@ public:
m_placeStep = 0;
}
~GraphAcyc() {
for (vector<OrigEdgeList*>::iterator it = m_origEdgeDelp.begin(); it != m_origEdgeDelp.end(); ++it) {
for (std::vector<OrigEdgeList*>::iterator it = m_origEdgeDelp.begin(); it != m_origEdgeDelp.end(); ++it) {
delete (*it);
}
m_origEdgeDelp.clear();
@ -453,7 +453,7 @@ void GraphAcyc::place() {
}
UINFO(4, " Cutable edges = "<<numEdges<<endl);
vector<V3GraphEdge*> edges; // List of all edges to be processed
std::vector<V3GraphEdge*> edges; // List of all edges to be processed
edges.reserve(numEdges+1); // Make the vector properly sized right off the bat -- faster than reallocating
for (V3GraphVertex* vertexp = m_breakGraph.verticesBeginp(); vertexp; vertexp=vertexp->verticesNextp()) {
vertexp->user(0); // Clear in prep of next step
@ -469,7 +469,7 @@ void GraphAcyc::place() {
// Process each edge in weighted order
m_placeStep = 10;
for (vector<V3GraphEdge*>::iterator it = edges.begin(); it!=edges.end(); ++it) {
for (std::vector<V3GraphEdge*>::iterator it = edges.begin(); it!=edges.end(); ++it) {
V3GraphEdge* edgep = (*it);
placeTryEdge(edgep);
}

View File

@ -186,7 +186,7 @@ void V3Graph::weaklyConnected(V3EdgeFuncP edgeFuncp) {
class GraphAlgStrongly : GraphAlg {
private:
uint32_t m_currentDfs; // DFS count
vector<V3GraphVertex*> m_callTrace; // List of everything we hit processing so far
std::vector<V3GraphVertex*> m_callTrace; // List of everything we hit processing so far
void main() {
// Use Tarjan's algorithm to find the strongly connected subgraphs.
@ -327,7 +327,7 @@ void V3Graph::rank(V3EdgeFuncP edgeFuncp) {
class GraphAlgRLoops : GraphAlg {
private:
vector<V3GraphVertex*> m_callTrace; // List of everything we hit processing so far
std::vector<V3GraphVertex*> m_callTrace; // List of everything we hit processing so far
bool m_done; // Exit algorithm
void main(V3GraphVertex* vertexp) {
@ -460,20 +460,20 @@ struct GraphSortEdgeCmp {
void V3Graph::sortVertices() {
// Sort list of vertices by rank, then fanout
vector<V3GraphVertex*> vertices;
std::vector<V3GraphVertex*> vertices;
for (V3GraphVertex* vertexp = verticesBeginp(); vertexp; vertexp=vertexp->verticesNextp()) {
vertices.push_back(vertexp);
}
std::stable_sort(vertices.begin(), vertices.end(), GraphSortVertexCmp());
this->verticesUnlink();
for (vector<V3GraphVertex*>::iterator it = vertices.begin(); it!=vertices.end(); ++it) {
for (std::vector<V3GraphVertex*>::iterator it = vertices.begin(); it!=vertices.end(); ++it) {
(*it)->verticesPushBack(this);
}
}
void V3Graph::sortEdges() {
// Sort edges by rank then fanout of node they point to
vector<V3GraphEdge*> edges;
std::vector<V3GraphEdge*> edges;
for (V3GraphVertex* vertexp = verticesBeginp(); vertexp; vertexp=vertexp->verticesNextp()) {
// Make a vector
for (V3GraphEdge* edgep = vertexp->outBeginp(); edgep; edgep = edgep->outNextp()) {
@ -486,7 +486,7 @@ void V3Graph::sortEdges() {
// We know the vector contains all of the edges that were
// there originally (didn't delete or add)
vertexp->outUnlink();
for (vector<V3GraphEdge*>::const_iterator it = edges.begin(); it!=edges.end(); ++it) {
for (std::vector<V3GraphEdge*>::const_iterator it = edges.begin(); it!=edges.end(); ++it) {
(*it)->outPushBack();
}
// Prep for next

View File

@ -63,8 +63,8 @@ class GraphNfaToDfa : GraphAlg {
// Edges from DFA to DFA indicate a completed input transition
private:
// TYPES
typedef deque<DfaVertex*> DfaStates;
typedef multimap<vluint64_t,DfaVertex*> HashMap;
typedef std::deque<DfaVertex*> DfaStates;
typedef std::multimap<vluint64_t,DfaVertex*> HashMap;
// MEMBERS
uint32_t m_step; // Processing step, so we can avoid clearUser all the time
@ -169,7 +169,7 @@ private:
// The order of the nodes is not deterministic; the hash thus must not depend on order of edges
uint32_t hash = hashDfaOrigins(nfasWithInput);
pair <HashMap::iterator,HashMap::iterator> eqrange = m_hashMap.equal_range(hash);
std::pair<HashMap::iterator,HashMap::iterator> eqrange = m_hashMap.equal_range(hash);
for (HashMap::iterator it = eqrange.first; it != eqrange.second; ++it) {
DfaVertex* testp = it->second;
if (compareDfaOrigins(nfasWithInput, testp)) {
@ -275,7 +275,7 @@ private:
UINFO(9," On dfaState "<<dfaStatep<<endl);
// From this dfaState, what corresponding nfaStates have what inputs?
set<int> inputs;
std::set<int> inputs;
// Foreach NFA state (this DFA state was formed from)
for (V3GraphEdge* dfaEdgep = dfaStatep->outBeginp(); dfaEdgep; dfaEdgep=dfaEdgep->outNextp()) {
if (nfaState(dfaEdgep->top())) {
@ -294,7 +294,7 @@ private:
}
// Foreach input state (NFA inputs of this DFA state)
for (set<int>::const_iterator inIt=inputs.begin(); inIt!=inputs.end(); ++inIt) {
for (std::set<int>::const_iterator inIt=inputs.begin(); inIt!=inputs.end(); ++inIt) {
DfaInput input = *inIt;
UINFO(9," ==="<<++i<<"=======================\n");
UINFO(9," On input "<<(void*)(input.toNodep())<<endl);
@ -397,7 +397,7 @@ private:
m_graphp->userClearVertices();
DfaVertex* startp = graphp()->findStart();
stack<V3GraphVertex*> workps; workps.push(startp);
std::stack<V3GraphVertex*> workps; workps.push(startp);
// Mark all nodes connected to start
while (!workps.empty()) {
@ -432,7 +432,7 @@ private:
m_graphp->userClearVertices();
// Find all dead vertexes
stack<DfaVertex*> workps;
std::stack<DfaVertex*> workps;
for (V3GraphVertex* vertexp = m_graphp->verticesBeginp(); vertexp; vertexp=vertexp->verticesNextp()) {
if (DfaVertex* vvertexp = dynamic_cast<DfaVertex*>(vertexp)) {
workps.push(vvertexp);

View File

@ -141,10 +141,10 @@ void V3Hashed::dumpFilePrefixed(const string& nameComment, bool tree) {
}
void V3Hashed::dumpFile(const string& filename, bool tree) {
const vl_unique_ptr<ofstream> logp (V3File::new_ofstream(filename));
const vl_unique_ptr<std::ofstream> logp (V3File::new_ofstream(filename));
if (logp->fail()) v3fatalSrc("Can't write "<<filename);
map<int,int> dist;
std::map<int,int> dist;
V3Hash lasthash;
int num_in_bucket = 0;
@ -165,8 +165,8 @@ void V3Hashed::dumpFile(const string& filename, bool tree) {
}
*logp <<"\n*** STATS:\n"<<endl;
*logp<<" #InBucket Occurrences\n";
for (map<int,int>::iterator it=dist.begin(); it!=dist.end(); ++it) {
*logp<<" "<<setw(9)<<it->first<<" "<<setw(12)<<it->second<<endl;
for (std::map<int,int>::iterator it=dist.begin(); it!=dist.end(); ++it) {
*logp<<" "<<std::setw(9)<<it->first<<" "<<std::setw(12)<<it->second<<endl;
}
*logp <<"\n*** Dump:\n"<<endl;
@ -185,7 +185,7 @@ void V3Hashed::dumpFile(const string& filename, bool tree) {
V3Hashed::iterator V3Hashed::findDuplicate(AstNode* nodep) {
UINFO(8," findD "<<nodep<<endl);
if (!nodep->user4p()) nodep->v3fatalSrc("Called findDuplicate on non-hashed node");
pair <HashMmap::iterator,HashMmap::iterator> eqrange = mmap().equal_range(nodeHash(nodep));
std::pair<HashMmap::iterator,HashMmap::iterator> eqrange = mmap().equal_range(nodeHash(nodep));
for (HashMmap::iterator eqit = eqrange.first; eqit != eqrange.second; ++eqit) {
AstNode* node2p = eqit->second;
if (nodep != node2p && sameNodes(nodep, node2p)) {
@ -198,7 +198,7 @@ V3Hashed::iterator V3Hashed::findDuplicate(AstNode* nodep) {
V3Hashed::iterator V3Hashed::findDuplicate(AstNode* nodep, V3HashedUserCheck* checkp) {
UINFO(8," findD "<<nodep<<endl);
if (!nodep->user4p()) nodep->v3fatalSrc("Called findDuplicate on non-hashed node");
pair <HashMmap::iterator,HashMmap::iterator> eqrange = mmap().equal_range(nodeHash(nodep));
std::pair<HashMmap::iterator,HashMmap::iterator> eqrange = mmap().equal_range(nodeHash(nodep));
for (HashMmap::iterator eqit = eqrange.first; eqit != eqrange.second; ++eqit) {
AstNode* node2p = eqit->second;
if (nodep != node2p && checkp->check(nodep,node2p) && sameNodes(nodep, node2p)) {

View File

@ -58,7 +58,7 @@ class V3Hashed : public VHashedBase {
AstUser4InUse m_inuser4;
// TYPES
typedef multimap<V3Hash,AstNode*> HashMmap;
typedef std::multimap<V3Hash,AstNode*> HashMmap;
public:
typedef HashMmap::iterator iterator;
private:

View File

@ -72,15 +72,15 @@ private:
AstNodeModule* m_modp; // Current module
V3Double0 m_statUnsup; // Statistic tracking
typedef vector<AstNodeModule*> ModVec;
typedef std::vector<AstNodeModule*> ModVec;
ModVec m_allMods; // All modules, in top-down order.
// Within the context of a given module, LocalInstanceMap maps
// from child modules to the count of each child's local instantiations.
typedef map<AstNodeModule*, int> LocalInstanceMap;
typedef std::map<AstNodeModule*, int> LocalInstanceMap;
// We keep a LocalInstanceMap for each module in the design
map<AstNodeModule*, LocalInstanceMap> m_instances;
std::map<AstNodeModule*, LocalInstanceMap> m_instances;
// METHODS
static int debug() {

View File

@ -158,7 +158,7 @@ class InstDeModVarVisitor : public AstNVisitor {
// Expand all module variables, and save names for later reference
private:
// STATE
typedef map<string,AstVar*> VarNameMap;
typedef std::map<string,AstVar*> VarNameMap;
VarNameMap m_modVarNameMap; // Per module, name of cloned variables
static int debug() {
@ -221,7 +221,7 @@ private:
int m_instSelNum; // Current instantiation count 0..N-1
InstDeModVarVisitor m_deModVars; // State of variables for current cell module
typedef map<string,AstVar*> VarNameMap;
typedef std::map<string,AstVar*> VarNameMap;
static int debug() {
static int level = -1;
@ -333,8 +333,8 @@ private:
UINFO(4," PIN "<<nodep<<endl);
int pinwidth = nodep->modVarp()->width();
int expwidth = nodep->exprp()->width();
pair<uint32_t,uint32_t> pinDim = nodep->modVarp()->dtypep()->dimensions(false);
pair<uint32_t,uint32_t> expDim = nodep->exprp()->dtypep()->dimensions(false);
std::pair<uint32_t,uint32_t> pinDim = nodep->modVarp()->dtypep()->dimensions(false);
std::pair<uint32_t,uint32_t> expDim = nodep->exprp()->dtypep()->dimensions(false);
UINFO(4," PINVAR "<<nodep->modVarp()<<endl);
UINFO(4," EXP "<<nodep->exprp()<<endl);
UINFO(4," pinwidth ew="<<expwidth<<" pw="<<pinwidth

View File

@ -30,14 +30,15 @@ class V3LanguageWords {
// List of common reserved keywords
private:
map<string,string> m_kwdMap; // List of keywords, and what language applies
typedef std::map<string,string> KeywordMap;
KeywordMap m_kwdMap; // List of keywords, and what language applies
void addKwd(const string& kwd, const string& why) {
m_kwdMap.insert(make_pair(kwd,why));
}
public:
string isKeyword(const string& kwd) {
map<string,string>::iterator it = m_kwdMap.find(kwd);
KeywordMap::iterator it = m_kwdMap.find(kwd);
if (it == m_kwdMap.end()) return "";
return it->second;
}
@ -107,8 +108,8 @@ class V3LanguageWords {
addKwd("long", "C++ keyword");
addKwd("map", "C++ common word");
addKwd("module", "C++ modules TS keyword");
addKwd("multimap", "C++ common word");
addKwd("multiset", "C++ common word");
addKwd("std::multimap", "C++ common word");
addKwd("std::multiset", "C++ common word");
addKwd("mutable", "C++ keyword");
addKwd("namespace", "C++ keyword");
addKwd("near", "C++ common word");

View File

@ -53,7 +53,7 @@ class LifeState {
public:
V3Double0 m_statAssnDel; // Statistic tracking
V3Double0 m_statAssnCon; // Statistic tracking
vector<AstNode*> m_unlinkps;
std::vector<AstNode*> m_unlinkps;
public:
// CONSTRUCTORS
@ -61,7 +61,7 @@ public:
~LifeState() {
V3Stats::addStatSum("Optimizations, Lifetime assign deletions", m_statAssnDel);
V3Stats::addStatSum("Optimizations, Lifetime constant prop", m_statAssnCon);
for (vector<AstNode*>::iterator it = m_unlinkps.begin(); it != m_unlinkps.end(); ++it) {
for (std::vector<AstNode*>::iterator it = m_unlinkps.begin(); it != m_unlinkps.end(); ++it) {
(*it)->unlinkFrBack();
(*it)->deleteTree();
}

View File

@ -105,11 +105,11 @@ public:
private:
// TYPES
typedef multimap<string,VSymEnt*> NameScopeSymMap;
typedef map<VSymEnt*,VSymEnt*> ScopeAliasMap;
typedef set<pair<AstNodeModule*,string> > ImplicitNameSet;
typedef vector<VSymEnt*> IfaceVarSyms;
typedef vector<pair<AstIface*,VSymEnt*> > IfaceModSyms;
typedef std::multimap<string,VSymEnt*> NameScopeSymMap;
typedef std::map<VSymEnt*,VSymEnt*> ScopeAliasMap;
typedef std::set<std::pair<AstNodeModule*,string> > ImplicitNameSet;
typedef std::vector<VSymEnt*> IfaceVarSyms;
typedef std::vector<std::pair<AstIface*,VSymEnt*> > IfaceModSyms;
static LinkDotState* s_errorThisp; // Last self, for error reporting only
@ -135,9 +135,9 @@ public:
void dump(const string& nameComment="linkdot", bool force=false) {
if (debug()>=6 || force) {
string filename = v3Global.debugFilename(nameComment)+".txt";
const vl_unique_ptr<ofstream> logp (V3File::new_ofstream(filename));
const vl_unique_ptr<std::ofstream> logp (V3File::new_ofstream(filename));
if (logp->fail()) v3fatalSrc("Can't write "<<filename);
ostream& os = *logp;
std::ostream& os = *logp;
m_syms.dump(os);
bool first = true;
for (int samn=0; samn<SAMN__MAX; ++samn) {
@ -1496,7 +1496,7 @@ private:
}
string ascii() const {
static const char* const names[] = { "NONE","PACKAGE","SCOPE","FINAL","MEMBER" };
ostringstream sstr;
std::ostringstream sstr;
sstr<<"ds="<<names[m_dotPos];
sstr<<" dse"<<(void*)m_dotSymp;
sstr<<" txt="<<m_dotText;

View File

@ -43,7 +43,7 @@
class LinkJumpVisitor : public AstNVisitor {
private:
// TYPES
typedef vector<AstBegin*> BeginStack;
typedef std::vector<AstBegin*> BeginStack;
// STATE
AstNodeModule* m_modp; // Current module

View File

@ -52,7 +52,7 @@ void V3LinkLevel::modSortByLevel() {
// level() was computed for us in V3LinkCells
typedef vector<AstNodeModule*> ModVec;
typedef std::vector<AstNodeModule*> ModVec;
ModVec vec;
AstNodeModule* topp = NULL;

View File

@ -49,8 +49,8 @@ private:
AstUser2InUse m_inuser2;
// TYPES
typedef map <pair<void*,string>,AstTypedef*> ImplTypedefMap;
typedef set <FileLine*> FileLineSet;
typedef std::map<std::pair<void*,string>,AstTypedef*> ImplTypedefMap;
typedef std::set<FileLine*> FileLineSet;
// STATE
AstVar* m_varp; // Variable we're under

View File

@ -113,7 +113,7 @@ private:
// STATE
V3Double0 m_statLocVars; // Statistic tracking
AstCFunc* m_cfuncp; // Current active function
vector<AstVar*> m_varps; // List of variables to consider for deletion
std::vector<AstVar*> m_varps; // List of variables to consider for deletion
// METHODS
void clearOptimizable(AstVar* nodep, const char* reason) {
@ -129,7 +129,7 @@ private:
flags.setNodeFlags(nodep);
}
void moveVars() {
for (vector<AstVar*>::iterator it = m_varps.begin(); it != m_varps.end(); ++it) {
for (std::vector<AstVar*>::iterator it = m_varps.begin(); it != m_varps.end(); ++it) {
AstVar* nodep = *it;
if (nodep->valuep()) clearOptimizable(nodep,"HasInitValue");
if (!VarFlags(nodep).m_stdFuncAsn) clearStdOptimizable(nodep,"NoStdAssign");

View File

@ -364,7 +364,7 @@ V3Number& V3Number::setMask(int nbits) {
// ACCESSORS - as strings
string V3Number::ascii(bool prefixed, bool cleanVerilog) const {
ostringstream out;
std::ostringstream out;
if (isDouble()) {
out.precision(17);
@ -781,7 +781,7 @@ bool V3Number::isUnknown() const {
return false;
}
bool V3Number::isLt(const V3Number& rhs) const {
for (int bit=0; bit<max(this->width(),rhs.width()); bit++) {
for (int bit=0; bit < std::max(this->width(),rhs.width()); bit++) {
if (this->bitIs1(bit) && rhs.bitIs0(bit)) { return 1; }
if (rhs.bitIs1(bit) && this->bitIs0(bit)) { return 0; }
if (this->bitIsXZ(bit)) { return 0; }
@ -791,7 +791,7 @@ bool V3Number::isLt(const V3Number& rhs) const {
}
bool V3Number::isLtXZ(const V3Number& rhs) const {
// Include X/Z in comparisons for sort ordering
for (int bit=0; bit<max(this->width(),rhs.width()); bit++) {
for (int bit=0; bit < std::max(this->width(),rhs.width()); bit++) {
if (this->bitIs1(bit) && rhs.bitIs0(bit)) { return 1; }
if (rhs.bitIs1(bit) && this->bitIs0(bit)) { return 0; }
if (this->bitIsXZ(bit)) { return 1; }
@ -1068,9 +1068,9 @@ V3Number& V3Number::opStreamL (const V3Number& lhs, const V3Number& rhs) {
m_fileline->v3warn(WIDTHCONCAT,"Unsized numbers/parameters not allowed in streams.");
}
// Slice size should never exceed the lhs width
int ssize=min(rhs.toUInt(), (unsigned)lhs.width());
int ssize = std::min(rhs.toUInt(), (unsigned)lhs.width());
for (int istart=0; istart<lhs.width(); istart+=ssize) {
int ostart=max(0, lhs.width()-ssize-istart);
int ostart = std::max(0, lhs.width()-ssize-istart);
for (int bit=0; bit<ssize && bit<lhs.width()-istart; bit++) {
setBit(ostart+bit, lhs.bitIs(istart+bit));
}
@ -1126,7 +1126,7 @@ V3Number& V3Number::opLogIff (const V3Number& lhs, const V3Number& rhs) {
V3Number& V3Number::opEq (const V3Number& lhs, const V3Number& rhs) {
// i op j, 1 bit return, max(L(lhs),L(rhs)) calculation, careful need to X/Z extend.
char outc = 1;
for (int bit=0; bit<max(lhs.width(),rhs.width()); bit++) {
for (int bit=0; bit < std::max(lhs.width(),rhs.width()); bit++) {
if (lhs.bitIs1(bit) && rhs.bitIs0(bit)) { outc=0; goto last; }
if (lhs.bitIs0(bit) && rhs.bitIs1(bit)) { outc=0; goto last; }
if (lhs.bitIsXZ(bit)) { outc='x'; }
@ -1139,7 +1139,7 @@ last:
V3Number& V3Number::opNeq (const V3Number& lhs, const V3Number& rhs) {
// i op j, 1 bit return, max(L(lhs),L(rhs)) calculation, careful need to X/Z extend.
char outc = 0;
for (int bit=0; bit<max(lhs.width(),rhs.width()); bit++) {
for (int bit=0; bit < std::max(lhs.width(),rhs.width()); bit++) {
if (lhs.bitIs1(bit) && rhs.bitIs0(bit)) { outc=1; goto last; }
if (lhs.bitIs0(bit) && rhs.bitIs1(bit)) { outc=1; goto last; }
if (lhs.bitIsXZ(bit)) { outc='x'; }
@ -1152,7 +1152,7 @@ last:
bool V3Number::isCaseEq (const V3Number& rhs) const {
// i op j, 1 bit return, max(L(lhs),L(rhs)) calculation, careful need to X/Z extend.
if (this->width() != rhs.width()) return false;
for (int bit=0; bit<max(this->width(),rhs.width()); bit++) {
for (int bit=0; bit < std::max(this->width(),rhs.width()); bit++) {
if (this->bitIs(bit) != rhs.bitIs(bit)) { return false; }
}
return true;
@ -1165,7 +1165,7 @@ V3Number& V3Number::opCaseEq (const V3Number& lhs, const V3Number& rhs) {
V3Number& V3Number::opCaseNeq (const V3Number& lhs, const V3Number& rhs) {
// i op j, 1 bit return, max(L(lhs),L(rhs)) calculation, careful need to X/Z extend.
char outc = 0;
for (int bit=0; bit<max(lhs.width(),rhs.width()); bit++) {
for (int bit=0; bit < std::max(lhs.width(),rhs.width()); bit++) {
if (lhs.bitIs(bit) != rhs.bitIs(bit)) { outc=1; goto last; }
}
last:
@ -1174,7 +1174,7 @@ last:
V3Number& V3Number::opWildEq (const V3Number& lhs, const V3Number& rhs) {
char outc = 1;
for (int bit=0; bit<max(lhs.width(),rhs.width()); bit++) {
for (int bit=0; bit < std::max(lhs.width(),rhs.width()); bit++) {
if (!rhs.bitIsXZ(bit)
&& lhs.bitIs(bit) != rhs.bitIs(bit)) { outc=0; goto last; }
if (lhs.bitIsXZ(bit)) outc='x';
@ -1185,7 +1185,7 @@ last:
V3Number& V3Number::opWildNeq (const V3Number& lhs, const V3Number& rhs) {
char outc = 0;
for (int bit=0; bit<max(lhs.width(),rhs.width()); bit++) {
for (int bit=0; bit < std::max(lhs.width(),rhs.width()); bit++) {
if (!rhs.bitIsXZ(bit)
&& lhs.bitIs(bit) != rhs.bitIs(bit)) { outc=1; goto last; }
if (lhs.bitIsXZ(bit)) outc='x';
@ -1197,7 +1197,7 @@ last:
V3Number& V3Number::opGt (const V3Number& lhs, const V3Number& rhs) {
// i op j, 1 bit return, max(L(lhs),L(rhs)) calculation, careful need to X/Z extend.
char outc = 0;
for (int bit=0; bit<max(lhs.width(),rhs.width()); bit++) {
for (int bit=0; bit < std::max(lhs.width(),rhs.width()); bit++) {
if (lhs.bitIs1(bit) && rhs.bitIs0(bit)) { outc=1; }
if (rhs.bitIs1(bit) && lhs.bitIs0(bit)) { outc=0; }
if (lhs.bitIsXZ(bit)) { outc='x'; }
@ -1210,14 +1210,14 @@ V3Number& V3Number::opGtS (const V3Number& lhs, const V3Number& rhs) {
// i op j, 1 bit return, max(L(lhs),L(rhs)) calculation, careful need to X/Z extend.
char outc = 0;
{
int mbit=max(lhs.width()-1,rhs.width()-1);
int mbit = std::max(lhs.width()-1,rhs.width()-1);
if (lhs.bitIsXZ(mbit)) { outc='x'; }
else if (rhs.bitIsXZ(mbit)) { outc='x'; }
else if (lhs.bitIs0(mbit) && rhs.bitIs1Extend(mbit)) { outc=1; } // + > -
else if (lhs.bitIs1Extend(mbit) && rhs.bitIs0(mbit)) { outc=0; } // - !> +
else {
// both positive or negative, normal >
for (int bit=0; bit<max(lhs.width()-1,rhs.width()-1); bit++) {
for (int bit=0; bit < std::max(lhs.width()-1,rhs.width()-1); bit++) {
if (lhs.bitIs1Extend(bit) && rhs.bitIs0(bit)) { outc=1; }
if (rhs.bitIs1Extend(bit) && lhs.bitIs0(bit)) { outc=0; }
if (lhs.bitIsXZ(bit)) { outc='x'; }
@ -1497,7 +1497,7 @@ V3Number& V3Number::opModDivGuts(const V3Number& lhs, const V3Number& rhs, bool
m_value[j] = unw64 / (vluint64_t)(rhs.m_value[0]);
k = unw64 - (vluint64_t)(m_value[j])*(vluint64_t)(rhs.m_value[0]);
}
UINFO(9, " opmoddiv-1w "<<lhs<<" "<<rhs<<" q="<<*this<<" rem=0x"<<hex<<k<<dec<<endl);
UINFO(9, " opmoddiv-1w "<<lhs<<" "<<rhs<<" q="<<*this<<" rem=0x"<<std::hex<<k<<std::dec<<endl);
if (is_modulus) { setZero(); m_value[0] = k; }
opCleanThis();
return *this;

View File

@ -39,8 +39,8 @@ class V3Number {
bool m_fromString:1; // True if from string literal
bool m_autoExtend:1; // True if SystemVerilog extend-to-any-width
FileLine* m_fileline;
vector<uint32_t> m_value; // The Value, with bit 0 being in bit 0 of this vector (unless X/Z)
vector<uint32_t> m_valueX; // Each bit is true if it's X or Z, 10=z, 11=x
std::vector<uint32_t> m_value; // The Value, with bit 0 being in bit 0 of this vector (unless X/Z)
std::vector<uint32_t> m_valueX; // Each bit is true if it's X or Z, 10=z, 11=x
string m_stringVal; // If isString, the value of the string
// METHODS
V3Number& setSingleBits(char value);
@ -330,6 +330,6 @@ public:
V3Number& opLtN (const V3Number& lhs, const V3Number& rhs);
V3Number& opLteN (const V3Number& lhs, const V3Number& rhs);
};
inline ostream& operator<<(ostream& os, const V3Number& rhs) { return os<<rhs.ascii(); }
inline std::ostream& operator<<(std::ostream& os, const V3Number& rhs) { return os<<rhs.ascii(); }
#endif // Guard

View File

@ -50,17 +50,17 @@
class V3OptionsImp {
public:
// TYPES
typedef std::map<string,set<string> > DirMap; // Directory listing
typedef std::map<string,std::set<string> > DirMap; // Directory listing
// STATE
list<string> m_allArgs; // List of every argument encountered
list<string> m_incDirUsers; // Include directories (ordered)
set<string> m_incDirUserSet; // Include directories (for removing duplicates)
list<string> m_incDirFallbacks; // Include directories (ordered)
set<string> m_incDirFallbackSet; // Include directories (for removing duplicates)
map<string,V3LangCode> m_langExts; // Language extension map
list<string> m_libExtVs; // Library extensions (ordered)
set<string> m_libExtVSet; // Library extensions (for removing duplicates)
std::list<string> m_allArgs; // List of every argument encountered
std::list<string> m_incDirUsers; // Include directories (ordered)
std::set<string> m_incDirUserSet; // Include directories (for removing duplicates)
std::list<string> m_incDirFallbacks; // Include directories (ordered)
std::set<string> m_incDirFallbackSet; // Include directories (for removing duplicates)
std::map<string,V3LangCode> m_langExts; // Language extension map
std::list<string> m_libExtVs; // Library extensions (ordered)
std::set<string> m_libExtVSet; // Library extensions (for removing duplicates)
DirMap m_dirMap; // Directory listing
// ACCESSOR METHODS
@ -167,9 +167,9 @@ string V3Options::parameter(string name) {
void V3Options::checkParameters() {
if (!m_parameters.empty()) {
stringstream msg;
std::stringstream msg;
msg << "Parameters from the command line were not found in the design:";
for (map<string,string>::iterator it = m_parameters.begin();
for (std::map<string,string>::iterator it = m_parameters.begin();
it != m_parameters.end(); ++it) {
msg << " " << it->first;
}
@ -235,7 +235,7 @@ void V3Options::addArg(const string& arg) {
string V3Options::allArgsString() {
string out;
for (list<string>::iterator it=m_impp->m_allArgs.begin(); it!=m_impp->m_allArgs.end(); ++it) {
for (std::list<string>::iterator it=m_impp->m_allArgs.begin(); it!=m_impp->m_allArgs.end(); ++it) {
if (out != "") out += " ";
out += *it;
}
@ -297,10 +297,10 @@ string V3Options::fileExists (const string& filename) {
V3OptionsImp::DirMap::iterator diriter = m_impp->m_dirMap.find(dir);
if (diriter == m_impp->m_dirMap.end()) {
// Read the listing
m_impp->m_dirMap.insert(make_pair(dir, set<string>() ));
m_impp->m_dirMap.insert(std::make_pair(dir, std::set<string>() ));
diriter = m_impp->m_dirMap.find(dir);
set<string>* setp = &(diriter->second);
std::set<string>* setp = &(diriter->second);
if (DIR* dirp = opendir(dir.c_str())) {
while (struct dirent* direntp = readdir(dirp)) {
@ -311,8 +311,8 @@ string V3Options::fileExists (const string& filename) {
}
}
// Find it
set<string>* filesetp = &(diriter->second);
set<string>::iterator fileiter = filesetp->find(basename);
std::set<string>* filesetp = &(diriter->second);
std::set<string>::iterator fileiter = filesetp->find(basename);
if (fileiter == filesetp->end()) {
return ""; // Not found
}
@ -323,7 +323,7 @@ string V3Options::fileExists (const string& filename) {
}
string V3Options::filePathCheckOneDir(const string& modname, const string& dirname) {
for (list<string>::iterator extIter=m_impp->m_libExtVs.begin(); extIter!=m_impp->m_libExtVs.end(); ++extIter) {
for (std::list<string>::iterator extIter=m_impp->m_libExtVs.begin(); extIter!=m_impp->m_libExtVs.end(); ++extIter) {
string fn = V3Os::filenameFromDirBase(dirname, modname+*extIter);
string exists = fileExists(fn);
if (exists!="") {
@ -340,12 +340,12 @@ string V3Options::filePath (FileLine* fl, const string& modname, const string& l
// Find a filename to read the specified module name,
// using the incdir and libext's.
// Return "" if not found.
for (list<string>::iterator dirIter=m_impp->m_incDirUsers.begin();
for (std::list<string>::iterator dirIter=m_impp->m_incDirUsers.begin();
dirIter!=m_impp->m_incDirUsers.end(); ++dirIter) {
string exists = filePathCheckOneDir(modname, *dirIter);
if (exists!="") return exists;
}
for (list<string>::iterator dirIter=m_impp->m_incDirFallbacks.begin();
for (std::list<string>::iterator dirIter=m_impp->m_incDirFallbacks.begin();
dirIter!=m_impp->m_incDirFallbacks.end(); ++dirIter) {
string exists = filePathCheckOneDir(modname, *dirIter);
if (exists!="") return exists;
@ -372,16 +372,16 @@ void V3Options::filePathLookedMsg(FileLine* fl, const string& modname) {
fl->v3error("This may be because there's no search path specified with -I<dir>."<<endl);
}
fl->v3error("Looked in:"<<endl);
for (list<string>::iterator dirIter=m_impp->m_incDirUsers.begin();
for (std::list<string>::iterator dirIter=m_impp->m_incDirUsers.begin();
dirIter!=m_impp->m_incDirUsers.end(); ++dirIter) {
for (list<string>::iterator extIter=m_impp->m_libExtVs.begin(); extIter!=m_impp->m_libExtVs.end(); ++extIter) {
for (std::list<string>::iterator extIter=m_impp->m_libExtVs.begin(); extIter!=m_impp->m_libExtVs.end(); ++extIter) {
string fn = V3Os::filenameFromDirBase(*dirIter,modname+*extIter);
fl->v3error(" "<<fn<<endl);
}
}
for (list<string>::iterator dirIter=m_impp->m_incDirFallbacks.begin();
for (std::list<string>::iterator dirIter=m_impp->m_incDirFallbacks.begin();
dirIter!=m_impp->m_incDirFallbacks.end(); ++dirIter) {
for (list<string>::iterator extIter=m_impp->m_libExtVs.begin(); extIter!=m_impp->m_libExtVs.end(); ++extIter) {
for (std::list<string>::iterator extIter=m_impp->m_libExtVs.begin(); extIter!=m_impp->m_libExtVs.end(); ++extIter) {
string fn = V3Os::filenameFromDirBase(*dirIter,modname+*extIter);
fl->v3error(" "<<fn<<endl);
}
@ -398,7 +398,7 @@ V3LangCode V3Options::fileLanguage(const string &filename) {
string::size_type pos;
if ((pos = ext.rfind(".")) != string::npos) {
ext.erase(0, pos + 1);
map<string,V3LangCode>::iterator it = m_impp->m_langExts.find(ext);
std::map<string,V3LangCode>::iterator it = m_impp->m_langExts.find(ext);
if (it != m_impp->m_langExts.end()) {
return it->second;
}
@ -1072,7 +1072,7 @@ void V3Options::parseOptsFile(FileLine* fl, const string& filename, bool rel) {
// Read the specified -f filename and process as arguments
UINFO(1,"Reading Options File "<<filename<<endl);
const vl_unique_ptr<ifstream> ifp (V3File::new_ifstream(filename));
const vl_unique_ptr<std::ifstream> ifp (V3File::new_ifstream(filename));
if (ifp->fail()) {
fl->v3error("Cannot open -f command file: "+filename);
return;
@ -1117,7 +1117,7 @@ void V3Options::parseOptsFile(FileLine* fl, const string& filename, bool rel) {
}
// Strip off arguments and parse into words
vector<string> args;
std::vector<string> args;
string::size_type startpos = 0;
while (startpos < whole_file.length()) {
while (isspace(whole_file[startpos])) ++startpos;

View File

@ -37,12 +37,12 @@
class V3OptionsImp;
class FileLine;
typedef vector<string> V3StringList;
typedef set<string> V3StringSet;
typedef std::vector<string> V3StringList;
typedef std::set<string> V3StringSet;
class V3Options {
// TYPES
typedef map<string,int> DebugSrcMap;
typedef std::map<string,int> DebugSrcMap;
// MEMBERS (general options)
V3OptionsImp* m_impp; // Slow hidden options
@ -58,7 +58,7 @@ class V3Options {
V3StringList m_forceIncs; // argument: -FI
DebugSrcMap m_debugSrcs; // argument: --debugi-<srcfile>=<level>
DebugSrcMap m_dumpTrees; // argument: --dump-treei-<srcfile>=<level>
map<string,string> m_parameters; // Parameters
std::map<string,string> m_parameters; // Parameters
bool m_preprocOnly; // main switch: -E

View File

@ -111,10 +111,10 @@ class OrderMoveDomScope;
void OrderGraph::loopsVertexCb(V3GraphVertex* vertexp) {
if (debug()) cout<<"-Info-Loop: "<<vertexp<<" "<<endl;
if (OrderLogicVertex* vvertexp = dynamic_cast<OrderLogicVertex*>(vertexp)) {
cerr<<V3Error::msgPrefix()<<" Example path: "<<vvertexp->nodep()->fileline()<<" "<<vvertexp->nodep()->typeName()<<endl;
std::cerr<<V3Error::msgPrefix()<<" Example path: "<<vvertexp->nodep()->fileline()<<" "<<vvertexp->nodep()->typeName()<<endl;
}
if (OrderVarVertex* vvertexp = dynamic_cast<OrderVarVertex*>(vertexp)) {
cerr<<V3Error::msgPrefix()<<" Example path: "<<vvertexp->varScp()->fileline()<<" "<<vvertexp->varScp()->prettyName()<<endl;
std::cerr<<V3Error::msgPrefix()<<" Example path: "<<vvertexp->varScp()->fileline()<<" "<<vvertexp->varScp()->prettyName()<<endl;
}
};
@ -130,7 +130,7 @@ private:
const AstSenTree* m_domainp; // Domain all vertices belong to
const AstScope* m_scopep; // Scope all vertices belong to
typedef pair<const AstSenTree*, const AstScope*> DomScopeKey;
typedef std::pair<const AstSenTree*, const AstScope*> DomScopeKey;
typedef std::map<DomScopeKey, OrderMoveDomScope*> DomScopeMap;
static DomScopeMap s_dsMap; // Structure registered for each dom/scope pairing
@ -171,7 +171,7 @@ public:
OrderMoveDomScope::DomScopeMap OrderMoveDomScope::s_dsMap;
inline ostream& operator<< (ostream& lhs, const OrderMoveDomScope& rhs) {
inline std::ostream& operator<< (std::ostream& lhs, const OrderMoveDomScope& rhs) {
lhs<<rhs.name();
return lhs;
}
@ -461,7 +461,7 @@ private:
bool m_inPre; // Underneath AstAssignPre
bool m_inPost; // Underneath AstAssignPost
OrderLogicVertex* m_activeSenVxp; // Sensitivity vertex
deque<OrderUser*> m_orderUserps; // All created OrderUser's for later deletion.
std::deque<OrderUser*> m_orderUserps; // All created OrderUser's for later deletion.
// STATE... for inside process
AstCFunc* m_pomNewFuncp; // Current function being created
int m_pomNewStmts; // Statements in function being created
@ -470,7 +470,7 @@ private:
protected:
friend class OrderMoveDomScope;
V3List<OrderMoveDomScope*> m_pomReadyDomScope; // List of ready domain/scope pairs, by loopId
vector<OrderVarStdVertex*> m_unoptflatVars; // Vector of variables in UNOPTFLAT loop
std::vector<OrderVarStdVertex*> m_unoptflatVars; // Vector of variables in UNOPTFLAT loop
private:
// STATS
@ -520,7 +520,7 @@ private:
void process();
void processCircular();
typedef deque<OrderEitherVertex*> VertexVec;
typedef std::deque<OrderEitherVertex*> VertexVec;
void processInputs();
void processInputsInIterate(OrderEitherVertex* vertexp, VertexVec& todoVec);
void processInputsOutIterate(OrderEitherVertex* vertexp, VertexVec& todoVec);
@ -631,31 +631,31 @@ private:
m_graph.userClearVertices();
// May be very large vector, so only report the "most important"
// elements. Up to 10 of the widest
cerr<<V3Error::msgPrefix()
<<" Widest candidate vars to split:"<<endl;
std::cerr<<V3Error::msgPrefix()
<<" Widest candidate vars to split:"<<endl;
std::stable_sort (m_unoptflatVars.begin(), m_unoptflatVars.end(), OrderVarWidthCmp());
int lim = m_unoptflatVars.size() < 10 ? m_unoptflatVars.size() : 10;
for (int i = 0; i < lim; i++) {
OrderVarStdVertex* vsvertexp = m_unoptflatVars[i];
AstVar* varp = vsvertexp->varScp()->varp();
cerr<<V3Error::msgPrefix()<<" "
<<varp->fileline()<<" "<<varp->prettyName()<<dec
<<", width "<<varp->width()<<", fanout "
<<vsvertexp->fanout()<<endl;
std::cerr<<V3Error::msgPrefix()<<" "
<<varp->fileline()<<" "<<varp->prettyName()<<std::dec
<<", width "<<varp->width()<<", fanout "
<<vsvertexp->fanout()<<endl;
}
// Up to 10 of the most fanned out
cerr<<V3Error::msgPrefix()
<<" Most fanned out candidate vars to split:"<<endl;
std::cerr<<V3Error::msgPrefix()
<<" Most fanned out candidate vars to split:"<<endl;
std::stable_sort (m_unoptflatVars.begin(), m_unoptflatVars.end(),
OrderVarFanoutCmp());
lim = m_unoptflatVars.size() < 10 ? m_unoptflatVars.size() : 10;
for (int i = 0; i < lim; i++) {
OrderVarStdVertex* vsvertexp = m_unoptflatVars[i];
AstVar* varp = vsvertexp->varScp()->varp();
cerr<<V3Error::msgPrefix()<<" "
<<varp->fileline()<<" "<<varp->prettyName()
<<", width "<<dec<<varp->width()
<<", fanout "<<vsvertexp->fanout()<<endl;
std::cerr<<V3Error::msgPrefix()<<" "
<<varp->fileline()<<" "<<varp->prettyName()
<<", width "<<std::dec<<varp->width()
<<", fanout "<<vsvertexp->fanout()<<endl;
}
m_unoptflatVars.clear();
}
@ -998,7 +998,7 @@ public:
}
}
// Destruction
for (deque<OrderUser*>::iterator it=m_orderUserps.begin(); it!=m_orderUserps.end(); ++it) {
for (std::deque<OrderUser*>::iterator it=m_orderUserps.begin(); it!=m_orderUserps.end(); ++it) {
delete *it;
}
m_graph.debug(V3Error::debugDefault());
@ -1262,11 +1262,11 @@ void OrderVisitor::processDomainsIterate(OrderEitherVertex* vertexp) {
void OrderVisitor::processEdgeReport() {
// Make report of all signal names and what clock edges they have
string filename = v3Global.debugFilename("order_edges.txt");
const vl_unique_ptr<ofstream> logp (V3File::new_ofstream(filename));
const vl_unique_ptr<std::ofstream> logp (V3File::new_ofstream(filename));
if (logp->fail()) v3fatalSrc("Can't write "<<filename);
//Testing emitter: V3EmitV::verilogForTree(v3Global.rootp(), *logp);
deque<string> report;
std::deque<string> report;
for (V3GraphVertex* itp = m_graph.verticesBeginp(); itp; itp=itp->verticesNextp()) {
if (OrderVarVertex* vvertexp = dynamic_cast<OrderVarVertex*>(itp)) {
@ -1275,9 +1275,9 @@ void OrderVisitor::processEdgeReport() {
else if (dynamic_cast<OrderVarPostVertex*>(itp)) name += " {POST}";
else if (dynamic_cast<OrderVarPordVertex*>(itp)) name += " {PORD}";
else if (dynamic_cast<OrderVarSettleVertex*>(itp)) name += " {STL}";
ostringstream os;
os.setf(ios::left);
os<<" "<<(void*)(vvertexp->varScp())<<" "<<setw(50)<<name<<" ";
std::ostringstream os;
os.setf(std::ios::left);
os<<" "<<(void*)(vvertexp->varScp())<<" "<<std::setw(50)<<name<<" ";
AstSenTree* sentreep = vvertexp->domainp();
if (sentreep) V3EmitV::verilogForTree(sentreep, os);
report.push_back(os.str());
@ -1286,7 +1286,7 @@ void OrderVisitor::processEdgeReport() {
*logp<<"Signals and their clock domains:"<<endl;
stable_sort(report.begin(), report.end());
for (deque<string>::iterator it=report.begin(); it!=report.end(); ++it) {
for (std::deque<string>::iterator it=report.begin(); it!=report.end(); ++it) {
*logp<<(*it)<<endl;
}
@ -1512,7 +1512,7 @@ void OrderVisitor::processMoveOne(OrderMoveVertex* vertexp, OrderMoveDomScope* d
UASSERT(vertexp->domScopep() == domScopep, "Domain mismatch; list misbuilt?\n");
OrderLogicVertex* lvertexp = vertexp->logicp();
AstScope* scopep = lvertexp->scopep();
UINFO(5," POSmove l"<<setw(3)<<level<<" d="<<(void*)(lvertexp->domainp())
UINFO(5," POSmove l"<<std::setw(3)<<level<<" d="<<(void*)(lvertexp->domainp())
<<" s="<<(void*)(scopep)<<" "<<lvertexp<<endl);
AstSenTree* domainp = lvertexp->domainp();
AstNode* nodep = lvertexp->nodep();
@ -1634,7 +1634,7 @@ void OrderVisitor::process() {
m_graph.dumpDotFilePrefixed("orderg_done");
if (0 && debug()) {
string dfilename = v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"_INT_order";
const vl_unique_ptr<ofstream> logp (V3File::new_ofstream(dfilename));
const vl_unique_ptr<std::ofstream> logp (V3File::new_ofstream(dfilename));
if (logp->fail()) v3fatalSrc("Can't write "<<dfilename);
m_graph.dump(*logp);
}

View File

@ -81,31 +81,31 @@ private:
// User1/2/3 used by constant function simulations
// TYPES
typedef deque<pair<AstIfaceRefDType*,AstIfaceRefDType*> > IfaceRefRefs; // Note may have duplicate entries
typedef std::deque<std::pair<AstIfaceRefDType*,AstIfaceRefDType*> > IfaceRefRefs; // Note may have duplicate entries
// STATE
typedef map<AstNode*,AstNode*> CloneMap;
typedef std::map<AstNode*,AstNode*> CloneMap;
struct ModInfo {
AstNodeModule* m_modp; // Module with specified name
CloneMap m_cloneMap; // Map of old-varp -> new cloned varp
explicit ModInfo(AstNodeModule* modp) { m_modp=modp; }
};
typedef map<string,ModInfo> ModNameMap;
typedef std::map<string,ModInfo> ModNameMap;
ModNameMap m_modNameMap; // Hash of created module flavors by name
typedef map<string,string> LongMap;
typedef std::map<string,string> LongMap;
LongMap m_longMap; // Hash of very long names to unique identity number
int m_longId;
typedef map<AstNode*,int> ValueMap;
typedef map<int,int> NextValueMap;
typedef std::map<AstNode*,int> ValueMap;
typedef std::map<int,int> NextValueMap;
ValueMap m_valueMap; // Hash of node to param value
NextValueMap m_nextValueMap;// Hash of param value to next value to be used
typedef multimap<int,AstNodeModule*> LevelModMap;
typedef std::multimap<int,AstNodeModule*> LevelModMap;
LevelModMap m_todoModps; // Modules left to process
typedef deque<AstCell*> CellList;
typedef std::deque<AstCell*> CellList;
CellList m_cellps; // Cells left to process (in this module)
AstNodeModule* m_modp; // Current module being processed
@ -120,7 +120,7 @@ private:
}
void makeSmallNames(AstNodeModule* modp) {
vector<int> usedLetter; usedLetter.resize(256);
std::vector<int> usedLetter; usedLetter.resize(256);
// Pass 1, assign first letter to each gparam's name
for (AstNode* stmtp = modp->stmtsp(); stmtp; stmtp=stmtp->nextp()) {
if (AstVar* varp = stmtp->castVar()) {

View File

@ -53,11 +53,11 @@ int V3ParseSym::s_anonNum = 0;
// Read class functions
V3ParseImp::~V3ParseImp() {
for (deque<string*>::iterator it = m_stringps.begin(); it != m_stringps.end(); ++it) {
for (std::deque<string*>::iterator it = m_stringps.begin(); it != m_stringps.end(); ++it) {
delete (*it);
}
m_stringps.clear();
for (deque<V3Number*>::iterator it = m_numberps.begin(); it != m_numberps.end(); ++it) {
for (std::deque<V3Number*>::iterator it = m_numberps.begin(); it != m_numberps.end(); ++it) {
delete (*it);
}
m_numberps.clear();
@ -122,8 +122,8 @@ void V3ParseImp::parseFile(FileLine* fileline, const string& modfilename, bool i
if (v3Global.opt.preprocOnly() || v3Global.opt.keepTempFiles()) {
// Create output file with all the preprocessor output we buffered up
string vppfilename = v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"_"+modname+".vpp";
ofstream* ofp = NULL;
ostream* osp;
std::ofstream* ofp = NULL;
std::ostream* osp;
bool noblanks = v3Global.opt.preprocOnly() && v3Global.opt.preprocNoLine();
if (v3Global.opt.preprocOnly()) {
osp = &cout;
@ -134,7 +134,7 @@ void V3ParseImp::parseFile(FileLine* fileline, const string& modfilename, bool i
fileline->v3error("Cannot write preprocessor output: "+vppfilename);
return;
} else {
for (deque<string>::iterator it = m_ppBuffers.begin(); it!=m_ppBuffers.end(); ++it) {
for (std::deque<string>::iterator it = m_ppBuffers.begin(); it!=m_ppBuffers.end(); ++it) {
if (noblanks) {
bool blank = true;
for (string::iterator its = it->begin(); its != it->end(); ++its) {

View File

@ -114,10 +114,10 @@ class V3ParseImp {
V3ParseBisonYYSType m_curBisonVal; // current token for error reporting
V3ParseBisonYYSType m_prevBisonVal; // previous token for error reporting
deque<string*> m_stringps; // Created strings for later cleanup
deque<V3Number*> m_numberps; // Created numbers for later cleanup
deque<FileLine> m_lintState; // Current lint state for save/restore
deque<string> m_ppBuffers; // Preprocessor->lex buffer of characters to process
std::deque<string*> m_stringps; // Created strings for later cleanup
std::deque<V3Number*> m_numberps; // Created numbers for later cleanup
std::deque<FileLine> m_lintState; // Current lint state for save/restore
std::deque<string> m_ppBuffers; // Preprocessor->lex buffer of characters to process
string m_tag; // Contents (if any) of current verilator tag
AstNode* m_tagNodep; // Points to the node to set to m_tag or NULL to not set.

View File

@ -33,7 +33,7 @@
class V3ParseSym {
// TYPES
typedef vector<VSymEnt*> SymStack;
typedef std::vector<VSymEnt*> SymStack;
private:
// MEMBERS
@ -124,7 +124,7 @@ public:
}
UINFO(1,"ParseSym Current: "<<symCurrentp()->nodep()<<endl);
}
void dump(ostream& os, const string& indent="") {
void dump(std::ostream& os, const string& indent="") {
m_syms.dump(os,indent);
}
AstNode* findEntUpward (const string& name) {

View File

@ -128,7 +128,7 @@ class VPreStream {
public:
FileLine* m_curFilelinep; // Current processing point (see also m_tokFilelinep)
V3PreLex* m_lexp; // Lexer, for resource tracking
deque<string> m_buffers; // Buffer of characters to process
std::deque<string> m_buffers; // Buffer of characters to process
int m_ignNewlines; // Ignore multiline newlines
bool m_eof; // "EOF" buffer
bool m_file; // Buffer is start of new file
@ -152,7 +152,7 @@ private:
class V3PreLex {
public: // Used only by V3PreLex.cpp and V3PreProc.cpp
V3PreProcImp* m_preimpp; // Preprocessor lexor belongs to
stack<VPreStream*> m_streampStack; // Stack of processing files
std::stack<VPreStream*> m_streampStack; // Stack of processing files
int m_streamDepth; // Depth of stream processing
YY_BUFFER_STATE m_bufferState; // Flex state
FileLine* m_tokFilelinep; // Starting position of current token

View File

@ -504,7 +504,7 @@ void V3PreLex::dumpSummary() {
ssize_t left = (yy_n_chars
- (yy_c_buf_p
-currentBuffer()->yy_ch_buf));
cout<<" left="<<dec<<left;
cout<<" left="<<std::dec<<left;
#endif
cout<<endl;
}
@ -512,7 +512,7 @@ void V3PreLex::dumpSummary() {
void V3PreLex::dumpStack() {
// For debug use
dumpSummary();
stack<VPreStream*> tmpstack = LEXP->m_streampStack;
std::stack<VPreStream*> tmpstack = LEXP->m_streampStack;
while (!tmpstack.empty()) {
VPreStream* streamp = tmpstack.top();
cout<<"- bufferStack["<<(void*)(streamp)<<"]: "

View File

@ -73,7 +73,7 @@ class V3DefineRef {
string m_nextarg; // String being built for next argument
int m_parenLevel; // Parenthesis counting inside def args (for PARENT not child)
vector<string> m_args; // List of define arguments
std::vector<string> m_args; // List of define arguments
public:
string name() const { return m_name; }
string params() const { return m_params; }
@ -81,7 +81,7 @@ public:
void nextarg(const string& value) { m_nextarg = value; }
int parenLevel() const { return m_parenLevel; }
void parenLevel(int value) { m_parenLevel = value; }
vector<string>& args() { return m_args; }
std::vector<string>& args() { return m_args; }
V3DefineRef(const string& name, const string& params)
: m_name(name), m_params(params), m_parenLevel(0) {}
~V3DefineRef() {}
@ -119,7 +119,7 @@ public:
// STATE
V3PreProc* m_preprocp; ///< Object we're holding data for
V3PreLex* m_lexp; ///< Current lexer state (NULL = closed)
stack<V3PreLex*> m_includeStack; ///< Stack of includers above current m_lexp
std::stack<V3PreLex*> m_includeStack; ///< Stack of includers above current m_lexp
enum ProcState { ps_TOP,
ps_DEFNAME_UNDEF, ps_DEFNAME_DEFINE,
@ -136,7 +136,7 @@ public:
return states[s];
};
stack<ProcState> m_states; ///< Current state of parser
std::stack<ProcState> m_states; ///< Current state of parser
int m_off; ///< If non-zero, ifdef level is turned off, don't dump text
string m_lastSym; ///< Last symbol name found.
string m_formals; ///< Last formals found
@ -158,18 +158,18 @@ public:
string m_strify; ///< Text to be stringified
// For defines
stack<V3DefineRef> m_defRefs; // Pending definine substitution
stack<VPreIfEntry> m_ifdefStack; ///< Stack of true/false emitting evaluations
std::stack<V3DefineRef> m_defRefs; ///< Pending definine substitution
std::stack<VPreIfEntry> m_ifdefStack; ///< Stack of true/false emitting evaluations
unsigned m_defDepth; ///< How many `defines deep
bool m_defPutJoin; ///< Insert `` after substitution
// For `` join
stack<string> m_joinStack; ///< Text on lhs of join
std::stack<string> m_joinStack; ///< Text on lhs of join
// For getline()
string m_lineChars; ///< Characters left for next line
void v3errorEnd(ostringstream& str) {
void v3errorEnd(std::ostringstream& str) {
fileline()->v3errorEnd(str);
}
@ -561,7 +561,7 @@ string V3PreProcImp::defineSubst(V3DefineRef* refp) {
string value = defValue(refp->name());
UINFO(4,"defineValue '"<<V3PreLex::cleanDbgStrg(value)<<"'"<<endl);
map<string,string> argValueByName;
std::map<string,string> argValueByName;
{ // Parse argument list into map
unsigned numArgs=0;
string argName;
@ -648,7 +648,7 @@ string V3PreProcImp::defineSubst(V3DefineRef* refp) {
}
if (argName != "") {
// Found a possible variable substitution
map<string,string>::iterator iter = argValueByName.find(argName);
std::map<string,string>::iterator iter = argValueByName.find(argName);
if (iter != argValueByName.end()) {
// Substitute
string subst = iter->second;

View File

@ -50,9 +50,9 @@ private:
AstUser2InUse m_inuser2;
// TYPES
typedef map<AstPackage*, AstScope*> PackageScopeMap;
typedef map<pair<AstVar*, AstScope*>, AstVarScope*> VarScopeMap;
typedef set<pair<AstVarRef*, AstScope*> > VarRefScopeSet;
typedef std::map<AstPackage*, AstScope*> PackageScopeMap;
typedef std::map<std::pair<AstVar*, AstScope*>, AstVarScope*> VarScopeMap;
typedef std::set<std::pair<AstVarRef*, AstScope*> > VarRefScopeSet;
// STATE, inside processing a single module
AstNodeModule* m_modp; // Current module

View File

@ -53,7 +53,7 @@ class SenTreeFinder : public AstNVisitor {
private:
// STATE
AstTopScope* m_topscopep; // Top scope to add statement to
vector<AstSenTree*> m_treesp; // List of sensitive blocks, for folding
std::vector<AstSenTree*> m_treesp; // List of sensitive blocks, for folding
// VISITORS
static int debug() {
@ -100,7 +100,7 @@ public:
// Not the fastest, but there tend to be few clocks
AstSenTree* treep = NULL;
//sensesp->dumpTree(cout," Lookingfor: ");
for (vector<AstSenTree*>::iterator it = m_treesp.begin(); it!=m_treesp.end(); ++it) {
for (std::vector<AstSenTree*>::iterator it = m_treesp.begin(); it!=m_treesp.end(); ++it) {
treep = *it;
if (treep) { // Not deleted
if (treep->sameTree(sensesp)) {

View File

@ -101,13 +101,13 @@ private:
int m_dataCount; ///< Bytes of data
AstJumpGo* m_jumpp; ///< Jump label we're branching from
// Simulating:
deque<V3Number*> m_numFreeps; ///< List of all numbers free and not in use
deque<V3Number*> m_numAllps; ///< List of all numbers free and in use
deque<SimulateStackNode*> m_callStack; ///< Call stack for verbose error messages
std::deque<V3Number*> m_numFreeps; ///< List of all numbers free and not in use
std::deque<V3Number*> m_numAllps; ///< List of all numbers free and in use
std::deque<SimulateStackNode*> m_callStack; ///< Call stack for verbose error messages
// Cleanup
// V3Numbers that represents strings are a bit special and the API for V3Number does not allow changing them.
deque<V3Number*> m_stringNumbersp; // List of allocated string numbers
std::deque<V3Number*> m_stringNumbersp; // List of allocated string numbers
// Note level 8&9 include debugging each simulation value
@ -124,7 +124,7 @@ private:
}
if (AstStructDType* stp = dtypep->castStructDType()) {
if (stp->packed()) {
ostringstream out;
std::ostringstream out;
out<<"'{";
for (AstMemberDType* itemp = stp->membersp(); itemp; itemp=itemp->nextp()->castMemberDType()) {
int width = itemp->width();
@ -145,7 +145,7 @@ private:
}
} else if (AstPackArrayDType * arrayp = dtypep->castPackArrayDType()) {
if (AstNodeDType * childTypep = arrayp->subDTypep()) {
ostringstream out;
std::ostringstream out;
out<<"[";
int arrayElements = arrayp->elementsConst();
for (int element = 0; element < arrayElements; ++element) {
@ -181,8 +181,8 @@ public:
cout<<endl;
}
m_whyNotOptimizable = why;
ostringstream stack;
for (deque<SimulateStackNode*>::iterator it=m_callStack.begin(); it !=m_callStack.end(); ++it) {
std::ostringstream stack;
for (std::deque<SimulateStackNode*>::iterator it=m_callStack.begin(); it !=m_callStack.end(); ++it) {
AstFuncRef* funcp = (*it)->m_funcp;
stack<<"\nCalled from:\n"<<funcp->fileline()<<" "<<funcp->prettyName()<<"() with parameters:";
V3TaskConnects* tconnects = (*it)->m_tconnects;
@ -959,10 +959,10 @@ public:
mainGuts(nodep);
}
virtual ~SimulateVisitor() {
for (deque<V3Number*>::iterator it = m_numAllps.begin(); it != m_numAllps.end(); ++it) {
for (std::deque<V3Number*>::iterator it = m_numAllps.begin(); it != m_numAllps.end(); ++it) {
delete (*it);
}
for (deque<V3Number*>::iterator it = m_stringNumbersp.begin(); it != m_stringNumbersp.end(); ++it) {
for (std::deque<V3Number*>::iterator it = m_stringNumbersp.begin(); it != m_stringNumbersp.end(); ++it) {
delete (*it);
}
m_stringNumbersp.clear();

View File

@ -224,7 +224,7 @@ private:
AstUser4InUse m_inuser4;
// TYPES
typedef vector<SplitLogicVertex*> VStack;
typedef std::vector<SplitLogicVertex*> VStack;
// STATE
bool m_reorder; // Reorder statements vs. just splitting
@ -340,7 +340,7 @@ private:
m_graph.weaklyConnected(&SplitEdge::followScoreboard);
// Add hard orderings between all nodes of same color, in the order they appeared
vector<SplitLogicVertex*> lastOfColor; lastOfColor.resize(numVertexes);
std::vector<SplitLogicVertex*> lastOfColor; lastOfColor.resize(numVertexes);
for (uint32_t i=0; i<numVertexes; i++) lastOfColor[i] = NULL;
for (AstNode* nextp=nodep; nextp; nextp=nextp->nextp()) {
SplitLogicVertex* vvertexp = (SplitLogicVertex*)nextp->user3p();
@ -368,8 +368,8 @@ private:
AstAlways* splitAlwaysp = nodep->backp()->castAlways();
// Map the rank numbers into nodes they associate with
typedef multimap<uint32_t,AstNode*> RankNodeMap;
typedef map<uint32_t,RankNodeMap> ColorRankMap;
typedef std::multimap<uint32_t,AstNode*> RankNodeMap;
typedef std::map<uint32_t,RankNodeMap> ColorRankMap;
ColorRankMap colorRankMap;
uint32_t firstColor = 0; bool multiColors = false;
int currOrder = 0; // Existing sequence number of assignment

View File

@ -41,7 +41,7 @@ class StatsVisitor : public AstNVisitor {
private:
// NODE STATE/TYPES
typedef map<string,int> NameMap; // Number of times a name appears
typedef std::map<string,int> NameMap; // Number of times a name appears
// STATE
string m_stage; // Name of the stage we are scanning
@ -55,13 +55,13 @@ private:
double m_instrs; // Current instr count (for determining branch direction)
bool m_tracingCall; // Iterating into a CCall to a CFunc
vector<V3Double0> m_statTypeCount; // Nodes of given type
std::vector<V3Double0> m_statTypeCount; // Nodes of given type
V3Double0 m_statAbove[AstType::_ENUM_END][AstType::_ENUM_END]; // Nodes of given type
V3Double0 m_statPred[AstBranchPred::_ENUM_END]; // Nodes of given type
V3Double0 m_statInstr; // Instruction count
V3Double0 m_statInstrFast; // Instruction count, non-slow() eval functions only
vector<V3Double0> m_statVarWidths; // Variables of given width
vector<NameMap> m_statVarWidthNames; // Var names of given width
std::vector<V3Double0> m_statVarWidths; // Variables of given width
std::vector<NameMap> m_statVarWidthNames; // Var names of given width
V3Double0 m_statVarArray; // Statistic tracking
V3Double0 m_statVarBytes; // Statistic tracking
V3Double0 m_statVarClock; // Statistic tracking
@ -246,11 +246,11 @@ public:
if (v3Global.opt.statsVars()) {
NameMap& nameMapr = m_statVarWidthNames.at(i);
for (NameMap::iterator it=nameMapr.begin(); it!=nameMapr.end(); ++it) {
ostringstream os; os<<"Vars, width "<<setw(5)<<dec<<i<<" "<<it->first;
std::ostringstream os; os<<"Vars, width "<<std::setw(5)<<std::dec<<i<<" "<<it->first;
V3Stats::addStat(m_stage, os.str(), it->second);
}
} else {
ostringstream os; os<<"Vars, width "<<setw(5)<<dec<<i;
std::ostringstream os; os<<"Vars, width "<<std::setw(5)<<std::dec<<i;
V3Stats::addStat(m_stage, os.str(), count);
}
}

View File

@ -66,7 +66,7 @@ public:
bool sumit() const { return m_sumit; }
bool perf() const { return m_perf; }
bool printit() const { return m_printit; }
virtual void dump(ofstream& os) const;
virtual void dump(std::ofstream& os) const;
void combineWith(V3Statistic* otherp) {
m_count += otherp->count();
otherp->m_printit = false;

View File

@ -38,10 +38,10 @@
class StatsReport {
// TYPES
typedef vector<V3Statistic> StatColl;
typedef std::vector<V3Statistic> StatColl;
// STATE
ofstream& os; // Output stream
std::ofstream& os; ///< Output stream
static StatColl s_allStats; ///< All statistics
void header() {
@ -56,7 +56,7 @@ class StatsReport {
void sumit() {
// If sumit is set on a statistic, combine with others of same name
typedef multimap<string,V3Statistic*> ByName;
typedef std::multimap<string,V3Statistic*> ByName;
ByName byName;
// * is always first
for (StatColl::iterator it = s_allStats.begin(); it!=s_allStats.end(); ++it) {
@ -79,7 +79,7 @@ class StatsReport {
void stars() {
// Find all stages
size_t maxWidth = 0;
typedef multimap<string,const V3Statistic*> ByName;
typedef std::multimap<string,const V3Statistic*> ByName;
ByName byName;
// * is always first
for (StatColl::iterator it = s_allStats.begin(); it!=s_allStats.end(); ++it) {
@ -96,7 +96,7 @@ class StatsReport {
for (ByName::iterator it = byName.begin(); it!=byName.end(); ++it) {
const V3Statistic* repp = it->second;
if (repp->perf()) continue;
os<<" "<<left<<setw(maxWidth)<<repp->name();
os<<" "<<std::left<<std::setw(maxWidth)<<repp->name();
repp->dump(os);
os<<endl;
}
@ -108,7 +108,7 @@ class StatsReport {
for (ByName::iterator it = byName.begin(); it!=byName.end(); ++it) {
const V3Statistic* repp = it->second;
if (!repp->perf()) continue;
os<<" "<<left<<setw(maxWidth)<<repp->name();
os<<" "<<std::left<<std::setw(maxWidth)<<repp->name();
repp->dump(os);
os<<endl;
}
@ -121,10 +121,10 @@ class StatsReport {
// Find all stages
int stage=0;
size_t maxWidth = 0;
typedef vector<string> Stages;
typedef std::vector<string> Stages;
Stages stages;
vl_unordered_map<string,int> stageInt;
typedef multimap<string,const V3Statistic*> ByName;
typedef std::multimap<string,const V3Statistic*> ByName;
ByName byName;
// * is always first
for (StatColl::iterator it = s_allStats.begin(); it!=s_allStats.end(); ++it) {
@ -140,14 +140,14 @@ class StatsReport {
}
// Header
os<<" Stat "<<left<<setw(maxWidth-5-2)<<"";
os<<" Stat "<<std::left<<std::setw(maxWidth-5-2)<<"";
for (Stages::iterator it = stages.begin(); it!=stages.end(); ++it) {
os<<" "<<left<<setw(9)<<*it;
os<<" "<<std::left<<std::setw(9)<<*it;
}
os<<endl;
os<<" -------- "<<left<<setw(maxWidth-5-2)<<"";
os<<" -------- "<<std::left<<std::setw(maxWidth-5-2)<<"";
for (Stages::iterator it = stages.begin(); it!=stages.end(); ++it) {
os<<" "<<left<<setw(9)<<"-------";
os<<" "<<std::left<<std::setw(9)<<"-------";
}
//os<<endl;
@ -172,10 +172,10 @@ class StatsReport {
}
os<<endl;
col = 0;
os<<" "<<left<<setw(maxWidth)<<repp->name();
os<<" "<<std::left<<std::setw(maxWidth)<<repp->name();
}
while (col<stages.size() && stages.at(col) != repp->stage()) {
os<<setw(11)<<"";
os<<std::setw(11)<<"";
col++;
}
repp->dump(os);
@ -191,7 +191,7 @@ public:
}
// CONSTRUCTORS
explicit StatsReport(ofstream* aofp)
explicit StatsReport(std::ofstream* aofp)
: os(*aofp) {
header();
sumit();
@ -206,11 +206,11 @@ StatsReport::StatColl StatsReport::s_allStats;
//######################################################################
// V3Statstic class
void V3Statistic::dump (ofstream& os) const {
void V3Statistic::dump (std::ofstream& os) const {
if (perf()) {
os<<" "<<right<<fixed<<setprecision(6)<<setw(9)<<count();
os<<" "<<std::right<<std::fixed<<std::setprecision(6)<<std::setw(9)<<count();
} else {
os<<" "<<right<<fixed<<setprecision(0)<<setw(9)<<count();
os<<" "<<std::right<<std::fixed<<std::setprecision(0)<<std::setw(9)<<count();
}
}
@ -243,7 +243,7 @@ void V3Stats::statsReport() {
// Open stats file
string filename = v3Global.opt.makeDir()+"/"+v3Global.opt.prefix()+"__stats.txt";
ofstream* ofp (V3File::new_ofstream(filename));
std::ofstream* ofp (V3File::new_ofstream(filename));
if (ofp->fail()) v3fatalSrc("Can't write "<<filename);
StatsReport reporter (ofp);

View File

@ -265,14 +265,14 @@ void VHashSha1::selfTestOne(const string& data, const string& data2,
VHashSha1 digest (data);
if (data2!="") digest.insert(data2);
if (digest.digestHex() != exp) {
cerr << "%Error: When hashing '"<<data+data2<<"'"<<endl;
cerr << "%Error: got="<<digest.digestHex()<<endl;
cerr << "%Error: exp="<<exp<<endl;
std::cerr << "%Error: When hashing '"<<data+data2<<"'"<<endl;
std::cerr << "%Error: got="<<digest.digestHex()<<endl;
std::cerr << "%Error: exp="<<exp<<endl;
}
if (digest.digestSymbol() != exp64) {
cerr << "%Error: When hashing '"<<data+data2<<"'"<<endl;
cerr << "%Error: got="<<digest.digestSymbol()<<endl;
cerr << "%Error: exp="<<exp64<<endl;
std::cerr << "%Error: When hashing '"<<data+data2<<"'"<<endl;
std::cerr << "%Error: got="<<digest.digestSymbol()<<endl;
std::cerr << "%Error: exp="<<exp64<<endl;
}
}

View File

@ -81,7 +81,7 @@ class SubstVarEntry {
bool m_wordAssign; // True if any word assignments
bool m_wordUse; // True if any individual word usage
SubstVarWord m_whole; // Data for whole vector used at once
vector<SubstVarWord> m_words; // Data for every word, if multi word variable
std::vector<SubstVarWord> m_words; // Data for every word, if multi word variable
int debug() { return SubstBaseVisitor::debug(); }
public:
@ -238,7 +238,7 @@ private:
AstUser2InUse m_inuser2;
// STATE
vector<SubstVarEntry*> m_entryps; // Nodes to delete when we are finished
std::vector<SubstVarEntry*> m_entryps; // Nodes to delete when we are finished
int m_ops; // Number of operators on assign rhs
int m_assignStep; // Assignment number to determine var lifetime
V3Double0 m_statSubsts; // Statistic tracking
@ -388,7 +388,7 @@ public:
}
virtual ~SubstVisitor() {
V3Stats::addStat("Optimizations, Substituted temps", m_statSubsts);
for (vector<SubstVarEntry*>::iterator it = m_entryps.begin(); it != m_entryps.end(); ++it) {
for (std::vector<SubstVarEntry*>::iterator it = m_entryps.begin(); it != m_entryps.end(); ++it) {
(*it)->deleteUnusedAssign();
delete (*it);
}

View File

@ -40,8 +40,8 @@ class VSymEnt;
//######################################################################
// Symbol table
typedef set<VSymEnt*> VSymMap;
typedef set<const VSymEnt*> VSymConstMap;
typedef std::set<VSymEnt*> VSymMap;
typedef std::set<const VSymEnt*> VSymConstMap;
class VSymEnt {
// Symbol table that can have a "superior" table for resolving upper references
@ -66,9 +66,9 @@ private:
static inline int debug() { return 0; } // NOT runtime, too hot of a function
#endif
public:
void dumpIterate(ostream& os, VSymConstMap& doneSymsr, const string& indent, int numLevels, const string& searchName) const {
os<<indent<<"+ "<<left<<setw(30)<<(searchName==""?"\"\"":searchName)<<setw(0)<<right;
os<<" se"<<(void*)(this)<<setw(0);
void dumpIterate(std::ostream& os, VSymConstMap& doneSymsr, const string& indent, int numLevels, const string& searchName) const {
os<<indent<<"+ "<<std::left<<std::setw(30)<<(searchName==""?"\"\"":searchName)<<std::setw(0)<<std::right;
os<<" se"<<(void*)(this)<<std::setw(0);
os<<" fallb=se"<<(void*)(m_fallbackp);
os<<" n="<<nodep();
os<<endl;
@ -83,7 +83,7 @@ public:
}
}
}
void dump(ostream& os, const string& indent="", int numLevels=1) const {
void dump(std::ostream& os, const string& indent="", int numLevels=1) const {
VSymConstMap doneSyms;
dumpIterate(os, doneSyms, indent, numLevels, "TOP");
}
@ -231,9 +231,9 @@ public:
}
}
if (scopes=="") scopes="<no cells found>";
cerr<<V3Error::msgPrefix()<<" Known scopes under '"<<prettyName<<"': "
<<scopes<<endl;
if (debug()) dump(cerr,"\t\t KnownScope: ", 1);
std::cerr<<V3Error::msgPrefix()<<" Known scopes under '"<<prettyName<<"': "
<<scopes<<endl;
if (debug()) dump(std::cerr,"\t\t KnownScope: ", 1);
}
};
@ -243,7 +243,7 @@ public:
class VSymGraph {
// Collection of symbol tables
// TYPES
typedef vector<VSymEnt*> SymStack;
typedef std::vector<VSymEnt*> SymStack;
// MEMBERS
VSymEnt* m_symRootp; // Root symbol table
@ -265,7 +265,7 @@ public:
// METHODS
VSymEnt* rootp() const { return m_symRootp; }
// Debug
void dump(ostream& os, const string& indent="") {
void dump(std::ostream& os, const string& indent="") {
VSymConstMap doneSyms;
os<<"SymEnt Dump:\n";
m_symRootp->dumpIterate(os, doneSyms, indent, 9999, "$root");
@ -281,7 +281,7 @@ public:
if (v3Global.opt.dumpTree()) {
string filename = v3Global.debugFilename(nameComment)+".txt";
UINFO(2,"Dumping "<<filename<<endl);
const vl_unique_ptr<ofstream> logp (V3File::new_ofstream(filename));
const vl_unique_ptr<std::ofstream> logp (V3File::new_ofstream(filename));
if (logp->fail()) v3fatalSrc("Can't write "<<filename);
dump(*logp, "");
}

View File

@ -81,7 +81,7 @@ private:
// State cleared on each module
AstNodeModule* m_modp; // Current MODULE
int m_modTables; // Number of tables created in this module
deque<AstVarScope*> m_modTableVscs; // All tables created
std::deque<AstVarScope*> m_modTableVscs; // All tables created
// State cleared on each scope
AstScope* m_scopep; // Current SCOPE
@ -90,12 +90,12 @@ private:
bool m_assignDly; // Consists of delayed assignments instead of normal assignments
int m_inWidth; // Input table width
int m_outWidth; // Output table width
deque<AstVarScope*> m_inVarps; // Input variable list
deque<AstVarScope*> m_outVarps; // Output variable list
deque<bool> m_outNotSet; // True if output variable is not set at some point
std::deque<AstVarScope*> m_inVarps; // Input variable list
std::deque<AstVarScope*> m_outVarps; // Output variable list
std::deque<bool> m_outNotSet; // True if output variable is not set at some point
// When creating a table
deque<AstVarScope*> m_tableVarps; // Table being created
std::deque<AstVarScope*> m_tableVarps; // Table being created
// METHODS
static int debug() {
@ -210,7 +210,7 @@ private:
// Collapse duplicate tables
chgVscp = findDuplicateTable(chgVscp);
for (deque<AstVarScope*>::iterator it = m_tableVarps.begin(); it!=m_tableVarps.end(); ++it) {
for (std::deque<AstVarScope*>::iterator it = m_tableVarps.begin(); it!=m_tableVarps.end(); ++it) {
*it = findDuplicateTable(*it);
}
@ -232,7 +232,7 @@ private:
void createTableVars(AstNode* nodep) {
// Create table for each output
for (deque<AstVarScope*>::iterator it = m_outVarps.begin(); it!=m_outVarps.end(); ++it) {
for (std::deque<AstVarScope*>::iterator it = m_outVarps.begin(); it!=m_outVarps.end(); ++it) {
AstVarScope* outvscp = *it;
AstVar* outvarp = outvscp->varp();
FileLine* fl = nodep->fileline();
@ -258,7 +258,7 @@ private:
// Concat inputs into a single temp variable (inside always)
// First var in inVars becomes the LSB of the concat
AstNode* concatp = NULL;
for (deque<AstVarScope*>::iterator it = m_inVarps.begin(); it!=m_inVarps.end(); ++it) {
for (std::deque<AstVarScope*>::iterator it = m_inVarps.begin(); it!=m_inVarps.end(); ++it) {
AstVarScope* invscp = *it;
AstVarRef* refp = new AstVarRef (nodep->fileline(), invscp, false);
if (concatp) {
@ -278,14 +278,14 @@ private:
// There may be a simulation path by which the output doesn't change value.
// We could bail on these cases, or we can have a "change it" boolean.
// We've choosen the later route, since recirc is common in large FSMs.
for (deque<AstVarScope*>::iterator it = m_outVarps.begin(); it!=m_outVarps.end(); ++it) {
for (std::deque<AstVarScope*>::iterator it = m_outVarps.begin(); it!=m_outVarps.end(); ++it) {
m_outNotSet.push_back(false);
}
uint32_t inValueNextInitArray=0;
TableSimulateVisitor simvis (this);
for (uint32_t inValue=0; inValue <= VL_MASK_I(m_inWidth); inValue++) {
// Make a new simulation structure so we can set new input values
UINFO(8," Simulating "<<hex<<inValue<<endl);
UINFO(8," Simulating "<<std::hex<<inValue<<endl);
// Above simulateVisitor clears user 3, so
// all outputs default to NULL to mean 'recirculating'.
@ -293,7 +293,7 @@ private:
// Set all inputs to the constant
uint32_t shift = 0;
for (deque<AstVarScope*>::iterator it = m_inVarps.begin(); it!=m_inVarps.end(); ++it) {
for (std::deque<AstVarScope*>::iterator it = m_inVarps.begin(); it!=m_inVarps.end(); ++it) {
AstVarScope* invscp = *it;
// LSB is first variable, so extract it that way
simvis.newNumber(invscp, VL_MASK_I(invscp->width()) & (inValue>>shift));
@ -310,7 +310,7 @@ private:
// If a output changed, add it to table
int outnum = 0;
V3Number outputChgMask (nodep->fileline(), m_outVarps.size(), 0);
for (deque<AstVarScope*>::iterator it = m_outVarps.begin(); it!=m_outVarps.end(); ++it) {
for (std::deque<AstVarScope*>::iterator it = m_outVarps.begin(); it!=m_outVarps.end(); ++it) {
AstVarScope* outvscp = *it;
V3Number* outnump = simvis.fetchOutNumberNull(outvscp);
AstNode* setp;
@ -345,7 +345,7 @@ private:
// See if another table we've created is identical, if so use it for both.
// (A more 'modern' way would be to instead use V3Hashed::findDuplicate)
AstVar* var1p = vsc1p->varp();
for (deque<AstVarScope*>::iterator it = m_modTableVscs.begin(); it!=m_modTableVscs.end(); ++it) {
for (std::deque<AstVarScope*>::iterator it = m_modTableVscs.begin(); it!=m_modTableVscs.end(); ++it) {
AstVarScope* vsc2p= *it;
AstVar* var2p = vsc2p->varp();
if (var1p->width() == var2p->width()
@ -371,7 +371,7 @@ private:
// elimination will remove it for us.
// Set each output from array ref into our table
int outnum = 0;
for (deque<AstVarScope*>::iterator it = m_outVarps.begin(); it!=m_outVarps.end(); ++it) {
for (std::deque<AstVarScope*>::iterator it = m_outVarps.begin(); it!=m_outVarps.end(); ++it) {
AstVarScope* outvscp = *it;
AstNode* alhsp = new AstVarRef(nodep->fileline(), outvscp, true);
AstNode* arhsp = new AstArraySel(nodep->fileline(),

View File

@ -109,7 +109,7 @@ private:
AstUser4InUse m_inuser4;
// TYPES
typedef std::map<pair<AstScope*,AstVar*>,AstVarScope*> VarToScopeMap;
typedef std::map<std::pair<AstScope*,AstVar*>,AstVarScope*> VarToScopeMap;
// MEMBERS
VarToScopeMap m_varToScopeMap; // Map for Var -> VarScope mappings
AstAssignW* m_assignwp; // Current assignment
@ -169,7 +169,7 @@ private:
if (AstVarScope* vscp = stmtp->castVarScope()) {
if (vscp->varp()->isFuncLocal()) {
UINFO(9," funcvsc "<<vscp<<endl);
m_varToScopeMap.insert(make_pair(make_pair(nodep, vscp->varp()), vscp));
m_varToScopeMap.insert(std::make_pair(std::make_pair(nodep, vscp->varp()), vscp));
}
}
}
@ -1272,7 +1272,7 @@ V3TaskConnects V3Task::taskConnects(AstNodeFTaskRef* nodep, AstNode* taskStmtsp)
// Missing pin/expr? We return (pinvar, NULL)
// Extra pin/expr? We clean it up
typedef map<string,int> NameToIndex;
typedef std::map<string,int> NameToIndex;
NameToIndex nameToIndex;
V3TaskConnects tconnects;
if (!nodep->taskp()) nodep->v3fatalSrc("unlinked");

View File

@ -28,8 +28,8 @@
//============================================================================
typedef pair<AstVar*,AstArg*> V3TaskConnect; // [port, pin-connects-to]
typedef vector<V3TaskConnect> V3TaskConnects; // [ [port, pin-connects-to] ... ]
typedef std::pair<AstVar*,AstArg*> V3TaskConnect; // [port, pin-connects-to]
typedef std::vector<V3TaskConnect> V3TaskConnects; // [ [port, pin-connects-to] ... ]
//============================================================================

View File

@ -207,7 +207,7 @@ private:
if (nodep->valuep()) {
if (nodep->valuep()->backp() != nodep) nodep->v3fatalSrc("Trace duplicate back needs consistency, so we can map duplicates back to TRACEINCs");
hashed.hash(nodep->valuep());
UINFO(8, " Hashed "<<hex<<hashed.nodeHash(nodep->valuep())<<" "<<nodep<<endl);
UINFO(8, " Hashed "<<std::hex<<hashed.nodeHash(nodep->valuep())<<" "<<nodep<<endl);
// Just keep one node in the map and point all duplicates to this node
if (hashed.findDuplicate(nodep->valuep()) == hashed.end()) {
@ -385,8 +385,8 @@ private:
// Form a sorted list of the traces we are interested in
UINFO(9,"Making trees\n");
typedef set<uint32_t> ActCodeSet; // All activity numbers applying to a given trace
typedef multimap<ActCodeSet,TraceTraceVertex*> TraceVec; // For activity set, what traces apply
typedef std::set<uint32_t> ActCodeSet; // All activity numbers applying to a given trace
typedef std::multimap<ActCodeSet,TraceTraceVertex*> TraceVec; // For activity set, what traces apply
TraceVec traces;
// Form sort structure

View File

@ -48,7 +48,7 @@ class UndrivenVarEntry {
AstVar* m_varp; // Variable this tracks
bool m_usedWhole; // True if whole vector used
bool m_drivenWhole; // True if whole vector driven
vector<bool> m_flags; // Used/Driven on each subbit
std::vector<bool> m_flags; // Used/Driven on each subbit
enum { FLAG_USED = 0, FLAG_DRIVEN = 1, FLAGS_PER_BIT = 2 };
@ -235,7 +235,7 @@ private:
AstUser2InUse m_inuser2;
// STATE
vector<UndrivenVarEntry*> m_entryps[3]; // Nodes to delete when we are finished
std::vector<UndrivenVarEntry*> m_entryps[3]; // Nodes to delete when we are finished
bool m_inBBox; // In black box; mark as driven+used
AstNodeFTask* m_taskp; // Current task
AstAlways* m_alwaysp; // Current always if combo, otherwise NULL
@ -392,11 +392,11 @@ public:
nodep->accept(*this);
}
virtual ~UndrivenVisitor() {
for (vector<UndrivenVarEntry*>::iterator it = m_entryps[1].begin(); it != m_entryps[1].end(); ++it) {
for (std::vector<UndrivenVarEntry*>::iterator it = m_entryps[1].begin(); it != m_entryps[1].end(); ++it) {
(*it)->reportViolations();
}
for (int usr=1; usr<3; ++usr) {
for (vector<UndrivenVarEntry*>::iterator it = m_entryps[usr].begin(); it != m_entryps[usr].end(); ++it) {
for (std::vector<UndrivenVarEntry*>::iterator it = m_entryps[usr].begin(); it != m_entryps[usr].end(); ++it) {
delete (*it);
}
}

View File

@ -87,14 +87,14 @@
//######################################################################
enum Stage { PRELIM=1,FINAL=2,BOTH=3 }; // Numbers are a bitmask <0>=prelim, <1>=final
ostream& operator<<(ostream& str, const Stage& rhs) { return str<<("-PFB"[(int)rhs]); }
std::ostream& operator<<(std::ostream& str, const Stage& rhs) { return str<<("-PFB"[(int)rhs]); }
enum Determ {
SELF, // Self-determined
CONTEXT, // Context-determined
ASSIGN // Assignment-like where sign comes from RHS only
};
ostream& operator<<(ostream& str, const Determ& rhs) {
std::ostream& operator<<(std::ostream& str, const Determ& rhs) {
static const char* const s_det[] = {"SELF","CNTX","ASSN"};
return str<<s_det[rhs];
}
@ -137,7 +137,7 @@ public:
}
bool prelim() const { return m_stage & PRELIM; }
bool final() const { return m_stage & FINAL; }
void dump(ostream& str) const {
void dump(std::ostream& str) const {
if (!m_dtypep) {
str<<" VUP(s="<<m_stage<<",self)";
} else {
@ -145,7 +145,7 @@ public:
}
}
};
ostream& operator<<(ostream& str, const WidthVP* vup) {
std::ostream& operator<<(std::ostream& str, const WidthVP* vup) {
if (vup) vup->dump(str);
return str;
}
@ -180,8 +180,8 @@ public:
class WidthVisitor : public AstNVisitor {
private:
// TYPES
typedef map<pair<AstNodeDType*,AstAttrType>, AstVar*> TableMap;
typedef map<int,AstPatMember*> PatVecMap;
typedef std::map<std::pair<AstNodeDType*,AstAttrType>, AstVar*> TableMap;
typedef std::map<int,AstPatMember*> PatVecMap;
// STATE
WidthVP* m_vup; // Current node state
@ -363,8 +363,8 @@ private:
if (nodep->expr1p()->isDouble() || nodep->expr2p()->isDouble()) {
nodep->dtypeSetDouble();
} else {
int width = max(nodep->expr1p()->width(), nodep->expr2p()->width());
int mwidth = max(nodep->expr1p()->widthMin(), nodep->expr2p()->widthMin());
int width = std::max(nodep->expr1p()->width(), nodep->expr2p()->width());
int mwidth = std::max(nodep->expr1p()->widthMin(), nodep->expr2p()->widthMin());
bool issigned = nodep->expr1p()->isSigned() && nodep->expr2p()->isSigned();
nodep->dtypeSetLogicSized(width,mwidth,AstNumeric::fromBool(issigned));
}
@ -542,7 +542,7 @@ private:
if (m_vup->prelim()) {
// Don't need to iterate because V3Const already constified
int width = nodep->elementsConst();
if (width > (1<<28)) nodep->v3error("Width of bit range is huge; vector of over 1billion bits: 0x"<<hex<<width);
if (width > (1<<28)) nodep->v3error("Width of bit range is huge; vector of over 1billion bits: 0x"<<std::hex<<width);
// Note width() not set on range; use elementsConst()
if (nodep->littleEndian() && !nodep->backp()->castUnpackArrayDType()
&& !nodep->backp()->castCell()) { // For cells we warn in V3Inst
@ -907,7 +907,7 @@ private:
case AstAttrType::DIM_DIMENSIONS:
case AstAttrType::DIM_UNPK_DIMENSIONS: {
if (!nodep->fromp() || !nodep->fromp()->dtypep()) nodep->v3fatalSrc("Unsized expression");
pair<uint32_t,uint32_t> dim = nodep->fromp()->dtypep()->dimensions(true);
std::pair<uint32_t,uint32_t> dim = nodep->fromp()->dtypep()->dimensions(true);
int val = (nodep->attrType()==AstAttrType::DIM_UNPK_DIMENSIONS
? dim.second : (dim.first+dim.second));
nodep->replaceWith(new AstConst(nodep->fileline(), AstConst::Signed32(), val)); nodep->deleteTree(); VL_DANGLING(nodep);
@ -921,7 +921,7 @@ private:
case AstAttrType::DIM_RIGHT:
case AstAttrType::DIM_SIZE: {
if (!nodep->fromp() || !nodep->fromp()->dtypep()) nodep->v3fatalSrc("Unsized expression");
pair<uint32_t,uint32_t> dim = nodep->fromp()->dtypep()->skipRefp()->dimensions(true);
std::pair<uint32_t,uint32_t> dim = nodep->fromp()->dtypep()->skipRefp()->dimensions(true);
uint32_t msbdim = dim.first+dim.second;
if (!nodep->dimp() || nodep->dimp()->castConst() || msbdim<1) {
int dim = !nodep->dimp() ? 1 : nodep->dimp()->castConst()->toSInt();
@ -1114,7 +1114,7 @@ private:
// However the output width is exactly that requested.
// So two steps, first do the calculation's width (max of the two widths)
{
int calcWidth = max(width, underDtp->width());
int calcWidth = std::max(width, underDtp->width());
AstNodeDType* calcDtp = (underDtp->isFourstate()
? nodep->findLogicDType(calcWidth, calcWidth, underDtp->numeric())
: nodep->findBitDType(calcWidth, calcWidth, underDtp->numeric()));
@ -1280,7 +1280,7 @@ private:
// Assign missing values
V3Number num (nodep->fileline(), nodep->width(), 0);
V3Number one (nodep->fileline(), nodep->width(), 1);
map<V3Number,AstEnumItem*> inits;
std::map<V3Number,AstEnumItem*> inits;
for (AstEnumItem* itemp = nodep->itemsp(); itemp; itemp=itemp->nextp()->castEnumItem()) {
if (itemp->valuep()) {
if (debug()>=9) { UINFO(0,"EnumInit "<<itemp<<endl); itemp->valuep()->dumpTree(cout,"-EnumInit: "); }
@ -1363,8 +1363,8 @@ private:
int width = nodep->exprp()->width();
int mwidth = nodep->exprp()->widthMin();
for (AstNode* itemp = nodep->itemsp(); itemp; itemp=itemp->nextp()) {
width = max(width,itemp->width());
mwidth = max(mwidth,itemp->widthMin());
width = std::max(width,itemp->width());
mwidth = std::max(mwidth,itemp->widthMin());
}
// Apply width
AstNodeDType* subDTypep = nodep->findLogicDType(width,mwidth,nodep->exprp()->dtypep()->numeric());
@ -1437,7 +1437,7 @@ private:
backip = itemp->backp()->castMemberDType();
itemp->lsb(lsb);
if (nodep->castUnionDType()) {
width = max(width, itemp->width());
width = std::max(width, itemp->width());
} else {
lsb += itemp->width();
width += itemp->width();
@ -1704,7 +1704,7 @@ private:
// which member each AstPatMember corresponds to before we can
// determine the dtypep for that PatMember's value, and then
// width the initial value appropriately.
typedef map<AstMemberDType*,AstPatMember*> PatMap;
typedef std::map<AstMemberDType*,AstPatMember*> PatMap;
PatMap patmap;
{
AstMemberDType* memp = classp->membersp();
@ -1729,7 +1729,7 @@ private:
} else if (!memp && patp) { patp->v3error("Assignment pattern contains too many elements");
memp=NULL; patp=NULL; break;
} else {
pair<PatMap::iterator, bool> ret = patmap.insert(make_pair(memp, patp));
std::pair<PatMap::iterator, bool> ret = patmap.insert(make_pair(memp, patp));
if (!ret.second) {
patp->v3error("Assignment pattern contains duplicate entry: " << patp->keyp()->castText()->text());
}
@ -1978,8 +1978,8 @@ private:
if (condp->dtypep()->isDouble()) {
subDTypep = nodep->findDoubleDType();
} else {
int width = max(subDTypep->width(),condp->width());
int mwidth = max(subDTypep->widthMin(),condp->widthMin());
int width = std::max(subDTypep->width(),condp->width());
int mwidth = std::max(subDTypep->widthMin(),condp->widthMin());
bool issigned = subDTypep->isSigned() && condp->isSigned();
subDTypep = nodep->findLogicDType(width,mwidth,AstNumeric::fromBool(issigned));
}
@ -2676,8 +2676,8 @@ private:
if (AstNodeBiop* newp=replaceWithUOrSVersion(nodep, signedFl)) { VL_DANGLING(nodep);
nodep = newp; // Process new node instead
}
int width = max(nodep->lhsp()->width(), nodep->rhsp()->width());
int ewidth = max(nodep->lhsp()->widthMin(), nodep->rhsp()->widthMin());
int width = std::max(nodep->lhsp()->width(), nodep->rhsp()->width());
int ewidth = std::max(nodep->lhsp()->widthMin(), nodep->rhsp()->widthMin());
AstNodeDType* subDTypep = nodep->findLogicDType(width, ewidth,
AstNumeric::fromBool(signedFl));
iterateCheck(nodep,"LHS",nodep->lhsp(),CONTEXT,FINAL,subDTypep,signedFl?EXTEND_LHS:EXTEND_ZERO);
@ -2846,8 +2846,8 @@ private:
userIterateAndNext(nodep->rhsp(), WidthVP(CONTEXT,PRELIM).p());
checkCvtUS(nodep->lhsp());
checkCvtUS(nodep->rhsp());
int width = max(nodep->lhsp()->width(), nodep->rhsp()->width());
int mwidth = max(nodep->lhsp()->widthMin(), nodep->rhsp()->widthMin());
int width = std::max(nodep->lhsp()->width(), nodep->rhsp()->width());
int mwidth = std::max(nodep->lhsp()->widthMin(), nodep->rhsp()->widthMin());
bool expSigned = (nodep->lhsp()->isSigned() && nodep->rhsp()->isSigned());
nodep->dtypeChgWidthSigned(width,mwidth,AstNumeric::fromBool(expSigned));
}
@ -2893,8 +2893,8 @@ private:
iterateCheckReal(nodep,"RHS",nodep->rhsp(),FINAL);
return;
} else {
int width = max(nodep->lhsp()->width(), nodep->rhsp()->width());
int mwidth = max(nodep->lhsp()->widthMin(), nodep->rhsp()->widthMin());
int width = std::max(nodep->lhsp()->width(), nodep->rhsp()->width());
int mwidth = std::max(nodep->lhsp()->widthMin(), nodep->rhsp()->widthMin());
bool expSigned = (nodep->lhsp()->isSigned() && nodep->rhsp()->isSigned());
nodep->dtypeChgWidthSigned(width,mwidth,AstNumeric::fromBool(expSigned));
}
@ -3206,8 +3206,8 @@ private:
// IEEE: Signedness is solely determined by the RHS (underp), not by the LHS (expDTypep)
if (underp->isSigned() != subDTypep->isSigned()
|| underp->width() != subDTypep->width()) {
subDTypep = nodep->findLogicDType(max(subDTypep->width(), underp->width()),
max(subDTypep->widthMin(), underp->widthMin()),
subDTypep = nodep->findLogicDType(std::max(subDTypep->width(), underp->width()),
std::max(subDTypep->widthMin(), underp->widthMin()),
AstNumeric::fromBool(underp->isSigned()));
UINFO(9,"Assignment of opposite-signed RHS to LHS: "<<nodep<<endl);
}
@ -3652,7 +3652,7 @@ private:
// Find valid values and populate
if (!nodep->itemsp()) nodep->v3fatalSrc("enum without items");
vector<AstNode*> values;
std::vector<AstNode*> values;
values.reserve(msbdim+1);
for (unsigned i=0; i<(msbdim+1); ++i) {
values[i] = NULL;

View File

@ -541,7 +541,7 @@ void process () {
int main(int argc, char** argv, char** env) {
// General initialization
ios::sync_with_stdio();
std::ios::sync_with_stdio();
time_t randseed;
time(&randseed);

View File

@ -136,7 +136,7 @@ void VlcOptions::showVersion(bool verbose) {
int main(int argc, char** argv, char** env) {
// General initialization
ios::sync_with_stdio();
std::ios::sync_with_stdio();
VlcTop top;

View File

@ -33,8 +33,8 @@
//######################################################################
// V3Options - Command line options
typedef vector<string> VlStringList;
typedef set<string> VlStringSet;
typedef std::vector<string> VlStringList;
typedef std::set<string> VlStringSet;
class VlcOptions {
// MEMBERS (general options)

View File

@ -85,9 +85,9 @@ public:
cout<<" Num, TestsCover, Count, Name"<<endl;
}
void dump() const {
cout<<" "<<setw(8)<<setfill('0')<<pointNum()
<<", "<<setw(7)<<setfill(' ')<<testsCovering()
<<", "<<setw(7)<<setfill(' ')<<count()
cout<<" "<<std::setw(8)<<std::setfill('0')<<pointNum()
<<", "<<std::setw(7)<<std::setfill(' ')<<testsCovering()
<<", "<<std::setw(7)<<std::setfill(' ')<<count()
<<", \""<<name()<<"\""<<endl;
}
};
@ -100,7 +100,7 @@ private:
// MEMBERS
typedef vl_unordered_map<string,vluint64_t> NameMap;
NameMap m_nameMap; //< Name to point-number
vector<VlcPoint> m_points; //< List of all points
std::vector<VlcPoint> m_points; //< List of all points
vluint64_t m_numPoints; //< Total unique points
public:

View File

@ -66,8 +66,8 @@ public:
class VlcSource {
public:
// TYPES
typedef map<int,VlcSourceCount> ColumnMap; // Map of {column}
typedef map<int,ColumnMap> LinenoMap; // Map of {lineno}{column}
typedef std::map<int,VlcSourceCount> ColumnMap; // Map of {column}
typedef std::map<int,ColumnMap> LinenoMap; // Map of {lineno}{column}
private:
// MEMBERS
@ -111,7 +111,7 @@ public:
class VlcSources {
public:
// TYPES
typedef map<string,VlcSource> NameMap;
typedef std::map<string,VlcSource> NameMap;
private:
// MEMBERS
NameMap m_sources; //< List of all sources

View File

@ -75,12 +75,12 @@ public:
}
void dump(bool bucketsToo) {
if (testrun() || computrons()!=0.0) {
cout<<" "<<setw(8)<<setfill('0')<<testrun()
<<", "<<setw(7)<<setfill(' ')<<computrons()<<",";
cout<<" "<<std::setw(8)<<std::setfill('0')<<testrun()
<<", "<<std::setw(7)<<std::setfill(' ')<<computrons()<<",";
}
cout<<" "<<setw(7)<<setfill(' ')<<bucketsCovered()
<<", "<<setw(7)<<setfill(' ')<<rank()
<<", "<<setw(7)<<setfill(' ')<<rankPoints()
cout<<" "<<std::setw(7)<<std::setfill(' ')<<bucketsCovered()
<<", "<<std::setw(7)<<std::setfill(' ')<<rank()
<<", "<<std::setw(7)<<std::setfill(' ')<<rankPoints()
<<", \""<<name()<<"\""<<endl;
if (bucketsToo) m_buckets.dump();
}
@ -92,7 +92,7 @@ public:
class VlcTests {
public:
// TYPES
typedef vector<VlcTest*> ByName;
typedef std::vector<VlcTest*> ByName;
private:
// MEMBERS
ByName m_tests; //< List of all tests

View File

@ -32,7 +32,7 @@
void VlcTop::readCoverage(const string& filename, bool nonfatal) {
UINFO(2,"readCoverage "<<filename<<endl);
ifstream is (filename.c_str());
std::ifstream is (filename.c_str());
if (!is) {
if (!nonfatal) v3fatal("Can't read "<<filename);
return;
@ -69,7 +69,7 @@ void VlcTop::readCoverage(const string& filename, bool nonfatal) {
void VlcTop::writeCoverage(const string& filename) {
UINFO(2,"writeCoverage "<<filename<<endl);
ofstream os (filename.c_str());
std::ofstream os (filename.c_str());
if (!os) {
v3fatal("Can't write "<<filename);
return;
@ -98,7 +98,7 @@ void VlcTop::rank() {
vluint64_t nextrank=1;
// Sort by computrons, so fast tests get selected first
vector<VlcTest*> bytime;
std::vector<VlcTest*> bytime;
for (VlcTests::ByName::iterator it=m_tests.begin(); it!=m_tests.end(); ++it) {
VlcTest* testp = *it;
if (testp->bucketsCovered()) { // else no points, so can't help us
@ -122,7 +122,7 @@ void VlcTop::rank() {
if (debug()) { UINFO(9,"Left on iter"<<nextrank<<": "); remaining.dump(); }
VlcTest* bestTestp = NULL;
vluint64_t bestRemain = 0;
for (vector<VlcTest*>::iterator it=bytime.begin(); it!=bytime.end(); ++it) {
for (std::vector<VlcTest*>::iterator it=bytime.begin(); it!=bytime.end(); ++it) {
VlcTest* testp = *it;
if (!testp->rank()) {
vluint64_t remain = testp->buckets().dataPopCount(remaining);
@ -188,7 +188,7 @@ void VlcTop::annotateCalcNeeded() {
}
float pct = totCases ? (100*totOk / totCases) : 0;
cout<<"Total coverage ("<<totOk<<"/"<<totCases<<") "
<<fixed<<setw(3)<<setprecision(2)<<pct<<"%"<<endl;
<<std::fixed<<std::setw(3)<<std::setprecision(2)<<pct<<"%"<<endl;
if (totOk != totCases) cout<<"See lines with '%00' in "<<opt.annotateOut()<<endl;
}
@ -203,13 +203,13 @@ void VlcTop::annotateOutputFiles(const string& dirname) {
UINFO(1,"annotateOutputFile "<<filename<<" -> "<<outfilename<<endl);
ifstream is (filename.c_str());
std::ifstream is (filename.c_str());
if (!is) {
v3error("Can't read "<<filename);
return;
}
ofstream os (outfilename.c_str());
std::ofstream os (outfilename.c_str());
if (!os) {
v3fatal("Can't write "<<outfilename);
return;
@ -233,7 +233,7 @@ void VlcTop::annotateOutputFiles(const string& dirname) {
VlcSourceCount& col = cit->second;
//UINFO(0,"Source "<<source.name()<<" lineno="<<col.lineno()<<" col="<<col.column()<<endl);
os<<(col.ok()?" ":"%")
<<setfill('0')<<setw(6)<<col.count()
<<std::setfill('0')<<std::setw(6)<<col.count()
<<"\t"<<line<<endl;
if (first) {
first = false;

View File

@ -65,8 +65,14 @@
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
using namespace std;
// Avoid needing std:: prefixes on some very common items
typedef std::string string;
using std::cout;
using std::endl;
using std::make_pair;
//**********************************************************************
//**** Configure-discovered library options