Internals: Cleanup some string/model constructors. No functional change.

This commit is contained in:
Wilson Snyder 2022-08-29 23:50:32 -04:00
parent 8658a0d7dc
commit 6a5f77b278
42 changed files with 73 additions and 69 deletions

View File

@ -31,7 +31,7 @@
void VerilatedFstSc::open(const char* filename) {
if (!sc_core::sc_get_curr_simcontext()->elaboration_done()) {
vl_fatal(__FILE__, __LINE__, "VerilatedFstSc",
("%Error: VerilatedFstSc::open(\"" + std::string(filename)
("%Error: VerilatedFstSc::open(\"" + std::string{filename}
+ "\") is called before sc_core::sc_start(). "
"Run sc_core::sc_start(sc_core::SC_ZERO_TIME) before opening a wave file.")
.c_str());

View File

@ -31,7 +31,7 @@
void VerilatedVcdSc::open(const char* filename) {
if (!sc_core::sc_get_curr_simcontext()->elaboration_done()) {
vl_fatal(__FILE__, __LINE__, "VerilatedVcdSc",
("%Error: VerilatedVcdSc::open(\"" + std::string(filename)
("%Error: VerilatedVcdSc::open(\"" + std::string{filename}
+ "\") is called before sc_core::sc_start(). "
"Run sc_core::sc_start(sc_core::SC_ZERO_TIME) before opening a wave file.")
.c_str());

View File

@ -1565,7 +1565,7 @@ public:
static string dedotName(const string& namein); // Name with dots removed
static string prettyName(const string& namein); // Name for printing out to the user
static string prettyNameQ(const string& namein) { // Quoted pretty name (for errors)
return string("'") + prettyName(namein) + "'";
return std::string{"'"} + prettyName(namein) + "'";
}
static string
encodeName(const string& namein); // Encode user name into internal C representation

View File

@ -481,7 +481,7 @@ string AstVar::cPubArgType(bool named, bool forReturn) const {
}
} else {
// Newer internal-compatible types
arg += dtypep()->cType((named ? name() : string{}), true, isRef);
arg += dtypep()->cType((named ? name() : std::string{}), true, isRef);
}
return arg;
}

View File

@ -51,7 +51,7 @@ static void makeToString(AstClass* nodep) {
funcp->isStatic(false);
funcp->protect(false);
AstNode* const exprp
= new AstCMath{nodep->fileline(), R"(std::string("'{") + to_string_middle() + "}")", 0};
= new AstCMath{nodep->fileline(), R"(std::string{"'{"} + to_string_middle() + "}")", 0};
exprp->dtypeSetString();
funcp->addStmtsp(new AstCReturn{nodep->fileline(), exprp});
nodep->addStmtp(funcp);

View File

@ -455,9 +455,9 @@ void EmitCFunc::emitDereference(const string& pointer) {
void EmitCFunc::emitCvtPackStr(AstNode* nodep) {
if (const AstConst* const constp = VN_CAST(nodep, Const)) {
putbs("std::string(");
putbs("std::string{");
putsQuoted(constp->num().toString());
puts(")");
puts("}");
} else {
putbs("VL_CVT_PACK_STR_N");
emitIQW(nodep);
@ -486,9 +486,9 @@ void EmitCFunc::emitConstant(AstConst* nodep, AstVarRef* assigntop, const string
if (nodep->num().isFourState()) {
nodep->v3warn(E_UNSUPPORTED, "Unsupported: 4-state numbers in this context");
} else if (nodep->num().isString()) {
putbs("std::string(");
putbs("std::string{");
putsQuoted(nodep->num().toString());
puts(")");
puts("}");
} else if (nodep->isWide()) {
int upWidth = nodep->num().widthMin();
int chunks = 0;

View File

@ -314,8 +314,8 @@ class EmitCImp final : EmitCFunc {
puts(" \"lineno\",lineno,");
puts(" \"column\",column,\n");
// Need to move hier into scopes and back out if do this
// puts( "\"hier\",std::string(vlSymsp->name())+hierp,");
puts("\"hier\",std::string(name())+hierp,");
// puts( "\"hier\",std::string{vlSymsp->name()} + hierp,");
puts("\"hier\",std::string{name()} + hierp,");
puts(" \"page\",pagep,");
puts(" \"comment\",commentp,");
puts(" (linescovp[0] ? \"linescov\" : \"\"), linescovp);\n");

View File

@ -208,7 +208,7 @@ class EmitVBaseVisitor VL_NOT_FINAL : public EmitCBaseVisitor {
putqs(nodep, "end\n");
}
virtual void visit(AstComment* nodep) override {
puts(string("// ") + nodep->name() + "\n");
puts(std::string{"// "} + nodep->name() + "\n");
iterateChildrenConst(nodep);
}
virtual void visit(AstContinue*) override {
@ -706,7 +706,7 @@ class EmitVBaseVisitor VL_NOT_FINAL : public EmitCBaseVisitor {
virtual void visit(AstCell*) override {} // Handled outside the Visit class
// Default
virtual void visit(AstNode* nodep) override {
puts(string("\n???? // ") + nodep->prettyTypeName() + "\n");
puts(std::string{"\n???? // "} + nodep->prettyTypeName() + "\n");
iterateChildrenConst(nodep);
// Not v3fatalSrc so we keep processing
if (!m_suppressUnknown) {

View File

@ -166,7 +166,7 @@ string FileLine::xmlDetailedLocation() const {
}
string FileLine::lineDirectiveStrg(int enterExit) const {
return std::string("`line ") + cvtToStr(lastLineno()) + " \"" + filename() + "\" "
return std::string{"`line "} + cvtToStr(lastLineno()) + " \"" + filename() + "\" "
+ cvtToStr(enterExit) + "\n";
}

View File

@ -1006,7 +1006,8 @@ class LinkDotFindVisitor final : public VNVisitor {
m_classOrPackagep = VN_AS(m_curSymp->nodep(), Class);
}
// Create symbol table for the task's vars
const string name = string{nodep->isExternProto() ? "extern " : ""} + nodep->name();
const string name
= std::string{nodep->isExternProto() ? "extern " : ""} + nodep->name();
m_curSymp = m_statep->insertBlock(m_curSymp, name, nodep, m_classOrPackagep);
m_curSymp->fallbackp(upSymp);
// Convert the func's range to the output variable

View File

@ -140,7 +140,7 @@ V3OptionParser::ActionIfs* V3OptionParser::find(const char* optp) {
if (act.second->isOnOffAllowed()) { // Find starts with "-no"
if (const char* const nop
= VString::startsWith(optp, "-no") ? (optp + strlen("-no")) : nullptr) {
if (act.first == nop || act.first == (string{"-"} + nop)) {
if (act.first == nop || act.first == (std::string{"-"} + nop)) {
return act.second.get();
}
}

View File

@ -1436,7 +1436,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
});
DECL_OPTION("-Wno-", CbPartialMatch, [fl, &parser](const char* optp) {
if (!FileLine::globalWarnOff(optp, true)) {
const string fullopt = string{"-Wno-"} + optp;
const string fullopt = std::string{"-Wno-"} + optp;
fl->v3fatal("Unknown warning specified: " << fullopt
<< parser.getSuggestion(fullopt.c_str()));
}
@ -1456,7 +1456,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
const V3ErrorCode code{optp};
if (code == V3ErrorCode::EC_ERROR) {
if (!isFuture(optp)) {
const string fullopt = string{"-Wwarn-"} + optp;
const string fullopt = std::string{"-Wwarn-"} + optp;
fl->v3fatal("Unknown warning specified: "
<< fullopt << parser.getSuggestion(fullopt.c_str()));
}

View File

@ -969,7 +969,7 @@ class ParamVisitor final : public VNVisitor {
// A generic visitor for cells and class refs
void visitCellOrClassRef(AstNode* nodep, bool isIface) {
// Must do ifaces first, so push to list and do in proper order
string* const genHierNamep = new string{m_generateHierName};
string* const genHierNamep = new std::string{m_generateHierName};
nodep->user5p(genHierNamep);
// Visit parameters in the instantiation.
iterateChildren(nodep);

View File

@ -618,7 +618,7 @@ void V3PreLex::scanNewFile(FileLine* filelinep) {
void V3PreLex::scanBytes(const string& str) {
// Note buffers also appended in ::scanBytesBack
// Not "m_buffers.push_front(string{strp,len})" as we need a `define
// Not "m_buffers.push_front(std::string{strp,len})" as we need a `define
// to take effect immediately, in the middle of the current buffer
// Also we don't use scan_bytes that would set yy_fill_buffer
// which would force Flex to bypass our YY_INPUT routine.

View File

@ -328,7 +328,7 @@ FileLine* V3PreProcImp::defFileline(const string& name) {
void V3PreProcImp::define(FileLine* fl, const string& name, const string& value,
const string& params, bool cmdline) {
UINFO(4, "DEFINE '" << name << "' as '" << value << "' params '" << params << "'" << endl);
if (!V3LanguageWords::isKeyword(string("`") + name).empty()) {
if (!V3LanguageWords::isKeyword(std::string{"`"} + name).empty()) {
fl->v3error("Attempting to define built-in directive: '`" << name
<< "' (IEEE 1800-2017 22.5.1)");
} else {
@ -886,7 +886,7 @@ void V3PreProcImp::dumpDefines(std::ostream& os) {
void V3PreProcImp::candidateDefines(VSpellCheck* spellerp) {
for (DefinesMap::const_iterator it = m_defines.begin(); it != m_defines.end(); ++it) {
spellerp->pushCandidate(string("`") + it->first);
spellerp->pushCandidate(std::string{"`"} + it->first);
}
}
@ -1106,7 +1106,7 @@ int V3PreProcImp::getStateToken() {
// IE, `ifdef `MACRO(x): Substitute and come back here when state pops.
break;
} else {
error(string("Expecting define name. Found: ") + tokenName(tok) + "\n");
error(std::string{"Expecting define name. Found: "} + tokenName(tok) + "\n");
goto next_tok;
}
}
@ -1127,7 +1127,7 @@ int V3PreProcImp::getStateToken() {
goto next_tok;
}
} else {
error(string("Expecting define formal arguments. Found: ") + tokenName(tok)
error(std::string{"Expecting define formal arguments. Found: "} + tokenName(tok)
+ "\n");
goto next_tok;
}
@ -1164,7 +1164,8 @@ int V3PreProcImp::getStateToken() {
define(fileline(), m_lastSym, value, formals, false);
}
} else {
const string msg = string("Bad define text, unexpected ") + tokenName(tok) + "\n";
const string msg
= std::string{"Bad define text, unexpected "} + tokenName(tok) + "\n";
fatalSrc(msg);
}
statePop();
@ -1182,7 +1183,7 @@ int V3PreProcImp::getStateToken() {
fatalSrc("Shouldn't be in DEFPAREN w/o active defref");
}
const VDefineRef* const refp = &(m_defRefs.top());
error(string("Expecting ( to begin argument list for define reference `")
error(std::string{"Expecting ( to begin argument list for define reference `"}
+ refp->name() + "\n");
statePop();
goto next_tok;
@ -1259,7 +1260,8 @@ int V3PreProcImp::getStateToken() {
statePush(ps_STRIFY);
goto next_tok;
} else {
error(string("Expecting ) or , to end argument list for define reference. Found: ")
error(std::string{
"Expecting ) or , to end argument list for define reference. Found: "}
+ tokenName(tok));
statePop();
goto next_tok;
@ -1285,7 +1287,7 @@ int V3PreProcImp::getStateToken() {
break;
} else {
statePop();
error(string("Expecting include filename. Found: ") + tokenName(tok) + "\n");
error(std::string{"Expecting include filename. Found: "} + tokenName(tok) + "\n");
goto next_tok;
}
}
@ -1298,7 +1300,7 @@ int V3PreProcImp::getStateToken() {
statePop();
goto next_tok;
} else {
error(string("Expecting `error string. Found: ") + tokenName(tok) + "\n");
error(std::string{"Expecting `error string. Found: "} + tokenName(tok) + "\n");
statePop();
goto next_tok;
}
@ -1343,7 +1345,7 @@ int V3PreProcImp::getStateToken() {
// multiline "..." without \ escapes.
// The spec is silent about this either way; simulators vary
std::replace(out.begin(), out.end(), '\n', ' ');
unputString(string("\"") + out + "\"");
unputString(std::string{"\""} + out + "\"");
statePop();
goto next_tok;
} else if (tok == VP_EOF) {
@ -1427,7 +1429,7 @@ int V3PreProcImp::getStateToken() {
} else {
// We want final text of `name, but that would cause
// recursion, so use a special character to get it through
unputDefrefString(string("`\032") + name);
unputDefrefString(std::string{"`\032"} + name);
goto next_tok;
}
} else {
@ -1517,7 +1519,7 @@ int V3PreProcImp::getStateToken() {
case VP_DEFFORM: // Handled by state=ps_DEFFORM;
case VP_DEFVALUE: // Handled by state=ps_DEFVALUE;
default: // LCOV_EXCL_LINE
fatalSrc(string("Internal error: Unexpected token ") + tokenName(tok) + "\n");
fatalSrc(std::string{"Internal error: Unexpected token "} + tokenName(tok) + "\n");
break; // LCOV_EXCL_LINE
}
return tok;

View File

@ -149,16 +149,17 @@ private:
// Timescale
if (v3Global.opt.hierChild() && v3Global.rootp()->timescaleSpecified()) {
// Emit timescale for hierarhical verilation if input HDL specifies timespec
txtp->addText(fl, string("timeunit ") + modp->timeunit().ascii() + ";\n");
txtp->addText(fl, string("timeprecision ") + +v3Global.rootp()->timeprecision().ascii()
+ ";\n");
txtp->addText(fl, std::string{"timeunit "} + modp->timeunit().ascii() + ";\n");
txtp->addText(fl, std::string{"timeprecision "}
+ +v3Global.rootp()->timeprecision().ascii() + ";\n");
} else {
addComment(txtp, fl,
"Precision of submodule"
" (commented out to avoid requiring timescale on all modules)");
addComment(txtp, fl, string("timeunit ") + v3Global.rootp()->timeunit().ascii() + ";");
addComment(txtp, fl,
string("timeprecision ") + v3Global.rootp()->timeprecision().ascii()
std::string{"timeunit "} + v3Global.rootp()->timeunit().ascii() + ";");
addComment(txtp, fl,
std::string{"timeprecision "} + v3Global.rootp()->timeprecision().ascii()
+ ";\n");
}

View File

@ -233,7 +233,7 @@ public:
if (candidate.empty()) {
return "";
} else {
return string("... Suggested alternative: '") + candidate + "'";
return std::string{"... Suggested alternative: '"} + candidate + "'";
}
}
static void selfTest();

View File

@ -379,7 +379,7 @@ private:
addToSubFunc(new AstTracePushNamePrefix{flp, m_traName});
for (int i = nodep->lo(); i <= nodep->hi(); ++i) {
VL_RESTORER(m_traValuep);
m_traName = string{"["} + cvtToStr(i) + string{"]"};
m_traName = std::string{"["} + cvtToStr(i) + std::string{"]"};
m_traValuep = m_traValuep->cloneTree(false);
m_traValuep = new AstArraySel{flp, m_traValuep, i - nodep->lo()};
m_traValuep->dtypep(subtypep);
@ -404,7 +404,7 @@ private:
addToSubFunc(new AstTracePushNamePrefix{flp, m_traName});
for (int i = nodep->lo(); i <= nodep->hi(); ++i) {
VL_RESTORER(m_traValuep);
m_traName = string{"["} + cvtToStr(i) + string{"]"};
m_traName = std::string{"["} + cvtToStr(i) + std::string{"]"};
const int lsb = (i - nodep->lo()) * subtypep->width();
m_traValuep = m_traValuep->cloneTree(false);
m_traValuep = new AstSel{flp, m_traValuep, lsb, subtypep->width()};

View File

@ -51,7 +51,7 @@ void mon_class_name(const char* namep) {
#endif
// Check the C's calling name of "" doesn't lead to extra dots in the name()
if (namep && namep[0] == '.')
vl_fatal(__FILE__, __LINE__, "", (std::string("Unexp class name ") + namep).c_str());
vl_fatal(__FILE__, __LINE__, "", (std::string{"Unexp class name "} + namep).c_str());
}
extern "C" void mon_scope_name(const char* namep);
@ -61,9 +61,9 @@ void mon_scope_name(const char* namep) {
VL_PRINTF("- mon_scope_name('%s', \"%s\");\n", modp, namep);
#endif
if (strcmp(namep, "t.sub"))
vl_fatal(__FILE__, __LINE__, "", (std::string("Unexp scope name ") + namep).c_str());
vl_fatal(__FILE__, __LINE__, "", (std::string{"Unexp scope name "} + namep).c_str());
if (strcmp(modp, "t.sub"))
vl_fatal(__FILE__, __LINE__, "", (std::string("Unexp dpiscope name ") + modp).c_str());
vl_fatal(__FILE__, __LINE__, "", (std::string{"Unexp dpiscope name "} + modp).c_str());
}
extern "C" void mon_register_b(const char* namep, int isOut);

View File

@ -56,7 +56,7 @@ Vt_embed1_child* __get_modelp() {
// Create the model
const char* scopenamep = svGetNameFromScope(scope);
if (!scopenamep) vl_fatal(__FILE__, __LINE__, __FILE__, "svGetNameFromScope failed");
__modelp = new Vt_embed1_child(scopenamep);
__modelp = new Vt_embed1_child{scopenamep};
if (svPutUserData(scope, &T_Embed_Child_Unique, __modelp)) {
vl_fatal(__FILE__, __LINE__, __FILE__, "svPutUserData failed");
}

View File

@ -25,7 +25,7 @@ int main()
#endif
{
Verilated::debug(0);
tb = new VM_PREFIX("tb");
tb = new VM_PREFIX{"tb"};
#ifdef SYSTEMC_VERSION
sc_signal<uint32_t> i3;

View File

@ -18,7 +18,7 @@ int main()
#endif
{
Verilated::debug(0);
tb = new VM_PREFIX("tb");
tb = new VM_PREFIX{"tb"};
tb->final();
VL_DO_DANGLING(delete tb, tb);

View File

@ -20,7 +20,7 @@ double sc_time_stamp() { return 0; }
int errors = 0;
int main(int argc, char* argv[]) {
Vt_multitop_sig* topp = new Vt_multitop_sig("");
Vt_multitop_sig* topp = new Vt_multitop_sig{""};
Verilated::debug(0);

View File

@ -9,7 +9,7 @@
VM_PREFIX* tb = nullptr;
int sc_main(int argc, char* argv[]) {
tb = new VM_PREFIX("tb");
tb = new VM_PREFIX{"tb"};
std::vector<sc_object*> ch = tb->get_child_objects();
bool found = false;

View File

@ -12,7 +12,7 @@ double sc_time_stamp() {
}
int main() {
tb = new VM_PREFIX("tb");
tb = new VM_PREFIX{"tb"};
tb->eval();
tb->eval();

View File

@ -26,7 +26,7 @@ double sc_time_stamp() { return (double)main_time; }
const unsigned long long dt_2 = 3;
int main(int argc, char** argv, char** env) {
VM_PREFIX* top = new VM_PREFIX("top");
VM_PREFIX* top = new VM_PREFIX{"top"};
Verilated::debug(0);
Verilated::traceEverOn(true);

View File

@ -33,8 +33,8 @@ int sc_main(int argc, char** argv) {
Verilated::traceEverOn(true);
Verilated::debug(0);
srand48(5);
ap = new VM_PREFIX("topa");
bp = new Vt_trace_two_b("topb");
ap = new VM_PREFIX{"topa"};
bp = new Vt_trace_two_b{"topb"};
ap->clk(clk);
bp->clk(clk);

View File

@ -36,7 +36,7 @@ int main() {
bool pass = true;
Verilated::debug(0);
tb = new VM_PREFIX("tb");
tb = new VM_PREFIX{"tb"};
// loop through every possibility and check the result
for (tb->SEL = 0; tb->SEL < 2; tb->SEL++) {

View File

@ -36,7 +36,7 @@ int main() {
bool pass = true;
Verilated::debug(0);
tb = new Vt_tri_inout("tb");
tb = new Vt_tri_inout{"tb"};
// loop through every possibility and check the result
for (tb->SEL = 0; tb->SEL < 2; tb->SEL++) {

View File

@ -34,7 +34,7 @@ void check(int d, int en, int exp0, int exp1, int expx, int expz) {
int main() {
Verilated::debug(0);
tb = new Vt_tri_inz("tb");
tb = new Vt_tri_inz{"tb"};
check(0, 1, 1, 0, 0, 0);
check(1, 1, 0, 1, 0, 0);
check(0, 0, 0, 0, 0, 1);

View File

@ -47,7 +47,7 @@ int main() {
bool pass = true;
Verilated::debug(0);
tb = new Vt_tri_pullup("tb");
tb = new Vt_tri_pullup{"tb"};
// loop through every possibility and check the result
for (tb->OE = 0; tb->OE < 2; tb->OE++) {

View File

@ -45,7 +45,7 @@ int main() {
bool pass = true;
Verilated::debug(0);
tb = new Vt_tri_select("tb");
tb = new Vt_tri_select{"tb"};
// loop through every possibility and check the result
for (tb->OE1 = 0; tb->OE1 < 2; tb->OE1++) {

View File

@ -22,7 +22,7 @@ double sc_time_stamp() { return main_time; }
int main(int argc, char** argv, char** env) {
Verilated::debug(0);
VM_PREFIX* topp = new VM_PREFIX(""); // Note null name - we're flattening it out
VM_PREFIX* topp = new VM_PREFIX{""}; // Note null name - we're flattening it out
main_time = 0;

View File

@ -9,7 +9,7 @@ VM_PREFIX* tb = nullptr;
int main() {
Verilated::debug(0);
tb = new VM_PREFIX("tb");
tb = new VM_PREFIX{"tb"};
VL_PRINTF("*-* All Finished *-*\n");
tb->final();
@ -18,7 +18,7 @@ int main() {
}
int sc_main(int argc, char* argv[]) {
tb = new VM_PREFIX("tb");
tb = new VM_PREFIX{"tb"};
VL_PRINTF("*-* All Finished *-*\n");
tb->final();

View File

@ -138,7 +138,7 @@ void _mem_check(const char* name, int size, int left, int right, int words) {
value.format = vpiBinStrVal;
vpi_get_value(mem_h, &value);
TEST_CHECK_Z(vpi_chk_error(&e));
TEST_CHECK_EQ(std::string(value.value.str), binStr);
TEST_CHECK_EQ(std::string{value.value.str}, binStr);
}
// don't care for non verilator

View File

@ -101,7 +101,7 @@ int check_param_int(std::string name, PLI_INT32 format, int exp_value, bool verb
p = vpi_get_str(vpiName, param_h);
CHECK_RESULT_CSTR(p, name.c_str());
p = vpi_get_str(vpiFullName, param_h);
CHECK_RESULT_CSTR(p, std::string("t." + name).c_str());
CHECK_RESULT_CSTR(p, std::string{"t." + name}.c_str());
p = vpi_get_str(vpiType, param_h);
CHECK_RESULT_CSTR(p, "vpiParameter");
vpi_type = vpi_get(vpiLocalParam, param_h);
@ -155,7 +155,7 @@ int check_param_str(std::string name, PLI_INT32 format, std::string exp_value, b
p = vpi_get_str(vpiName, param_h);
CHECK_RESULT_CSTR(p, name.c_str());
p = vpi_get_str(vpiFullName, param_h);
CHECK_RESULT_CSTR(p, std::string("t." + name).c_str());
CHECK_RESULT_CSTR(p, std::string{"t." + name}.c_str());
p = vpi_get_str(vpiType, param_h);
CHECK_RESULT_CSTR(p, "vpiParameter");
vpi_type = vpi_get(vpiLocalParam, param_h);

View File

@ -8,7 +8,7 @@
VM_PREFIX* tb = nullptr;
int sc_main(int argc, char* argv[]) {
tb = new VM_PREFIX("tb");
tb = new VM_PREFIX{"tb"};
VL_PRINTF("*-* All Finished *-*\n");
tb->final();

View File

@ -536,7 +536,7 @@ int _mon_check_putget_str(p_cb_data cb_data) {
CHECK_RESULT_CSTR(v.value.str, data[i].str.c_str());
} else {
data[i].type = v.format;
data[i].str = std::string(v.value.str);
data[i].str = std::string{v.value.str};
}
}

View File

@ -138,7 +138,7 @@ int main(int argc, char** argv, char** env) {
void* lib = dlopen(filenamep, RTLD_LAZY);
void* bootstrap = dlsym(lib, "vpi_compat_bootstrap");
if (!bootstrap) {
const std::string msg = std::string("%Error: Could not dlopen ") + filenamep;
const std::string msg = std::string{"%Error: Could not dlopen "} + filenamep;
vl_fatal(__FILE__, __LINE__, "main", msg.c_str());
}
((void (*)(void))bootstrap)();

View File

@ -84,7 +84,7 @@ void sim(VM_PREFIX* topp) {
}
std::string filename
= std::string(VL_STRINGIFY(TEST_OBJ_DIR) "/coverage_") + topp->name() + ".dat";
= std::string{VL_STRINGIFY(TEST_OBJ_DIR) "/coverage_"} + topp->name() + ".dat";
contextp->coveragep()->write(filename.c_str());
}

View File

@ -92,7 +92,7 @@ int main(int argc, char** argv, char** env) {
TEST_CHECK_EQ(sizeof(vlsint32_t), 4); // Intentional use of old typedef
TEST_CHECK_EQ(sizeof(vlsint64_t), 8); // Intentional use of old typedef
VM_PREFIX* topp = new VM_PREFIX();
VM_PREFIX* topp = new VM_PREFIX{};
topp->eval();
topp->clk = 0;

View File

@ -31,7 +31,7 @@ double sc_time_stamp() { return 0; }
// clang-format on
int main(int argc, const char** argv) {
VM_PREFIX* top = new VM_PREFIX();
VM_PREFIX* top = new VM_PREFIX{};
#if defined(T_X_ASSIGN_UNIQUE_0)
Verilated::randReset(0);