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 dtype of condition operation on class objects (verilator#4345) (v…
- Loading branch information
Showing
6 changed files
with
122 additions
and
41 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
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,21 @@ | ||
#!/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(simulator => 1); | ||
|
||
compile( | ||
); | ||
|
||
execute( | ||
check_finished => 1, | ||
); | ||
|
||
ok(1); | ||
1; |
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,43 @@ | ||
// DESCRIPTION: Verilator: Verilog Test module | ||
// | ||
// This file ONLY is placed into the Public Domain, for any use, | ||
// without warranty, 2023 by Antmicro Ltd. | ||
// SPDX-License-Identifier: CC0-1.0 | ||
|
||
class Cls; | ||
int x; | ||
function new; | ||
x = 1; | ||
endfunction | ||
endclass | ||
|
||
class ExtendCls extends Cls; | ||
function new; | ||
x = 2; | ||
endfunction | ||
endclass | ||
|
||
class AnotherExtendCls extends Cls; | ||
function new; | ||
x = 3; | ||
endfunction | ||
endclass | ||
|
||
module t (/*AUTOARG*/); | ||
initial begin | ||
Cls cls = new; | ||
ExtendCls ext_cls = new; | ||
AnotherExtendCls an_ext_cls = new; | ||
|
||
if (cls.x == 1) cls = ext_cls; | ||
else cls = an_ext_cls; | ||
if (cls.x != 2) $stop; | ||
|
||
if (cls.x == 1) cls = ext_cls; | ||
else cls = an_ext_cls; | ||
if (cls.x != 3) $stop; | ||
|
||
$write("*-* All Finished *-*\n"); | ||
$finish; | ||
end | ||
endmodule |