From: Zachary Snow Date: Mon, 10 May 2021 15:06:02 +0000 (-0400) Subject: sv: check validity of package end label X-Git-Tag: yosys-0.10~211 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=445208086121ea343bdb80a9998637361c841bea;p=yosys.git sv: check validity of package end label --- diff --git a/frontends/verilog/verilog_parser.y b/frontends/verilog/verilog_parser.y index e4b3258c2..dd25f412f 100644 --- a/frontends/verilog/verilog_parser.y +++ b/frontends/verilog/verilog_parser.y @@ -579,6 +579,8 @@ package: append_attr(mod, $1); } ';' package_body TOK_ENDPACKAGE opt_label { ast_stack.pop_back(); + if ($4 != NULL && $9 != NULL && *$4 != *$9) + frontend_verilog_yyerror("Package name (%s) and end label (%s) don't match.", $4->c_str()+1, $9->c_str()+1); current_ast_mod = NULL; exitTypeScope(); }; diff --git a/tests/verilog/package_end_label.ys b/tests/verilog/package_end_label.ys new file mode 100644 index 000000000..ccc5c96e9 --- /dev/null +++ b/tests/verilog/package_end_label.ys @@ -0,0 +1,15 @@ +logger -expect-no-warnings +read_verilog -sv <