Internals: Favor {} constructor syntax. No functional change intended.
This commit is contained in:
parent
cdb61842d6
commit
8caf9be3e6
|
|
@ -54,11 +54,11 @@ private:
|
||||||
string assertDisplayMessage(AstNode* nodep, const string& prefix, const string& message,
|
string assertDisplayMessage(AstNode* nodep, const string& prefix, const string& message,
|
||||||
VDisplayType severity) {
|
VDisplayType severity) {
|
||||||
if (severity == VDisplayType::DT_ERROR || severity == VDisplayType::DT_FATAL) {
|
if (severity == VDisplayType::DT_ERROR || severity == VDisplayType::DT_FATAL) {
|
||||||
return (string("[%0t] " + prefix + ": ") + nodep->fileline()->filebasename() + ":"
|
return (string{"[%0t] " + prefix + ": "} + nodep->fileline()->filebasename() + ":"
|
||||||
+ cvtToStr(nodep->fileline()->lineno()) + ": Assertion failed in %m"
|
+ cvtToStr(nodep->fileline()->lineno()) + ": Assertion failed in %m"
|
||||||
+ ((message != "") ? ": " : "") + message + "\n");
|
+ ((message != "") ? ": " : "") + message + "\n");
|
||||||
} else {
|
} else {
|
||||||
return (string("[%0t] " + prefix + ": ") + nodep->fileline()->filebasename() + ":"
|
return (string{"[%0t] " + prefix + ": "} + nodep->fileline()->filebasename() + ":"
|
||||||
+ cvtToStr(nodep->fileline()->lineno()) + ": %m"
|
+ cvtToStr(nodep->fileline()->lineno()) + ": %m"
|
||||||
+ ((message != "") ? ": " : "") + message + "\n");
|
+ ((message != "") ? ": " : "") + message + "\n");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ private:
|
||||||
// always queue.push(<sampled var>);
|
// always queue.push(<sampled var>);
|
||||||
AstCMethodHard* const pushp = new AstCMethodHard{
|
AstCMethodHard* const pushp = new AstCMethodHard{
|
||||||
flp, new AstVarRef{flp, queueVarp, VAccess::WRITE}, "push",
|
flp, new AstVarRef{flp, queueVarp, VAccess::WRITE}, "push",
|
||||||
new AstTime(nodep->fileline(), m_modp->timeunit())};
|
new AstTime{nodep->fileline(), m_modp->timeunit()}};
|
||||||
pushp->addPinsp(exprp->cloneTree(false));
|
pushp->addPinsp(exprp->cloneTree(false));
|
||||||
pushp->dtypeSetVoid();
|
pushp->dtypeSetVoid();
|
||||||
m_clockingp->addNextHere(
|
m_clockingp->addNextHere(
|
||||||
|
|
@ -238,7 +238,7 @@ private:
|
||||||
// always @<clocking event> queue.pop(<skew>, /*out*/<skewed var>});
|
// always @<clocking event> queue.pop(<skew>, /*out*/<skewed var>});
|
||||||
AstCMethodHard* const popp = new AstCMethodHard{
|
AstCMethodHard* const popp = new AstCMethodHard{
|
||||||
flp, new AstVarRef{flp, queueVarp, VAccess::READWRITE}, "pop",
|
flp, new AstVarRef{flp, queueVarp, VAccess::READWRITE}, "pop",
|
||||||
new AstTime(nodep->fileline(), m_modp->timeunit())};
|
new AstTime{nodep->fileline(), m_modp->timeunit()}};
|
||||||
popp->addPinsp(skewp->unlinkFrBack());
|
popp->addPinsp(skewp->unlinkFrBack());
|
||||||
popp->addPinsp(refp);
|
popp->addPinsp(refp);
|
||||||
popp->dtypeSetVoid();
|
popp->dtypeSetVoid();
|
||||||
|
|
|
||||||
|
|
@ -952,7 +952,7 @@ public:
|
||||||
BROKEN_RTN(!fmtp());
|
BROKEN_RTN(!fmtp());
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
string verilogKwd() const override { return (string("$") + string(displayType().ascii())); }
|
string verilogKwd() const override { return string{"$"} + string{displayType().ascii()}; }
|
||||||
bool isGateOptimizable() const override { return false; }
|
bool isGateOptimizable() const override { return false; }
|
||||||
bool isPredictOptimizable() const override { return false; }
|
bool isPredictOptimizable() const override { return false; }
|
||||||
bool isPure() const override { return false; } // SPECIAL: $display has 'visual' ordering
|
bool isPure() const override { return false; } // SPECIAL: $display has 'visual' ordering
|
||||||
|
|
@ -1360,7 +1360,7 @@ public:
|
||||||
void name(const string& name) override { m_name = name; }
|
void name(const string& name) override { m_name = name; }
|
||||||
void dump(std::ostream& str) const override;
|
void dump(std::ostream& str) const override;
|
||||||
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; }
|
||||||
//
|
//
|
||||||
AstScope* aboveScopep() const VL_MT_SAFE { return m_aboveScopep; }
|
AstScope* aboveScopep() const VL_MT_SAFE { return m_aboveScopep; }
|
||||||
|
|
@ -2640,8 +2640,8 @@ public:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
string verilogKwd() const override {
|
string verilogKwd() const override {
|
||||||
return (filep() ? string("$f") + string(displayType().ascii())
|
return (filep() ? string{"$f"} + string{displayType().ascii()}
|
||||||
: string("$") + string(displayType().ascii()));
|
: string{"$"} + string{displayType().ascii()});
|
||||||
}
|
}
|
||||||
bool isGateOptimizable() const override { return false; }
|
bool isGateOptimizable() const override { return false; }
|
||||||
bool isPredictOptimizable() const override { return false; }
|
bool isPredictOptimizable() const override { return false; }
|
||||||
|
|
|
||||||
|
|
@ -574,7 +574,7 @@ string AstVar::dpiArgType(bool named, bool forReturn) const {
|
||||||
} else {
|
} else {
|
||||||
class converter final : public dpiTypesToStringConverter {
|
class converter final : public dpiTypesToStringConverter {
|
||||||
string bitLogicVector(const AstVar* varp, bool isBit) const override {
|
string bitLogicVector(const AstVar* varp, bool isBit) const override {
|
||||||
return string(varp->isReadOnly() ? "const " : "")
|
return string{varp->isReadOnly() ? "const " : ""}
|
||||||
+ dpiTypesToStringConverter::bitLogicVector(varp, isBit) + '*';
|
+ dpiTypesToStringConverter::bitLogicVector(varp, isBit) + '*';
|
||||||
}
|
}
|
||||||
string primitive(const AstVar* varp) const override {
|
string primitive(const AstVar* varp) const override {
|
||||||
|
|
@ -637,13 +637,13 @@ string AstVar::dpiTmpVarType(const string& varName) const {
|
||||||
|
|
||||||
string AstVar::scType() const {
|
string AstVar::scType() const {
|
||||||
if (isScBigUint()) {
|
if (isScBigUint()) {
|
||||||
return (string("sc_biguint<") + cvtToStr(widthMin())
|
return (string{"sc_biguint<"} + cvtToStr(widthMin())
|
||||||
+ "> "); // Keep the space so don't get >>
|
+ "> "); // Keep the space so don't get >>
|
||||||
} else if (isScUint()) {
|
} else if (isScUint()) {
|
||||||
return (string("sc_uint<") + cvtToStr(widthMin())
|
return (string{"sc_uint<"} + cvtToStr(widthMin())
|
||||||
+ "> "); // Keep the space so don't get >>
|
+ "> "); // Keep the space so don't get >>
|
||||||
} else if (isScBv()) {
|
} else if (isScBv()) {
|
||||||
return (string("sc_bv<") + cvtToStr(widthMin()) + "> "); // Keep the space so don't get >>
|
return (string{"sc_bv<"} + cvtToStr(widthMin()) + "> "); // Keep the space so don't get >>
|
||||||
} else if (widthMin() == 1) {
|
} else if (widthMin() == 1) {
|
||||||
return "bool";
|
return "bool";
|
||||||
} else if (widthMin() <= VL_IDATASIZE) {
|
} else if (widthMin() <= VL_IDATASIZE) {
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,7 @@ private:
|
||||||
// To keep correct visual order, must add before other Text's
|
// To keep correct visual order, must add before other Text's
|
||||||
AstText* const afterp = nodep->scopeAttrp();
|
AstText* const afterp = nodep->scopeAttrp();
|
||||||
if (afterp) afterp->unlinkFrBackWithNext();
|
if (afterp) afterp->unlinkFrBackWithNext();
|
||||||
nodep->addScopeAttrp(new AstText{nodep->fileline(), string("__DOT__") + scname});
|
nodep->addScopeAttrp(new AstText{nodep->fileline(), string{"__DOT__"} + scname});
|
||||||
if (afterp) nodep->addScopeAttrp(afterp);
|
if (afterp) nodep->addScopeAttrp(afterp);
|
||||||
}
|
}
|
||||||
iterateChildren(nodep);
|
iterateChildren(nodep);
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ private:
|
||||||
if (vscp->user1p()) return VN_AS(vscp->user1p(), VarScope);
|
if (vscp->user1p()) return VN_AS(vscp->user1p(), VarScope);
|
||||||
const AstVar* const varp = vscp->varp();
|
const AstVar* const varp = vscp->varp();
|
||||||
const string newvarname
|
const string newvarname
|
||||||
= string("__Vsampled__") + vscp->scopep()->nameDotless() + "__" + varp->name();
|
= string{"__Vsampled__"} + vscp->scopep()->nameDotless() + "__" + varp->name();
|
||||||
FileLine* const flp = vscp->fileline();
|
FileLine* const flp = vscp->fileline();
|
||||||
AstVar* const newvarp = new AstVar{flp, VVarType::MODULETEMP, newvarname, varp->dtypep()};
|
AstVar* const newvarp = new AstVar{flp, VVarType::MODULETEMP, newvarname, varp->dtypep()};
|
||||||
newvarp->noReset(true); // Reset by below assign
|
newvarp->noReset(true); // Reset by below assign
|
||||||
|
|
|
||||||
|
|
@ -262,8 +262,8 @@ private:
|
||||||
if (VN_IS(dimp, Const)) { // bit = const, can just use it
|
if (VN_IS(dimp, Const)) { // bit = const, can just use it
|
||||||
dimreadps.push_front(dimp);
|
dimreadps.push_front(dimp);
|
||||||
} else {
|
} else {
|
||||||
const string bitvarname = (string("__Vdlyvdim") + cvtToStr(dimension) + "__"
|
const string bitvarname = string{"__Vdlyvdim"} + cvtToStr(dimension) + "__"
|
||||||
+ oldvarp->shortName() + "__v" + cvtToStr(modVecNum));
|
+ oldvarp->shortName() + "__v" + cvtToStr(modVecNum);
|
||||||
AstVarScope* const bitvscp
|
AstVarScope* const bitvscp
|
||||||
= createVarSc(varrefp->varScopep(), bitvarname, dimp->width(), nullptr);
|
= createVarSc(varrefp->varScopep(), bitvarname, dimp->width(), nullptr);
|
||||||
AstAssign* const bitassignp = new AstAssign{
|
AstAssign* const bitassignp = new AstAssign{
|
||||||
|
|
@ -282,8 +282,8 @@ private:
|
||||||
// vlsb = constant, can just push constant into where we use it
|
// vlsb = constant, can just push constant into where we use it
|
||||||
bitreadp = lsbvaluep;
|
bitreadp = lsbvaluep;
|
||||||
} else {
|
} else {
|
||||||
const string bitvarname = (string("__Vdlyvlsb__") + oldvarp->shortName() + "__v"
|
const string bitvarname
|
||||||
+ cvtToStr(modVecNum));
|
= string{"__Vdlyvlsb__"} + oldvarp->shortName() + "__v" + cvtToStr(modVecNum);
|
||||||
AstVarScope* const bitvscp
|
AstVarScope* const bitvscp
|
||||||
= createVarSc(varrefp->varScopep(), bitvarname, lsbvaluep->width(), nullptr);
|
= createVarSc(varrefp->varScopep(), bitvarname, lsbvaluep->width(), nullptr);
|
||||||
AstAssign* const bitassignp = new AstAssign{
|
AstAssign* const bitassignp = new AstAssign{
|
||||||
|
|
@ -301,7 +301,7 @@ private:
|
||||||
valreadp = nodep->rhsp()->unlinkFrBack();
|
valreadp = nodep->rhsp()->unlinkFrBack();
|
||||||
} else {
|
} else {
|
||||||
const string valvarname
|
const string valvarname
|
||||||
= (string("__Vdlyvval__") + oldvarp->shortName() + "__v" + cvtToStr(modVecNum));
|
= string{"__Vdlyvval__"} + oldvarp->shortName() + "__v" + cvtToStr(modVecNum);
|
||||||
AstVarScope* const valvscp
|
AstVarScope* const valvscp
|
||||||
= createVarSc(varrefp->varScopep(), valvarname, 0, nodep->rhsp()->dtypep());
|
= createVarSc(varrefp->varScopep(), valvarname, 0, nodep->rhsp()->dtypep());
|
||||||
newlhsp = new AstVarRef{nodep->fileline(), valvscp, VAccess::WRITE};
|
newlhsp = new AstVarRef{nodep->fileline(), valvscp, VAccess::WRITE};
|
||||||
|
|
@ -321,7 +321,7 @@ private:
|
||||||
++m_statSharedSet;
|
++m_statSharedSet;
|
||||||
} else { // Create new one
|
} else { // Create new one
|
||||||
const string setvarname
|
const string setvarname
|
||||||
= (string("__Vdlyvset__") + oldvarp->shortName() + "__v" + cvtToStr(modVecNum));
|
= string{"__Vdlyvset__"} + oldvarp->shortName() + "__v" + cvtToStr(modVecNum);
|
||||||
setvscp = createVarSc(varrefp->varScopep(), setvarname, 1, nullptr);
|
setvscp = createVarSc(varrefp->varScopep(), setvarname, 1, nullptr);
|
||||||
if (!m_inSuspendableOrFork) {
|
if (!m_inSuspendableOrFork) {
|
||||||
// Suspendables reset __Vdlyvset__ in the AstAlwaysPost
|
// Suspendables reset __Vdlyvset__ in the AstAlwaysPost
|
||||||
|
|
@ -483,7 +483,7 @@ private:
|
||||||
if (nodep->isDelayed()) {
|
if (nodep->isDelayed()) {
|
||||||
AstVarRef* const vrefp = VN_AS(nodep->operandp(), VarRef);
|
AstVarRef* const vrefp = VN_AS(nodep->operandp(), VarRef);
|
||||||
vrefp->unlinkFrBack();
|
vrefp->unlinkFrBack();
|
||||||
const string newvarname = (string("__Vdly__") + vrefp->varp()->shortName());
|
const string newvarname = string{"__Vdly__"} + vrefp->varp()->shortName();
|
||||||
AstVarScope* const dlyvscp = createVarSc(vrefp->varScopep(), newvarname, 1, nullptr);
|
AstVarScope* const dlyvscp = createVarSc(vrefp->varScopep(), newvarname, 1, nullptr);
|
||||||
|
|
||||||
const auto dlyRef = [=](VAccess access) {
|
const auto dlyRef = [=](VAccess access) {
|
||||||
|
|
@ -572,7 +572,7 @@ private:
|
||||||
checkActivePost(nodep, oldactivep);
|
checkActivePost(nodep, oldactivep);
|
||||||
}
|
}
|
||||||
if (!dlyvscp) { // First use of this delayed variable
|
if (!dlyvscp) { // First use of this delayed variable
|
||||||
const string newvarname = (string("__Vdly__") + nodep->varp()->shortName());
|
const string newvarname = string{"__Vdly__"} + nodep->varp()->shortName();
|
||||||
dlyvscp = createVarSc(oldvscp, newvarname, 0, nullptr);
|
dlyvscp = createVarSc(oldvscp, newvarname, 0, nullptr);
|
||||||
AstNodeAssign* const prep = new AstAssignPre{
|
AstNodeAssign* const prep = new AstAssignPre{
|
||||||
nodep->fileline(),
|
nodep->fileline(),
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ private:
|
||||||
new AstEq{
|
new AstEq{
|
||||||
funcp->fileline(), new AstCExpr{funcp->fileline(), "this", 64},
|
funcp->fileline(), new AstCExpr{funcp->fileline(), "this", 64},
|
||||||
new AstCExpr{funcp->fileline(),
|
new AstCExpr{funcp->fileline(),
|
||||||
string("&(") + funcp->scopep()->nameVlSym() + ")",
|
string{"&("} + funcp->scopep()->nameVlSym() + ")",
|
||||||
64}},
|
64}},
|
||||||
returnp};
|
returnp};
|
||||||
newfuncp->addStmtsp(ifp);
|
newfuncp->addStmtsp(ifp);
|
||||||
|
|
@ -178,7 +178,7 @@ private:
|
||||||
// to come up with some return value
|
// to come up with some return value
|
||||||
// newfuncp->addStmtsp(new AstDisplay(newfuncp->fileline(),
|
// newfuncp->addStmtsp(new AstDisplay(newfuncp->fileline(),
|
||||||
// VDisplayType::DT_WARNING,
|
// VDisplayType::DT_WARNING,
|
||||||
// string("%%Error: ")+name+"() called with bad
|
// string{"%%Error: "}+name+"() called with bad
|
||||||
// scope", nullptr));
|
// scope", nullptr));
|
||||||
// newfuncp->addStmtsp(new AstStop(newfuncp->fileline()));
|
// newfuncp->addStmtsp(new AstStop(newfuncp->fileline()));
|
||||||
if (debug() >= 9) newfuncp->dumpTree("- newfunc: ");
|
if (debug() >= 9) newfuncp->dumpTree("- newfunc: ");
|
||||||
|
|
|
||||||
|
|
@ -275,9 +275,9 @@ void EmitCFunc::displayArg(AstNode* dispp, AstNode** elistp, bool isScan, const
|
||||||
double dchars = mantissabits / 3.321928094887362 + 1.0;
|
double dchars = mantissabits / 3.321928094887362 + 1.0;
|
||||||
if (fmtLetter == 'd') dchars++; // space for sign
|
if (fmtLetter == 'd') dchars++; // space for sign
|
||||||
const int nchars = int(dchars);
|
const int nchars = int(dchars);
|
||||||
pfmt = string("%") + cvtToStr(nchars) + fmtLetter;
|
pfmt = string{"%"} + cvtToStr(nchars) + fmtLetter;
|
||||||
} else {
|
} else {
|
||||||
pfmt = string("%") + vfmt + fmtLetter;
|
pfmt = string{"%"} + vfmt + fmtLetter;
|
||||||
}
|
}
|
||||||
m_emitDispState.pushFormat(pfmt);
|
m_emitDispState.pushFormat(pfmt);
|
||||||
if (!ignore) {
|
if (!ignore) {
|
||||||
|
|
@ -672,7 +672,7 @@ string EmitCFunc::emitVarResetRecurse(const AstVar* varp, const string& varNameP
|
||||||
} else if (const AstUnpackArrayDType* const adtypep = VN_CAST(dtypep, UnpackArrayDType)) {
|
} else if (const AstUnpackArrayDType* const adtypep = VN_CAST(dtypep, UnpackArrayDType)) {
|
||||||
UASSERT_OBJ(adtypep->hi() >= adtypep->lo(), varp,
|
UASSERT_OBJ(adtypep->hi() >= adtypep->lo(), varp,
|
||||||
"Should have swapped msb & lsb earlier.");
|
"Should have swapped msb & lsb earlier.");
|
||||||
const string ivar = string("__Vi") + cvtToStr(depth);
|
const string ivar = string{"__Vi"} + cvtToStr(depth);
|
||||||
const string pre = ("for (int " + ivar + " = " + cvtToStr(0) + "; " + ivar + " < "
|
const string pre = ("for (int " + ivar + " = " + cvtToStr(0) + "; " + ivar + " < "
|
||||||
+ cvtToStr(adtypep->elementsConst()) + "; ++" + ivar + ") {\n");
|
+ cvtToStr(adtypep->elementsConst()) + "; ++" + ivar + ") {\n");
|
||||||
const string below = emitVarResetRecurse(varp, varNameProtected, adtypep->subDTypep(),
|
const string below = emitVarResetRecurse(varp, varNameProtected, adtypep->subDTypep(),
|
||||||
|
|
|
||||||
|
|
@ -492,7 +492,7 @@ public:
|
||||||
if (!v3Global.opt.protectIds()) return;
|
if (!v3Global.opt.protectIds()) return;
|
||||||
}
|
}
|
||||||
if (!(nodep->protect() && v3Global.opt.protectIds())) {
|
if (!(nodep->protect() && v3Global.opt.protectIds())) {
|
||||||
putsDecoration(string("// ") + nodep->name() + at + "\n");
|
putsDecoration(string{"// "} + nodep->name() + at + "\n");
|
||||||
}
|
}
|
||||||
iterateChildrenConst(nodep);
|
iterateChildrenConst(nodep);
|
||||||
}
|
}
|
||||||
|
|
@ -1310,7 +1310,7 @@ public:
|
||||||
|
|
||||||
// Default
|
// Default
|
||||||
void visit(AstNode* nodep) override {
|
void visit(AstNode* nodep) override {
|
||||||
puts(string("\n???? // ") + nodep->prettyTypeName() + "\n");
|
puts(string{"\n???? // "} + nodep->prettyTypeName() + "\n");
|
||||||
iterateChildrenConst(nodep);
|
iterateChildrenConst(nodep);
|
||||||
// LCOV_EXCL_START
|
// LCOV_EXCL_START
|
||||||
if (!v3Global.opt.lintOnly()) { // An internal problem, so suppress
|
if (!v3Global.opt.lintOnly()) { // An internal problem, so suppress
|
||||||
|
|
|
||||||
|
|
@ -401,7 +401,7 @@ class EmitCImp final : EmitCFunc {
|
||||||
const int vecnum = vects++;
|
const int vecnum = vects++;
|
||||||
UASSERT_OBJ(arrayp->hi() >= arrayp->lo(), varp,
|
UASSERT_OBJ(arrayp->hi() >= arrayp->lo(), varp,
|
||||||
"Should have swapped msb & lsb earlier.");
|
"Should have swapped msb & lsb earlier.");
|
||||||
const string ivar = string("__Vi") + cvtToStr(vecnum);
|
const string ivar = string{"__Vi"} + cvtToStr(vecnum);
|
||||||
puts("for (int __Vi" + cvtToStr(vecnum) + " = " + cvtToStr(0));
|
puts("for (int __Vi" + cvtToStr(vecnum) + " = " + cvtToStr(0));
|
||||||
puts("; " + ivar + " < " + cvtToStr(arrayp->elementsConst()));
|
puts("; " + ivar + " < " + cvtToStr(arrayp->elementsConst()));
|
||||||
puts("; ++" + ivar + ") {\n");
|
puts("; ++" + ivar + ") {\n");
|
||||||
|
|
@ -415,7 +415,7 @@ class EmitCImp final : EmitCFunc {
|
||||||
if (elementp->isWide()
|
if (elementp->isWide()
|
||||||
&& !(basicp && basicp->keyword() == VBasicDTypeKwd::STRING)) {
|
&& !(basicp && basicp->keyword() == VBasicDTypeKwd::STRING)) {
|
||||||
const int vecnum = vects++;
|
const int vecnum = vects++;
|
||||||
const string ivar = string("__Vi") + cvtToStr(vecnum);
|
const string ivar = string{"__Vi"} + cvtToStr(vecnum);
|
||||||
puts("for (int __Vi" + cvtToStr(vecnum) + " = " + cvtToStr(0));
|
puts("for (int __Vi" + cvtToStr(vecnum) + " = " + cvtToStr(0));
|
||||||
puts("; " + ivar + " < " + cvtToStr(elementp->widthWords()));
|
puts("; " + ivar + " < " + cvtToStr(elementp->widthWords()));
|
||||||
puts("; ++" + ivar + ") {\n");
|
puts("; ++" + ivar + ") {\n");
|
||||||
|
|
|
||||||
|
|
@ -516,7 +516,7 @@ void EmitCSyms::emitSymHdr() {
|
||||||
puts("\n// CONSTRUCTORS\n");
|
puts("\n// CONSTRUCTORS\n");
|
||||||
puts(symClassName() + "(VerilatedContext* contextp, const char* namep, " + topClassName()
|
puts(symClassName() + "(VerilatedContext* contextp, const char* namep, " + topClassName()
|
||||||
+ "* modelp);\n");
|
+ "* modelp);\n");
|
||||||
puts(string("~") + symClassName() + "();\n");
|
puts(string{"~"} + symClassName() + "();\n");
|
||||||
|
|
||||||
for (const auto& i : m_usesVfinal) {
|
for (const auto& i : m_usesVfinal) {
|
||||||
puts("void " + symClassName() + "_" + cvtToStr(i.first) + "(");
|
puts("void " + symClassName() + "_" + cvtToStr(i.first) + "(");
|
||||||
|
|
|
||||||
|
|
@ -156,9 +156,9 @@ public:
|
||||||
of.puts("# Path to Verilator kit (from $VERILATOR_ROOT)\n");
|
of.puts("# Path to Verilator kit (from $VERILATOR_ROOT)\n");
|
||||||
of.puts("VERILATOR_ROOT = " + V3Options::getenvVERILATOR_ROOT() + "\n");
|
of.puts("VERILATOR_ROOT = " + V3Options::getenvVERILATOR_ROOT() + "\n");
|
||||||
of.puts("# SystemC include directory with systemc.h (from $SYSTEMC_INCLUDE)\n");
|
of.puts("# SystemC include directory with systemc.h (from $SYSTEMC_INCLUDE)\n");
|
||||||
of.puts(string("SYSTEMC_INCLUDE ?= ") + V3Options::getenvSYSTEMC_INCLUDE() + "\n");
|
of.puts(string{"SYSTEMC_INCLUDE ?= "} + V3Options::getenvSYSTEMC_INCLUDE() + "\n");
|
||||||
of.puts("# SystemC library directory with libsystemc.a (from $SYSTEMC_LIBDIR)\n");
|
of.puts("# SystemC library directory with libsystemc.a (from $SYSTEMC_LIBDIR)\n");
|
||||||
of.puts(string("SYSTEMC_LIBDIR ?= ") + V3Options::getenvSYSTEMC_LIBDIR() + "\n");
|
of.puts(string{"SYSTEMC_LIBDIR ?= "} + V3Options::getenvSYSTEMC_LIBDIR() + "\n");
|
||||||
|
|
||||||
// Only check it if we really need the value
|
// Only check it if we really need the value
|
||||||
if (v3Global.opt.systemC() && !V3Options::systemCFound()) {
|
if (v3Global.opt.systemC() && !V3Options::systemCFound()) {
|
||||||
|
|
@ -169,22 +169,22 @@ public:
|
||||||
|
|
||||||
of.puts("\n### Switches...\n");
|
of.puts("\n### Switches...\n");
|
||||||
of.puts("# C++ code coverage 0/1 (from --prof-c)\n");
|
of.puts("# C++ code coverage 0/1 (from --prof-c)\n");
|
||||||
of.puts(string("VM_PROFC = ") + ((v3Global.opt.profC()) ? "1" : "0") + "\n");
|
of.puts(string{"VM_PROFC = "} + ((v3Global.opt.profC()) ? "1" : "0") + "\n");
|
||||||
of.puts("# SystemC output mode? 0/1 (from --sc)\n");
|
of.puts("# SystemC output mode? 0/1 (from --sc)\n");
|
||||||
of.puts(string("VM_SC = ") + ((v3Global.opt.systemC()) ? "1" : "0") + "\n");
|
of.puts(string{"VM_SC = "} + ((v3Global.opt.systemC()) ? "1" : "0") + "\n");
|
||||||
of.puts("# Legacy or SystemC output mode? 0/1 (from --sc)\n");
|
of.puts("# Legacy or SystemC output mode? 0/1 (from --sc)\n");
|
||||||
of.puts(string("VM_SP_OR_SC = $(VM_SC)\n"));
|
of.puts(string{"VM_SP_OR_SC = $(VM_SC)\n"});
|
||||||
of.puts("# Deprecated\n");
|
of.puts("# Deprecated\n");
|
||||||
of.puts(string("VM_PCLI = ") + (v3Global.opt.systemC() ? "0" : "1") + "\n");
|
of.puts(string{"VM_PCLI = "} + (v3Global.opt.systemC() ? "0" : "1") + "\n");
|
||||||
of.puts(
|
of.puts(
|
||||||
"# Deprecated: SystemC architecture to find link library path (from $SYSTEMC_ARCH)\n");
|
"# Deprecated: SystemC architecture to find link library path (from $SYSTEMC_ARCH)\n");
|
||||||
of.puts(string("VM_SC_TARGET_ARCH = ") + V3Options::getenvSYSTEMC_ARCH() + "\n");
|
of.puts(string{"VM_SC_TARGET_ARCH = "} + V3Options::getenvSYSTEMC_ARCH() + "\n");
|
||||||
|
|
||||||
of.puts("\n### Vars...\n");
|
of.puts("\n### Vars...\n");
|
||||||
of.puts("# Design prefix (from --prefix)\n");
|
of.puts("# Design prefix (from --prefix)\n");
|
||||||
of.puts(string("VM_PREFIX = ") + v3Global.opt.prefix() + "\n");
|
of.puts(string{"VM_PREFIX = "} + v3Global.opt.prefix() + "\n");
|
||||||
of.puts("# Module prefix (from --prefix)\n");
|
of.puts("# Module prefix (from --prefix)\n");
|
||||||
of.puts(string("VM_MODPREFIX = ") + v3Global.opt.modPrefix() + "\n");
|
of.puts(string{"VM_MODPREFIX = "} + v3Global.opt.modPrefix() + "\n");
|
||||||
|
|
||||||
of.puts("# User CFLAGS (from -CFLAGS on Verilator command line)\n");
|
of.puts("# User CFLAGS (from -CFLAGS on Verilator command line)\n");
|
||||||
of.puts("VM_USER_CFLAGS = \\\n");
|
of.puts("VM_USER_CFLAGS = \\\n");
|
||||||
|
|
|
||||||
|
|
@ -257,7 +257,7 @@ void V3Error::init() {
|
||||||
describedEachWarn(static_cast<V3ErrorCode>(i), false);
|
describedEachWarn(static_cast<V3ErrorCode>(i), false);
|
||||||
pretendError(static_cast<V3ErrorCode>(i), V3ErrorCode{i}.pretendError());
|
pretendError(static_cast<V3ErrorCode>(i), V3ErrorCode{i}.pretendError());
|
||||||
}
|
}
|
||||||
if (VL_UNCOVERABLE(string(V3ErrorCode{V3ErrorCode::_ENUM_MAX}.ascii()) != " MAX")) {
|
if (VL_UNCOVERABLE(string{V3ErrorCode{V3ErrorCode::_ENUM_MAX}.ascii()} != " MAX")) {
|
||||||
v3fatalSrc("Enum table in V3ErrorCode::EC_ascii() is munged");
|
v3fatalSrc("Enum table in V3ErrorCode::EC_ascii() is munged");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ void V3Global::readFiles() {
|
||||||
VInFilter filter{v3Global.opt.pipeFilter()};
|
VInFilter filter{v3Global.opt.pipeFilter()};
|
||||||
V3ParseSym parseSyms{v3Global.rootp()}; // Symbol table must be common across all parsing
|
V3ParseSym parseSyms{v3Global.rootp()}; // Symbol table must be common across all parsing
|
||||||
|
|
||||||
V3Parse parser(v3Global.rootp(), &filter, &parseSyms);
|
V3Parse parser{v3Global.rootp(), &filter, &parseSyms};
|
||||||
|
|
||||||
// Parse the std package
|
// Parse the std package
|
||||||
if (v3Global.opt.std()) {
|
if (v3Global.opt.std()) {
|
||||||
|
|
|
||||||
|
|
@ -555,7 +555,7 @@ public:
|
||||||
V3Inst::checkOutputShort(pinp);
|
V3Inst::checkOutputShort(pinp);
|
||||||
AstNodeExpr* const pinexprp = VN_AS(pinp->exprp(), NodeExpr)->unlinkFrBack();
|
AstNodeExpr* const pinexprp = VN_AS(pinp->exprp(), NodeExpr)->unlinkFrBack();
|
||||||
const string newvarname
|
const string newvarname
|
||||||
= (string(pinVarp->isWritable() ? "__Vcellout" : "__Vcellinp")
|
= (string{pinVarp->isWritable() ? "__Vcellout" : "__Vcellinp"}
|
||||||
// Prevent name conflict if both tri & non-tri add signals
|
// Prevent name conflict if both tri & non-tri add signals
|
||||||
+ (forTristate ? "t" : "") + "__" + cellp->name() + "__" + pinp->name());
|
+ (forTristate ? "t" : "") + "__" + cellp->name() + "__" + pinp->name());
|
||||||
AstVar* const newvarp
|
AstVar* const newvarp
|
||||||
|
|
|
||||||
|
|
@ -253,7 +253,7 @@ private:
|
||||||
|
|
||||||
// Prepare a temporary variable
|
// Prepare a temporary variable
|
||||||
FileLine* const fl = backp->fileline();
|
FileLine* const fl = backp->fileline();
|
||||||
const string name = string("__Vincrement") + cvtToStr(++m_modIncrementsNum);
|
const string name = string{"__Vincrement"} + cvtToStr(++m_modIncrementsNum);
|
||||||
AstVar* const varp = new AstVar{fl, VVarType::BLOCKTEMP, name, VFlagChildDType{},
|
AstVar* const varp = new AstVar{fl, VVarType::BLOCKTEMP, name, VFlagChildDType{},
|
||||||
varrefp->varp()->subDTypep()->cloneTree(true)};
|
varrefp->varp()->subDTypep()->cloneTree(true)};
|
||||||
if (m_ftaskp) varp->funcLocal(true);
|
if (m_ftaskp) varp->funcLocal(true);
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ private:
|
||||||
// REPEAT(count,body) -> loop=count,WHILE(loop>0) { body, loop-- }
|
// REPEAT(count,body) -> loop=count,WHILE(loop>0) { body, loop-- }
|
||||||
// Note var can be signed or unsigned based on original number.
|
// Note var can be signed or unsigned based on original number.
|
||||||
AstNodeExpr* const countp = nodep->countp()->unlinkFrBackWithNext();
|
AstNodeExpr* const countp = nodep->countp()->unlinkFrBackWithNext();
|
||||||
const string name = string("__Vrepeat") + cvtToStr(m_modRepeatNum++);
|
const string name = string{"__Vrepeat"} + cvtToStr(m_modRepeatNum++);
|
||||||
// Spec says value is integral, if negative is ignored
|
// Spec says value is integral, if negative is ignored
|
||||||
AstVar* const varp
|
AstVar* const varp
|
||||||
= new AstVar{nodep->fileline(), VVarType::BLOCKTEMP, name, nodep->findSigned32DType()};
|
= new AstVar{nodep->fileline(), VVarType::BLOCKTEMP, name, nodep->findSigned32DType()};
|
||||||
|
|
|
||||||
|
|
@ -966,9 +966,9 @@ void V3Options::parseOpts(FileLine* fl, int argc, char** argv) {
|
||||||
|
|
||||||
// Default prefix to the filename
|
// Default prefix to the filename
|
||||||
if (prefix() == "" && topModule() != "")
|
if (prefix() == "" && topModule() != "")
|
||||||
m_prefix = string("V") + AstNode::encodeName(topModule());
|
m_prefix = string{"V"} + AstNode::encodeName(topModule());
|
||||||
if (prefix() == "" && vFilesList.size() >= 1)
|
if (prefix() == "" && vFilesList.size() >= 1)
|
||||||
m_prefix = string("V") + AstNode::encodeName(V3Os::filenameNonExt(*(vFilesList.begin())));
|
m_prefix = string{"V"} + AstNode::encodeName(V3Os::filenameNonExt(*(vFilesList.begin())));
|
||||||
if (modPrefix() == "") m_modPrefix = prefix();
|
if (modPrefix() == "") m_modPrefix = prefix();
|
||||||
|
|
||||||
// Find files in makedir
|
// Find files in makedir
|
||||||
|
|
|
||||||
|
|
@ -510,7 +510,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
string name() const {
|
string name() const {
|
||||||
return (string("MDS:") + " d=" + cvtToHex(domainp()) + " s=" + cvtToHex(scopep()));
|
return string{"MDS:"} + " d=" + cvtToHex(domainp()) + " s=" + cvtToHex(scopep());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ public:
|
||||||
nm = "nul"; // LCOV_EXCL_LINE
|
nm = "nul"; // LCOV_EXCL_LINE
|
||||||
} else {
|
} else {
|
||||||
nm = logicp()->name();
|
nm = logicp()->name();
|
||||||
nm += (string("\\nMV:") + " d=" + cvtToHex(logicp()->domainp())
|
nm += (string{"\\nMV:"} + " d=" + cvtToHex(logicp()->domainp())
|
||||||
+ " s=" + cvtToHex(logicp()->scopep()));
|
+ " s=" + cvtToHex(logicp()->scopep()));
|
||||||
}
|
}
|
||||||
return nm;
|
return nm;
|
||||||
|
|
@ -127,7 +127,7 @@ public:
|
||||||
string nm;
|
string nm;
|
||||||
if (logicp()) {
|
if (logicp()) {
|
||||||
nm = logicp()->name();
|
nm = logicp()->name();
|
||||||
nm += (string("\\nMV:") + " d=" + cvtToHex(logicp()->domainp()) + " s="
|
nm += (string{"\\nMV:"} + " d=" + cvtToHex(logicp()->domainp()) + " s="
|
||||||
+ cvtToHex(logicp()->scopep())
|
+ cvtToHex(logicp()->scopep())
|
||||||
// "color()" represents the mtask ID.
|
// "color()" represents the mtask ID.
|
||||||
+ "\\nt=" + cvtToStr(color()));
|
+ "\\nt=" + cvtToStr(color()));
|
||||||
|
|
|
||||||
|
|
@ -554,7 +554,7 @@ void V3ParseImp::tokenPipelineSym() {
|
||||||
}
|
}
|
||||||
if (foundp && !v3Global.usesStdPackage()) {
|
if (foundp && !v3Global.usesStdPackage()) {
|
||||||
AstPackageImport* const impp
|
AstPackageImport* const impp
|
||||||
= new AstPackageImport(stdpkgp->fileline(), stdpkgp, "*");
|
= new AstPackageImport{stdpkgp->fileline(), stdpkgp, "*"};
|
||||||
unitPackage(stdpkgp->fileline())->addStmtsp(impp);
|
unitPackage(stdpkgp->fileline())->addStmtsp(impp);
|
||||||
v3Global.setUsesStdPackage();
|
v3Global.setUsesStdPackage();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ public:
|
||||||
SplitVarPostVertex(V3Graph* graphp, AstNode* nodep)
|
SplitVarPostVertex(V3Graph* graphp, AstNode* nodep)
|
||||||
: SplitNodeVertex{graphp, nodep} {}
|
: SplitNodeVertex{graphp, nodep} {}
|
||||||
~SplitVarPostVertex() override = default;
|
~SplitVarPostVertex() override = default;
|
||||||
string name() const override VL_MT_STABLE { return string("POST ") + SplitNodeVertex::name(); }
|
string name() const override VL_MT_STABLE { return string{"POST "} + SplitNodeVertex::name(); }
|
||||||
string dotColor() const override { return "CadetBlue"; }
|
string dotColor() const override { return "CadetBlue"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -513,10 +513,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 (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed(string("splitg_preo"), false);
|
if (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed("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 (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed(string("splitg_opt"), false);
|
if (dumpGraph() >= 9) m_graph.dumpDotFilePrefixed("splitg_opt", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void reorderBlock(AstNode* nodep) {
|
void reorderBlock(AstNode* nodep) {
|
||||||
|
|
|
||||||
|
|
@ -323,7 +323,7 @@ struct TaskDpiUtils {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
const AstNodeDType* const dtypep = portp->dtypep()->skipRefp();
|
const AstNodeDType* const dtypep = portp->dtypep()->skipRefp();
|
||||||
frstmt = "VL_SET_" + string(dtypep->charIQWN()) + "_" + frSvType + "(";
|
frstmt = "VL_SET_" + string{dtypep->charIQWN()} + "_" + frSvType + "(";
|
||||||
if (VN_IS(dtypep, UnpackArrayDType)) frstmt += "&";
|
if (VN_IS(dtypep, UnpackArrayDType)) frstmt += "&";
|
||||||
frstmt += frName;
|
frstmt += frName;
|
||||||
ket = ")";
|
ket = ")";
|
||||||
|
|
@ -425,7 +425,7 @@ private:
|
||||||
AstNode* const newbodysp
|
AstNode* const newbodysp
|
||||||
= AstNode::cloneTreeNull(refp->taskp()->stmtsp(), true); // Maybe nullptr
|
= AstNode::cloneTreeNull(refp->taskp()->stmtsp(), true); // Maybe nullptr
|
||||||
AstNode* const beginp
|
AstNode* const beginp
|
||||||
= new AstComment{refp->fileline(), string("Function: ") + refp->name(), true};
|
= new AstComment{refp->fileline(), string{"Function: "} + refp->name(), true};
|
||||||
if (newbodysp) beginp->addNext(newbodysp);
|
if (newbodysp) beginp->addNext(newbodysp);
|
||||||
if (debug() >= 9) beginp->dumpTreeAndNext(cout, "- newbegi: ");
|
if (debug() >= 9) beginp->dumpTreeAndNext(cout, "- newbegi: ");
|
||||||
//
|
//
|
||||||
|
|
@ -542,7 +542,7 @@ private:
|
||||||
UASSERT_OBJ(cfuncp, refp, "No non-inline task associated with this task call?");
|
UASSERT_OBJ(cfuncp, refp, "No non-inline task associated with this task call?");
|
||||||
//
|
//
|
||||||
AstNode* const beginp
|
AstNode* const beginp
|
||||||
= new AstComment{refp->fileline(), string("Function: ") + refp->name(), true};
|
= new AstComment{refp->fileline(), string{"Function: "} + refp->name(), true};
|
||||||
AstNodeCCall* ccallp;
|
AstNodeCCall* ccallp;
|
||||||
if (VN_IS(refp, New)) {
|
if (VN_IS(refp, New)) {
|
||||||
AstCNew* const cnewp = new AstCNew{refp->fileline(), cfuncp};
|
AstCNew* const cnewp = new AstCNew{refp->fileline(), cfuncp};
|
||||||
|
|
@ -1725,7 +1725,7 @@ string V3Task::assignInternalToDpi(AstVar* portp, bool isPtr, const string& frSu
|
||||||
stmt = "for (size_t " + idx + " = 0; " + idx + " < " + cvtToStr(unpackSize) + "; ++" + idx
|
stmt = "for (size_t " + idx + " = 0; " + idx + " < " + cvtToStr(unpackSize) + "; ++" + idx
|
||||||
+ ") ";
|
+ ") ";
|
||||||
stmt += (isBit ? "VL_SET_SVBV_" : "VL_SET_SVLV_")
|
stmt += (isBit ? "VL_SET_SVBV_" : "VL_SET_SVLV_")
|
||||||
+ string(portp->dtypep()->skipRefp()->charIQWN()) + "(" + cvtToStr(portp->width())
|
+ string{portp->dtypep()->skipRefp()->charIQWN()} + "(" + cvtToStr(portp->width())
|
||||||
+ ", ";
|
+ ", ";
|
||||||
stmt += toName + " + " + cvtToStr(portp->dtypep()->skipRefp()->widthWords()) + " * " + idx
|
stmt += toName + " + " + cvtToStr(portp->dtypep()->skipRefp()->widthWords()) + " * " + idx
|
||||||
+ ", ";
|
+ ", ";
|
||||||
|
|
|
||||||
|
|
@ -1803,11 +1803,11 @@ modportPortsDecl<nodep>:
|
||||||
// // IEEE: modport_simple_ports_declaration
|
// // IEEE: modport_simple_ports_declaration
|
||||||
| modportSimplePortOrTFPort { $$ = GRAMMARP->m_modportImpExpActive ?
|
| modportSimplePortOrTFPort { $$ = GRAMMARP->m_modportImpExpActive ?
|
||||||
static_cast<AstNode*>(
|
static_cast<AstNode*>(
|
||||||
new AstModportFTaskRef(
|
new AstModportFTaskRef{
|
||||||
$<fl>1, *$1, GRAMMARP->m_modportImpExpLastIsExport) ) :
|
$<fl>1, *$1, GRAMMARP->m_modportImpExpLastIsExport} ) :
|
||||||
static_cast<AstNode*>(
|
static_cast<AstNode*>(
|
||||||
new AstModportVarRef(
|
new AstModportVarRef{
|
||||||
$<fl>1, *$1, GRAMMARP->m_varIO) ); }
|
$<fl>1, *$1, GRAMMARP->m_varIO} ); }
|
||||||
;
|
;
|
||||||
|
|
||||||
modportSimplePortOrTFPort<strp>:// IEEE: modport_simple_port or modport_tf_port, depending what keyword was earlier
|
modportSimplePortOrTFPort<strp>:// IEEE: modport_simple_port or modport_tf_port, depending what keyword was earlier
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue