diff options
author | Peter <peter@crozier.com> | 2020-03-03 19:30:54 +0000 |
---|---|---|
committer | Grazfather <grazfather@gmail.com> | 2020-03-22 18:20:46 -0700 |
commit | 0aaa36ca6d4a95771ef26a515b64031c4d43be11 (patch) | |
tree | 8025c93e5de530b08ccc4e60ca3e89d68f714d11 /frontends/verilog | |
parent | 6d8d6b402fafd31ef555415b9f4b9e17941337ea (diff) | |
download | yosys-0aaa36ca6d4a95771ef26a515b64031c4d43be11.tar.gz yosys-0aaa36ca6d4a95771ef26a515b64031c4d43be11.tar.bz2 yosys-0aaa36ca6d4a95771ef26a515b64031c4d43be11.zip |
Clear pkg_user_types if no packages following a 'design -reset-vlog'.
Diffstat (limited to 'frontends/verilog')
-rw-r--r-- | frontends/verilog/verilog_frontend.cc | 4 | ||||
-rw-r--r-- | frontends/verilog/verilog_parser.y | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/frontends/verilog/verilog_frontend.cc b/frontends/verilog/verilog_frontend.cc index de05d29a7..61db0a176 100644 --- a/frontends/verilog/verilog_frontend.cc +++ b/frontends/verilog/verilog_frontend.cc @@ -465,6 +465,10 @@ struct VerilogFrontend : public Frontend { log("-- Verilog code after preprocessor --\n%s-- END OF DUMP --\n", code_after_preproc.c_str()); lexin = new std::istringstream(code_after_preproc); } + if (design->verilog_packages.empty()) { + // might be because of a `design -reset-vlog` command + pkg_user_types.clear(); + } frontend_verilog_yyset_lineno(1); frontend_verilog_yyrestart(NULL); diff --git a/frontends/verilog/verilog_parser.y b/frontends/verilog/verilog_parser.y index 690dfdb6e..f7e3afd13 100644 --- a/frontends/verilog/verilog_parser.y +++ b/frontends/verilog/verilog_parser.y @@ -522,6 +522,7 @@ interface: ast_stack.pop_back(); log_assert(ast_stack.size() == 1); current_ast_mod = NULL; + user_types.clear(); }; interface_body: |