Global Sources
EE Times - IndiaWebsite
Stay in touch with EE Times India
eeBlog-Article content Home / eeBlog / 

Profile
Nickname: asicwithankit     Articles(7)    Visits(39518)    Comments(5)    Votes(24)    RSS
ASIC with Ankit covers ASIC design verification, languages and methodology. The author, Ankit Gopani, works as a Lead Design Verification Engineer with SmartPlay Inc. He has 9 years of industry experience in ASIC design verification and executed several Verification projects.
Blog Archive:
2015 -  Mar
2014 -  Nov
2013 -  May.,  Apr.,  Mar.,  Feb
View All

Posted: 01:09:30 PM, 27/05/2013

What is "this" in System Verilog ?

   

 

Dear Readers,

 

Here I would like to share some understanding on keyword called "this". What is "this" in System Verilog? How does it used? Usage of "this" is simple but important in test bench development.

 

First of all lets understand What is "this" in System Verilog?

 

"this" is a key word in System Verilog used to unambiguously refer to class properties or methods of current object. The "this" keyword shall only used within a non-static class methods otherwise an error shall occur.

 

As example is the best way to understand the most of the things, let me take a example and try to explain.

Example to understand the usage of "this" in System Verilog:

 

#############################################


     class ASICwithAnkit ;

        int a ;


        function new (int a);

           this.a = a;

        endfunction : new


     endclass : ASICwithAnkit


//Class instantiation and usage


ASICwithAnkit  AwA = new (123);

$display ("AwA.a = %d,", AwA.a);


##########################################

 

In above example we can see that 'a' is a member of class "ASICwithAnkit". When we initialize the memory for class for usage, we have passed a integer value '123' to its constructor (function new). The variable 'a' is local to class instance "AwA and is now 123 as we have passed this from constructor.

 

Hope this is useful to understand the meaning and usage of "this" in System Verilog.

 

Happy Reading !

ASIC With Ankit

Views(4230) Comments(0)
Total [10] users voted     
[Last update: 01:09:30 PM, 27/05/2013]
CONTACT US TO OWN A BLOGNew!  

Have Your Say!

Got something to say? Why not share itwith other engineers?

CONTACT US TO OWN ONE!

SEE WHAT OTHERS HAVE SAID?

Top eeBlog Keywords

1.  arduino

2.  software

3.  power

4.  code

5.  embedded

Happening Now...

Pulse of the industry

eeForum homepage

 
Back to Top