diff --git a/configure.ac b/configure.ac index 83be6f139..3c387976b 100644 --- a/configure.ac +++ b/configure.ac @@ -167,9 +167,11 @@ AC_DEFUN([_MY_CXX_CHECK_OPT], # Macros work such that first option that passes is the one we take # gnu++14 is the newest that Verilator supports # std++03 is the oldest that Verilator supports +_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++17) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++14) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++11) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=gnu++03) +_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++17) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++14) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++11) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_NEWEST,-std=c++03) @@ -179,6 +181,7 @@ AC_SUBST(CFG_CXXFLAGS_STD_NEWEST) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=std++03) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=std++11) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=std++14) +_MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=std++17) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=gnu++03) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=gnu++11) _MY_CXX_CHECK_SET(CFG_CXXFLAGS_STD_OLDEST,-std=gnu++14) @@ -218,6 +221,7 @@ AC_SUBST(CFG_CXXFLAGS_PARSER) _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-faligned-new) _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-fbracket-depth=4096) _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Qunused-arguments) +_MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-bool-operation) _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-parentheses-equality) _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-sign-compare) _MY_CXX_CHECK_OPT(CFG_CXXFLAGS_NO_UNUSED,-Wno-uninitialized) diff --git a/test_regress/driver.pl b/test_regress/driver.pl index b5fe0e257..61242fb1f 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -663,7 +663,7 @@ sub compile { elsif ($param{vlt}) { my @cmdargs = $self->compile_vlt_flags(%param); - if ($self->sc && !defined $ENV{SYSTEMC} && !defined $ENV{SYSTEMC_INCLUDE}) { + if ($self->sc && !$self->have_sc) { $self->skip("Test requires SystemC; ignore error since not installed\n"); return 1; } @@ -911,6 +911,12 @@ sub sc { return $self->{sc}; } +sub have_sc { + #my $self = shift; + return 1 if (defined $ENV{SYSTEMC} || defined $ENV{SYSTEMC_INCLUDE}); + return 0; +} + #---------------------------------------------------------------------- sub run { diff --git a/test_regress/t/t_param_public.cpp b/test_regress/t/t_param_public.cpp index 9bf79f879..c59102b17 100644 --- a/test_regress/t/t_param_public.cpp +++ b/test_regress/t/t_param_public.cpp @@ -16,7 +16,7 @@ int main (int argc, char *argv[]) { Verilated::debug(0); // Make sure public tag worked - if (static_cast(Vt_param_public_p::INPACK)) {} + if (static_cast(Vt_param_public_p::INPACK) != 0) {} for (int i = 0; i < 10; i++) { topp->eval(); diff --git a/test_regress/t/t_trace_ena_sc.pl b/test_regress/t/t_trace_ena_sc.pl index b2d4bc0c5..4f5d30882 100755 --- a/test_regress/t/t_trace_ena_sc.pl +++ b/test_regress/t/t_trace_ena_sc.pl @@ -7,21 +7,26 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di # Lesser General Public License Version 3 or the Perl Artistic License # Version 2.0. -top_filename("t/t_trace_ena.v"); +if (!$Self->have_sc) { + $Self->skip("No SystemC installed"); +} +else { + top_filename("t/t_trace_ena.v"); -compile ( - verilator_flags2 => ['-trace -sc'], - ); + compile ( + verilator_flags2 => ['-trace -sc'], + ); -execute ( - check_finished=>1, - ); + execute ( + check_finished=>1, + ); -if ($Self->{vlt}) { - # Note more checks in _cc.pl - file_grep ("$Self->{obj_dir}/simx.vcd", qr/\$enddefinitions/x); + if ($Self->{vlt}) { + # Note more checks in _cc.pl + file_grep ("$Self->{obj_dir}/simx.vcd", qr/\$enddefinitions/x); - vcd_identical("$Self->{obj_dir}/simx.vcd", "t/$Self->{name}.out"); + vcd_identical("$Self->{obj_dir}/simx.vcd", "t/$Self->{name}.out"); + } } ok(1); diff --git a/test_regress/t/t_verilated_all_newest.pl b/test_regress/t/t_verilated_all_newest.pl index 7bb138b9a..6e4f5eb51 100755 --- a/test_regress/t/t_verilated_all_newest.pl +++ b/test_regress/t/t_verilated_all_newest.pl @@ -14,6 +14,7 @@ my $root = ".."; compile ( # Can't use --coverage and --savable together, so cheat and compile inline verilator_flags2 => ['--cc --coverage-toggle --coverage-line --coverage-user --trace --vpi $root/include/verilated_save.cpp'], + make_flags => 'DRIVER_STD=newest', ); execute ( diff --git a/test_regress/t/t_vlcov_merge.pl b/test_regress/t/t_vlcov_merge.pl index c811644bd..da25bdd87 100755 --- a/test_regress/t/t_vlcov_merge.pl +++ b/test_regress/t/t_vlcov_merge.pl @@ -17,5 +17,14 @@ $Self->run(cmd=>["../bin/verilator_coverage", "t/t_vlcov_data_d.dat", ], ); -ok(files_identical("$Self->{obj_dir}/coverage.dat", "t/$Self->{name}.out")); + +# Older clib's didn't properly sort maps, but the coverage data doesn't +# really care about ordering. So avoid false failures by sorting. +$Self->run(cmd=>["sort", + "$Self->{obj_dir}/coverage.dat", + "> $Self->{obj_dir}/coverage-sort.dat", + ], + ); + +ok(files_identical("$Self->{obj_dir}/coverage-sort.dat", "t/$Self->{name}.out")); 1;