From ab5d4bd51dbd409b54a689d8db6ce2dc9644de44 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Tue, 12 Jan 2021 18:09:56 -0500 Subject: [PATCH] Tests: Abstract out common test comparison --- test_regress/driver.pl | 6 ++++++ test_regress/t/t_cover_line_cc.pl | 3 ++- test_regress/t/t_cover_line_cc_vlt.pl | 3 ++- test_regress/t/t_display_noopt.pl | 2 +- test_regress/t/t_display_real_noopt.pl | 2 +- test_regress/t/t_display_signed_noopt.pl | 2 +- test_regress/t/t_dpi_arg_inout_type.pl | 8 +++----- test_regress/t/t_dpi_arg_inout_unpack.pl | 8 +++----- test_regress/t/t_dpi_arg_input_type.pl | 8 +++----- test_regress/t/t_dpi_arg_input_unpack.pl | 8 +++----- test_regress/t/t_dpi_arg_output_type.pl | 8 +++----- test_regress/t/t_dpi_arg_output_unpack.pl | 8 +++----- test_regress/t/t_dpi_result_type.pl | 8 +++----- test_regress/t/t_gen_genblk_noinl.pl | 3 ++- test_regress/t/t_interface_ref_trace_inla.pl | 2 +- test_regress/t/t_interface_ref_trace_inlab.pl | 2 +- test_regress/t/t_interface_ref_trace_inlb.pl | 2 +- test_regress/t/t_preproc_dos.pl | 2 +- test_regress/t/t_trace_array_fst_portable.pl | 2 +- test_regress/t/t_trace_array_fst_threads_1.pl | 2 +- test_regress/t/t_trace_array_fst_threads_2.pl | 2 +- test_regress/t/t_trace_complex_fst_threads_1.pl | 2 +- test_regress/t/t_trace_complex_fst_threads_2.pl | 2 +- test_regress/t/t_trace_complex_old_api.pl | 3 ++- test_regress/t/t_trace_complex_portable.pl | 3 ++- test_regress/t/t_trace_complex_threads_1.pl | 2 +- test_regress/t/t_trace_public_func.pl | 4 ++-- test_regress/t/t_trace_public_func_vlt.pl | 4 ++-- test_regress/t/t_trace_public_sig.pl | 4 ++-- test_regress/t/t_trace_public_sig_vlt.pl | 5 +++-- 30 files changed, 59 insertions(+), 61 deletions(-) diff --git a/test_regress/driver.pl b/test_regress/driver.pl index ff7c66fc1..9b94e8fc9 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -1385,6 +1385,12 @@ sub errors { return $self->{errors}; } +sub golden_filename { + my $self = (ref $_[0]? shift : $Self); + $self->{golden_filename} = shift if defined $_[0]; + return $self->{golden_filename}; +} + sub scenario_off { my $self = (ref $_[0]? shift : $Self); return $self->{scenario_off}; diff --git a/test_regress/t/t_cover_line_cc.pl b/test_regress/t/t_cover_line_cc.pl index 08a0a6f03..8c8d785ae 100755 --- a/test_regress/t/t_cover_line_cc.pl +++ b/test_regress/t/t_cover_line_cc.pl @@ -11,6 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(simulator => 1); top_filename("t/t_cover_line.v"); +golden_filename("t/t_cover_line.out"); compile( verilator_flags2 => ['--cc --coverage-line +define+ATTRIBUTE'], @@ -29,7 +30,7 @@ run(cmd => ["../bin/verilator_coverage", verilator_run => 1, ); -files_identical("$Self->{obj_dir}/annotated/t_cover_line.v", "t/t_cover_line.out"); +files_identical("$Self->{obj_dir}/annotated/t_cover_line.v", $Self->{golden_filename}); # Also try lcov run(cmd => ["../bin/verilator_coverage", diff --git a/test_regress/t/t_cover_line_cc_vlt.pl b/test_regress/t/t_cover_line_cc_vlt.pl index 1d21931e1..6b885fb8f 100755 --- a/test_regress/t/t_cover_line_cc_vlt.pl +++ b/test_regress/t/t_cover_line_cc_vlt.pl @@ -11,6 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(simulator => 1); top_filename("t/t_cover_line.v"); +golden_filename("t/t_cover_line.out"); compile( verilator_flags2 => ['--cc', '--coverage-line', "t/t_cover_line.vlt"], @@ -30,7 +31,7 @@ run(cmd => ["../bin/verilator_coverage", verilator_run => 1, ); -files_identical("$Self->{obj_dir}/annotated/t_cover_line.v", "t/t_cover_line.out"); +files_identical("$Self->{obj_dir}/annotated/t_cover_line.v", $Self->{golden_filename}); ok(1); 1; diff --git a/test_regress/t/t_display_noopt.pl b/test_regress/t/t_display_noopt.pl index 795598e65..ced4aa8a5 100755 --- a/test_regress/t/t_display_noopt.pl +++ b/test_regress/t/t_display_noopt.pl @@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(simulator => 1); top_filename("t/t_display.v"); -$Self->{golden_filename} = "t/t_display.out"; # Match unopt version +golden_filename("t/t_display.out"); compile( verilator_flags2 => ["-O0"], diff --git a/test_regress/t/t_display_real_noopt.pl b/test_regress/t/t_display_real_noopt.pl index 04d0a8222..a41a102e4 100755 --- a/test_regress/t/t_display_real_noopt.pl +++ b/test_regress/t/t_display_real_noopt.pl @@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(simulator => 1); top_filename("t/t_display_real.v"); -$Self->{golden_filename} = "t/t_display_real.out"; # Match unopt version +golden_filename("t/t_display_real.out"); compile( verilator_flags2 => ["-O0"], diff --git a/test_regress/t/t_display_signed_noopt.pl b/test_regress/t/t_display_signed_noopt.pl index 669394f5f..e113d374d 100755 --- a/test_regress/t/t_display_signed_noopt.pl +++ b/test_regress/t/t_display_signed_noopt.pl @@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(simulator => 1); top_filename("t/t_display_signed.v"); -$Self->{golden_filename} = "t/t_display_signed.out"; # Match unopt version +golden_filename("t/t_display_signed.out"); compile( verilator_flags2 => ["-O0"], diff --git a/test_regress/t/t_dpi_arg_inout_type.pl b/test_regress/t/t_dpi_arg_inout_type.pl index c885022e4..4bdfdef91 100755 --- a/test_regress/t/t_dpi_arg_inout_type.pl +++ b/test_regress/t/t_dpi_arg_inout_type.pl @@ -19,7 +19,7 @@ if ($Self->{nc}) { } compile( - v_flags2 => ["t/t_dpi_arg_inout_type.cpp"], + v_flags2 => ["t/$Self->{name}.cpp"], # --no-decoration so .out file doesn't comment on source lines verilator_flags2 => ["-Wall -Wno-DECLFILENAME --no-decoration"], # NC: Gdd the obj_dir to the C include path @@ -30,10 +30,8 @@ compile( ); if ($Self->{vlt_all}) { - files_identical( - "$Self->{obj_dir}/Vt_dpi_arg_inout_type__Dpi.h", - "t/t_dpi_arg_inout_type__Dpi.out" - ); + files_identical("$Self->{obj_dir}/$Self->{VM_PREFIX}__Dpi.h", + "t/$Self->{name}__Dpi.out"); } execute( diff --git a/test_regress/t/t_dpi_arg_inout_unpack.pl b/test_regress/t/t_dpi_arg_inout_unpack.pl index b46d023f8..ec76ba91c 100755 --- a/test_regress/t/t_dpi_arg_inout_unpack.pl +++ b/test_regress/t/t_dpi_arg_inout_unpack.pl @@ -19,7 +19,7 @@ if ($Self->{nc}) { } compile( - v_flags2 => ["t/t_dpi_arg_inout_unpack.cpp"], + v_flags2 => ["t/$Self->{name}.cpp"], # --no-decoration so .out file doesn't comment on source lines verilator_flags2 => ["-Wall -Wno-DECLFILENAME --no-decoration"], # NC: Gdd the obj_dir to the C include path @@ -30,10 +30,8 @@ compile( ); if ($Self->{vlt_all}) { - files_identical( - "$Self->{obj_dir}/Vt_dpi_arg_inout_unpack__Dpi.h", - "t/t_dpi_arg_inout_unpack__Dpi.out" - ); + files_identical("$Self->{obj_dir}/$Self->{VM_PREFIX}__Dpi.h", + "t/$Self->{name}__Dpi.out"); } execute( diff --git a/test_regress/t/t_dpi_arg_input_type.pl b/test_regress/t/t_dpi_arg_input_type.pl index 8c609be40..4bdfdef91 100755 --- a/test_regress/t/t_dpi_arg_input_type.pl +++ b/test_regress/t/t_dpi_arg_input_type.pl @@ -19,7 +19,7 @@ if ($Self->{nc}) { } compile( - v_flags2 => ["t/t_dpi_arg_input_type.cpp"], + v_flags2 => ["t/$Self->{name}.cpp"], # --no-decoration so .out file doesn't comment on source lines verilator_flags2 => ["-Wall -Wno-DECLFILENAME --no-decoration"], # NC: Gdd the obj_dir to the C include path @@ -30,10 +30,8 @@ compile( ); if ($Self->{vlt_all}) { - files_identical( - "$Self->{obj_dir}/Vt_dpi_arg_input_type__Dpi.h", - "t/t_dpi_arg_input_type__Dpi.out" - ); + files_identical("$Self->{obj_dir}/$Self->{VM_PREFIX}__Dpi.h", + "t/$Self->{name}__Dpi.out"); } execute( diff --git a/test_regress/t/t_dpi_arg_input_unpack.pl b/test_regress/t/t_dpi_arg_input_unpack.pl index f6772ebcc..ec76ba91c 100755 --- a/test_regress/t/t_dpi_arg_input_unpack.pl +++ b/test_regress/t/t_dpi_arg_input_unpack.pl @@ -19,7 +19,7 @@ if ($Self->{nc}) { } compile( - v_flags2 => ["t/t_dpi_arg_input_unpack.cpp"], + v_flags2 => ["t/$Self->{name}.cpp"], # --no-decoration so .out file doesn't comment on source lines verilator_flags2 => ["-Wall -Wno-DECLFILENAME --no-decoration"], # NC: Gdd the obj_dir to the C include path @@ -30,10 +30,8 @@ compile( ); if ($Self->{vlt_all}) { - files_identical( - "$Self->{obj_dir}/Vt_dpi_arg_input_unpack__Dpi.h", - "t/t_dpi_arg_input_unpack__Dpi.out" - ); + files_identical("$Self->{obj_dir}/$Self->{VM_PREFIX}__Dpi.h", + "t/$Self->{name}__Dpi.out"); } execute( diff --git a/test_regress/t/t_dpi_arg_output_type.pl b/test_regress/t/t_dpi_arg_output_type.pl index d469bfc8a..4bdfdef91 100755 --- a/test_regress/t/t_dpi_arg_output_type.pl +++ b/test_regress/t/t_dpi_arg_output_type.pl @@ -19,7 +19,7 @@ if ($Self->{nc}) { } compile( - v_flags2 => ["t/t_dpi_arg_output_type.cpp"], + v_flags2 => ["t/$Self->{name}.cpp"], # --no-decoration so .out file doesn't comment on source lines verilator_flags2 => ["-Wall -Wno-DECLFILENAME --no-decoration"], # NC: Gdd the obj_dir to the C include path @@ -30,10 +30,8 @@ compile( ); if ($Self->{vlt_all}) { - files_identical( - "$Self->{obj_dir}/Vt_dpi_arg_output_type__Dpi.h", - "t/t_dpi_arg_output_type__Dpi.out" - ); + files_identical("$Self->{obj_dir}/$Self->{VM_PREFIX}__Dpi.h", + "t/$Self->{name}__Dpi.out"); } execute( diff --git a/test_regress/t/t_dpi_arg_output_unpack.pl b/test_regress/t/t_dpi_arg_output_unpack.pl index c4b0c26de..ec76ba91c 100755 --- a/test_regress/t/t_dpi_arg_output_unpack.pl +++ b/test_regress/t/t_dpi_arg_output_unpack.pl @@ -19,7 +19,7 @@ if ($Self->{nc}) { } compile( - v_flags2 => ["t/t_dpi_arg_output_unpack.cpp"], + v_flags2 => ["t/$Self->{name}.cpp"], # --no-decoration so .out file doesn't comment on source lines verilator_flags2 => ["-Wall -Wno-DECLFILENAME --no-decoration"], # NC: Gdd the obj_dir to the C include path @@ -30,10 +30,8 @@ compile( ); if ($Self->{vlt_all}) { - files_identical( - "$Self->{obj_dir}/Vt_dpi_arg_output_unpack__Dpi.h", - "t/t_dpi_arg_output_unpack__Dpi.out" - ); + files_identical("$Self->{obj_dir}/$Self->{VM_PREFIX}__Dpi.h", + "t/$Self->{name}__Dpi.out"); } execute( diff --git a/test_regress/t/t_dpi_result_type.pl b/test_regress/t/t_dpi_result_type.pl index 7796879c7..4bdfdef91 100755 --- a/test_regress/t/t_dpi_result_type.pl +++ b/test_regress/t/t_dpi_result_type.pl @@ -19,7 +19,7 @@ if ($Self->{nc}) { } compile( - v_flags2 => ["t/t_dpi_result_type.cpp"], + v_flags2 => ["t/$Self->{name}.cpp"], # --no-decoration so .out file doesn't comment on source lines verilator_flags2 => ["-Wall -Wno-DECLFILENAME --no-decoration"], # NC: Gdd the obj_dir to the C include path @@ -30,10 +30,8 @@ compile( ); if ($Self->{vlt_all}) { - files_identical( - "$Self->{obj_dir}/Vt_dpi_result_type__Dpi.h", - "t/t_dpi_result_type__Dpi.out" - ); + files_identical("$Self->{obj_dir}/$Self->{VM_PREFIX}__Dpi.h", + "t/$Self->{name}__Dpi.out"); } execute( diff --git a/test_regress/t/t_gen_genblk_noinl.pl b/test_regress/t/t_gen_genblk_noinl.pl index 86adb4a8e..7574a1cfb 100755 --- a/test_regress/t/t_gen_genblk_noinl.pl +++ b/test_regress/t/t_gen_genblk_noinl.pl @@ -9,6 +9,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 top_filename("t_gen_genblk.v"); +golden_filename("t/t_gen_genblk.out"); scenarios(simulator => 1); @@ -19,7 +20,7 @@ compile( ); execute( - expect_filename => "t/t_gen_genblk.out", + expect_filename => $Self->{golden_filename}, ); ok(1); diff --git a/test_regress/t/t_interface_ref_trace_inla.pl b/test_regress/t/t_interface_ref_trace_inla.pl index bbcf8c7d1..60ba35eb9 100755 --- a/test_regress/t/t_interface_ref_trace_inla.pl +++ b/test_regress/t/t_interface_ref_trace_inla.pl @@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(simulator => 1); top_filename("t/t_interface_ref_trace.v"); -$Self->{golden_filename} = "t/t_interface_ref_trace.out"; +golden_filename("t/t_interface_ref_trace.out"); compile( v_flags2 => ['+define+NO_INLINE_A'], diff --git a/test_regress/t/t_interface_ref_trace_inlab.pl b/test_regress/t/t_interface_ref_trace_inlab.pl index 35e91ccf0..68d5d7a0e 100755 --- a/test_regress/t/t_interface_ref_trace_inlab.pl +++ b/test_regress/t/t_interface_ref_trace_inlab.pl @@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(simulator => 1); top_filename("t/t_interface_ref_trace.v"); -$Self->{golden_filename} = "t/t_interface_ref_trace.out"; +golden_filename("t/t_interface_ref_trace.out"); compile( v_flags2 => ['+define+NO_INLINE_A +define+NO_INLINE_B'], diff --git a/test_regress/t/t_interface_ref_trace_inlb.pl b/test_regress/t/t_interface_ref_trace_inlb.pl index fd06fd865..10e5c5036 100755 --- a/test_regress/t/t_interface_ref_trace_inlb.pl +++ b/test_regress/t/t_interface_ref_trace_inlb.pl @@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(simulator => 1); top_filename("t/t_interface_ref_trace.v"); -$Self->{golden_filename} = "t/t_interface_ref_trace.out"; +golden_filename("t/t_interface_ref_trace.out"); compile( v_flags2 => ['+define+NO_INLINE_B'], diff --git a/test_regress/t/t_preproc_dos.pl b/test_regress/t/t_preproc_dos.pl index 166adf78f..a32871293 100755 --- a/test_regress/t/t_preproc_dos.pl +++ b/test_regress/t/t_preproc_dos.pl @@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(vlt => 1); top_filename("$Self->{obj_dir}/$Self->{name}.v"); -$Self->{golden_filename} = "$Self->{obj_dir}/$Self->{name}.out"; +golden_filename("$Self->{obj_dir}/$Self->{name}.out"); # Rather then having to maintain a new .v and .out, simply add returns # to all lines of the existing t_preproc test. diff --git a/test_regress/t/t_trace_array_fst_portable.pl b/test_regress/t/t_trace_array_fst_portable.pl index f182ef1b7..3a34b9113 100755 --- a/test_regress/t/t_trace_array_fst_portable.pl +++ b/test_regress/t/t_trace_array_fst_portable.pl @@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(vlt => 1); top_filename("t/t_trace_array.v"); -$Self->{golden_filename} = "t/t_trace_array_fst.out"; +golden_filename("t/t_trace_array_fst.out"); compile( verilator_flags2 => ['--cc --trace-fst --trace-structs', diff --git a/test_regress/t/t_trace_array_fst_threads_1.pl b/test_regress/t/t_trace_array_fst_threads_1.pl index 0be5ffbc2..c75beb0ca 100755 --- a/test_regress/t/t_trace_array_fst_threads_1.pl +++ b/test_regress/t/t_trace_array_fst_threads_1.pl @@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(vlt => 1); top_filename("t/t_trace_array.v"); -$Self->{golden_filename} = "t/t_trace_array_fst.out"; +golden_filename("t/t_trace_array_fst.out"); compile( verilator_flags2 => ['--cc --trace-fst --trace-threads 1 --trace-structs'], diff --git a/test_regress/t/t_trace_array_fst_threads_2.pl b/test_regress/t/t_trace_array_fst_threads_2.pl index e20a9056b..75bbc7391 100755 --- a/test_regress/t/t_trace_array_fst_threads_2.pl +++ b/test_regress/t/t_trace_array_fst_threads_2.pl @@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(vlt => 1); top_filename("t/t_trace_array.v"); -$Self->{golden_filename} = "t/t_trace_array_fst.out"; +golden_filename("t/t_trace_array_fst.out"); compile( verilator_flags2 => ['--cc --trace-fst --trace-threads 2 --trace-structs'], diff --git a/test_regress/t/t_trace_complex_fst_threads_1.pl b/test_regress/t/t_trace_complex_fst_threads_1.pl index e38cce31c..a43a89337 100755 --- a/test_regress/t/t_trace_complex_fst_threads_1.pl +++ b/test_regress/t/t_trace_complex_fst_threads_1.pl @@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(simulator => 1); top_filename("t/t_trace_complex.v"); -$Self->{golden_filename} = "t/t_trace_complex_fst.out"; +golden_filename("t/t_trace_complex_fst.out"); compile( verilator_flags2 => ['--cc --trace-fst --trace-threads 1'], diff --git a/test_regress/t/t_trace_complex_fst_threads_2.pl b/test_regress/t/t_trace_complex_fst_threads_2.pl index 72d74d432..b2c4721c7 100755 --- a/test_regress/t/t_trace_complex_fst_threads_2.pl +++ b/test_regress/t/t_trace_complex_fst_threads_2.pl @@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(simulator => 1); top_filename("t/t_trace_complex.v"); -$Self->{golden_filename} = "t/t_trace_complex_fst.out"; +golden_filename("t/t_trace_complex_fst.out"); compile( verilator_flags2 => ['--cc --trace-fst --trace-threads 2'], diff --git a/test_regress/t/t_trace_complex_old_api.pl b/test_regress/t/t_trace_complex_old_api.pl index f1b4027b6..bdf9a0dec 100755 --- a/test_regress/t/t_trace_complex_old_api.pl +++ b/test_regress/t/t_trace_complex_old_api.pl @@ -13,6 +13,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(vlt => 1); top_filename("t/t_trace_complex.v"); +golden_filename("t/t_trace_complex.out"); compile( verilator_flags2 => ['--cc --trace -CFLAGS -DVL_TRACE_VCD_OLD_API'], @@ -32,7 +33,7 @@ file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arru\(/); file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arrp\(/); file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_strp\(/); -vcd_identical ("$Self->{obj_dir}/simx.vcd", "t/t_trace_complex.out"); +vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename}); ok(1); 1; diff --git a/test_regress/t/t_trace_complex_portable.pl b/test_regress/t/t_trace_complex_portable.pl index 5ddd2e3a4..ec7e5462e 100755 --- a/test_regress/t/t_trace_complex_portable.pl +++ b/test_regress/t/t_trace_complex_portable.pl @@ -13,6 +13,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(vlt => 1); top_filename("t/t_trace_complex.v"); +golden_filename("t/t_trace_complex.out"); compile( verilator_flags2 => ['--cc --trace -CFLAGS -DVL_PORTABLE_ONLY'], @@ -32,7 +33,7 @@ file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arru\(/); file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_arrp\(/); file_grep ("$Self->{obj_dir}/simx.vcd", qr/ v_arru_strp\(/); -vcd_identical ("$Self->{obj_dir}/simx.vcd", "t/t_trace_complex.out"); +vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename}); ok(1); 1; diff --git a/test_regress/t/t_trace_complex_threads_1.pl b/test_regress/t/t_trace_complex_threads_1.pl index 483faf3ab..3c7085576 100755 --- a/test_regress/t/t_trace_complex_threads_1.pl +++ b/test_regress/t/t_trace_complex_threads_1.pl @@ -11,7 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(simulator => 1); top_filename("t/t_trace_complex.v"); -$Self->{golden_filename} = "t/t_trace_complex.out"; +golden_filename("t/t_trace_complex.out"); compile( verilator_flags2 => ['--cc --trace --trace-threads 1'] diff --git a/test_regress/t/t_trace_public_func.pl b/test_regress/t/t_trace_public_func.pl index e17f41601..519178385 100755 --- a/test_regress/t/t_trace_public_func.pl +++ b/test_regress/t/t_trace_public_func.pl @@ -11,6 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(vlt_all => 1); top_filename("t/t_trace_public.v"); +golden_filename("t/t_trace_public.out"); compile( make_top_shell => 0, @@ -22,8 +23,7 @@ execute( check_finished => 1, ); -vcd_identical("$Self->{obj_dir}/simx.vcd", - "t/t_trace_public.out"); +vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename}); ok(1); 1; diff --git a/test_regress/t/t_trace_public_func_vlt.pl b/test_regress/t/t_trace_public_func_vlt.pl index 3c627949a..f532f19d0 100755 --- a/test_regress/t/t_trace_public_func_vlt.pl +++ b/test_regress/t/t_trace_public_func_vlt.pl @@ -11,6 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(vlt_all => 1); top_filename("t/t_trace_public.v"); +golden_filename("t/t_trace_public.out"); compile( make_top_shell => 0, @@ -22,8 +23,7 @@ execute( check_finished => 1, ); -vcd_identical("$Self->{obj_dir}/simx.vcd", - "t/t_trace_public.out"); +vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename}); ok(1); 1; diff --git a/test_regress/t/t_trace_public_sig.pl b/test_regress/t/t_trace_public_sig.pl index 0a577a343..edb8bf2c4 100755 --- a/test_regress/t/t_trace_public_sig.pl +++ b/test_regress/t/t_trace_public_sig.pl @@ -11,6 +11,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(vlt_all => 1); top_filename("t/t_trace_public.v"); +golden_filename("t/t_trace_public.out"); compile( make_top_shell => 0, @@ -22,8 +23,7 @@ execute( check_finished => 1, ); -vcd_identical("$Self->{obj_dir}/simx.vcd", - "t/t_trace_public.out"); +vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename}); # vcd_identical doesn't detect "$var a.b;" vs "$scope module a; $var b;" file_grep("$Self->{obj_dir}/simx.vcd", qr/module glbl/i); diff --git a/test_regress/t/t_trace_public_sig_vlt.pl b/test_regress/t/t_trace_public_sig_vlt.pl index 2f20c9ff2..c29e1cdc2 100755 --- a/test_regress/t/t_trace_public_sig_vlt.pl +++ b/test_regress/t/t_trace_public_sig_vlt.pl @@ -11,6 +11,8 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(vlt_all => 1); top_filename("t/t_trace_public.v"); +golden_filename("t/t_trace_public.out"); + my $out_filename = "$Self->{obj_dir}/V$Self->{name}.xml"; compile( @@ -27,8 +29,7 @@ execute( check_finished => 1, ); -vcd_identical("$Self->{obj_dir}/simx.vcd", - "t/t_trace_public.out"); +vcd_identical("$Self->{obj_dir}/simx.vcd", $Self->{golden_filename}); # vcd_identical doesn't detect "$var a.b;" vs "$scope module a; $var b;" file_grep("$Self->{obj_dir}/simx.vcd", qr/module glbl/i);