verilator/test_regress/t/t_process_task.v

35 lines
642 B
Systemverilog
Raw Normal View History

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain.
// SPDX-FileCopyrightText: 2023 Antmicro Ltd
// SPDX-License-Identifier: CC0-1.0
2026-03-03 13:21:24 +01:00
module t;
2026-03-10 02:38:29 +01:00
std::process proc;
logic clk = 0;
logic b = 0;
2026-03-10 02:38:29 +01:00
always #1 clk = ~clk;
2026-03-10 02:38:29 +01:00
task kill_me_after_1ns();
fork
#1 proc.kill();
#3 begin
$write("*-* All Finished *-*\n");
$finish;
end
2026-03-10 02:38:29 +01:00
join_none
endtask
always @(posedge clk) begin
if (!b) begin
proc = std::process::self();
kill_me_after_1ns();
b = 1;
end
else begin
$stop;
end
end
endmodule