diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-07-30 20:18:48 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-07-30 20:18:48 +0200 |
commit | 7daad40ca408732786d46fee8b5485bf45595807 (patch) | |
tree | 5458b6f3b56f50cca341b6f8962a73999f3e49bd /frontends | |
parent | 6400ae36489a7ada5419d7bc502934f6d05e69bb (diff) | |
download | yosys-7daad40ca408732786d46fee8b5485bf45595807.tar.gz yosys-7daad40ca408732786d46fee8b5485bf45595807.tar.bz2 yosys-7daad40ca408732786d46fee8b5485bf45595807.zip |
Fixed counting verilog line numbers for "// synopsys translate_off" sections
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/verilog/lexer.l | 6 | ||||
-rw-r--r-- | frontends/verilog/preproc.cc | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/frontends/verilog/lexer.l b/frontends/verilog/lexer.l index 0839f5cf9..00deeb0b4 100644 --- a/frontends/verilog/lexer.l +++ b/frontends/verilog/lexer.l @@ -74,21 +74,21 @@ namespace VERILOG_FRONTEND { %% -"`file_push "[^\n]* { +<INITIAL,SYNOPSYS_TRANSLATE_OFF>"`file_push "[^\n]* { fn_stack.push_back(current_filename); ln_stack.push_back(frontend_verilog_yyget_lineno()); current_filename = yytext+11; frontend_verilog_yyset_lineno(0); } -"`file_pop"[^\n]*\n { +<INITIAL,SYNOPSYS_TRANSLATE_OFF>"`file_pop"[^\n]*\n { current_filename = fn_stack.back(); fn_stack.pop_back(); frontend_verilog_yyset_lineno(ln_stack.back()); ln_stack.pop_back(); } -"`line"[ \t]+[^ \t\r\n]+[ \t]+\"[^ \r\n]+\"[^\r\n]*\n { +<INITIAL,SYNOPSYS_TRANSLATE_OFF>"`line"[ \t]+[^ \t\r\n]+[ \t]+\"[^ \r\n]+\"[^\r\n]*\n { char *p = yytext + 5; while (*p == ' ' || *p == '\t') p++; frontend_verilog_yyset_lineno(atoi(p)); diff --git a/frontends/verilog/preproc.cc b/frontends/verilog/preproc.cc index 9ff68822e..2cfa8ca76 100644 --- a/frontends/verilog/preproc.cc +++ b/frontends/verilog/preproc.cc @@ -300,7 +300,7 @@ std::string frontend_verilog_preproc(FILE *f, std::string filename, const std::m input_file(fp, fn); fclose(fp); } else - output_code.push_back("`file_notfound " + fn + "\n"); + output_code.push_back("`file_notfound " + fn); continue; } |