Altera_Forum
Honored Contributor
11 years agois "for loop" in counter looping according clock cycle?
Hi, all
I would like to create a adjustable delay counter using verilog. I use for loop inside. However, I notice that the for loop does not count base on clock cycle. Any mistake I done? Below is my coding: always @(posedge clk or posedge rst_counter) begin if (rst_counter) begin abc <= 0; end else if (en_counter) begin for (i=0;i<= receiveSize; i++) begin if (i== receiveSize) abc <= 1; end end end