forked from verilator/verilator
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix assoc_wildcard and dynarray method tests, isolate invalid width b…
…ug for dynarrays Signed-off-by: Krzysztof Boronski <[email protected]>
- Loading branch information
1 parent
e14488d
commit a39a8a3
Showing
4 changed files
with
83 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// DESCRIPTION: Verilator: Verilog Test module | ||
// | ||
// This file ONLY is placed under the Creative Commons Public Domain, for | ||
// any use, without warranty, 2024 by Antmicro Ltd. | ||
// SPDX-License-Identifier: CC0-1.0 | ||
|
||
`define stop $stop | ||
`define checkh(gotv,expv) do if ((gotv) !== (expv)) begin $write("%%Error: %s:%0d: got='h%x exp='h%x\n", `__FILE__,`__LINE__, (gotv), (expv)); `stop; end while(0); | ||
`define checks(gotv,expv) do if ((gotv) != (expv)) begin $write("%%Error: %s:%0d: got='%s' exp='%s'\n", `__FILE__,`__LINE__, (gotv), (expv)); `stop; end while(0); | ||
`define checkp(gotv,expv_s) do begin string gotv_s; gotv_s = $sformatf("%p", gotv); if ((gotv_s) !== (expv_s)) begin $write("%%Error: %s:%0d: got='%s' exp='%s'\n", `__FILE__,`__LINE__, (gotv_s), (expv_s)); `stop; end end while(0); | ||
|
||
module t (/*AUTOARG*/); | ||
string s[] = { "hello", "sad", "sad", "world" }; | ||
|
||
initial begin | ||
int i; | ||
bit b; | ||
|
||
i = s.sum with (item.len); | ||
`checkh(i, 10); | ||
i = s.product with (item.len); | ||
`checkh(i, 24); | ||
b = s.sum with (item == "hello"); | ||
`checkh(b, 1'b1); | ||
b = s.sum with (item == ""); | ||
`checkh(b, 1'b0); | ||
b = s.product with (item inside {"hello", "sad"}); | ||
`checkh(b, 1'b0); | ||
b = s.product with (item inside { "hello", "sad", "world" }); | ||
`checkh(b, 1'b1); | ||
|
||
$write("*-* All Finished *-*\n"); | ||
$finish; | ||
end | ||
endmodule |