diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-12-27 03:40:27 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-12-27 03:40:27 +0100 |
commit | 7751c491fb08eccb13f2b5f5609d3fd6d2a8ffef (patch) | |
tree | 64e899935ccfa71289b8c69ba5ae2f9ddc9e0b34 /frontends/verilog/verilog_lexer.l | |
parent | 12ca6538a4e429ef318f47b5bb07f6a2a8dd2538 (diff) | |
download | yosys-7751c491fb08eccb13f2b5f5609d3fd6d2a8ffef.tar.gz yosys-7751c491fb08eccb13f2b5f5609d3fd6d2a8ffef.tar.bz2 yosys-7751c491fb08eccb13f2b5f5609d3fd6d2a8ffef.zip |
Improved some warning messages
Diffstat (limited to 'frontends/verilog/verilog_lexer.l')
-rw-r--r-- | frontends/verilog/verilog_lexer.l | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/frontends/verilog/verilog_lexer.l b/frontends/verilog/verilog_lexer.l index 74a66d964..42b5bf7ea 100644 --- a/frontends/verilog/verilog_lexer.l +++ b/frontends/verilog/verilog_lexer.l @@ -254,8 +254,12 @@ supply1 { return TOK_SUPPLY1; } } "/*"[ \t]*(synopsys|synthesis)[ \t]*translate_off[ \t]*"*/" { - log_warning("Found one of those horrible `(synopsys|synthesis) translate_off' comments.\n" - "It is strongly suggested to use `ifdef constructs instead!\n"); + static bool printed_warning = false; + if (!printed_warning) { + log_warning("Found one of those horrible `(synopsys|synthesis) translate_off' comments.\n" + "Yosys does support them but it is recommended to use `ifdef constructs instead!\n"); + printed_warning = true; + } BEGIN(SYNOPSYS_TRANSLATE_OFF); } <SYNOPSYS_TRANSLATE_OFF>. /* ignore synopsys translate_off body */ @@ -266,13 +270,21 @@ supply1 { return TOK_SUPPLY1; } BEGIN(SYNOPSYS_FLAGS); } <SYNOPSYS_FLAGS>full_case { - log_warning("Found one of those horrible `(synopsys|synthesis) full_case' comments.\n" - "It is strongly suggested to use verilog x-values and default branches instead!\n"); + static bool printed_warning = false; + if (!printed_warning) { + log_warning("Found one of those horrible `(synopsys|synthesis) full_case' comments.\n" + "Yosys does support them but it is recommended to use verilog `full_case' attributes instead!\n"); + printed_warning = true; + } return TOK_SYNOPSYS_FULL_CASE; } <SYNOPSYS_FLAGS>parallel_case { - log_warning("Found one of those horrible `(synopsys|synthesis) parallel_case' comments.\n" - "It is strongly suggested to use verilog `parallel_case' attributes instead!\n"); + static bool printed_warning = false; + if (!printed_warning) { + log_warning("Found one of those horrible `(synopsys|synthesis) parallel_case' comments.\n" + "Yosys does support them but it is recommended to use verilog `parallel_case' attributes instead!\n"); + printed_warning = true; + } return TOK_SYNOPSYS_PARALLEL_CASE; } <SYNOPSYS_FLAGS>. /* ignore everything else */ |