From cb5466a90b03e37dae73a464ffaf1f6313a5e224 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 9 Sep 2023 11:54:55 -0400 Subject: [PATCH] Tests: UVM passes V3Param stage --- src/V3Options.cpp | 1 + src/V3Options.h | 2 ++ src/Verilator.cpp | 10 ++++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 3cf91c24f..bc08b0256 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -1173,6 +1173,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char DECL_OPTION("-debug-emitv", OnOff, &m_debugEmitV).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 702ff680b..f9ee897bb 100644 --- a/src/V3Options.h +++ b/src/V3Options.h @@ -236,6 +236,7 @@ private: bool m_debugEmitV = false; // main switch: --debug-emitv 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_debugPartition = false; // main switch: --debug-partition @@ -461,6 +462,7 @@ public: bool debugEmitV() const VL_MT_SAFE { return m_debugEmitV; } 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 243b4c4ae..57b8a90c0 100644 --- a/src/Verilator.cpp +++ b/src/Verilator.cpp @@ -143,16 +143,22 @@ static void process() { V3Error::abortIfErrors(); if (v3Global.opt.stats()) V3Stats::statsStageAll(v3Global.rootp(), "Link"); - if (v3Global.opt.debugExitUvm()) { + if (v3Global.opt.debugExitUvm23()) { V3Error::abortIfErrors(); if (v3Global.opt.xmlOnly()) V3EmitXml::emitxml(); - cout << "--debug-exit-uvm: Exiting after UVM-supported pass\n"; + cout << "--debug-exit-uvm23: Exiting after UVM-supported pass\n"; std::exit(0); } // Remove parameters by cloning modules to de-parameterized versions // This requires some width calculations and constant propagation V3Param::param(v3Global.rootp()); + if (v3Global.opt.debugExitUvm()) { + V3Error::abortIfErrors(); + if (v3Global.opt.xmlOnly()) V3EmitXml::emitxml(); + cout << "--debug-exit-uvm: Exiting after UVM-supported pass\n"; + std::exit(0); + } V3LinkDot::linkDotParamed(v3Global.rootp()); // Cleanup as made new modules V3LinkLValue::linkLValue(v3Global.rootp()); // Resolve new VarRefs V3Error::abortIfErrors();