Support recursive function calls (#3267).

This commit is contained in:
Wilson Snyder 2023-09-15 20:46:31 -04:00
parent 26ed2a06a0
commit aa608472ae
9 changed files with 6 additions and 39 deletions

View File

@ -14,6 +14,7 @@ Verilator 5.015 devel
**Minor:**
* Add --no-trace-top to not trace top signals (#4412) (#4422). [Frans Skarman]
* Support recursive function calls (#3267).
* Support assignments of packed values to stream expressions on queues (#4401). [Ryszard Rozak, Antmicro Ltd]
* Support no-parentheses calls to static methods (#4432). [Krzysztof Boroński]
* Support 'let'.

View File

@ -5322,13 +5322,7 @@ private:
// Grab width from the output variable (if it's a function)
if (nodep->didWidth()) return;
if (nodep->doingWidth()) {
if (nodep->classMethod()) {
UINFO(5, "Recursive method call: " << nodep);
} else {
UINFO(5, "Recursive function or task call: " << nodep);
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Recursive function or task call: "
<< nodep->prettyNameQ());
}
UINFO(5, "Recursive function or task call: " << nodep);
nodep->recursive(true);
nodep->didWidth(true);
return;

View File

@ -1,6 +0,0 @@
%Error-UNSUPPORTED: t/t_func_recurse.v:9:27: Unsupported: Recursive function or task call: 'recurse_self'
: ... In instance t
9 | function automatic int recurse_self;
| ^~~~~~~~~~~~
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error: Exiting due to

View File

@ -11,13 +11,11 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(simulator => 1);
compile(
fails => $Self->{vlt_all},
expect_filename => $Self->{golden_filename},
);
execute(
check_finished => 1,
) if !$Self->{vlt_all};
);
ok(1);
1;

View File

@ -1,6 +0,0 @@
%Error-UNSUPPORTED: t/t_func_recurse2.v:9:27: Unsupported: Recursive function or task call: 'recurse_1'
: ... In instance t
9 | function automatic int recurse_1;
| ^~~~~~~~~
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error: Exiting due to

View File

@ -11,13 +11,11 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(simulator => 1);
compile(
fails => $Self->{vlt_all},
expect_filename => $Self->{golden_filename},
);
execute(
check_finished => 1,
) if !$Self->{vlt_all};
);
ok(1);
1;

View File

@ -1,8 +1,3 @@
%Error-UNSUPPORTED: t/t_func_recurse_param.v:9:27: Unsupported: Recursive function or task call: 'recurse_self'
: ... In instance t
9 | function automatic int recurse_self;
| ^~~~~~~~~~~~
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error: t/t_func_recurse_param.v:15:26: Expecting expression to be constant, but can't determine constant for FUNCREF 'recurse_self'
: ... In instance t
t/t_func_recurse_param.v:9:27: ... Location of non-constant FUNC 'recurse_self': Unsupported: Recursive constant functions

View File

@ -1,8 +1,3 @@
%Error-UNSUPPORTED: t/t_func_recurse_param_bad.v:9:27: Unsupported: Recursive function or task call: 'recurse_self'
: ... In instance t
9 | function automatic int recurse_self;
| ^~~~~~~~~~~~
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error: t/t_func_recurse_param_bad.v:15:26: Expecting expression to be constant, but can't determine constant for FUNCREF 'recurse_self'
: ... In instance t
t/t_func_recurse_param_bad.v:9:27: ... Location of non-constant FUNC 'recurse_self': Unsupported: Recursive constant functions

View File

@ -765,10 +765,8 @@ function void uvm_report_fatal(string id,
uvm_coreservice_t cs;
cs = uvm_coreservice_t::get();
top = cs.get_root();
//TODO issue #3267 - Support recursive functions
//TODO %Error-UNSUPPORTED: t/t_uvm_pkg_todo.vh:753:15: Unsupported: Recursive function or task call: 'uvm_report_fatal'
//TODO top.uvm_report_fatal(id, message, verbosity, filename, line, context_name,
//TODO report_enabled_checked);
top.uvm_report_fatal(id, message, verbosity, filename, line, context_name,
report_enabled_checked);
endfunction
function void uvm_process_report_message(uvm_report_message report_message);
uvm_root top;