Tests: Add randsequence test

This commit is contained in:
Wilson Snyder 2023-04-09 17:08:04 -04:00
parent 663d6a1c8d
commit e3bdae77a0
3 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,20 @@
%Error-UNSUPPORTED: t/t_randsequence_bad.v:13:25: Unsupported: randsequence production
13 | such_production: { };
| ^
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
%Error-UNSUPPORTED: t/t_randsequence_bad.v:12:7: Unsupported: randsequence
12 | randsequence(no_such_production)
| ^~~~~~~~~~~~
%Error-UNSUPPORTED: t/t_randsequence_bad.v:17:16: Unsupported: randsequence production id
17 | main: production_bad;
| ^~~~~~~~~~~~~~
%Error-UNSUPPORTED: t/t_randsequence_bad.v:17:14: Unsupported: randsequence production
17 | main: production_bad;
| ^
%Error-UNSUPPORTED: t/t_randsequence_bad.v:18:24: Unsupported: randsequence production
18 | production_baa: {};
| ^
%Error-UNSUPPORTED: t/t_randsequence_bad.v:16:7: Unsupported: randsequence
16 | randsequence(main)
| ^~~~~~~~~~~~
%Error: Exiting due to

View File

@ -0,0 +1,19 @@
#!/usr/bin/env perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2022 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(vlt => 1);
lint(
fails => 1,
expect_filename => $Self->{golden_filename},
);
ok(1);
1;

View File

@ -0,0 +1,25 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// Copyright 2023 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
module t(/*AUTOARG*/);
initial begin;
randsequence(no_such_production) // Bad
such_production: { };
endsequence
randsequence(main)
main: production_bad; // Bad
production_baa: {};
endsequence
$write("*-* All Finished *-*\n");
$finish;
end
endmodule