Question on events

Hi,

I have coded a tracking logic for a certain cover point making use of events

	initial 
	begin
		forever
		begin
			@(posedge clk);
			if(Awburst==WRAP && Awvalid)
			begin
			upper_boundary=(2**Awsize)*Awlen;
			wrap_addr=((int'(Awaddr/upper_boundary))*upper_boundary); 
			wb = wrap_addr+upper_boundary;
			addr_que.push_back(Awaddr);
			 for(int i=1;Awlen+1;i++)
		       	 begin
				addr_que[i]=addr_que[i-1]+2**Awsize;
				if(addr_que[i]>=wb)
					begin
						addr_que[i]=wrap_addr;
						->wrap_event;
                                                //[HERE]
						$display("wrap event occurs.............",$time);
					end
						@(posedge clk);//CLKINGEVENT2
		     	 end
		      end
		end
	    
	end

     int a=1;

	covergroup wrap_cg@(wrap_event);	
		option.per_instance =1;
		wrap_cover:coverpoint a;
		endgroup
  1. Supposingly, if I remove CLKINGEVENT2 from the code I see that ->wrap_event is thrown infinitely and the test hangs though I have it in the for loop that executes finite number of times. Why is it so?
    2)If I put the CLKINGEVENT2 at //[HERE] instead I see that the event is thrown but the coverpoint doesn’t get covered…why?

Thanks

In reply to sagar@aceic.com:

check the terminating condition of your for loop.

In reply to dave_59:

Thanks Dave :)