Internals: Add --debug-exit-elab; remove --debug-exit-uvm*

This commit is contained in:
Wilson Snyder 2025-12-08 18:02:46 -05:00
parent d0a5da2445
commit bd87dfc579
5 changed files with 13 additions and 27 deletions

View File

@ -1346,9 +1346,8 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc,
DECL_OPTION("-debug-check", OnOff, &m_debugCheck);
DECL_OPTION("-debug-collision", OnOff, &m_debugCollision).undocumented();
DECL_OPTION("-debug-emitv", OnOff, &m_debugEmitV).undocumented();
DECL_OPTION("-debug-exit-elab", OnOff, &m_debugExitElab).undocumented();
DECL_OPTION("-debug-exit-parse", OnOff, &m_debugExitParse).undocumented();
DECL_OPTION("-debug-exit-uvm", OnOff, &m_debugExitUvm).undocumented();
DECL_OPTION("-debug-exit-uvm23", OnOff, &m_debugExitUvm23).undocumented();
DECL_OPTION("-debug-fatalsrc", CbCall, []() {
v3fatalSrc("--debug-fatal-src");
}).undocumented(); // See also --debug-abort

View File

@ -234,9 +234,8 @@ private:
bool m_debugCheck = false; // main switch: --debug-check
bool m_debugCollision = false; // main switch: --debug-collision
bool m_debugEmitV = false; // main switch: --debug-emitv
bool m_debugExitElab = false; // main switch: --debug-exit-elab
bool m_debugExitParse = false; // main switch: --debug-exit-parse
bool m_debugExitUvm = false; // main switch: --debug-exit-uvm
bool m_debugExitUvm23 = false; // main switch: --debug-exit-uvm23
bool m_debugLeak = true; // main switch: --debug-leak
bool m_debugNondeterminism = false; // main switch: --debug-nondeterminism
bool m_debugOptions = false; // main switch: --debug-options
@ -512,9 +511,8 @@ public:
bool debugCheck() const VL_MT_SAFE { return m_debugCheck; }
bool debugCollision() const { return m_debugCollision; }
bool debugEmitV() const VL_MT_SAFE { return m_debugEmitV; }
bool debugExitElab() const { return m_debugExitElab; }
bool debugExitParse() const { return m_debugExitParse; }
bool debugExitUvm() const { return m_debugExitUvm; }
bool debugExitUvm23() const { return m_debugExitUvm23; }
bool debugLeak() const { return m_debugLeak; }
bool debugNondeterminism() const { return m_debugNondeterminism; }
bool debugPartition() const { return m_debugPartition; }

View File

@ -172,12 +172,6 @@ static void process() {
V3Error::abortIfErrors();
if (v3Global.opt.stats()) V3Stats::statsStageAll(v3Global.rootp(), "Link");
if (v3Global.opt.debugExitUvm23()) {
V3Error::abortIfErrors();
if (v3Global.opt.serializeOnly()) emitXmlOrJson();
cout << "--debug-exit-uvm23: Exiting after UVM-supported pass\n";
v3Global.vlExit(0);
}
// Remove parameters by cloning modules to de-parameterized versions
// This requires some width calculations and constant propagation
@ -204,12 +198,6 @@ static void process() {
return;
}
}
if (v3Global.opt.debugExitUvm()) {
V3Error::abortIfErrors();
if (v3Global.opt.serializeOnly()) emitXmlOrJson();
cout << "--debug-exit-uvm: Exiting after UVM-supported pass\n";
v3Global.vlExit(0);
}
// Calculate and check widths, edit tree to TRUNC/EXTRACT any width mismatches
V3Width::width(v3Global.rootp());
@ -224,6 +212,12 @@ static void process() {
// End of elaboration
V3Stats::addStatPerf(V3Stats::STAT_WALLTIME_ELAB, elabWallTime.deltaTime());
VlOs::DeltaWallTime cvtWallTime{true};
if (v3Global.opt.debugExitElab()) {
V3Error::abortIfErrors();
if (v3Global.opt.serializeOnly()) emitXmlOrJson();
cout << "--debug-exit-elab: Exiting after elaboration pass\n";
v3Global.vlExit(0);
}
// Coverage insertion
// Before we do dead code elimination and inlining, or we'll lose it.

View File

@ -1960,7 +1960,7 @@ class VlTest:
return True
def _run_output(self, data, logfh, tee):
if re.search(r'--debug-exit-uvm23: Exiting', str(data)):
if re.search(r'--debug-exit-.*: Exiting', str(data)):
self._force_pass = True
print("EXIT: " + str(data))
if tee:

View File

@ -10,15 +10,10 @@
import vltest_bootstrap
test.scenarios('vlt')
test.top_filename = "t_process.v"
test.top_filename = "t_EXAMPLE.v"
out_filename = test.obj_dir + "/V" + test.name + ".tree.json"
test.lint(verilator_flags2=["--debug-exit-elab"])
test.compile(verilator_flags2=["--debug-exit-uvm", "--json-only"],
make_main=False,
make_top_shell=False,
verilator_make_gmake=False)
test.file_grep(out_filename, r'.') # Exists
test.file_grep(test.compile_log_filename, r'--debug-exit-elab')
test.passes()