aboutsummaryrefslogtreecommitdiffstats
path: root/frontends
diff options
context:
space:
mode:
authorZachary Snow <zach@zachjs.com>2022-10-29 15:14:11 -0400
committerZachary Snow <zach@zachjs.com>2022-10-29 15:14:11 -0400
commit71e7e09092dc262b7cddbfc99e1b92e81ac58f21 (patch)
treef487fbfb87a81cd2ab8616db883078a91c50504c /frontends
parent31c15e5fa60b8cb47e7785fc420d90e860708034 (diff)
downloadyosys-71e7e09092dc262b7cddbfc99e1b92e81ac58f21.tar.gz
yosys-71e7e09092dc262b7cddbfc99e1b92e81ac58f21.tar.bz2
yosys-71e7e09092dc262b7cddbfc99e1b92e81ac58f21.zip
verilog: Support module-scoped task/function calls
This is primarily intended to enable the standard-permitted use of module-scoped identifiers to refer to tasks and non-constant functions. As a side-effect, this also adds support for the non-standard use of module-scoped identifiers referring to constant functions, a feature that is supported in some other tools, including Iverilog.
Diffstat (limited to 'frontends')
-rw-r--r--frontends/ast/simplify.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/frontends/ast/simplify.cc b/frontends/ast/simplify.cc
index 49bf9af09..c932e2c49 100644
--- a/frontends/ast/simplify.cc
+++ b/frontends/ast/simplify.cc
@@ -3656,6 +3656,8 @@ skip_dynamic_range_lvalue_expansion:;
goto apply_newNode;
}
+ if (current_scope.count(str) == 0)
+ str = try_pop_module_prefix();
if (current_scope.count(str) == 0 || current_scope[str]->type != AST_FUNCTION)
log_file_error(filename, location.first_line, "Can't resolve function name `%s'.\n", str.c_str());
}
@@ -3727,6 +3729,8 @@ skip_dynamic_range_lvalue_expansion:;
goto apply_newNode;
}
+ if (current_scope.count(str) == 0)
+ str = try_pop_module_prefix();
if (current_scope.count(str) == 0 || current_scope[str]->type != AST_TASK)
log_file_error(filename, location.first_line, "Can't resolve task name `%s'.\n", str.c_str());
}