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:
parent
c1c4c28313
commit
542d80b1b1
|
|
@ -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
|
||||||
|
|
@ -41,6 +41,7 @@ sv_array_cassign6 vvp_tests/sv_array_cassign6.json
|
||||||
sv_array_cassign7 vvp_tests/sv_array_cassign7.json
|
sv_array_cassign7 vvp_tests/sv_array_cassign7.json
|
||||||
sv_foreach9 vvp_tests/sv_foreach9.json
|
sv_foreach9 vvp_tests/sv_foreach9.json
|
||||||
sv_foreach10 vvp_tests/sv_foreach10.json
|
sv_foreach10 vvp_tests/sv_foreach10.json
|
||||||
|
sv_wildcard_import8 vvp_tests/sv_wildcard_import8.json
|
||||||
sdf_header vvp_tests/sdf_header.json
|
sdf_header vvp_tests/sdf_header.json
|
||||||
task_return1 vvp_tests/task_return1.json
|
task_return1 vvp_tests/task_return1.json
|
||||||
task_return2 vvp_tests/task_return2.json
|
task_return2 vvp_tests/task_return2.json
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"type" : "normal",
|
||||||
|
"source" : "sv_wildcard_import8.v",
|
||||||
|
"iverilog-args" : [ "-g2005-sv" ]
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue