Add --error-limit option

git-svn-id: file://localhost/svn/verilator/trunk/verilator@1002 77ca24e4-aefa-0310-84f0-b9a241c72d87
This commit is contained in:
Wilson Snyder 2008-03-20 00:14:26 +00:00
parent 4fb8dcfd4e
commit b1565f5b89
5 changed files with 18 additions and 3 deletions

View File

@ -3,7 +3,7 @@ Revision history for Verilator
The contributors that suggested a given feature are shown in []. [by ...]
indicates the contributor was also the author of the fix; Thanks!
* Verilator 3.65****
* Verilator 3.66****
*** Add support for hard-coding VERILATOR_ROOT etc in the executables,
to enable easier use of Verilator RPMs. [Gunter Dannoritzer]
@ -12,6 +12,8 @@ indicates the contributor was also the author of the fix; Thanks!
*** Convert re-defining macro error to warning. [Stefan Thiede]
*** Add --error-limit option. [Stefan Thiede]
**** Fix genvar to be signed, so "< 0" works properly. [Niranjan Prabhu]
**** Fix assignments to inputs inside functions/tasks. [Patricio Kaplan]

View File

@ -190,6 +190,7 @@ descriptions in the next sections for more information.
--debug-check Enable debugging assertions
--dump-tree Enable dumping .tree files
-E Preprocess, but do not compile
--error-limit <value> Abort after this number of errors
--exe Link to create executable
-f <file> Parse options from a file
--help Display this help.
@ -348,6 +349,11 @@ Preprocess the source code, but do not compile, as with 'gcc -E'. Output
is written to standard out. Beware of enabling debugging messages, as they
will also go to standard out.
=item --error-limit <value>
After this number of errors or warnings are encountered, exit. Defaults to
50.
=item --exe
Generate a executable. You will also need to pass additional .cpp files on

View File

@ -243,8 +243,8 @@ void V3Error::incWarnings() {
void V3Error::incErrors() {
s_errCount++;
if (errorCount() == MAX_ERRORS) { // Not >= as would otherwise recurse
v3fatal ("Exiting due to too many errors encountered\n");
if (errorCount() == v3Global.opt.errorLimit()) { // Not >= as would otherwise recurse
v3fatal ("Exiting due to too many errors encountered; --error-limit="<<errorCount()<<endl);
}
}

View File

@ -506,6 +506,10 @@ void V3Options::parseOptsList(FileLine* fl, int argc, char** argv) {
cout <<endl;
exit(0);
}
else if ( !strcmp (sw, "-error-limit") ) {
shift;
m_inlineMult = atoi(argv[i]);
}
else if ( !strcmp (sw, "-inline-mult") ) {
shift;
m_inlineMult = atoi(argv[i]);
@ -770,6 +774,7 @@ V3Options::V3Options() {
m_traceDups = false;
m_underlineZero = false;
m_errorLimit = 50;
m_inlineMult = 2000;
m_outputSplit = 0;
m_outputSplitCFuncs = 0;

View File

@ -71,6 +71,7 @@ class V3Options {
bool m_traceDups; // main switch: --trace-dups
bool m_underlineZero;// main switch: --underline-zero
int m_errorLimit; // main switch: --error-limit
int m_inlineMult; // main switch: --inline-mult
int m_outputSplit; // main switch: --output-split
int m_outputSplitCFuncs;// main switch: --output-split-cfuncs
@ -160,6 +161,7 @@ class V3Options {
bool ignc() const { return m_ignc; }
bool inhibitSim() const { return m_inhibitSim; }
int errorLimit() const { return m_errorLimit; }
int inlineMult() const { return m_inlineMult; }
int outputSplit() const { return m_outputSplit; }
int outputSplitCFuncs() const { return m_outputSplitCFuncs; }