Internals: Cleanup string casts. No functional change.
This commit is contained in:
parent
bccb9f794c
commit
e4d638c73d
|
|
@ -1405,7 +1405,7 @@ public:
|
||||||
virtual string name() const { return m_name; } // * = Scope name
|
virtual string name() const { return m_name; } // * = Scope name
|
||||||
virtual void name(const string& name) { m_name = name; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
string nameDotless() const;
|
string nameDotless() const;
|
||||||
string nameVlSym() const { return (((string)"vlSymsp->") + nameDotless()); }
|
string nameVlSym() const { return ((string("vlSymsp->")) + nameDotless()); }
|
||||||
AstNodeModule* modp() const { return m_modp; }
|
AstNodeModule* modp() const { return m_modp; }
|
||||||
void addVarp(AstNode* nodep) { addOp1p(nodep); }
|
void addVarp(AstNode* nodep) { addOp1p(nodep); }
|
||||||
AstNode* varsp() const { return op1p(); } // op1 = AstVarScope's
|
AstNode* varsp() const { return op1p(); } // op1 = AstVarScope's
|
||||||
|
|
@ -2585,8 +2585,8 @@ public:
|
||||||
ASTNODE_NODE_FUNCS(Display)
|
ASTNODE_NODE_FUNCS(Display)
|
||||||
virtual void dump(std::ostream& str);
|
virtual void dump(std::ostream& str);
|
||||||
virtual const char* broken() const { BROKEN_RTN(!fmtp()); return NULL; }
|
virtual const char* broken() const { BROKEN_RTN(!fmtp()); return NULL; }
|
||||||
virtual string verilogKwd() const { return (filep() ? (string)"$f"+(string)displayType().ascii()
|
virtual string verilogKwd() const { return (filep() ? string("$f")+string(displayType().ascii())
|
||||||
: (string)"$"+(string)displayType().ascii()); }
|
: string("$")+string(displayType().ascii())); }
|
||||||
virtual bool isGateOptimizable() const { return false; }
|
virtual bool isGateOptimizable() const { return false; }
|
||||||
virtual bool isPredictOptimizable() const { return false; }
|
virtual bool isPredictOptimizable() const { return false; }
|
||||||
virtual bool isPure() const { return false; } // SPECIAL: $display has 'visual' ordering
|
virtual bool isPure() const { return false; } // SPECIAL: $display has 'visual' ordering
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ private:
|
||||||
// To keep correct visual order, must add before other Text's
|
// To keep correct visual order, must add before other Text's
|
||||||
AstNode* afterp = nodep->scopeAttrp();
|
AstNode* afterp = nodep->scopeAttrp();
|
||||||
if (afterp) afterp->unlinkFrBackWithNext();
|
if (afterp) afterp->unlinkFrBackWithNext();
|
||||||
nodep->scopeAttrp(new AstText(nodep->fileline(), (string)"__DOT__"+m_namedScope));
|
nodep->scopeAttrp(new AstText(nodep->fileline(), string("__DOT__")+m_namedScope));
|
||||||
if (afterp) nodep->scopeAttrp(afterp);
|
if (afterp) nodep->scopeAttrp(afterp);
|
||||||
}
|
}
|
||||||
iterateChildren(nodep);
|
iterateChildren(nodep);
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ private:
|
||||||
if (vscp->user1p()) return ((AstVarScope*)vscp->user1p());
|
if (vscp->user1p()) return ((AstVarScope*)vscp->user1p());
|
||||||
AstVar* varp = vscp->varp();
|
AstVar* varp = vscp->varp();
|
||||||
if (!varp->width1()) varp->v3error("Unsupported: Clock edge on non-single bit signal: "<<varp->prettyName());
|
if (!varp->width1()) varp->v3error("Unsupported: Clock edge on non-single bit signal: "<<varp->prettyName());
|
||||||
string newvarname = ((string)"__Vclklast__"+vscp->scopep()->nameDotless()+"__"+varp->name());
|
string newvarname = (string("__Vclklast__")+vscp->scopep()->nameDotless()+"__"+varp->name());
|
||||||
AstVar* newvarp = new AstVar(vscp->fileline(), AstVarType::MODULETEMP, newvarname, VFlagLogicPacked(), 1);
|
AstVar* newvarp = new AstVar(vscp->fileline(), AstVarType::MODULETEMP, newvarname, VFlagLogicPacked(), 1);
|
||||||
newvarp->noReset(true); // Reset by below assign
|
newvarp->noReset(true); // Reset by below assign
|
||||||
m_modp->addStmtp(newvarp);
|
m_modp->addStmtp(newvarp);
|
||||||
|
|
|
||||||
|
|
@ -1075,8 +1075,8 @@ private:
|
||||||
if (!m_modp) nodep->v3fatalSrc("Not under module");
|
if (!m_modp) nodep->v3fatalSrc("Not under module");
|
||||||
// We could create just one temp variable, but we'll get better optimization
|
// We could create just one temp variable, but we'll get better optimization
|
||||||
// if we make one per term.
|
// if we make one per term.
|
||||||
string name1 = ((string)"__Vconcswap"+cvtToStr(m_modp->varNumGetInc()));
|
string name1 = (string("__Vconcswap")+cvtToStr(m_modp->varNumGetInc()));
|
||||||
string name2 = ((string)"__Vconcswap"+cvtToStr(m_modp->varNumGetInc()));
|
string name2 = (string("__Vconcswap")+cvtToStr(m_modp->varNumGetInc()));
|
||||||
AstVar* temp1p = new AstVar(sel1p->fileline(), AstVarType::BLOCKTEMP, name1,
|
AstVar* temp1p = new AstVar(sel1p->fileline(), AstVarType::BLOCKTEMP, name1,
|
||||||
VFlagLogicPacked(), msb1-lsb1+1);
|
VFlagLogicPacked(), msb1-lsb1+1);
|
||||||
AstVar* temp2p = new AstVar(sel2p->fileline(), AstVarType::BLOCKTEMP, name2,
|
AstVar* temp2p = new AstVar(sel2p->fileline(), AstVarType::BLOCKTEMP, name2,
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ private:
|
||||||
// We'll do this, and make the if(...) coverinc later.
|
// We'll do this, and make the if(...) coverinc later.
|
||||||
|
|
||||||
// Add signal to hold the old value
|
// Add signal to hold the old value
|
||||||
string newvarname = (string)"__Vtogcov__"+nodep->shortName();
|
string newvarname = string("__Vtogcov__")+nodep->shortName();
|
||||||
AstVar* chgVarp = new AstVar(nodep->fileline(), AstVarType::MODULETEMP, newvarname, nodep);
|
AstVar* chgVarp = new AstVar(nodep->fileline(), AstVarType::MODULETEMP, newvarname, nodep);
|
||||||
chgVarp->fileline()->modifyWarnOff(V3ErrorCode::UNUSED, true);
|
chgVarp->fileline()->modifyWarnOff(V3ErrorCode::UNUSED, true);
|
||||||
m_modp->addStmtp(chgVarp);
|
m_modp->addStmtp(chgVarp);
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ private:
|
||||||
UINFO(6," Deep "<<nodep<<endl);
|
UINFO(6," Deep "<<nodep<<endl);
|
||||||
//if (debug()>=9) nodep->dumpTree(cout,"deep:");
|
//if (debug()>=9) nodep->dumpTree(cout,"deep:");
|
||||||
|
|
||||||
string newvarname = ((string)"__Vdeeptemp"+cvtToStr(m_modp->varNumGetInc()));
|
string newvarname = (string("__Vdeeptemp")+cvtToStr(m_modp->varNumGetInc()));
|
||||||
AstVar* varp = new AstVar(nodep->fileline(), AstVarType::STMTTEMP, newvarname,
|
AstVar* varp = new AstVar(nodep->fileline(), AstVarType::STMTTEMP, newvarname,
|
||||||
// Width, not widthMin, as we may be in middle of BITSEL expression which
|
// Width, not widthMin, as we may be in middle of BITSEL expression which
|
||||||
// though it's one bit wide, needs the mask in the upper bits.
|
// though it's one bit wide, needs the mask in the upper bits.
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ public:
|
||||||
nodep->v3fatalSrc("Case statements should have been reduced out");
|
nodep->v3fatalSrc("Case statements should have been reduced out");
|
||||||
}
|
}
|
||||||
virtual void visit(AstComment* nodep) {
|
virtual void visit(AstComment* nodep) {
|
||||||
putsDecoration((string)"// "+nodep->name()+" at "+nodep->fileline()->ascii()+"\n");
|
putsDecoration(string("// ")+nodep->name()+" at "+nodep->fileline()->ascii()+"\n");
|
||||||
iterateChildren(nodep);
|
iterateChildren(nodep);
|
||||||
}
|
}
|
||||||
virtual void visit(AstCoverDecl* nodep) {
|
virtual void visit(AstCoverDecl* nodep) {
|
||||||
|
|
@ -776,7 +776,7 @@ public:
|
||||||
virtual void visit(AstCFile*) {} // Handled outside the Visit class
|
virtual void visit(AstCFile*) {} // Handled outside the Visit class
|
||||||
// Default
|
// Default
|
||||||
virtual void visit(AstNode* nodep) {
|
virtual void visit(AstNode* nodep) {
|
||||||
puts((string)"\n???? // "+nodep->prettyTypeName()+"\n");
|
puts(string("\n???? // ")+nodep->prettyTypeName()+"\n");
|
||||||
iterateChildren(nodep);
|
iterateChildren(nodep);
|
||||||
nodep->v3fatalSrc("Unknown node type reached emitter: "<<nodep->prettyTypeName());
|
nodep->v3fatalSrc("Unknown node type reached emitter: "<<nodep->prettyTypeName());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,7 @@ void EmitCSyms::emitSymHdr() {
|
||||||
}
|
}
|
||||||
|
|
||||||
puts("\n// SYMS CLASS\n");
|
puts("\n// SYMS CLASS\n");
|
||||||
puts((string)"class "+symClassName()+" : public VerilatedSyms {\n");
|
puts(string("class ")+symClassName()+" : public VerilatedSyms {\n");
|
||||||
ofp()->putsPrivate(false); // public:
|
ofp()->putsPrivate(false); // public:
|
||||||
|
|
||||||
puts("\n// LOCAL STATE\n");
|
puts("\n// LOCAL STATE\n");
|
||||||
|
|
@ -340,7 +340,7 @@ void EmitCSyms::emitSymHdr() {
|
||||||
|
|
||||||
puts("\n// CREATORS\n");
|
puts("\n// CREATORS\n");
|
||||||
puts(symClassName()+"("+topClassName()+"* topp, const char* namep);\n");
|
puts(symClassName()+"("+topClassName()+"* topp, const char* namep);\n");
|
||||||
puts((string)"~"+symClassName()+"() {}\n");
|
puts(string("~")+symClassName()+"() {}\n");
|
||||||
|
|
||||||
puts("\n// METHODS\n");
|
puts("\n// METHODS\n");
|
||||||
puts("inline const char* name() { return __Vm_namep; }\n");
|
puts("inline const char* name() { return __Vm_namep; }\n");
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ class EmitVBaseVisitor : public EmitCBaseVisitor {
|
||||||
putqs(nodep,"end\n");
|
putqs(nodep,"end\n");
|
||||||
}
|
}
|
||||||
virtual void visit(AstComment* nodep) {
|
virtual void visit(AstComment* nodep) {
|
||||||
puts((string)"// "+nodep->name()+"\n");
|
puts(string("// ")+nodep->name()+"\n");
|
||||||
iterateChildren(nodep);
|
iterateChildren(nodep);
|
||||||
}
|
}
|
||||||
virtual void visit(AstContinue* nodep) {
|
virtual void visit(AstContinue* nodep) {
|
||||||
|
|
@ -595,7 +595,7 @@ class EmitVBaseVisitor : public EmitCBaseVisitor {
|
||||||
virtual void visit(AstCell*) {} // Handled outside the Visit class
|
virtual void visit(AstCell*) {} // Handled outside the Visit class
|
||||||
// Default
|
// Default
|
||||||
virtual void visit(AstNode* nodep) {
|
virtual void visit(AstNode* nodep) {
|
||||||
puts((string)"\n???? // "+nodep->prettyTypeName()+"\n");
|
puts(string("\n???? // ")+nodep->prettyTypeName()+"\n");
|
||||||
iterateChildren(nodep);
|
iterateChildren(nodep);
|
||||||
// Not v3fatalSrc so we keep processing
|
// Not v3fatalSrc so we keep processing
|
||||||
nodep->v3error("Internal: Unknown node type reached emitter: "<<nodep->prettyTypeName());
|
nodep->v3error("Internal: Unknown node type reached emitter: "<<nodep->prettyTypeName());
|
||||||
|
|
|
||||||
|
|
@ -130,8 +130,8 @@ string V3Error::msgPrefix() {
|
||||||
else if (code==V3ErrorCode::EC_FATAL) return "%Error: ";
|
else if (code==V3ErrorCode::EC_FATAL) return "%Error: ";
|
||||||
else if (code==V3ErrorCode::EC_FATALSRC) return "%Error: Internal Error: ";
|
else if (code==V3ErrorCode::EC_FATALSRC) return "%Error: Internal Error: ";
|
||||||
else if (code==V3ErrorCode::EC_ERROR) return "%Error: ";
|
else if (code==V3ErrorCode::EC_ERROR) return "%Error: ";
|
||||||
else if (isError(code, supp)) return "%Error-"+(string)code.ascii()+": ";
|
else if (isError(code, supp)) return "%Error-"+string(code.ascii())+": ";
|
||||||
else return "%Warning-"+(string)code.ascii()+": ";
|
else return "%Warning-"+string(code.ascii())+": ";
|
||||||
}
|
}
|
||||||
|
|
||||||
//======================================================================
|
//======================================================================
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ FileLine::FileLine(FileLine::EmptySecret) {
|
||||||
string FileLine::lineDirectiveStrg(int enterExit) const {
|
string FileLine::lineDirectiveStrg(int enterExit) const {
|
||||||
char numbuf[20]; sprintf(numbuf, "%d", lineno());
|
char numbuf[20]; sprintf(numbuf, "%d", lineno());
|
||||||
char levelbuf[20]; sprintf(levelbuf, "%d", enterExit);
|
char levelbuf[20]; sprintf(levelbuf, "%d", enterExit);
|
||||||
return ((string)"`line "+numbuf+" \""+filename()+"\" "+levelbuf+"\n");
|
return (string("`line ")+numbuf+" \""+filename()+"\" "+levelbuf+"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileLine::lineDirective(const char* textp, int& enterExitRef) {
|
void FileLine::lineDirective(const char* textp, int& enterExitRef) {
|
||||||
|
|
|
||||||
|
|
@ -438,11 +438,11 @@ private:
|
||||||
// To keep correct visual order, must add before other Text's
|
// To keep correct visual order, must add before other Text's
|
||||||
AstNode* afterp = nodep->scopeAttrp();
|
AstNode* afterp = nodep->scopeAttrp();
|
||||||
if (afterp) afterp->unlinkFrBackWithNext();
|
if (afterp) afterp->unlinkFrBackWithNext();
|
||||||
nodep->scopeAttrp(new AstText(nodep->fileline(), (string)"__DOT__"+m_cellp->name()));
|
nodep->scopeAttrp(new AstText(nodep->fileline(), string("__DOT__")+m_cellp->name()));
|
||||||
if (afterp) nodep->scopeAttrp(afterp);
|
if (afterp) nodep->scopeAttrp(afterp);
|
||||||
afterp = nodep->scopeEntrp();
|
afterp = nodep->scopeEntrp();
|
||||||
if (afterp) afterp->unlinkFrBackWithNext();
|
if (afterp) afterp->unlinkFrBackWithNext();
|
||||||
nodep->scopeEntrp(new AstText(nodep->fileline(), (string)"__DOT__"+m_cellp->name()));
|
nodep->scopeEntrp(new AstText(nodep->fileline(), string("__DOT__")+m_cellp->name()));
|
||||||
if (afterp) nodep->scopeEntrp(afterp);
|
if (afterp) nodep->scopeEntrp(afterp);
|
||||||
iterateChildren(nodep);
|
iterateChildren(nodep);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -513,7 +513,7 @@ public:
|
||||||
// Make a new temp wire
|
// Make a new temp wire
|
||||||
//if (1||debug()>=9) { pinp->dumpTree(cout,"-in_pin:"); }
|
//if (1||debug()>=9) { pinp->dumpTree(cout,"-in_pin:"); }
|
||||||
AstNode* pinexprp = pinp->exprp()->unlinkFrBack();
|
AstNode* pinexprp = pinp->exprp()->unlinkFrBack();
|
||||||
string newvarname = ((string)(pinVarp->isOutput() ? "__Vcellout" : "__Vcellinp")
|
string newvarname = (string(pinVarp->isOutput() ? "__Vcellout" : "__Vcellinp")
|
||||||
+(forTristate?"t":"") // Prevent name conflict if both tri & non-tri add signals
|
+(forTristate?"t":"") // Prevent name conflict if both tri & non-tri add signals
|
||||||
+"__"+cellp->name()+"__"+pinp->name());
|
+"__"+cellp->name()+"__"+pinp->name());
|
||||||
AstVar* newvarp = new AstVar(pinVarp->fileline(), AstVarType::MODULETEMP, newvarname, pinVarp);
|
AstVar* newvarp = new AstVar(pinVarp->fileline(), AstVarType::MODULETEMP, newvarname, pinVarp);
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ void V3LinkLevel::wrapTop(AstNetlist* netlistp) {
|
||||||
// We do ONLY the top module
|
// We do ONLY the top module
|
||||||
AstNodeModule* oldmodp = netlistp->modulesp();
|
AstNodeModule* oldmodp = netlistp->modulesp();
|
||||||
if (!oldmodp) netlistp->v3fatalSrc("No module found to process");
|
if (!oldmodp) netlistp->v3fatalSrc("No module found to process");
|
||||||
AstNodeModule* newmodp = new AstModule(oldmodp->fileline(), (string)"TOP_"+oldmodp->name());
|
AstNodeModule* newmodp = new AstModule(oldmodp->fileline(), string("TOP_")+oldmodp->name());
|
||||||
// Make the new module first in the list
|
// Make the new module first in the list
|
||||||
oldmodp->unlinkFrBackWithNext();
|
oldmodp->unlinkFrBackWithNext();
|
||||||
newmodp->addNext(oldmodp);
|
newmodp->addNext(oldmodp);
|
||||||
|
|
|
||||||
|
|
@ -57,13 +57,13 @@ private:
|
||||||
void rename(AstNode* nodep, bool addPvt) {
|
void rename(AstNode* nodep, bool addPvt) {
|
||||||
if (!nodep->user1()) { // Not already done
|
if (!nodep->user1()) { // Not already done
|
||||||
if (addPvt) {
|
if (addPvt) {
|
||||||
string newname = (string)"__PVT__"+nodep->name();
|
string newname = string("__PVT__")+nodep->name();
|
||||||
nodep->name(newname);
|
nodep->name(newname);
|
||||||
} else {
|
} else {
|
||||||
string rsvd = m_words.isKeyword(nodep->name());
|
string rsvd = m_words.isKeyword(nodep->name());
|
||||||
if (rsvd != "") {
|
if (rsvd != "") {
|
||||||
nodep->v3warn(SYMRSVDWORD,"Symbol matches "+rsvd+": '"<<nodep->prettyName()<<"'");
|
nodep->v3warn(SYMRSVDWORD,"Symbol matches "+rsvd+": '"<<nodep->prettyName()<<"'");
|
||||||
string newname = (string)"__SYM__"+nodep->name();
|
string newname = string("__SYM__")+nodep->name();
|
||||||
nodep->name(newname);
|
nodep->name(newname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ private:
|
||||||
int num = bucket + offset * BUCKETS;
|
int num = bucket + offset * BUCKETS;
|
||||||
m_valueMap.insert(make_pair(nodep, num));
|
m_valueMap.insert(make_pair(nodep, num));
|
||||||
// 'z' just to make sure we don't collide with a normal non-hashed number
|
// 'z' just to make sure we don't collide with a normal non-hashed number
|
||||||
return (string)"z"+cvtToStr(num);
|
return string("z")+cvtToStr(num);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void collectPins(CloneMap* clonemapp, AstNodeModule* modp) {
|
void collectPins(CloneMap* clonemapp, AstNodeModule* modp) {
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ void V3ParseImp::parseFile(FileLine* fileline, const string& modfilename, bool i
|
||||||
// intervening +<lang>ext+ options since it was first ecountered.
|
// intervening +<lang>ext+ options since it was first ecountered.
|
||||||
FileLine *modfileline = new FileLine(modfilename, 0);
|
FileLine *modfileline = new FileLine(modfilename, 0);
|
||||||
modfileline->language(v3Global.opt.fileLanguage(modfilename));
|
modfileline->language(v3Global.opt.fileLanguage(modfilename));
|
||||||
ppPushText((string)"`begin_keywords \""+modfileline->language().ascii()+"\"\n");
|
ppPushText(string("`begin_keywords \"")+modfileline->language().ascii()+"\"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Preprocess into m_ppBuffer
|
// Preprocess into m_ppBuffer
|
||||||
|
|
|
||||||
|
|
@ -999,7 +999,7 @@ int V3PreProcImp::getStateToken() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
error((string)"Expecting define name. Found: "+tokenName(tok)+"\n");
|
error(string("Expecting define name. Found: ")+tokenName(tok)+"\n");
|
||||||
goto next_tok;
|
goto next_tok;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1015,7 +1015,7 @@ int V3PreProcImp::getStateToken() {
|
||||||
if (!m_off) return tok;
|
if (!m_off) return tok;
|
||||||
else goto next_tok;
|
else goto next_tok;
|
||||||
} else {
|
} else {
|
||||||
error((string)"Expecting define formal arguments. Found: "+tokenName(tok)+"\n");
|
error(string("Expecting define formal arguments. Found: ")+tokenName(tok)+"\n");
|
||||||
goto next_tok;
|
goto next_tok;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1068,7 +1068,7 @@ int V3PreProcImp::getStateToken() {
|
||||||
} else {
|
} else {
|
||||||
if (m_defRefs.empty()) fatalSrc("Shouldn't be in DEFPAREN w/o active defref");
|
if (m_defRefs.empty()) fatalSrc("Shouldn't be in DEFPAREN w/o active defref");
|
||||||
V3DefineRef* refp = &(m_defRefs.top());
|
V3DefineRef* refp = &(m_defRefs.top());
|
||||||
error((string)"Expecting ( to begin argument list for define reference `"+refp->name()+"\n");
|
error(string("Expecting ( to begin argument list for define reference `")+refp->name()+"\n");
|
||||||
statePop();
|
statePop();
|
||||||
goto next_tok;
|
goto next_tok;
|
||||||
}
|
}
|
||||||
|
|
@ -1132,7 +1132,7 @@ int V3PreProcImp::getStateToken() {
|
||||||
statePush(ps_STRIFY);
|
statePush(ps_STRIFY);
|
||||||
goto next_tok;
|
goto next_tok;
|
||||||
} else {
|
} else {
|
||||||
error((string)"Expecting ) or , to end argument list for define reference. Found: "+tokenName(tok));
|
error(string("Expecting ) or , to end argument list for define reference. Found: ")+tokenName(tok));
|
||||||
statePop();
|
statePop();
|
||||||
goto next_tok;
|
goto next_tok;
|
||||||
}
|
}
|
||||||
|
|
@ -1161,7 +1161,7 @@ int V3PreProcImp::getStateToken() {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
statePop();
|
statePop();
|
||||||
error((string)"Expecting include filename. Found: "+tokenName(tok)+"\n");
|
error(string("Expecting include filename. Found: ")+tokenName(tok)+"\n");
|
||||||
goto next_tok;
|
goto next_tok;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1175,7 +1175,7 @@ int V3PreProcImp::getStateToken() {
|
||||||
goto next_tok;
|
goto next_tok;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
error((string)"Expecting `error string. Found: "+tokenName(tok)+"\n");
|
error(string("Expecting `error string. Found: ")+tokenName(tok)+"\n");
|
||||||
statePop();
|
statePop();
|
||||||
goto next_tok;
|
goto next_tok;
|
||||||
}
|
}
|
||||||
|
|
@ -1217,7 +1217,7 @@ int V3PreProcImp::getStateToken() {
|
||||||
while ((pos=out.find("\n")) != string::npos) {
|
while ((pos=out.find("\n")) != string::npos) {
|
||||||
out.replace(pos, 1, " ");
|
out.replace(pos, 1, " ");
|
||||||
}
|
}
|
||||||
unputString((string)"\""+out+"\"");
|
unputString(string("\"")+out+"\"");
|
||||||
statePop();
|
statePop();
|
||||||
goto next_tok;
|
goto next_tok;
|
||||||
}
|
}
|
||||||
|
|
@ -1386,7 +1386,7 @@ int V3PreProcImp::getStateToken() {
|
||||||
case VP_DEFFORM: // Handled by state=ps_DEFFORM;
|
case VP_DEFFORM: // Handled by state=ps_DEFFORM;
|
||||||
case VP_DEFVALUE: // Handled by state=ps_DEFVALUE;
|
case VP_DEFVALUE: // Handled by state=ps_DEFVALUE;
|
||||||
default:
|
default:
|
||||||
fatalSrc((string)"Internal error: Unexpected token "+tokenName(tok)+"\n");
|
fatalSrc(string("Internal error: Unexpected token ")+tokenName(tok)+"\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return tok;
|
return tok;
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
AstVar* getBlockTemp(AstNode* nodep) {
|
AstVar* getBlockTemp(AstNode* nodep) {
|
||||||
string newvarname = ((string)"__Vtemp"+cvtToStr(m_modp->varNumGetInc()));
|
string newvarname = (string("__Vtemp")+cvtToStr(m_modp->varNumGetInc()));
|
||||||
AstVar* varp = new AstVar(nodep->fileline(), AstVarType::STMTTEMP, newvarname,
|
AstVar* varp = new AstVar(nodep->fileline(), AstVarType::STMTTEMP, newvarname,
|
||||||
nodep->dtypep());
|
nodep->dtypep());
|
||||||
m_funcp->addInitsp(varp);
|
m_funcp->addInitsp(varp);
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ private:
|
||||||
}
|
}
|
||||||
virtual void visit(AstScopeName* nodep) {
|
virtual void visit(AstScopeName* nodep) {
|
||||||
// If there's a %m in the display text, we add a special node that will contain the name()
|
// If there's a %m in the display text, we add a special node that will contain the name()
|
||||||
string prefix = (string)("__DOT__")+m_scopep->name();
|
string prefix = string("__DOT__")+m_scopep->name();
|
||||||
// TOP and above will be the user's name().
|
// TOP and above will be the user's name().
|
||||||
// Note 'TOP.' is stripped by scopePrettyName
|
// Note 'TOP.' is stripped by scopePrettyName
|
||||||
// To keep correct visual order, must add before other Text's
|
// To keep correct visual order, must add before other Text's
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ public:
|
||||||
SplitVarPostVertex(V3Graph* graphp, AstNode* nodep)
|
SplitVarPostVertex(V3Graph* graphp, AstNode* nodep)
|
||||||
: SplitNodeVertex(graphp,nodep) {}
|
: SplitNodeVertex(graphp,nodep) {}
|
||||||
virtual ~SplitVarPostVertex() {}
|
virtual ~SplitVarPostVertex() {}
|
||||||
virtual string name() const { return (string)"POST "+SplitNodeVertex::name(); }
|
virtual string name() const { return string("POST ")+SplitNodeVertex::name(); }
|
||||||
virtual string dotColor() const { return "CadetBlue"; }
|
virtual string dotColor() const { return "CadetBlue"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -526,10 +526,10 @@ protected:
|
||||||
// And a real ordering to get the statements into something reasonable
|
// And a real ordering to get the statements into something reasonable
|
||||||
// We don't care if there's cutable violations here...
|
// We don't care if there's cutable violations here...
|
||||||
// Non-cutable violations should be impossible; as those edges are program-order
|
// Non-cutable violations should be impossible; as those edges are program-order
|
||||||
if (debug()>=9) m_graph.dumpDotFilePrefixed((string)"splitg_preo", false);
|
if (debug()>=9) m_graph.dumpDotFilePrefixed(string("splitg_preo"), false);
|
||||||
m_graph.acyclic(&SplitEdge::followCyclic);
|
m_graph.acyclic(&SplitEdge::followCyclic);
|
||||||
m_graph.rank(&SplitEdge::followCyclic); // Or order(), but that's more expensive
|
m_graph.rank(&SplitEdge::followCyclic); // Or order(), but that's more expensive
|
||||||
if (debug()>=9) m_graph.dumpDotFilePrefixed((string)"splitg_opt", false);
|
if (debug()>=9) m_graph.dumpDotFilePrefixed(string("splitg_opt"), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void reorderBlock(AstNode* nodep) {
|
void reorderBlock(AstNode* nodep) {
|
||||||
|
|
|
||||||
|
|
@ -359,7 +359,7 @@ private:
|
||||||
// outvscp is the variable for functions only, if NULL, it's a task
|
// outvscp is the variable for functions only, if NULL, it's a task
|
||||||
if (!refp->taskp()) refp->v3fatalSrc("Unlinked?");
|
if (!refp->taskp()) refp->v3fatalSrc("Unlinked?");
|
||||||
AstNode* newbodysp = AstNode::cloneTreeNull(refp->taskp()->stmtsp(), true); // Maybe NULL
|
AstNode* newbodysp = AstNode::cloneTreeNull(refp->taskp()->stmtsp(), true); // Maybe NULL
|
||||||
AstNode* beginp = new AstComment(refp->fileline(), (string)("Function: ")+refp->name());
|
AstNode* beginp = new AstComment(refp->fileline(), string("Function: ")+refp->name());
|
||||||
if (newbodysp) beginp->addNext(newbodysp);
|
if (newbodysp) beginp->addNext(newbodysp);
|
||||||
if (debug()>=9) { beginp->dumpTreeAndNext(cout,"-newbegi:"); }
|
if (debug()>=9) { beginp->dumpTreeAndNext(cout,"-newbegi:"); }
|
||||||
//
|
//
|
||||||
|
|
@ -470,7 +470,7 @@ private:
|
||||||
AstCFunc* cfuncp = m_statep->ftaskCFuncp(refp->taskp());
|
AstCFunc* cfuncp = m_statep->ftaskCFuncp(refp->taskp());
|
||||||
if (!cfuncp) refp->v3fatalSrc("No non-inline task associated with this task call?");
|
if (!cfuncp) refp->v3fatalSrc("No non-inline task associated with this task call?");
|
||||||
//
|
//
|
||||||
AstNode* beginp = new AstComment(refp->fileline(), (string)("Function: ")+refp->name());
|
AstNode* beginp = new AstComment(refp->fileline(), string("Function: ")+refp->name());
|
||||||
AstCCall* ccallp = new AstCCall(refp->fileline(), cfuncp, NULL);
|
AstCCall* ccallp = new AstCCall(refp->fileline(), cfuncp, NULL);
|
||||||
beginp->addNext(ccallp);
|
beginp->addNext(ccallp);
|
||||||
// Convert complicated outputs to temp signals
|
// Convert complicated outputs to temp signals
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ public:
|
||||||
}
|
}
|
||||||
virtual string name() const {
|
virtual string name() const {
|
||||||
if (activityAlways()) return "*ALWAYS*";
|
if (activityAlways()) return "*ALWAYS*";
|
||||||
else return ((string)(slow()?"*SLOW* ":""))+insertp()->name();
|
else return (string(slow()?"*SLOW* ":""))+insertp()->name();
|
||||||
}
|
}
|
||||||
virtual string dotColor() const { return slow()?"yellowGreen":"green"; }
|
virtual string dotColor() const { return slow()?"yellowGreen":"green"; }
|
||||||
bool activityCodeValid() const { return m_activityCodeValid; }
|
bool activityCodeValid() const { return m_activityCodeValid; }
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ private:
|
||||||
replaceHandle.relink(newp);
|
replaceHandle.relink(newp);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
string name = ((string)"__Vlvbound"+cvtToStr(m_modp->varNumGetInc()));
|
string name = (string("__Vlvbound")+cvtToStr(m_modp->varNumGetInc()));
|
||||||
AstVar* varp = new AstVar(fl, AstVarType::MODULETEMP, name,
|
AstVar* varp = new AstVar(fl, AstVarType::MODULETEMP, name,
|
||||||
prep->dtypep());
|
prep->dtypep());
|
||||||
m_modp->addStmtp(varp);
|
m_modp->addStmtp(varp);
|
||||||
|
|
@ -287,7 +287,7 @@ private:
|
||||||
// Make a Vxrand variable
|
// Make a Vxrand variable
|
||||||
// We use the special XTEMP type so it doesn't break pure functions
|
// We use the special XTEMP type so it doesn't break pure functions
|
||||||
if (!m_modp) nodep->v3fatalSrc("X number not under module");
|
if (!m_modp) nodep->v3fatalSrc("X number not under module");
|
||||||
string newvarname = ((string)"__Vxrand"
|
string newvarname = (string("__Vxrand")
|
||||||
+cvtToStr(m_modp->varNumGetInc()));
|
+cvtToStr(m_modp->varNumGetInc()));
|
||||||
AstVar* newvarp
|
AstVar* newvarp
|
||||||
= new AstVar(nodep->fileline(), AstVarType::XTEMP, newvarname,
|
= new AstVar(nodep->fileline(), AstVarType::XTEMP, newvarname,
|
||||||
|
|
|
||||||
|
|
@ -201,7 +201,7 @@ int V3ParseGrammar::s_modTypeImpNum = 0;
|
||||||
|
|
||||||
static void ERRSVKWD(FileLine* fileline, const string& tokname) {
|
static void ERRSVKWD(FileLine* fileline, const string& tokname) {
|
||||||
static int toldonce = 0;
|
static int toldonce = 0;
|
||||||
fileline->v3error((string)"Unexpected \""+tokname+"\": \""+tokname+"\" is a SystemVerilog keyword misused as an identifier.");
|
fileline->v3error(string("Unexpected \"")+tokname+"\": \""+tokname+"\" is a SystemVerilog keyword misused as an identifier.");
|
||||||
if (!toldonce++) fileline->v3error("Modify the Verilog-2001 code to avoid SV keywords, or use `begin_keywords or --language.");
|
if (!toldonce++) fileline->v3error("Modify the Verilog-2001 code to avoid SV keywords, or use `begin_keywords or --language.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue