summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-11-09 11:02:20 +0100
committerClifford Wolf <clifford@clifford.at>2014-11-09 11:02:20 +0100
commit1e0f6b5ddbfc3a7bc30f2537decf45654e7f1524 (patch)
treefb85b0c0a95accfc503f2b5a32015b45a96698bb
parenta112b1093444429a1a55a90b73c58c8b7ffee1bc (diff)
Added "yosys -qq" to also quiet warning messages
-rw-r--r--kernel/driver.cc5
-rw-r--r--kernel/log.cc5
-rw-r--r--kernel/log.h1
-rwxr-xr-xtests/realmath/run-test.sh2
4 files changed, 9 insertions, 4 deletions
diff --git a/kernel/driver.cc b/kernel/driver.cc
index 8164fef2..7f466839 100644
--- a/kernel/driver.cc
+++ b/kernel/driver.cc
@@ -141,6 +141,8 @@ int main(int argc, char **argv)
}
break;
case 'q':
+ if (log_errfile == stderr)
+ log_quiet_warnings = true;
log_errfile = stderr;
break;
case 'v':
@@ -170,7 +172,8 @@ int main(int argc, char **argv)
fprintf(stderr, " suppress printing of footer (log hash, version, timing statistics)\n");
fprintf(stderr, "\n");
fprintf(stderr, " -q\n");
- fprintf(stderr, " quiet operation. only write error messages to console\n");
+ fprintf(stderr, " quiet operation. only write warnings and error messages to console\n");
+ fprintf(stderr, " use this option twice to also quiet warning messages\n");
fprintf(stderr, "\n");
fprintf(stderr, " -v <level>\n");
fprintf(stderr, " print log headers up to level <level> to the console. (implies -q)\n");
diff --git a/kernel/log.cc b/kernel/log.cc
index 9f9c4db9..0773429a 100644
--- a/kernel/log.cc
+++ b/kernel/log.cc
@@ -41,6 +41,7 @@ SHA1 *log_hasher = NULL;
bool log_time = false;
bool log_cmd_error_throw = false;
+bool log_quiet_warnings = false;
int log_verbose_level;
std::vector<int> header_count;
@@ -154,14 +155,14 @@ void logv_header(const char *format, va_list ap)
void logv_warning(const char *format, va_list ap)
{
- if (log_errfile != NULL)
+ if (log_errfile != NULL && !log_quiet_warnings)
log_files.push_back(log_errfile);
log("Warning: ");
logv(format, ap);
log_flush();
- if (log_errfile != NULL)
+ if (log_errfile != NULL && !log_quiet_warnings)
log_files.pop_back();
}
diff --git a/kernel/log.h b/kernel/log.h
index b69e2ee2..278e35b4 100644
--- a/kernel/log.h
+++ b/kernel/log.h
@@ -47,6 +47,7 @@ extern SHA1 *log_hasher;
extern bool log_time;
extern bool log_cmd_error_throw;
+extern bool log_quiet_warnings;
extern int log_verbose_level;
void logv(const char *format, va_list ap);
diff --git a/tests/realmath/run-test.sh b/tests/realmath/run-test.sh
index b8e222ad..0997ccb5 100755
--- a/tests/realmath/run-test.sh
+++ b/tests/realmath/run-test.sh
@@ -11,7 +11,7 @@ echo "running tests.."
for ((i = 0; i < 100; i++)); do
echo -n "[$i]"
idx=$( printf "%05d" $i )
- ../../../yosys -q uut_${idx}.ys
+ ../../../yosys -qq uut_${idx}.ys
iverilog -o uut_${idx}_tb uut_${idx}_tb.v uut_${idx}.v uut_${idx}_syn.v
./uut_${idx}_tb | tee uut_${idx}.err
if test -s uut_${idx}.err; then