@FvM, thank a lot for your fast response!
My counter is "reg [7:0]", so it is 8 bits wide.
I'm not sure that you said the counter should divide by 9 not 8 is correct. I have tried 7,8,9, seams not OK.
The result when I use 8 is, the flag show at first 8th clock positive edge, but the second flag show at next 7th(15th from the beginning) clock positive edge. The test totally generate 16 clock in real CPLD device MAX II E240. The ModelSim result with test bench show correct flag wave, which is different to real one.:confused: