verilator/test_regress/t/t_class_new_ref_bad.v

34 lines
628 B
Systemverilog
Raw Normal View History

2024-08-11 16:09:05 +02:00
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2024 Wilson Snyder
2024-08-11 16:09:05 +02:00
// SPDX-License-Identifier: CC0-1.0
class Base;
endclass
class Cls extends Base;
2026-03-08 23:26:40 +01:00
typedef int txn_type_t; // Bad type
2024-08-11 16:09:05 +02:00
2026-03-08 23:26:40 +01:00
rand txn_type_t req_txn_type;
2024-08-11 16:09:05 +02:00
2026-03-08 23:26:40 +01:00
static function txn_type_t generate_txn();
txn_type_t txn = new;
txn_type_t copy = new txn;
return txn;
endfunction
2024-08-11 16:09:05 +02:00
endclass
module t;
2024-08-11 16:09:05 +02:00
2026-03-08 23:26:40 +01:00
initial begin
automatic Base b = Cls::generate_txn();
$display("%p", b);
2024-08-11 16:09:05 +02:00
2026-03-08 23:26:40 +01:00
$write("*-* All Finished *-*\n");
$finish;
end
2024-08-11 16:09:05 +02:00
endmodule