# Static Method

**URL:** <https://verificationacademy.com/forums/t/static-method/30147>\
**Category:** UVM\
**Tags:** UVM, static-method\
**Created:** [November 19, 2014, 6:43pm UTC](https://verificationacademy.com/forums/t/static-method/30147 "2014-11-19T18:43:03Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![anthony.vu.gd-ais.com](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/a/919ad9/32.png) [@anthony.vu.gd-ais.com](https://verificationacademy.com/forums/u/anthony.vu.gd-ais.com)\
**Post date:** [November 20, 2014, 5:29pm UTC](https://verificationacademy.com/forums/t/static-method/30147/5 "2014-11-20T17:29:54Z")

</div>

_In reply to [dave\_59](https://verificationacademy.com/forums/t/static-method/30147/4):_

Great responses! I know that I’m gonna learn much from you any time I’d ask; really appreciate this; I agree with most of them.

1. Indeed the compile needs to know if a type exists; I must agree with your response on this principle. This is precisely why we sometimes do typedef class uvm\_component; etc.  
The point is a compile may not know what pss\_env\_config is until it is defined; therefore, the code as written may not work. More likely or not, it will result in a syntax error due to “undefined” type. For your example, the reason that uvm\_component works is that it is typedef’ed in its parent class uvm\_report\_object line 26.

2. Who knows and remembers all the terminologies of OOP all the time? Thanks a bunch to point it out :-) I completely agree with you about their loaded words!  
The key word “static” is not a legacy term; it is defined in all IEEE 1800’s including the IEEE 1800-2012 section 8.10 page 141. It is stated that “A static method has no access to non-static members (class properties or methods)”. Accessing a non-static method as shown in pss\_env\_config::get\_config will be a syntax error.  
The reason that `uvm_fatal_context works and `uvm\_fatal does not is that `uvm_fatal_context uses a static method but `uvm\_fatal does not.

The point of my inquiry is that the code as written will have at least a syntax error unless there is some clever trick hidden somewhere which I don’t know and would like to learn.  
In my humble opinion, the code would be fine if it would has been written as:  
1.  
typedef class pss\_env\_config;  
`include “pss_env_config.svh” These can be written in the package in which the pss_env_config.svh is `include’d.

1. `uvm_fatal_context should be used instead of `uvm\_fatal.

Thanks again; it is always a pleasure reading your posts; I am a big fan of yours.  
Best regards

---

_[View the full topic](https://verificationacademy.com/forums/t/static-method/30147)._
