RegisterLogin  
Update Profile
   
You are here: Forum  
Minimize 
SVUG Community Forum
Subject: "this" in SV
Prev Next
You are not authorized to post a reply.

Author Messages
DivyaUser is Offline

Posts:1

08/06/2007 7:37 AM  

Can anyone please tell me what is the use of "this" operator in SV and when is it used?

Thanks,

Divya

VlsiUser is Offline

Posts:1

08/11/2007 5:51 AM  

hi

this is used to point variables in the current class...and if u want to use variables from base clas thn use "super"

DivyaUser is Offline

Posts:1

08/13/2007 1:32 AM  

Hi,

Thanks a lot for ur reply :)

But, what is the use of using "this" pointer in the current class? You can use current class variables w/o using "this", right?

Can you plz explain this??

Thanks,

Divya

VlsiUser is Offline

Posts:1

08/13/2007 1:48 AM  

hi divya,

take d ex below..

class example;

integer x;

function new (integer x)

this.x = x;

endfunction

end class

now the compile will know how to resolve between class propert x ans method argument x and for this purpose we usaually use this...but if u hv diff variable thn use of this is not necessary...

i hope u r clear..if u still hv any querry u can ask..

well i do hv one doubt..

can u explain me the eaxact functionality of

fet_randstate and set_randstate...

 

You are not authorized to post a reply.



ActiveForums 3.7
  

 Copyright 2008 by SystemVerilog User Group Contact Us    Privacy Statement