I have written a code for counter and i'm implementing the disable statement. The counter has to count for particular value and exit the block once it reaches the value.
Here is the code:
module counter(
);
parameter number_of_count = 37;
reg clk;
integer count;
initial
begin
count = 5;
clk = 1'b0;
forever #10 clk = ~clk;
end
always @(posedge clk)
begin: this_block
count = count + 1;
$display ($time, " The present count is %d", count);
repeat (number_of_count == count)
begin
count = 5;
disable this_block;
end
end
endmodule
I am not sure what I am missing.