Module UpDownCounter(
Module UpDownCounter(
reg [2:0]next_counter;
initial begin
counter <= 3'b000;
end
endmodule
module UpDownCounter_TB;
reg CLK;
reg MODE;
wire [2:0]COUNTER;
UpDownCounter
counter_instance(.clock_pulse(CLK), .mode(MODE), .counter(COUNTER));
always begin
#10 CLK = ~CLK;
end
initial begin
MODE = 1'b0;
CLK = 1'b0;
#800;
$finish;
end
always @(posedge CLK) begin
$display("CLK = %b, MODE = %b, COUNTER = %b", CLK, MODE, COUNTER);
end
endmodule