Tests: Separate make_main flag from verilator_make_gcc flag.

This commit is contained in:
Wilson Snyder 2018-11-29 19:50:09 -05:00
parent 8170391573
commit 2e5919549c
33 changed files with 54 additions and 29 deletions

View File

@ -764,9 +764,8 @@ sub compile {
return 1; return 1;
} }
if (!$param{fails} && $param{verilator_make_gcc} if (!$param{fails} && $param{make_main}) {
&& $param{make_main}) { $self->_make_main();
$self->_make_main();
} }
$self->_run(logfile=>"$self->{obj_dir}/vlt_compile.log", $self->_run(logfile=>"$self->{obj_dir}/vlt_compile.log",

View File

@ -12,6 +12,8 @@ scenarios(vlt => 1);
compile( compile(
v_flags => ['--cdc'], v_flags => ['--cdc'],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
fails => 1, fails => 1,
expect_filename => $Self->{golden_filename}, expect_filename => $Self->{golden_filename},
); );

View File

@ -10,10 +10,10 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(vlt => 1); scenarios(vlt => 1);
compile( compile(
make_top_shell => 0,
make_main => 0,
verilator_flags2 => [qw(--lint-only -Wfuture-FUTURE1 -Wfuture-FUTURE2)], verilator_flags2 => [qw(--lint-only -Wfuture-FUTURE1 -Wfuture-FUTURE2)],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
); );
ok(1); ok(1);

View File

@ -16,9 +16,9 @@ compile(
expect => expect =>
'gotit 'gotit
', ',
verilator_make_gcc => 0,
make_top_shell => 0, make_top_shell => 0,
make_main => 0, make_main => 0,
verilator_make_gcc => 0,
); );
ok(1); ok(1);

View File

@ -12,9 +12,9 @@ scenarios(vlt => 1);
compile( compile(
v_flags2 => ["--relative-includes", v_flags2 => ["--relative-includes",
"--lint-only $Self->{t_dir}/t_flag_relinc_dir/chip/t_flag_relinc_sub.v"], "--lint-only $Self->{t_dir}/t_flag_relinc_dir/chip/t_flag_relinc_sub.v"],
verilator_make_gcc => 0,
make_top_shell => 0, make_top_shell => 0,
make_main => 0, make_main => 0,
verilator_make_gcc => 0,
); );
ok(1); ok(1);

View File

@ -11,10 +11,10 @@ scenarios(simulator => 1);
compile( compile(
# Unsupported: UDP Tables # Unsupported: UDP Tables
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--lint-only --bbox-unsup"], verilator_flags2 => ["--lint-only --bbox-unsup"],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
); );
ok(1); ok(1);

View File

@ -11,9 +11,9 @@ scenarios(simulator => 1);
compile( compile(
v_flags2 => ["--lint-only"], v_flags2 => ["--lint-only"],
verilator_make_gcc => 0,
make_top_shell => 0, make_top_shell => 0,
make_main => 0, make_main => 0,
verilator_make_gcc => 0,
); );
ok(1); ok(1);

View File

@ -10,9 +10,10 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(simulator => 1); scenarios(simulator => 1);
compile( compile(
make_top_shell => 0,
verilator_flags2 => [qw(-sc -Wno-WIDTH)], verilator_flags2 => [qw(-sc -Wno-WIDTH)],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
); );
#No execute() #No execute()

View File

@ -13,9 +13,10 @@ top_filename("t/t_inst_overwide.v");
compile( compile(
v_flags2 => ["--lint-only"], v_flags2 => ["--lint-only"],
make_top_shell => 0,
verilator_flags => [qw(-cc)], verilator_flags => [qw(-cc)],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
fails => $Self->{vlt_all}, fails => $Self->{vlt_all},
expect_filename => $Self->{golden_filename}, expect_filename => $Self->{golden_filename},
); );

View File

@ -11,9 +11,9 @@ scenarios(vlt_all => 1);
compile( compile(
v_flags2 => ["--lint-only"], v_flags2 => ["--lint-only"],
verilator_make_gcc => 0,
make_top_shell => 0, make_top_shell => 0,
make_main => 0, make_main => 0,
verilator_make_gcc => 0,
fails => 1, fails => 1,
expect_filename => $Self->{golden_filename}, expect_filename => $Self->{golden_filename},
); );

View File

@ -10,10 +10,10 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(vlt_all => 1); scenarios(vlt_all => 1);
compile( compile(
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--lint-only -Wwarn-UNUSED"], verilator_flags2 => ["--lint-only -Wwarn-UNUSED"],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
fails => 1, fails => 1,
expect => expect =>
'%Warning-UNUSED: t/t_lint_once_bad.v:\d+: Signal is not driven, nor used: unus1 '%Warning-UNUSED: t/t_lint_once_bad.v:\d+: Signal is not driven, nor used: unus1

View File

@ -10,10 +10,10 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(vlt_all => 1); scenarios(vlt_all => 1);
compile( compile(
make_top_shell => 0,
make_main => 0,
v_flags2 => ["--lint-only"], v_flags2 => ["--lint-only"],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
); );
foreach my $file (glob("$Self->{obj_dir}/*t_lint_only*")) { foreach my $file (glob("$Self->{obj_dir}/*t_lint_only*")) {

View File

@ -10,10 +10,10 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(vlt_all => 1); scenarios(vlt_all => 1);
compile( compile(
make_top_shell => 0,
make_main => 0,
v_flags2 => ["--lint-only -Wwarn-REALCVT"], v_flags2 => ["--lint-only -Wwarn-REALCVT"],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
fails => 1, fails => 1,
expect => expect =>
'%Warning-REALCVT: t/t_lint_realcvt_bad.v:\d+: Implicit conversion of real to integer '%Warning-REALCVT: t/t_lint_realcvt_bad.v:\d+: Implicit conversion of real to integer

View File

@ -11,9 +11,9 @@ scenarios(vlt_all => 1);
compile( compile(
v_flags2 => ["--lint-only"], v_flags2 => ["--lint-only"],
verilator_make_gcc => 0,
make_top_shell => 0, make_top_shell => 0,
make_main => 0, make_main => 0,
verilator_make_gcc => 0,
); );
ok(1); ok(1);

View File

@ -10,10 +10,10 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(vlt_all => 1); scenarios(vlt_all => 1);
compile( compile(
make_top_shell => 0,
make_main => 0,
v_flags2 => ["--lint-only"], v_flags2 => ["--lint-only"],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
); );
ok(1); ok(1);

View File

@ -14,6 +14,8 @@ top_filename("t/t_pipe_filter.v");
compile( compile(
verilator_flags2 => ['-E --pipe-filter \'perl t/t_pipe_exit_bad.pf\' '], verilator_flags2 => ['-E --pipe-filter \'perl t/t_pipe_exit_bad.pf\' '],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
stdout_filename => $stdout_filename, stdout_filename => $stdout_filename,
fails => 1, fails => 1,
expect => expect =>

View File

@ -14,6 +14,8 @@ my $stdout_filename = "$Self->{obj_dir}/$Self->{name}__test.vpp";
compile( compile(
verilator_flags2 => ['-E --pipe-filter \'perl t/t_pipe_filter.pf\' '], verilator_flags2 => ['-E --pipe-filter \'perl t/t_pipe_filter.pf\' '],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
stdout_filename => $stdout_filename, stdout_filename => $stdout_filename,
); );

View File

@ -14,6 +14,8 @@ my $stdout_filename = "$Self->{obj_dir}/$Self->{name}__test.vpp";
compile( compile(
verilator_flags2 => ['-DDEF_A0 -DPREDEF_COMMAND_LINE -E'], verilator_flags2 => ['-DDEF_A0 -DPREDEF_COMMAND_LINE -E'],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
stdout_filename => $stdout_filename, stdout_filename => $stdout_filename,
); );

View File

@ -16,6 +16,8 @@ my $stdout_filename = "$Self->{obj_dir}/$Self->{name}__test.vpp";
compile( compile(
verilator_flags2 => ['-DDEF_A0 -DPREDEF_COMMAND_LINE -E --pp-comments'], verilator_flags2 => ['-DDEF_A0 -DPREDEF_COMMAND_LINE -E --pp-comments'],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
stdout_filename => $stdout_filename, stdout_filename => $stdout_filename,
); );

View File

@ -14,6 +14,8 @@ my $stdout_filename = "$Self->{obj_dir}/$Self->{name}__test.vpp";
compile( compile(
verilator_flags2 => ['-E'], verilator_flags2 => ['-E'],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
stdout_filename => $stdout_filename, stdout_filename => $stdout_filename,
); );

View File

@ -16,6 +16,8 @@ my $stdout_filename = "$Self->{obj_dir}/$Self->{name}__test.vpp";
compile( compile(
verilator_flags2 => ['-DDEF_A0 -DPREDEF_COMMAND_LINE -E --dump-defines'], verilator_flags2 => ['-DDEF_A0 -DPREDEF_COMMAND_LINE -E --dump-defines'],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
stdout_filename => $stdout_filename, stdout_filename => $stdout_filename,
); );

View File

@ -16,6 +16,8 @@ top_filename("t/t_preproc_noline.v");
compile( compile(
verilator_flags2 => ['-E -P'], verilator_flags2 => ['-E -P'],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
stdout_filename => $stdout_filename, stdout_filename => $stdout_filename,
); );

View File

@ -20,6 +20,7 @@ compile(
verilator_flags3 => ['',], verilator_flags3 => ['',],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0, make_top_shell => 0,
make_main => 0,
stdout_filename => $stdout_filename, stdout_filename => $stdout_filename,
); );

View File

@ -19,6 +19,7 @@ compile(
verilator_flags3 => ['',], verilator_flags3 => ['',],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0, make_top_shell => 0,
make_main => 0,
stdout_filename => $stdout_filename, stdout_filename => $stdout_filename,
); );

View File

@ -11,9 +11,9 @@ scenarios(simulator => 1);
compile( compile(
v_flags2 => ["--lint-only"], v_flags2 => ["--lint-only"],
verilator_make_gcc => 0,
make_top_shell => 0, make_top_shell => 0,
make_main => 0, make_main => 0,
verilator_make_gcc => 0,
); );
ok(1); ok(1);

View File

@ -13,10 +13,10 @@ top_filename("t/t_udp.v");
compile( compile(
# Unsupported: UDP Tables # Unsupported: UDP Tables
make_top_shell => 0,
make_main => 0,
verilator_flags2 => ["--lint-only --bbox-unsup"], verilator_flags2 => ["--lint-only --bbox-unsup"],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
); );
ok(1); ok(1);

View File

@ -14,6 +14,8 @@ top_filename("t/t_var_pinsizes.v");
compile( compile(
verilator_flags2 => ['-cc'], verilator_flags2 => ['-cc'],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
); );
{ {

View File

@ -11,9 +11,9 @@ scenarios(simulator => 1);
compile( compile(
v_flags2 => ["--lint-only"], v_flags2 => ["--lint-only"],
verilator_make_gcc => 0,
make_top_shell => 0, make_top_shell => 0,
make_main => 0, make_main => 0,
verilator_make_gcc => 0,
fails => 1, fails => 1,
expect => expect =>
q{%Error: t/t_var_ref_bad1.v:\d+: Ref connection 'bad_sub_ref' requires matching types; ref requires BASICDTYPE 'real' but connection is BASICDTYPE 'bit'. q{%Error: t/t_var_ref_bad1.v:\d+: Ref connection 'bad_sub_ref' requires matching types; ref requires BASICDTYPE 'real' but connection is BASICDTYPE 'bit'.

View File

@ -11,9 +11,9 @@ scenarios(simulator => 1);
compile( compile(
v_flags2 => ["--lint-only"], v_flags2 => ["--lint-only"],
verilator_make_gcc => 0,
make_top_shell => 0, make_top_shell => 0,
make_main => 0, make_main => 0,
verilator_make_gcc => 0,
fails => 1, fails => 1,
expect => expect =>
q{%Error: t/t_var_ref_bad2.v:\d+: Assigning to const ref variable: bad_const_set q{%Error: t/t_var_ref_bad2.v:\d+: Assigning to const ref variable: bad_const_set

View File

@ -11,9 +11,9 @@ scenarios(simulator => 1);
compile( compile(
v_flags2 => ["--lint-only"], v_flags2 => ["--lint-only"],
verilator_make_gcc => 0,
make_top_shell => 0, make_top_shell => 0,
make_main => 0, make_main => 0,
verilator_make_gcc => 0,
fails => 1, fails => 1,
expect => expect =>
q{%Error: t/t_var_ref_bad3.v:\d+: Unsupported: ref/const ref as primary input/output: bad_primary_ref q{%Error: t/t_var_ref_bad3.v:\d+: Unsupported: ref/const ref as primary input/output: bad_primary_ref

View File

@ -10,9 +10,9 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(vlt => 1); scenarios(vlt => 1);
compile( compile(
verilator_make_gcc => 0,
make_top_shell => 0, make_top_shell => 0,
make_main => 0, make_main => 0,
verilator_make_gcc => 0,
v_flags2 => ["--lint-only t/t_vlt_warn.vlt"], v_flags2 => ["--lint-only t/t_vlt_warn.vlt"],
); );

View File

@ -14,6 +14,8 @@ my $out_filename = "$Self->{obj_dir}/V$Self->{name}.xml";
compile( compile(
verilator_flags2 => ['--xml-only'], verilator_flags2 => ['--xml-only'],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
); );
files_identical("$out_filename", "t/$Self->{name}.out"); files_identical("$out_filename", "t/$Self->{name}.out");

View File

@ -14,6 +14,8 @@ my $out_filename = "$Self->{obj_dir}/V$Self->{name}.xml";
compile( compile(
verilator_flags2 => ['--xml-only'], verilator_flags2 => ['--xml-only'],
verilator_make_gcc => 0, verilator_make_gcc => 0,
make_top_shell => 0,
make_main => 0,
); );
files_identical("$out_filename", "t/$Self->{name}.out"); files_identical("$out_filename", "t/$Self->{name}.out");