yosys/examples/cmos/counter_tb.v

34 lines
558 B
Verilog
Raw Normal View History

module counter_tb;
/* Make a reset pulse and specify dump file */
reg reset = 0;
initial begin
$dumpfile("counter_tb.vcd");
$dumpvars(0,counter_tb);
# 0 reset = 1;
# 4 reset = 0;
# 36 reset = 1;
# 4 reset = 0;
# 6 $finish;
end
2017-04-08 22:54:31 -05:00
/* Make enable with period of 8 and 6,7 low */
reg en = 1;
always begin
en = 1;
#6;
en = 0;
#2;
end
/* Make a regular pulsing clock. */
reg clk = 0;
always #1 clk = !clk;
2017-04-08 22:54:31 -05:00
/* UUT */
wire [2:0] count;
counter c1 (clk, reset, en, count);
endmodule