Add regression tests for nested function and final contexts
Check that statements that are not allowed in functions or final procedures are still rejected when they are placed in a named block scope. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
5b512e4f1e
commit
de415b2f03
|
|
@ -0,0 +1,12 @@
|
|||
// Check that final context is preserved when elaborating nested blocks.
|
||||
|
||||
module test;
|
||||
|
||||
task t;
|
||||
endtask
|
||||
|
||||
final begin : nested
|
||||
t;
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
// Check that function context is preserved when elaborating nested blocks.
|
||||
|
||||
module test;
|
||||
|
||||
reg x;
|
||||
integer y;
|
||||
|
||||
function integer f;
|
||||
input a;
|
||||
begin : nested
|
||||
x <= a;
|
||||
f = 0;
|
||||
end
|
||||
endfunction
|
||||
|
||||
initial begin
|
||||
y = f(1'b1);
|
||||
$display("FAILED");
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
|
@ -137,9 +137,11 @@ early_sig_elab3 vvp_tests/early_sig_elab3.json
|
|||
eofmt_percent vvp_tests/eofmt_percent.json
|
||||
fdisplay3 vvp_tests/fdisplay3.json
|
||||
final3 vvp_tests/final3.json
|
||||
final_nested_block_task_fail vvp_tests/final_nested_block_task_fail.json
|
||||
fmonitor1 vvp_tests/fmonitor1.json
|
||||
fmonitor2 vvp_tests/fmonitor2.json
|
||||
fread-error vvp_tests/fread-error.json
|
||||
func_nested_block_nb_fail vvp_tests/func_nested_block_nb_fail.json
|
||||
line_directive vvp_tests/line_directive.json
|
||||
localparam_type vvp_tests/localparam_type.json
|
||||
macro_str_esc vvp_tests/macro_str_esc.json
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"type" : "CE",
|
||||
"source" : "final_nested_block_task_fail.v",
|
||||
"iverilog-args" : [ "-g2009" ]
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"type" : "CE",
|
||||
"source" : "func_nested_block_nb_fail.v"
|
||||
}
|
||||
Loading…
Reference in New Issue