2012-05-17 01:31:24 +02:00
|
|
|
// DESCRIPTION: Verilator: Non-cutable edge in loop
|
|
|
|
|
//
|
|
|
|
|
// This code (stripped down from a much larger application) has a loop between
|
|
|
|
|
// the use of ready in the first two always blocks. However it should
|
|
|
|
|
// trivially trigger the $write on the first clk posedge.
|
|
|
|
|
//
|
2023-09-16 00:12:11 +02:00
|
|
|
// This is a regression test against issue #513.
|
2012-05-17 01:31:24 +02:00
|
|
|
//
|
2026-01-27 02:24:34 +01:00
|
|
|
// This file ONLY is placed under the Creative Commons Public Domain.
|
|
|
|
|
// SPDX-FileCopyrightText: 2012 Jeremy Bennett
|
2020-03-21 16:24:24 +01:00
|
|
|
// SPDX-License-Identifier: CC0-1.0
|
2012-05-17 01:31:24 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
module t (
|
|
|
|
|
input clk
|
|
|
|
|
);
|
2012-05-17 01:31:24 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
reg ready;
|
2012-05-17 01:31:24 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
initial begin
|
|
|
|
|
ready = 1'b0;
|
|
|
|
|
end
|
2012-05-17 01:31:24 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
always @(posedge ready) begin
|
|
|
|
|
if ((ready === 1'b1)) begin
|
|
|
|
|
$write("*-* All Finished *-*\n");
|
|
|
|
|
$finish;
|
|
|
|
|
end
|
|
|
|
|
end
|
2012-05-17 01:31:24 +02:00
|
|
|
|
2026-03-10 02:38:29 +01:00
|
|
|
always @(posedge ready) begin
|
|
|
|
|
if ((ready === 1'b0)) begin
|
2012-05-17 01:31:24 +02:00
|
|
|
ready = 1'b1;
|
2026-03-10 02:38:29 +01:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
always @(posedge clk) begin
|
|
|
|
|
ready = 1'b1;
|
|
|
|
|
end
|
2012-05-17 01:31:24 +02:00
|
|
|
|
|
|
|
|
endmodule
|