-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
313f376
commit 6b5d7a3
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module top; | ||
|
||
logic clk = 0; | ||
int cnt = 0; | ||
|
||
always @(posedge clk) begin | ||
fork begin | ||
#(10*2); // Wait 10 clock periods | ||
cnt++; | ||
end | ||
join_none | ||
end | ||
|
||
initial begin | ||
$display("Starting test"); | ||
repeat (100) begin | ||
#1 clk = 1; | ||
#1 clk = 0; | ||
end | ||
#(10*2); // Wait 10 clock periods | ||
$display("cnt = %0d", cnt); | ||
if (cnt === 100) | ||
$display("PASSED"); | ||
else | ||
$display("FAILED"); | ||
$finish(0); | ||
end | ||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters