From 2df886b2b056b1d0be06f57119be13408bc9a717 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 22 Oct 2022 10:58:10 -0400 Subject: [PATCH] Tests: Check std:: package for mailbox/process/semaphore --- test_regress/t/t_mailbox_std.out | 11 +++++++++++ test_regress/t/t_mailbox_std.pl | 26 ++++++++++++++++++++++++++ test_regress/t/t_process_bad.out | 12 ++++++------ test_regress/t/t_process_bad.pl | 2 -- test_regress/t/t_process_std.out | 11 +++++++++++ test_regress/t/t_process_std.pl | 26 ++++++++++++++++++++++++++ test_regress/t/t_semaphore_std.out | 11 +++++++++++ test_regress/t/t_semaphore_std.pl | 26 ++++++++++++++++++++++++++ 8 files changed, 117 insertions(+), 8 deletions(-) create mode 100644 test_regress/t/t_mailbox_std.out create mode 100755 test_regress/t/t_mailbox_std.pl create mode 100644 test_regress/t/t_process_std.out create mode 100755 test_regress/t/t_process_std.pl create mode 100644 test_regress/t/t_semaphore_std.out create mode 100755 test_regress/t/t_semaphore_std.pl diff --git a/test_regress/t/t_mailbox_std.out b/test_regress/t/t_mailbox_std.out new file mode 100644 index 000000000..d9c517f02 --- /dev/null +++ b/test_regress/t/t_mailbox_std.out @@ -0,0 +1,11 @@ +%Error: t/t_mailbox.pl:1:1: syntax error, unexpected '#' + 1 | #!/usr/bin/env perl + | ^ +%Error-UNSUPPORTED: t/t_mailbox.pl:2:19: Unsupported: Verilog 2001-config reserved word not implemented: 'use' + 2 | if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } + | ^~~ + ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest +%Error-UNSUPPORTED: t/t_mailbox.pl:3:47: Unsupported: SystemVerilog 2005 reserved word not implemented: 'expect' + 3 | # DESCRIPTION: Verilator: Verilog Test driver/expect definition + | ^~~~~~ +%Error: Exiting due to diff --git a/test_regress/t/t_mailbox_std.pl b/test_regress/t/t_mailbox_std.pl new file mode 100755 index 000000000..207b5f005 --- /dev/null +++ b/test_regress/t/t_mailbox_std.pl @@ -0,0 +1,26 @@ +#!/usr/bin/env perl +if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# Copyright 2020 by Wilson Snyder. This program is free software; you +# can redistribute it and/or modify it under the terms of either the GNU +# Lesser General Public License Version 3 or the Perl Artistic License +# Version 2.0. +# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 + +scenarios(simulator => 1); + +top_filename("t/t_mailbox.pl"); + +compile( + v_flags2 => ["+define+T_MAILBOX+std::mailbox"], + fails => $Self->{vlt_all}, + expect_filename => $Self->{golden_filename}, + ); + +execute( + check_finished => 1, + ) if !$Self->{vlt_all}; + +ok(1); +1; diff --git a/test_regress/t/t_process_bad.out b/test_regress/t/t_process_bad.out index a4ada3778..3a5b96793 100644 --- a/test_regress/t/t_process_bad.out +++ b/test_regress/t/t_process_bad.out @@ -1,10 +1,10 @@ -%Error: t/t_process.v:22:4: Can't find typedef: 'process' - 22 | process p; +%Error: t/t_process_bad.v:8:4: Can't find typedef: 'process' + 8 | process p; | ^~~~~~~ -%Error-UNSUPPORTED: t/t_process.v:26:20: Unsupported: 'process' - 26 | p = process::self(); +%Error-UNSUPPORTED: t/t_process_bad.v:12:20: Unsupported: 'process' + 12 | p = process::self(); | ^~~~ ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest -%Error: Internal Error: t/t_process.v:26:11: ../V3LinkDot.cpp:#: Bad package link - 26 | p = process::self(); +%Error: Internal Error: t/t_process_bad.v:12:11: ../V3LinkDot.cpp:#: Bad package link + 12 | p = process::self(); | ^~~~~~~ diff --git a/test_regress/t/t_process_bad.pl b/test_regress/t/t_process_bad.pl index 7be24ae56..dd3bcbbf3 100755 --- a/test_regress/t/t_process_bad.pl +++ b/test_regress/t/t_process_bad.pl @@ -10,8 +10,6 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(vlt => 1); -top_filename("t_process.v"); - lint( verilator_flags2 => ["--xml-only"], fails => 1, diff --git a/test_regress/t/t_process_std.out b/test_regress/t/t_process_std.out new file mode 100644 index 000000000..80b26b03c --- /dev/null +++ b/test_regress/t/t_process_std.out @@ -0,0 +1,11 @@ +%Error: t/t_process.pl:1:1: syntax error, unexpected '#' + 1 | #!/usr/bin/env perl + | ^ +%Error-UNSUPPORTED: t/t_process.pl:2:19: Unsupported: Verilog 2001-config reserved word not implemented: 'use' + 2 | if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } + | ^~~ + ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest +%Error-UNSUPPORTED: t/t_process.pl:3:47: Unsupported: SystemVerilog 2005 reserved word not implemented: 'expect' + 3 | # DESCRIPTION: Verilator: Verilog Test driver/expect definition + | ^~~~~~ +%Error: Exiting due to diff --git a/test_regress/t/t_process_std.pl b/test_regress/t/t_process_std.pl new file mode 100755 index 000000000..462019b41 --- /dev/null +++ b/test_regress/t/t_process_std.pl @@ -0,0 +1,26 @@ +#!/usr/bin/env perl +if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# Copyright 2020 by Wilson Snyder. This program is free software; you +# can redistribute it and/or modify it under the terms of either the GNU +# Lesser General Public License Version 3 or the Perl Artistic License +# Version 2.0. +# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 + +scenarios(simulator => 1); + +top_filename("t/t_process.pl"); + +compile( + v_flags2 => ["+define+T_PROCESS+std::process"], + fails => $Self->{vlt_all}, + expect_filename => $Self->{golden_filename}, + ); + +execute( + check_finished => 1, + ) if !$Self->{vlt_all}; + +ok(1); +1; diff --git a/test_regress/t/t_semaphore_std.out b/test_regress/t/t_semaphore_std.out new file mode 100644 index 000000000..884a7159b --- /dev/null +++ b/test_regress/t/t_semaphore_std.out @@ -0,0 +1,11 @@ +%Error: t/t_semaphore.pl:1:1: syntax error, unexpected '#' + 1 | #!/usr/bin/env perl + | ^ +%Error-UNSUPPORTED: t/t_semaphore.pl:2:19: Unsupported: Verilog 2001-config reserved word not implemented: 'use' + 2 | if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } + | ^~~ + ... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest +%Error-UNSUPPORTED: t/t_semaphore.pl:3:47: Unsupported: SystemVerilog 2005 reserved word not implemented: 'expect' + 3 | # DESCRIPTION: Verilator: Verilog Test driver/expect definition + | ^~~~~~ +%Error: Exiting due to diff --git a/test_regress/t/t_semaphore_std.pl b/test_regress/t/t_semaphore_std.pl new file mode 100755 index 000000000..b6c87f81b --- /dev/null +++ b/test_regress/t/t_semaphore_std.pl @@ -0,0 +1,26 @@ +#!/usr/bin/env perl +if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# Copyright 2020 by Wilson Snyder. This program is free software; you +# can redistribute it and/or modify it under the terms of either the GNU +# Lesser General Public License Version 3 or the Perl Artistic License +# Version 2.0. +# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 + +scenarios(simulator => 1); + +top_filename("t/t_semaphore.pl"); + +compile( + v_flags2 => ["+define+T_SEMAPHORE+std::semaphore"], + fails => $Self->{vlt_all}, + expect_filename => $Self->{golden_filename}, + ); + +execute( + check_finished => 1, + ) if !$Self->{vlt_all}; + +ok(1); +1;