2006-08-26 13:35:28 +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: 2003 Wilson Snyder
|
2020-03-21 16:24:24 +01:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
module t (
|
|
|
|
|
input clk
|
|
|
|
|
);
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
reg [7:0] cyc;
|
|
|
|
|
initial cyc = 0;
|
|
|
|
|
reg set_in_task;
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
always @(posedge clk) begin
|
|
|
|
|
if (cyc == 8'd0) begin
|
|
|
|
|
cyc <= 8'd1;
|
|
|
|
|
set_in_task <= 0;
|
|
|
|
|
end
|
|
|
|
|
if (cyc == 8'd1) begin
|
|
|
|
|
cyc <= 8'h2;
|
|
|
|
|
ttask;
|
|
|
|
|
end
|
|
|
|
|
if (cyc == 8'd2) begin
|
|
|
|
|
if (!set_in_task) $stop;
|
|
|
|
|
cyc <= 8'hf;
|
|
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
|
$finish;
|
|
|
|
|
end
|
|
|
|
|
end
|
2006-08-26 13:35:28 +02:00
|
|
|
|
2026-03-08 23:26:40 +01:00
|
|
|
task ttask;
|
|
|
|
|
begin
|
|
|
|
|
set_in_task <= 1'b1;
|
|
|
|
|
end
|
|
|
|
|
endtask
|
2006-08-26 13:35:28 +02:00
|
|
|
|
|
|
|
|
endmodule
|