Created
December 9, 2019 23:55
-
-
Save ZipCPU/adef3cc8617a42b9acb3c31b3b28f172 to your computer and use it in GitHub Desktop.
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
module vtb; | |
reg clk, d, q; | |
initial clk = 0; | |
always @(*) | |
clk <= #5 !clk; | |
always @(posedge clk) | |
q <= d; | |
initial begin | |
$dumpfile("test.vcd"); | |
$dumpvars(0,vtb); | |
d = 0; | |
@(posedge clk); | |
d = 1; | |
@(posedge clk); | |
d = 0; | |
@(posedge clk); | |
d = 1; | |
@(posedge clk); | |
d = 0; | |
@(posedge clk); | |
d = 1; | |
@(posedge clk); | |
d = 0; | |
@(posedge clk); | |
d = 1; | |
end | |
reg [4:0] counter = 0; | |
always @(posedge clk) | |
begin | |
counter <= counter + 1; | |
if (counter > 20) | |
begin | |
$display("All done\n"); | |
$finish; | |
end | |
end | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment