Tests: Temporary fix for (#2407)

This commit is contained in:
Wilson Snyder 2020-06-05 07:28:51 -04:00
parent c83b1478e1
commit 5a622fd9db
4 changed files with 61 additions and 68 deletions

View File

@ -2121,6 +2121,20 @@ sub files_identical {
}
}
sub files_identical_sorted {
my $self = (ref $_[0]? shift : $Self);
my $fn1 = shift;
my $fn2 = shift;
my $fn1_is_logfile = shift;
return 1 if $self->errors || $self->skips || $self->unsupporteds;
# Set LC_ALL as suggested in the sort manpage to avoid sort order
# changes from the locale.
setenv('LC_ALL', "C");
my $fn1sort = "$fn1.sort";
run(cmd => ["sort", "$fn1", "> $fn1sort"]);
return $self->files_identical($fn1sort, $fn2, $fn1_is_logfile);
}
sub copy_if_golden {
my $self = (ref $_[0]? shift : $Self);
my $fn1 = shift;

View File

@ -1,65 +1,48 @@
%Warning-SPLITVAR: t/t_split_var_1_bad.v:7:13: 'should_show_warning_global0' has split_var metacomment, but will not be split because it is not declared in a module.
7 | logic [7:0] should_show_warning_global0 /*verilator split_var*/ ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
... Use "/* verilator lint_off SPLITVAR */" and lint_on around source to disable this message.
%Warning-SPLITVAR: t/t_split_var_1_bad.v:8:13: 'should_show_warning_global1' has split_var metacomment, but will not be split because it is not declared in a module.
8 | logic [7:0] should_show_warning_global1 [1:0] /*verilator split_var*/ ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
%Warning-SPLITVAR: t/t_split_var_1_bad.v:11:16: 'should_show_warning_ifs0' has split_var metacomment, but will not be split because it is not declared in a module.
11 | logic [7:0] should_show_warning_ifs0 /*verilator split_var*/ ;
| ^~~~~~~~~~~~~~~~~~~~~~~~
%Warning-SPLITVAR: t/t_split_var_1_bad.v:12:16: 'should_show_warning_ifs1' has split_var metacomment, but will not be split because it is not declared in a module.
12 | logic [7:0] should_show_warning_ifs1 [1:0] /*verilator split_var*/ ;
| ^~~~~~~~~~~~~~~~~~~~~~~~
%Warning-SPLITVAR: t/t_split_var_1_bad.v:38:14: 'cannot_split1' has split_var metacomment but will not be split because it is accessed from another module via a dot.
38 | i_sub0.cannot_split1[0] = 0;
| ^~~~~~~~~~~~~
%Warning-SELRANGE: t/t_split_var_1_bad.v:83:33: Selection index out of range: 13 outside 12:10
: ... In instance t.i_sub3
83 | assign outwires[12] = inwires[13];
| ^
%Warning-WIDTH: t/t_split_var_1_bad.v:39:31: Operator ASSIGN expects 8 bits on the Assign RHS, but Assign RHS's FUNCREF 'bad_func' generates 32 bits.
: ... In instance t
39 | i_sub0.cannot_split1[1] = bad_func(addr, rd_data0);
| ^
%Error: t/t_split_var_1_bad.v:72:16: Illegal assignment of constant to unpacked array
: ... In instance t.i_sub2
72 | assign b = a[0];
| ^
%Warning-SPLITVAR: t/t_split_var_1_bad.v:51:31: 'cannot_split0' has split_var metacomment but will not be split because index cannot be determined statically.
: ... In instance t
: ... In instance t
: ... In instance t
: ... In instance t
: ... In instance t.i_sub0
51 | rd_data = cannot_split0[addr];
| ^~~~
%Warning-SPLITVAR: t/t_split_var_1_bad.v:83:34: 'inwires' has split_var metacomment but will not be split because index is out of range.
: ... In instance t.i_sub1
: ... In instance t.i_sub1
: ... In instance t.i_sub3
: ... In instance t.i_sub3
83 | assign outwires[12] = inwires[13];
| ^~
%Warning-SPLITVAR: t/t_split_var_1_bad.v:17:9: 'should_show_warning0' has split_var metacomment but will not be split because it is not an aggregate type of bit nor logic
: ... In instance t
17 | real should_show_warning0 /*verilator split_var*/ ;
| ^~~~~~~~~~~~~~~~~~~~
%Warning-SPLITVAR: t/t_split_var_1_bad.v:18:11: 'should_show_warning1' has split_var metacomment but will not be split because it is not an aggregate type of bit nor logic
: ... In instance t
18 | string should_show_warning1 /*verilator split_var*/ ;
| ^~~~~~~~~~~~~~~~~~~~
%Warning-SPLITVAR: t/t_split_var_1_bad.v:19:11: 'should_show_warning2' has split_var metacomment but will not be split because its bitwidth is 1
: ... In instance t
19 | wire should_show_warning2 /*verilator split_var*/ ;
| ^~~~~~~~~~~~~~~~~~~~
%Warning-SPLITVAR: t/t_split_var_1_bad.v:30:44: 'inout_port' has split_var metacomment but will not be split because it is an inout port
: ... In instance t
30 | function int bad_func(inout logic [3:0] inout_port /*verilator split_var*/ ,
: ... In instance t
: ... In instance t.i_sub2
... Use "/* verilator lint_off SPLITVAR */" and lint_on around source to disable this message.
| ^~~~~~~~~~
%Warning-SPLITVAR: t/t_split_var_1_bad.v:31:42: 'ref_port' has split_var metacomment but will not be split because it is a ref argument
: ... In instance t
31 | ref logic [7:0] ref_port /*verilator split_var*/ );
| ^~~~~~~~
%Warning-SPLITVAR: t/t_split_var_1_bad.v:57:11: 'cannot_split_genvar' has split_var metacomment but will not be split because it is not an aggregate type of bit nor logic
: ... In instance t.i_sub1
57 | genvar cannot_split_genvar /*verilator split_var*/ ;
| ^~~~~~~~~~~~~~~~~~~
%Warning-SPLITVAR: t/t_split_var_1_bad.v:60:29: 'cannot_split' has split_var metacomment but will not be split because its bit range cannot be determined statically.
: ... In instance t.i_sub1
60 | rd_data = cannot_split[addr];
| ^~
| ^
| ^
| ^~~~
| ^
| ^
| ^~~~~~~~~~~~~~~~~~~~~~~~
| ^~~~~~~~~~~~~~~~~~~~~~~~
| ^~~~~~~~~~~~~
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
| ^~~~~~~~~~~~~~~~~~~
| ^~~~~~~~~~~~~~~~~~~~
| ^~~~~~~~~~~~~~~~~~~~
| ^~~~~~~~~~~~~~~~~~~~
7 | logic [7:0] should_show_warning_global0 /*verilator split_var*/ ;
8 | logic [7:0] should_show_warning_global1 [1:0] /*verilator split_var*/ ;
11 | logic [7:0] should_show_warning_ifs0 /*verilator split_var*/ ;
12 | logic [7:0] should_show_warning_ifs1 [1:0] /*verilator split_var*/ ;
17 | real should_show_warning0 /*verilator split_var*/ ;
18 | string should_show_warning1 /*verilator split_var*/ ;
19 | wire should_show_warning2 /*verilator split_var*/ ;
30 | function int bad_func(inout logic [3:0] inout_port /*verilator split_var*/ ,
31 | ref logic [7:0] ref_port /*verilator split_var*/ );
38 | i_sub0.cannot_split1[0] = 0;
39 | i_sub0.cannot_split1[1] = bad_func(addr, rd_data0);
51 | rd_data = cannot_split0[addr];
57 | genvar cannot_split_genvar /*verilator split_var*/ ;
60 | rd_data = cannot_split[addr];
72 | assign b = a[0];
83 | assign outwires[12] = inwires[13];
83 | assign outwires[12] = inwires[13];
%Error: Exiting due to

View File

@ -13,8 +13,12 @@ scenarios(linter => 1);
lint(
fails => 1,
verilator_flags2 => ['--stats'],
expect_filename => $Self->{golden_filename},
# When issue-2407 resolved, decomment and update golden file
#expect_filename => $Self->{golden_filename},
);
# When issue-2407 resolved, remove
files_identical_sorted("$Self->{obj_dir}/vlt_compile.log", $Self->{golden_filename}, 1);
ok(1);
1;

View File

@ -22,15 +22,7 @@ run(cmd => ["../bin/verilator_coverage",
# Older clib's didn't properly sort maps, but the coverage data doesn't
# really care about ordering. So avoid false failures by sorting.
# Set LC_ALL as suggested in the sort manpage to avoid sort order
# changes from the locale.
setenv('LC_ALL', "C");
run(cmd => ["sort",
"$Self->{obj_dir}/coverage.dat",
"> $Self->{obj_dir}/coverage-sort.dat",
]);
files_identical("$Self->{obj_dir}/coverage-sort.dat", $Self->{golden_filename});
files_identical_sorted("$Self->{obj_dir}/coverage.dat", $Self->{golden_filename});
ok(1);
1;