aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/verilog
diff options
context:
space:
mode:
authorDag Lem <dag@nimrod.no>2023-01-22 09:32:24 +0100
committerZachary Snow <zachary.j.snow@gmail.com>2023-01-29 13:51:44 -0500
commit26db5a11d3ab3657adb77f3a7d0cabbd19529033 (patch)
treef384728056fb62dc62752da3e5c472e801a963d3 /frontends/verilog
parentdb13c6df2bd0c0e471d380a3a72a3af83f6341fc (diff)
downloadyosys-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.y7
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) {