Tests: Misc cleanups
This commit is contained in:
parent
840c8f5782
commit
201416a0c7
|
|
@ -10,7 +10,7 @@ module t(/*AUTOARG*/
|
||||||
);
|
);
|
||||||
input clk;
|
input clk;
|
||||||
|
|
||||||
initial begin;
|
initial begin
|
||||||
@(clk);
|
@(clk);
|
||||||
$write("[%0t] Got\n", $time);
|
$write("[%0t] Got\n", $time);
|
||||||
@(clk);
|
@(clk);
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ module t;
|
||||||
return i;
|
return i;
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
initial begin;
|
initial begin
|
||||||
if (randfunc() != 100) $stop;
|
if (randfunc() != 100) $stop;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -1,59 +1,59 @@
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:23:7: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:23:5: Unsupported: randsequence
|
||||||
23 | randsequence(main)
|
23 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
|
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:40:7: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:40:5: Unsupported: randsequence
|
||||||
40 | randsequence(main)
|
40 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:51:7: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:51:5: Unsupported: randsequence
|
||||||
51 | randsequence()
|
51 | randsequence()
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:58:7: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:58:5: Unsupported: randsequence
|
||||||
58 | randsequence()
|
58 | randsequence()
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:65:10: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:65:7: Unsupported: randsequence
|
||||||
65 | randsequence(main)
|
65 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:79:10: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:79:7: Unsupported: randsequence
|
||||||
79 | randsequence(main)
|
79 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:81:21: Unsupported: randsequence if
|
%Error-UNSUPPORTED: t/t_randsequence.v:81:17: Unsupported: randsequence if
|
||||||
81 | one_if: if (i % 10 == 0) count_1 else most;
|
81 | one_if: if (i % 10 == 0) count_1 else most;
|
||||||
| ^~
|
| ^~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:87:19: Unsupported: randsequence case
|
%Error-UNSUPPORTED: t/t_randsequence.v:87:15: Unsupported: randsequence case
|
||||||
87 | most: case (i % 10)
|
87 | most: case (i % 10)
|
||||||
| ^~~~
|
| ^~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:103:10: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:103:7: Unsupported: randsequence
|
||||||
103 | randsequence(main)
|
103 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:105:21: Unsupported: randsequence if
|
%Error-UNSUPPORTED: t/t_randsequence.v:105:17: Unsupported: randsequence if
|
||||||
105 | one_if: if (i % 10 == 0) count_1 else most;
|
105 | one_if: if (i % 10 == 0) count_1 else most;
|
||||||
| ^~
|
| ^~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:111:19: Unsupported: randsequence case
|
%Error-UNSUPPORTED: t/t_randsequence.v:111:15: Unsupported: randsequence case
|
||||||
111 | most: case (i % 10)
|
111 | most: case (i % 10)
|
||||||
| ^~~~
|
| ^~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:126:7: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:126:5: Unsupported: randsequence
|
||||||
126 | randsequence(main)
|
126 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:127:16: Unsupported: randsequence repeat
|
%Error-UNSUPPORTED: t/t_randsequence.v:127:13: Unsupported: randsequence repeat
|
||||||
127 | main: repeat(10) count_1;
|
127 | main: repeat(10) count_1;
|
||||||
| ^~~~~~
|
| ^~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:135:10: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:135:7: Unsupported: randsequence
|
||||||
135 | randsequence(main)
|
135 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:147:10: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:147:7: Unsupported: randsequence
|
||||||
147 | randsequence(main)
|
147 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:152:10: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:152:7: Unsupported: randsequence
|
||||||
152 | randsequence(main)
|
152 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:167:10: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:167:7: Unsupported: randsequence
|
||||||
167 | randsequence(main)
|
167 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:185:10: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:185:7: Unsupported: randsequence
|
||||||
185 | randsequence(main)
|
185 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence.v:202:10: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence.v:202:7: Unsupported: randsequence
|
||||||
202 | randsequence(main)
|
202 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error: Exiting due to
|
%Error: Exiting due to
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ module t;
|
||||||
for (int i = 0; i < COUNT; ++i) counts[i] = 0;
|
for (int i = 0; i < COUNT; ++i) counts[i] = 0;
|
||||||
endtask
|
endtask
|
||||||
|
|
||||||
initial begin;
|
initial begin
|
||||||
if (sfunc() != 1) $stop;
|
if (sfunc() != 1) $stop;
|
||||||
|
|
||||||
// simple
|
// simple
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
%Error-UNSUPPORTED: t/t_randsequence_bad.v:12:7: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence_bad.v:12:5: Unsupported: randsequence
|
||||||
12 | randsequence(no_such_production)
|
12 | randsequence(no_such_production)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
|
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
|
||||||
%Error-UNSUPPORTED: t/t_randsequence_bad.v:16:7: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence_bad.v:16:5: Unsupported: randsequence
|
||||||
16 | randsequence(main)
|
16 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error-UNSUPPORTED: t/t_randsequence_bad.v:21:7: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence_bad.v:21:5: Unsupported: randsequence
|
||||||
21 | randsequence()
|
21 | randsequence()
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
%Error: Exiting due to
|
%Error: Exiting due to
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
import vltest_bootstrap
|
import vltest_bootstrap
|
||||||
|
|
||||||
test.scenarios('vlt')
|
test.scenarios('linter')
|
||||||
|
|
||||||
test.lint(fails=True, expect_filename=test.golden_filename)
|
test.lint(fails=True, expect_filename=test.golden_filename)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%Error-UNSUPPORTED: t/t_randsequence_recurse.v:21:7: Unsupported: randsequence
|
%Error-UNSUPPORTED: t/t_randsequence_recurse.v:21:5: Unsupported: randsequence
|
||||||
21 | randsequence(main)
|
21 | randsequence(main)
|
||||||
| ^~~~~~~~~~~~
|
| ^~~~~~~~~~~~
|
||||||
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
|
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
%Error-UNSUPPORTED: t/t_randsequence_rs_bad.v:12:5: Unsupported: randsequence
|
||||||
|
12 | randsequence()
|
||||||
|
| ^~~~~~~~~~~~
|
||||||
|
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
|
||||||
|
%Error-UNSUPPORTED: t/t_randsequence_rs_bad.v:14:10: Unsupported: randsequence
|
||||||
|
14 | randsequence()
|
||||||
|
| ^~~~~~~~~~~~
|
||||||
|
%Error: Exiting due to
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||||
|
#
|
||||||
|
# Copyright 2024 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
|
||||||
|
|
||||||
|
import vltest_bootstrap
|
||||||
|
|
||||||
|
test.scenarios('linter')
|
||||||
|
|
||||||
|
test.lint(fails=True, expect_filename=test.golden_filename)
|
||||||
|
|
||||||
|
test.passes()
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
// DESCRIPTION: Verilator: Verilog Test module
|
||||||
|
//
|
||||||
|
// Copyright 2025 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;
|
||||||
|
|
||||||
|
initial begin
|
||||||
|
randsequence()
|
||||||
|
a: {
|
||||||
|
randsequence()
|
||||||
|
b: {};
|
||||||
|
endsequence
|
||||||
|
};
|
||||||
|
endsequence
|
||||||
|
$write("*-* All Finished *-*\n");
|
||||||
|
$finish;
|
||||||
|
end
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
%Error-UNSUPPORTED: t/t_randsequence_rule_code_bad.v:12:5: Unsupported: randsequence
|
||||||
|
12 | randsequence()
|
||||||
|
| ^~~~~~~~~~~~
|
||||||
|
... For error description see https://verilator.org/warn/UNSUPPORTED?v=latest
|
||||||
|
%Error: Exiting due to
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||||
|
#
|
||||||
|
# Copyright 2024 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
|
||||||
|
|
||||||
|
import vltest_bootstrap
|
||||||
|
|
||||||
|
test.scenarios('linter')
|
||||||
|
|
||||||
|
test.lint(fails=True, expect_filename=test.golden_filename)
|
||||||
|
|
||||||
|
test.passes()
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
// DESCRIPTION: Verilator: Verilog Test module
|
||||||
|
//
|
||||||
|
// Copyright 2025 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;
|
||||||
|
|
||||||
|
initial begin
|
||||||
|
randsequence()
|
||||||
|
main : first := 1 { $stop; } | second := 0;
|
||||||
|
first : { $display("first"); };
|
||||||
|
second : { $display("second"); };
|
||||||
|
endsequence
|
||||||
|
$write("*-* All Finished *-*\n");
|
||||||
|
$finish;
|
||||||
|
end
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
|
@ -194,7 +194,7 @@ module t;
|
||||||
`checkh(rbits, 64'hefbeaddefecadefa);
|
`checkh(rbits, 64'hefbeaddefecadefa);
|
||||||
endtask
|
endtask
|
||||||
|
|
||||||
initial begin;
|
initial begin
|
||||||
test1();
|
test1();
|
||||||
test2();
|
test2();
|
||||||
test3();
|
test3();
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ module top();
|
||||||
// struct HIJ
|
// struct HIJ
|
||||||
HIJ_struct HIJ;
|
HIJ_struct HIJ;
|
||||||
|
|
||||||
initial begin;
|
initial begin
|
||||||
// struct ab
|
// struct ab
|
||||||
ab = '{0, 0}; //constant member by position
|
ab = '{0, 0}; //constant member by position
|
||||||
if (ab.a != 0) $stop;
|
if (ab.a != 0) $stop;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue