Add regression tests for implicit function/task import the unit scope

Check that implicit import of functions and tasks is supported if the
wildcard import statement is in the unit scope.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2023-06-11 09:15:09 -07:00
parent c1c4c28313
commit 542d80b1b1
3 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,28 @@
// Check that implicit imports of functions and tasks works if the wildcard
// import statement is in the unit scope.
package P;
function integer f(integer x);
return x * 2;
endfunction
task t(bit failed);
if (failed) begin
$display("FAILED");
end else begin
$display("PASSED");
end
endtask
endpackage
import P::*;
module test;
initial begin
t(f(10) !== 20);
end
endmodule

View File

@ -41,6 +41,7 @@ sv_array_cassign6 vvp_tests/sv_array_cassign6.json
sv_array_cassign7 vvp_tests/sv_array_cassign7.json
sv_foreach9 vvp_tests/sv_foreach9.json
sv_foreach10 vvp_tests/sv_foreach10.json
sv_wildcard_import8 vvp_tests/sv_wildcard_import8.json
sdf_header vvp_tests/sdf_header.json
task_return1 vvp_tests/task_return1.json
task_return2 vvp_tests/task_return2.json

View File

@ -0,0 +1,5 @@
{
"type" : "normal",
"source" : "sv_wildcard_import8.v",
"iverilog-args" : [ "-g2005-sv" ]
}