Add regression tests for invalid index component contexts
Consolidating variable dimensions and hierarchy indices into a shared grammar makes all index component forms parse in either context. Check that `+:` and `-:` indexed part selects are rejected as dimensions, and that `[]` and `[$:N]` are rejected as hierarchy indices. These forms were previously excluded by the context-specific grammar rules. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
cb3bf494f2
commit
2efe188b52
|
|
@ -0,0 +1,5 @@
|
|||
// Check that a descending indexed part select is not a dimension.
|
||||
|
||||
module test;
|
||||
reg value[1 -: 2];
|
||||
endmodule
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
// Check that an ascending indexed part select is not a dimension.
|
||||
|
||||
module test;
|
||||
reg value[0 +: 2];
|
||||
endmodule
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
// Check that an empty index is not allowed in a hierarchy identifier.
|
||||
|
||||
module test;
|
||||
reg [3:0] value;
|
||||
initial $display("%b", value[]);
|
||||
endmodule
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
// Check that a queue bound is not allowed in a hierarchy identifier.
|
||||
|
||||
module test;
|
||||
reg [3:0] value;
|
||||
initial $display("%b", value[$:1]);
|
||||
endmodule
|
||||
|
|
@ -137,6 +137,8 @@ dffsynth8 vvp_tests/dffsynth8.json
|
|||
dffsynth9 vvp_tests/dffsynth9.json
|
||||
dffsynth10 vvp_tests/dffsynth10.json
|
||||
dffsynth11 vvp_tests/dffsynth11.json
|
||||
dimension_idx_down_fail vvp_tests/dimension_idx_down_fail.json
|
||||
dimension_idx_up_fail vvp_tests/dimension_idx_up_fail.json
|
||||
drive_strength4 vvp_tests/drive_strength4.json
|
||||
dumpfile vvp_tests/dumpfile.json
|
||||
early_sig_elab1 vvp_tests/early_sig_elab1.json
|
||||
|
|
@ -150,6 +152,8 @@ 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
|
||||
hier_index_empty_fail vvp_tests/hier_index_empty_fail.json
|
||||
hier_index_queue_fail vvp_tests/hier_index_queue_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" : "dimension_idx_down_fail.v",
|
||||
"iverilog-args" : [ "-g2001" ]
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"type" : "CE",
|
||||
"source" : "dimension_idx_up_fail.v",
|
||||
"iverilog-args" : [ "-g2001" ]
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"type" : "CE",
|
||||
"source" : "hier_index_empty_fail.v",
|
||||
"iverilog-args" : [ "-g2005-sv" ]
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"type" : "CE",
|
||||
"source" : "hier_index_queue_fail.v",
|
||||
"iverilog-args" : [ "-g2005-sv" ]
|
||||
}
|
||||
Loading…
Reference in New Issue