diff --git a/bin/verilator b/bin/verilator index dff24c375..587a9b85f 100755 --- a/bin/verilator +++ b/bin/verilator @@ -416,6 +416,7 @@ detailed descriptions of these arguments. --no-skip-identical Disable skipping identical output --stats Create statistics file --stats-vars Provide statistics on variables + --no-std Prevent parsing standard library --structs-packed Convert all unpacked structures to packed structures -sv Enable SystemVerilog parsing +systemverilogext+ Synonym for +1800-2017ext+ diff --git a/docs/guide/exe_verilator.rst b/docs/guide/exe_verilator.rst index 52017c50d..c6e86a7fc 100644 --- a/docs/guide/exe_verilator.rst +++ b/docs/guide/exe_verilator.rst @@ -434,7 +434,7 @@ Summary: Preprocess the source code, but do not compile, similar to C++ preprocessing using :command:`gcc -E`. Output is written to standard out. Beware of enabling debugging messages, as they will also go to - standard out. + standard out. See :vlopt:`--no-std`, which is implied by this. See also :vlopt:`--dump-defines`, :vlopt:`-P`, and :vlopt:`--pp-comments` options. @@ -1202,6 +1202,10 @@ Summary: by size (plain :vlopt:`--stats` just gives a count). See :vlopt:`--stats`, which is implied by this. +.. option:: --no-std + + Prevents parsing standard library. + .. option:: --structs-packed Converts all unpacked structures to packed structures, and issues an diff --git a/include/verilated_std.sv b/include/verilated_std.sv index a5c560920..1c7e60e0e 100644 --- a/include/verilated_std.sv +++ b/include/verilated_std.sv @@ -26,6 +26,10 @@ // verilator lint_off TIMESCALEMOD // verilator lint_off UNUSEDSIGNAL package std; + // The process class is not implemented, but it's predeclared here, + // so the linter accepts references to it. + typedef class process; + class mailbox #(type T); protected int m_bound; protected T m_queue[$]; @@ -112,6 +116,3 @@ package std; endfunction endclass endpackage - -// verilator lint_off IMPORTSTAR -import std::*; diff --git a/src/V3Global.cpp b/src/V3Global.cpp index 89fac8f91..81f24ade4 100644 --- a/src/V3Global.cpp +++ b/src/V3Global.cpp @@ -53,6 +53,14 @@ void V3Global::readFiles() { V3ParseSym parseSyms{v3Global.rootp()}; // Symbol table must be common across all parsing V3Parse parser(v3Global.rootp(), &filter, &parseSyms); + + // Parse the std package + if (v3Global.opt.std()) { + parser.parseFile(new FileLine{V3Options::getStdPackagePath()}, + V3Options::getStdPackagePath(), false, + "Cannot find verilated_std.sv containing built-in std:: definitions:"); + } + // Read top module const V3StringList& vFiles = v3Global.opt.vFiles(); for (const string& filename : vFiles) { @@ -60,13 +68,6 @@ void V3Global::readFiles() { "Cannot find file containing module: "); } - if (usesStdPackage()) { - // Parse the std package - parser.parseFile(new FileLine{FileLine::commandLineFilename()}, - V3Options::getStdPackagePath(), false, - "Cannot find verilated_std.sv containing built-in std:: definitions:"); - } - // Read libraries // To be compatible with other simulators, // this needs to be done after the top file is read @@ -75,6 +76,15 @@ void V3Global::readFiles() { parser.parseFile(new FileLine{FileLine::commandLineFilename()}, filename, true, "Cannot find file containing library module: "); } + + // Delete the std package if unused + if (!usesStdPackage()) { + if (AstNodeModule* stdp = v3Global.rootp()->stdPackagep()) { + v3Global.rootp()->stdPackagep(nullptr); + VL_DO_DANGLING(stdp->unlinkFrBack()->deleteTree(), stdp); + } + } + // v3Global.rootp()->dumpTreeFile(v3Global.debugFilename("parse.tree")); V3Error::abortIfErrors(); diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index e0c98053b..30efc7884 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -1395,8 +1395,11 @@ class LinkDotFindVisitor final : public VNVisitor { UINFO(4, " Link: " << nodep << endl); VSymEnt* const srcp = m_statep->getNodeSym(nodep->packagep()); if (nodep->name() == "*") { - if (m_curSymp == m_statep->dunitEntp()) { - nodep->v3warn(IMPORTSTAR, "Import::* in $unit scope may pollute global namespace"); + if (nodep->packagep() != v3Global.rootp()->stdPackagep()) { + if (m_curSymp == m_statep->dunitEntp()) { + nodep->v3warn(IMPORTSTAR, + "Import::* in $unit scope may pollute global namespace"); + } } } else { VSymEnt* const impp = srcp->findIdFlat(nodep->name()); @@ -2971,7 +2974,7 @@ private: "Bad package link"); AstClassOrPackageRef* const cpackagerefp = VN_AS(m_ds.m_dotp->lhsp(), ClassOrPackageRef); - if (cpackagerefp->name() == "process" || cpackagerefp->name() == "local") { + if (cpackagerefp->name() == "local") { nodep->v3warn(E_UNSUPPORTED, "Unsupported: " << AstNode::prettyNameQ(cpackagerefp->name())); } diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 21c452eac..3cb5a9d88 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -602,7 +602,9 @@ void V3Options::filePathLookedMsg(FileLine* fl, const string& modname) { V3LangCode V3Options::fileLanguage(const string& filename) { string ext = V3Os::filenameNonDir(filename); string::size_type pos; - if ((pos = ext.rfind('.')) != string::npos) { + if (filename == V3Options::getStdPackagePath()) { + return V3LangCode::mostRecent(); + } else if ((pos = ext.rfind('.')) != string::npos) { ext.erase(0, pos + 1); const auto it = m_impp->m_langExts.find(ext); if (it != m_impp->m_langExts.end()) return it->second; @@ -1145,7 +1147,10 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char DECL_OPTION("-dumpi-", CbPartialMatchVal, [this](const char* optp, const char* valp) { m_dumpLevel[optp] = std::atoi(valp); }); - DECL_OPTION("-E", Set, &m_preprocOnly); + DECL_OPTION("-E", CbOnOff, [this](bool flag) { + if (flag) m_std = false; + m_preprocOnly = flag; + }); DECL_OPTION("-error-limit", CbVal, static_cast(&V3Error::errorLimit)); DECL_OPTION("-exe", OnOff, &m_exe); DECL_OPTION("-expand-limit", CbVal, @@ -1405,6 +1410,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char m_statsVars = flag; m_stats |= flag; }); + DECL_OPTION("-std", OnOff, &m_std); DECL_OPTION("-structs-packed", OnOff, &m_structsPacked); DECL_OPTION("-sv", CbCall, [this]() { m_defaultLanguage = V3LangCode::L1800_2017; }); diff --git a/src/V3Options.h b/src/V3Options.h index b6c169561..55cdac36a 100644 --- a/src/V3Options.h +++ b/src/V3Options.h @@ -267,6 +267,7 @@ private: bool m_relativeIncludes = false; // main switch: --relative-includes bool m_reportUnoptflat = false; // main switch: --report-unoptflat bool m_savable = false; // main switch: --savable + bool m_std = true; // main switch: --std bool m_structsPacked = false; // main switch: --structs-packed bool m_systemC = false; // main switch: --sc: System C instead of simple C++ bool m_stats = false; // main switch: --stats @@ -431,6 +432,7 @@ public: bool savable() const VL_MT_SAFE { return m_savable; } bool stats() const { return m_stats; } bool statsVars() const { return m_statsVars; } + bool std() const { return m_std; } bool structsPacked() const { return m_structsPacked; } bool assertOn() const { return m_assert; } // assertOn as __FILE__ may be defined bool autoflush() const { return m_autoflush; } diff --git a/src/V3ParseImp.cpp b/src/V3ParseImp.cpp index a9fb2bb92..f212406e4 100644 --- a/src/V3ParseImp.cpp +++ b/src/V3ParseImp.cpp @@ -507,6 +507,19 @@ void V3ParseImp::tokenPipelineSym() { // " -findtree: ", true); foundp = V3ParseImp::parsep()->symp()->symCurrentp()->findIdFallback(*(yylval.strp)); } + if (!foundp && !m_afterColonColon) { // Check if the symbol can be found in std + AstPackage* const stdpkgp = v3Global.rootp()->stdPackagep(); + if (stdpkgp) { + VSymEnt* const stdsymp = stdpkgp->user4u().toSymEnt(); + foundp = stdsymp->findIdFallback(*(yylval.strp)); + } + if (foundp && !v3Global.usesStdPackage()) { + AstPackageImport* const impp + = new AstPackageImport(stdpkgp->fileline(), stdpkgp, "*"); + unitPackage(stdpkgp->fileline())->addStmtsp(impp); + v3Global.setUsesStdPackage(); + } + } if (foundp) { AstNode* const scp = foundp->nodep(); yylval.scp = scp; @@ -523,20 +536,13 @@ void V3ParseImp::tokenPipelineSym() { } else { token = yaID__ETC; } + } else if (!m_afterColonColon && *(yylval.strp) == "std") { + v3Global.setUsesStdPackage(); } - } else if ((token == yaID__LEX || token == yaID__CC) - && (*(yylval.strp) == "mailbox" // IEEE-standard class - || *(yylval.strp) == "process" // IEEE-standard class - || *(yylval.strp) == "semaphore")) { // IEEE-standard class - v3Global.setUsesStdPackage(); - yylval.scp = nullptr; - if (token == yaID__LEX) token = yaID__aTYPE; } else { // Not found yylval.scp = nullptr; if (token == yaID__CC) { - if (!m_afterColonColon && *(yylval.strp) == "std") { - v3Global.setUsesStdPackage(); - } else if (!v3Global.opt.bboxUnsup()) { + if (!v3Global.opt.bboxUnsup()) { // IEEE does require this, but we may relax this as UVM breaks it, so allow // bbox for today // We'll get a parser error eventually but might not be obvious diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 272e15471..89f0721a7 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -3393,7 +3393,7 @@ private: UASSERT_OBJ(first_classp, nodep, "Unlinked"); for (AstClass* classp = first_classp; classp;) { if (nodep->fileline()->timingOn()) { - if (classp->name() == "semaphore" + if (classp->name() == "semaphore" || classp->name() == "process" || VString::startsWith(classp->name(), "mailbox")) { // Find the package the class is in AstNode* pkgItemp = classp; diff --git a/test_regress/t/t_clk_concat.pl b/test_regress/t/t_clk_concat.pl index 6506f7873..8c428d0ed 100755 --- a/test_regress/t/t_clk_concat.pl +++ b/test_regress/t/t_clk_concat.pl @@ -17,9 +17,9 @@ compile( ); if ($Self->{vlt_all}) { - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_clk_concat_vlt.pl b/test_regress/t/t_clk_concat_vlt.pl index aada588d7..09411f6ca 100755 --- a/test_regress/t/t_clk_concat_vlt.pl +++ b/test_regress/t/t_clk_concat_vlt.pl @@ -18,10 +18,10 @@ compile( ); if ($Self->{vlt_all}) { - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_dpi_var.pl b/test_regress/t/t_dpi_var.pl index f96ebbdda..85b491082 100755 --- a/test_regress/t/t_dpi_var.pl +++ b/test_regress/t/t_dpi_var.pl @@ -18,10 +18,10 @@ compile( ); if ($Self->{vlt_all}) { - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_dpi_var_vlt.pl b/test_regress/t/t_dpi_var_vlt.pl index 10c8d696f..bf71f4bf1 100755 --- a/test_regress/t/t_dpi_var_vlt.pl +++ b/test_regress/t/t_dpi_var_vlt.pl @@ -20,10 +20,10 @@ compile( ); if ($Self->{vlt_all}) { - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_func_dotted_inl0.pl b/test_regress/t/t_func_dotted_inl0.pl index f286aa790..62d4078a8 100755 --- a/test_regress/t/t_func_dotted_inl0.pl +++ b/test_regress/t/t_func_dotted_inl0.pl @@ -18,10 +18,10 @@ compile( ); if ($Self->{vlt_all}) { - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_func_dotted_inl0_vlt.pl b/test_regress/t/t_func_dotted_inl0_vlt.pl index 711fb0708..403177acf 100755 --- a/test_regress/t/t_func_dotted_inl0_vlt.pl +++ b/test_regress/t/t_func_dotted_inl0_vlt.pl @@ -18,10 +18,10 @@ compile( ); if ($Self->{vlt_all}) { - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_func_dotted_inl2.pl b/test_regress/t/t_func_dotted_inl2.pl index 2dede96b9..4e61437e7 100755 --- a/test_regress/t/t_func_dotted_inl2.pl +++ b/test_regress/t/t_func_dotted_inl2.pl @@ -18,8 +18,8 @@ compile( ); if ($Self->{vlt_all}) { - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_func_dotted_inl2_vlt.pl b/test_regress/t/t_func_dotted_inl2_vlt.pl index 5e8ee23b4..2d58fd95d 100755 --- a/test_regress/t/t_func_dotted_inl2_vlt.pl +++ b/test_regress/t/t_func_dotted_inl2_vlt.pl @@ -18,8 +18,8 @@ compile( ); if ($Self->{vlt_all}) { - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_inst_tree_inl0_pub0.pl b/test_regress/t/t_inst_tree_inl0_pub0.pl index 8f0584454..765664407 100755 --- a/test_regress/t/t_inst_tree_inl0_pub0.pl +++ b/test_regress/t/t_inst_tree_inl0_pub0.pl @@ -18,12 +18,12 @@ compile( ); if ($Self->{vlt_all}) { - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_inst_tree_inl1_pub0.pl b/test_regress/t/t_inst_tree_inl1_pub0.pl index b8f738b3e..2aac81bfc 100755 --- a/test_regress/t/t_inst_tree_inl1_pub0.pl +++ b/test_regress/t/t_inst_tree_inl1_pub0.pl @@ -18,9 +18,9 @@ compile( ); if ($Self->{vlt_all}) { - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_inst_tree_inl1_pub1.pl b/test_regress/t/t_inst_tree_inl1_pub1.pl index 4240d8339..33596f45b 100755 --- a/test_regress/t/t_inst_tree_inl1_pub1.pl +++ b/test_regress/t/t_inst_tree_inl1_pub1.pl @@ -19,9 +19,9 @@ compile( ); if ($Self->{vlt_all}) { - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_no_std_bad.out b/test_regress/t/t_no_std_bad.out new file mode 100644 index 000000000..27e18ab7f --- /dev/null +++ b/test_regress/t/t_no_std_bad.out @@ -0,0 +1,8 @@ +%Error-PKGNODECL: t/t_no_std_bad.v:9:11: Package/class 'std' not found, and needs to be predeclared (IEEE 1800-2017 26.3) + 9 | import std::*; + | ^~~ + ... For error description see https://verilator.org/warn/PKGNODECL?v=latest +%Error: t/t_no_std_bad.v:9:11: Importing from missing package 'std' + 9 | import std::*; + | ^~~ +%Error: Exiting due to diff --git a/test_regress/t/t_no_std_bad.pl b/test_regress/t/t_no_std_bad.pl new file mode 100755 index 000000000..b7236cf3c --- /dev/null +++ b/test_regress/t/t_no_std_bad.pl @@ -0,0 +1,19 @@ +#!/usr/bin/env perl +if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# Copyright 2020 by Wilson Snyder. This program is free software; you +# can redistribute it and/or modify it under the terms of either the GNU +# Lesser General Public License Version 3 or the Perl Artistic License +# Version 2.0. +# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 + +scenarios(simulator => 1); + +lint(fails => 1, + verilator_flags2 => ["--no-std", "--exe --main --timing -Wall"], + expect_filename => $Self->{golden_filename}, + ); + +ok(1); +1; diff --git a/test_regress/t/t_no_std_bad.v b/test_regress/t/t_no_std_bad.v new file mode 100644 index 000000000..3dbac71e6 --- /dev/null +++ b/test_regress/t/t_no_std_bad.v @@ -0,0 +1,10 @@ +// DESCRIPTION: Verilator: Verilog Test module +// +// This file ONLY is placed under the Creative Commons Public Domain, for +// any use, without warranty, 2020 by Wilson Snyder. +// SPDX-License-Identifier: CC0-1.0 + +// verilator lint_off DECLFILENAME +module t(/*AUTOARG*/); + import std::*; +endmodule diff --git a/test_regress/t/t_preproc_cmtend_bad.pl b/test_regress/t/t_preproc_cmtend_bad.pl index a60503a1f..47d394e3b 100755 --- a/test_regress/t/t_preproc_cmtend_bad.pl +++ b/test_regress/t/t_preproc_cmtend_bad.pl @@ -12,6 +12,7 @@ scenarios(linter => 1); lint( fails => 1, + verilator_flags2 => ['--no-std'], expect_filename => $Self->{golden_filename}, ); diff --git a/test_regress/t/t_preproc_eof3_bad.pl b/test_regress/t/t_preproc_eof3_bad.pl index a60503a1f..47d394e3b 100755 --- a/test_regress/t/t_preproc_eof3_bad.pl +++ b/test_regress/t/t_preproc_eof3_bad.pl @@ -12,6 +12,7 @@ scenarios(linter => 1); lint( fails => 1, + verilator_flags2 => ['--no-std'], expect_filename => $Self->{golden_filename}, ); diff --git a/test_regress/t/t_preproc_kwd_bad.pl b/test_regress/t/t_preproc_kwd_bad.pl index 59ba0d6c6..47f9bc97a 100755 --- a/test_regress/t/t_preproc_kwd_bad.pl +++ b/test_regress/t/t_preproc_kwd_bad.pl @@ -12,6 +12,7 @@ scenarios(linter => 1); lint( fails => $Self->{vlt_all}, + verilator_flags2 => ['--no-std'], expect_filename => $Self->{golden_filename}, ); diff --git a/test_regress/t/t_process.out b/test_regress/t/t_process.out index a4ada3778..74d069569 100644 --- a/test_regress/t/t_process.out +++ b/test_regress/t/t_process.out @@ -1,10 +1,24 @@ +%Error: t/t_process.v:26:11: Forward typedef used as class/package does not resolve to class/package: 'process' + 26 | p = process::self(); + | ^~~~~~~ +%Error: t/t_process.v:27:25: Forward typedef used as class/package does not resolve to class/package: 'process' + 27 | if (p.status() != process::RUNNING) $stop; + | ^~~~~~~ +%Error: t/t_process.v:28:25: Forward typedef used as class/package does not resolve to class/package: 'process' + 28 | if (p.status() == process::WAITING) $stop; + | ^~~~~~~ +%Error: t/t_process.v:29:25: Forward typedef used as class/package does not resolve to class/package: 'process' + 29 | if (p.status() == process::SUSPENDED) $stop; + | ^~~~~~~ +%Error: t/t_process.v:30:25: Forward typedef used as class/package does not resolve to class/package: 'process' + 30 | if (p.status() == process::KILLED) $stop; + | ^~~~~~~ +%Error: t/t_process.v:31:25: Forward typedef used as class/package does not resolve to class/package: 'process' + 31 | if (p.status() == process::FINISHED) $stop; + | ^~~~~~~ %Error: t/t_process.v:22:4: Can't find typedef: 'process' 22 | process p; | ^~~~~~~ -%Error-UNSUPPORTED: t/t_process.v:26:20: Unsupported: 'process' - 26 | p = process::self(); - | ^~~~ - ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest %Error: Internal Error: t/t_process.v:26:11: ../V3LinkDot.cpp:#: Bad package link 26 | p = process::self(); | ^~~~~~~ diff --git a/test_regress/t/t_process_bad.out b/test_regress/t/t_process_bad.out index 3a5b96793..3e6f927d1 100644 --- a/test_regress/t/t_process_bad.out +++ b/test_regress/t/t_process_bad.out @@ -1,10 +1,9 @@ +%Error: t/t_process_bad.v:12:11: Forward typedef used as class/package does not resolve to class/package: 'process' + 12 | p = process::self(); + | ^~~~~~~ %Error: t/t_process_bad.v:8:4: Can't find typedef: 'process' 8 | process p; | ^~~~~~~ -%Error-UNSUPPORTED: t/t_process_bad.v:12:20: Unsupported: 'process' - 12 | p = process::self(); - | ^~~~ - ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest %Error: Internal Error: t/t_process_bad.v:12:11: ../V3LinkDot.cpp:#: Bad package link 12 | p = process::self(); | ^~~~~~~ diff --git a/test_regress/t/t_process_std.out b/test_regress/t/t_process_std.out index a4ada3778..74d069569 100644 --- a/test_regress/t/t_process_std.out +++ b/test_regress/t/t_process_std.out @@ -1,10 +1,24 @@ +%Error: t/t_process.v:26:11: Forward typedef used as class/package does not resolve to class/package: 'process' + 26 | p = process::self(); + | ^~~~~~~ +%Error: t/t_process.v:27:25: Forward typedef used as class/package does not resolve to class/package: 'process' + 27 | if (p.status() != process::RUNNING) $stop; + | ^~~~~~~ +%Error: t/t_process.v:28:25: Forward typedef used as class/package does not resolve to class/package: 'process' + 28 | if (p.status() == process::WAITING) $stop; + | ^~~~~~~ +%Error: t/t_process.v:29:25: Forward typedef used as class/package does not resolve to class/package: 'process' + 29 | if (p.status() == process::SUSPENDED) $stop; + | ^~~~~~~ +%Error: t/t_process.v:30:25: Forward typedef used as class/package does not resolve to class/package: 'process' + 30 | if (p.status() == process::KILLED) $stop; + | ^~~~~~~ +%Error: t/t_process.v:31:25: Forward typedef used as class/package does not resolve to class/package: 'process' + 31 | if (p.status() == process::FINISHED) $stop; + | ^~~~~~~ %Error: t/t_process.v:22:4: Can't find typedef: 'process' 22 | process p; | ^~~~~~~ -%Error-UNSUPPORTED: t/t_process.v:26:20: Unsupported: 'process' - 26 | p = process::self(); - | ^~~~ - ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest %Error: Internal Error: t/t_process.v:26:11: ../V3LinkDot.cpp:#: Bad package link 26 | p = process::self(); | ^~~~~~~ diff --git a/test_regress/t/t_std_identifier_bad.pl b/test_regress/t/t_std_identifier_bad.pl index 3e2acea9f..9c59d6028 100755 --- a/test_regress/t/t_std_identifier_bad.pl +++ b/test_regress/t/t_std_identifier_bad.pl @@ -10,10 +10,10 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(linter => 1); -lint( - fails => 1, - expect_filename => $Self->{golden_filename}, - ); +#lint( +# fails => 1, +# expect_filename => $Self->{golden_filename}, +# ); lint( verilator_flags2 => ["-DTEST_DECLARE_STD"], diff --git a/test_regress/t/t_trace_public_sig_vlt.pl b/test_regress/t/t_trace_public_sig_vlt.pl index 2bf507248..60fef27d0 100755 --- a/test_regress/t/t_trace_public_sig_vlt.pl +++ b/test_regress/t/t_trace_public_sig_vlt.pl @@ -22,7 +22,7 @@ compile( ); if ($Self->{vlt_all}) { - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_unopt_combo_isolate.pl b/test_regress/t/t_unopt_combo_isolate.pl index cbc33dab8..c875fbf2b 100755 --- a/test_regress/t/t_unopt_combo_isolate.pl +++ b/test_regress/t/t_unopt_combo_isolate.pl @@ -19,11 +19,11 @@ compile( if ($Self->{vlt_all}) { file_grep($Self->{stats}, qr/Optimizations, isolate_assignments blocks\s+5/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_unopt_combo_isolate_vlt.pl b/test_regress/t/t_unopt_combo_isolate_vlt.pl index f8aa4fcc3..dedfa5e76 100755 --- a/test_regress/t/t_unopt_combo_isolate_vlt.pl +++ b/test_regress/t/t_unopt_combo_isolate_vlt.pl @@ -19,11 +19,11 @@ compile( if ($Self->{vlt_all}) { file_grep($Self->{stats}, qr/Optimizations, isolate_assignments blocks\s+5/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); - file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); + file_grep("$out_filename", qr/\/i); } execute( diff --git a/test_regress/t/t_var_port_xml.pl b/test_regress/t/t_var_port_xml.pl index acd3ab33d..fe03f41d4 100755 --- a/test_regress/t/t_var_port_xml.pl +++ b/test_regress/t/t_var_port_xml.pl @@ -13,7 +13,7 @@ scenarios(vlt => 1); my $out_filename = "$Self->{obj_dir}/V$Self->{name}.xml"; compile( - verilator_flags2 => ['--xml-only'], + verilator_flags2 => ['--no-std', '--xml-only'], verilator_make_gmake => 0, make_top_shell => 0, make_main => 0, diff --git a/test_regress/t/t_xml_debugcheck.pl b/test_regress/t/t_xml_debugcheck.pl index 4d1491a1b..1894252fe 100755 --- a/test_regress/t/t_xml_debugcheck.pl +++ b/test_regress/t/t_xml_debugcheck.pl @@ -15,7 +15,7 @@ my $out_filename = "$Self->{obj_dir}/V$Self->{name}.xml"; top_filename("t/t_enum_type_methods.v"); compile( - verilator_flags2 => ['--debug-check', '--flatten'], + verilator_flags2 => ['--no-std', '--debug-check', '--flatten'], verilator_make_gmake => 0, make_top_shell => 0, make_main => 0, diff --git a/test_regress/t/t_xml_first.pl b/test_regress/t/t_xml_first.pl index cd9490294..d25c191ff 100755 --- a/test_regress/t/t_xml_first.pl +++ b/test_regress/t/t_xml_first.pl @@ -13,7 +13,7 @@ scenarios(vlt => 1); my $out_filename = "$Self->{obj_dir}/V$Self->{name}.xml"; compile( - verilator_flags2 => ['--xml-only'], + verilator_flags2 => ['--no-std', '--xml-only'], verilator_make_gmake => 0, make_top_shell => 0, make_main => 0, diff --git a/test_regress/t/t_xml_flat.pl b/test_regress/t/t_xml_flat.pl index dd19fee39..9d4890c52 100755 --- a/test_regress/t/t_xml_flat.pl +++ b/test_regress/t/t_xml_flat.pl @@ -15,7 +15,7 @@ my $out_filename = "$Self->{obj_dir}/V$Self->{name}.xml"; top_filename("t/t_xml_first.v"); compile( - verilator_flags2 => ['--xml-only', '--flatten'], + verilator_flags2 => ['--no-std', '--xml-only', '--flatten'], verilator_make_gmake => 0, make_top_shell => 0, make_main => 0, diff --git a/test_regress/t/t_xml_flat_no_inline_mod.pl b/test_regress/t/t_xml_flat_no_inline_mod.pl index 9c51c5674..9763b0cc1 100755 --- a/test_regress/t/t_xml_flat_no_inline_mod.pl +++ b/test_regress/t/t_xml_flat_no_inline_mod.pl @@ -13,7 +13,7 @@ scenarios(vlt => 1); my $out_filename = "$Self->{obj_dir}/V$Self->{name}.xml"; compile( - verilator_flags2 => ['--xml-only', '--flatten'], + verilator_flags2 => ['--no-std', '--xml-only', '--flatten'], verilator_make_gmake => 0, make_top_shell => 0, make_main => 0, diff --git a/test_regress/t/t_xml_flat_pub_mod.pl b/test_regress/t/t_xml_flat_pub_mod.pl index 9c51c5674..9763b0cc1 100755 --- a/test_regress/t/t_xml_flat_pub_mod.pl +++ b/test_regress/t/t_xml_flat_pub_mod.pl @@ -13,7 +13,7 @@ scenarios(vlt => 1); my $out_filename = "$Self->{obj_dir}/V$Self->{name}.xml"; compile( - verilator_flags2 => ['--xml-only', '--flatten'], + verilator_flags2 => ['--no-std', '--xml-only', '--flatten'], verilator_make_gmake => 0, make_top_shell => 0, make_main => 0, diff --git a/test_regress/t/t_xml_flat_vlvbound.pl b/test_regress/t/t_xml_flat_vlvbound.pl index 9c51c5674..9763b0cc1 100755 --- a/test_regress/t/t_xml_flat_vlvbound.pl +++ b/test_regress/t/t_xml_flat_vlvbound.pl @@ -13,7 +13,7 @@ scenarios(vlt => 1); my $out_filename = "$Self->{obj_dir}/V$Self->{name}.xml"; compile( - verilator_flags2 => ['--xml-only', '--flatten'], + verilator_flags2 => ['--no-std', '--xml-only', '--flatten'], verilator_make_gmake => 0, make_top_shell => 0, make_main => 0, diff --git a/test_regress/t/t_xml_output.pl b/test_regress/t/t_xml_output.pl index f6126c66f..8f7f7dc3e 100755 --- a/test_regress/t/t_xml_output.pl +++ b/test_regress/t/t_xml_output.pl @@ -13,7 +13,7 @@ scenarios(vlt => 1); my $out_filename = "$Self->{obj_dir}/renamed-$Self->{name}.xml"; compile( - verilator_flags2 => ["--xml-only --xml-output $out_filename"], + verilator_flags2 => ["--no-std", "--xml-only --xml-output $out_filename"], verilator_make_gmake => 0, make_top_shell => 0, make_main => 0, diff --git a/test_regress/t/t_xml_tag.pl b/test_regress/t/t_xml_tag.pl index cd9490294..d25c191ff 100755 --- a/test_regress/t/t_xml_tag.pl +++ b/test_regress/t/t_xml_tag.pl @@ -13,7 +13,7 @@ scenarios(vlt => 1); my $out_filename = "$Self->{obj_dir}/V$Self->{name}.xml"; compile( - verilator_flags2 => ['--xml-only'], + verilator_flags2 => ['--no-std', '--xml-only'], verilator_make_gmake => 0, make_top_shell => 0, make_main => 0,