From: Clifford Wolf Date: Sun, 9 Nov 2014 10:02:20 +0000 (+0100) Subject: Added "yosys -qq" to also quiet warning messages X-Git-Tag: yosys-0.5~278 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1e0f6b5ddbfc3a7bc30f2537decf45654e7f1524;p=yosys.git Added "yosys -qq" to also quiet warning messages --- diff --git a/kernel/driver.cc b/kernel/driver.cc index 8164fef28..7f466839c 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 \n"); fprintf(stderr, " print log headers up to level to the console. (implies -q)\n"); diff --git a/kernel/log.cc b/kernel/log.cc index 9f9c4db9f..0773429a6 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 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 b69e2ee2d..278e35b41 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 b8e222ad6..0997ccb5d 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