Tests: Add --debug-exit-parse

This commit is contained in:
Wilson Snyder 2020-06-08 22:10:55 -04:00
parent e2b40195b4
commit 6e2d8df9e5
4 changed files with 29 additions and 0 deletions

View File

@ -845,6 +845,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
else if (!strcmp(sw, "-debug-abort")) { V3Error::vlAbort(); } // Undocumented, see also --debug-sigsegv
else if ( onoff (sw, "-debug-check", flag/*ref*/)) { m_debugCheck = flag; }
else if ( onoff (sw, "-debug-collision", flag/*ref*/)) { m_debugCollision = flag; } // Undocumented
else if ( onoff (sw, "-debug-exit-parse", flag/*ref*/)) { m_debugExitParse = flag; } // Undocumented
else if ( onoff (sw, "-debug-leak", flag/*ref*/)) { m_debugLeak = flag; }
else if ( onoff (sw, "-debug-nondeterminism", flag/*ref*/)){ m_debugNondeterminism = flag; }
else if ( onoff (sw, "-debug-partition", flag/*ref*/)){ m_debugPartition = flag; } // Undocumented
@ -1552,6 +1553,7 @@ V3Options::V3Options() {
m_coverageUser = false;
m_debugCheck = false;
m_debugCollision = false;
m_debugExitParse = false;
m_debugLeak = true;
m_debugNondeterminism = false;
m_debugPartition = false;

View File

@ -239,6 +239,7 @@ private:
bool m_coverageUser; // main switch: --coverage-func
bool m_debugCheck; // main switch: --debug-check
bool m_debugCollision; // main switch: --debug-collision
bool m_debugExitParse; // main switch: --debug-exit-parse
bool m_debugLeak; // main switch: --debug-leak
bool m_debugNondeterminism; // main switch: --debug-nondeterminism
bool m_debugPartition; // main switch: --debug-partition
@ -438,6 +439,7 @@ public:
bool coverageUser() const { return m_coverageUser; }
bool debugCheck() const { return m_debugCheck; }
bool debugCollision() const { return m_debugCollision; }
bool debugExitParse() const { return m_debugExitParse; }
bool debugLeak() const { return m_debugLeak; }
bool debugNondeterminism() const { return m_debugNondeterminism; }
bool debugPartition() const { return m_debugPartition; }

View File

@ -104,6 +104,10 @@ static void process() {
// Sort modules by level so later algorithms don't need to care
V3LinkLevel::modSortByLevel();
V3Error::abortIfErrors();
if (v3Global.opt.debugExitParse()) {
cout << "--debug-exit-parse: Exiting after parse\n";
exit(0);
}
// Convert parseref's to varrefs, and other directly post parsing fixups
V3LinkParse::linkParse(v3Global.rootp());

View File

@ -0,0 +1,21 @@
#!/usr/bin/env perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2003 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(vlt => 1);
top_filename("t_EXAMPLE.v");
lint(
verilator_flags2 => ["--debug-exit-parse"],
expect => '--debug-exit-parse',
);
ok(1);
1;