diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 6a300f141..c3970959b 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -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 diff --git a/src/V3Options.h b/src/V3Options.h index 476ea2289..304079ecd 100644 --- a/src/V3Options.h +++ b/src/V3Options.h @@ -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; } diff --git a/src/Verilator.cpp b/src/Verilator.cpp index 03c89f0ae..519096ee5 100644 --- a/src/Verilator.cpp +++ b/src/Verilator.cpp @@ -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. diff --git a/test_regress/driver.py b/test_regress/driver.py index 9b2983cda..2a6314cc8 100755 --- a/test_regress/driver.py +++ b/test_regress/driver.py @@ -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: diff --git a/test_regress/t/t_process_parse.py b/test_regress/t/t_debug_exit_elab.py similarity index 58% rename from test_regress/t/t_process_parse.py rename to test_regress/t/t_debug_exit_elab.py index 5bda0b542..837e2694f 100755 --- a/test_regress/t/t_process_parse.py +++ b/test_regress/t/t_debug_exit_elab.py @@ -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()