Skip to content

Instantly share code, notes, and snippets.

@axayjha
Created April 7, 2019 15:20
Show Gist options
  • Save axayjha/2152ac7d8fad2729a3f9b97798dd65ee to your computer and use it in GitHub Desktop.
Save axayjha/2152ac7d8fad2729a3f9b97798dd65ee to your computer and use it in GitHub Desktop.
module test;
/* Make a reset that pulses once. */
reg reset = 0;
initial begin
$dumpfile("test.vcd");
$dumpvars(0,test);
# 17 reset = 1;
# 11 reset = 0;
# 29 reset = 1;
# 5 reset =0;
# 513 $finish;
end
/* Make a regular pulsing clock. */
reg clk = 0;
always #1 clk = !clk;
wire [7:0] value;
counter c1 (value, clk, reset);
initial
$monitor("At time %t, value = %h (%0d)",
$time, value, value);
endmodule // test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment