# Question on events

**URL:** <https://verificationacademy.com/forums/t/question-on-events/29901>\
**Category:** SystemVerilog\
**Tags:** SystemVerilog, events\
**Created:** [September 8, 2014, 5:35am UTC](https://verificationacademy.com/forums/t/question-on-events/29901 "2014-09-08T05:35:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sagar.aceic.com](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@sagar.aceic.com](https://verificationacademy.com/forums/u/sagar.aceic.com)\
**Post date:** [September 8, 2014, 5:35am UTC](https://verificationacademy.com/forums/t/question-on-events/29901/1 "2014-09-08T05:35:23Z")

</div>

Hi,

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

```verilog
	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

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [September 8, 2014, 5:48am UTC](https://verificationacademy.com/forums/t/question-on-events/29901/2 "2014-09-08T05:48:16Z")

</div>

_In reply to [sagar@aceic.com](https://verificationacademy.com/forums/t/question-on-events/29901):_

check the terminating condition of your **for** loop.

---

<div class="post-metadata">

**Author:** ![sagar.aceic.com](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@sagar.aceic.com](https://verificationacademy.com/forums/u/sagar.aceic.com)\
**Post date:** [September 8, 2014, 6:09am UTC](https://verificationacademy.com/forums/t/question-on-events/29901/3 "2014-09-08T06:09:28Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/question-on-events/29901/2):_

Thanks Dave :)
