3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-24 13:18:56 +00:00

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.
This commit is contained in:
Zachary Snow 2022-10-29 15:14:11 -04:00
parent 31c15e5fa6
commit 71e7e09092
3 changed files with 52 additions and 0 deletions

View file

@ -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());
}