2025-04-09 04:09:40 +02:00
|
|
|
// DESCRIPTION: Verilator: Verilog Test module
|
|
|
|
|
//
|
2026-01-27 02:24:34 +01:00
|
|
|
// This file ONLY is placed under the Creative Commons Public Domain.
|
|
|
|
|
// SPDX-FileCopyrightText: 2020 Wilson Snyder
|
2025-04-09 04:09:40 +02:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
|
|
|
|
|
|
|
|
|
class Base1;
|
2026-03-08 23:26:40 +01:00
|
|
|
int s = 2;
|
|
|
|
|
function new(int def = 3);
|
|
|
|
|
s = def;
|
|
|
|
|
endfunction
|
2025-04-09 04:09:40 +02:00
|
|
|
endclass
|
|
|
|
|
|
|
|
|
|
class Cls1 extends Base1(default);
|
2026-03-08 23:26:40 +01:00
|
|
|
// Gets new(int def)
|
2025-04-09 04:09:40 +02:00
|
|
|
endclass
|
|
|
|
|
|
2025-09-13 15:28:43 +02:00
|
|
|
module t;
|
2026-03-08 23:26:40 +01:00
|
|
|
initial begin
|
|
|
|
|
Cls1 c1;
|
|
|
|
|
Cls1 c5;
|
|
|
|
|
c1 = new(57);
|
|
|
|
|
if (c1.s !== 57) $stop;
|
2025-04-09 04:09:40 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
c5 = new;
|
|
|
|
|
if (c5.s !== 5) $stop;
|
2025-04-09 04:09:40 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
|
$finish;
|
|
|
|
|
end
|
2025-04-09 04:09:40 +02:00
|
|
|
|
|
|
|
|
endmodule
|