diff options
author | Dag Lem <dag@nimrod.no> | 2023-01-22 09:32:24 +0100 |
---|---|---|
committer | Zachary Snow <zachary.j.snow@gmail.com> | 2023-01-29 13:51:44 -0500 |
commit | 26db5a11d3ab3657adb77f3a7d0cabbd19529033 (patch) | |
tree | f384728056fb62dc62752da3e5c472e801a963d3 /frontends/verilog | |
parent | db13c6df2bd0c0e471d380a3a72a3af83f6341fc (diff) | |
download | yosys-26db5a11d3ab3657adb77f3a7d0cabbd19529033.tar.gz yosys-26db5a11d3ab3657adb77f3a7d0cabbd19529033.tar.bz2 yosys-26db5a11d3ab3657adb77f3a7d0cabbd19529033.zip |
Resolve struct member package types
Diffstat (limited to 'frontends/verilog')
-rw-r--r-- | frontends/verilog/verilog_parser.y | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/frontends/verilog/verilog_parser.y b/frontends/verilog/verilog_parser.y index 70ee47561..87b50438a 100644 --- a/frontends/verilog/verilog_parser.y +++ b/frontends/verilog/verilog_parser.y @@ -173,6 +173,13 @@ static bool isInLocalScope(const std::string *name) static AstNode *getTypeDefinitionNode(std::string type_name) { + // check package types + if (type_name.find("::") != std::string::npos && pkg_user_types.count(type_name) > 0) { + auto typedef_node = pkg_user_types[type_name]; + log_assert(typedef_node->type == AST_TYPEDEF); + return typedef_node->children[0]; + } + // check current scope then outer scopes for a name for (auto it = user_type_stack.rbegin(); it != user_type_stack.rend(); ++it) { if (it->count(type_name) > 0) { |