cliffc Posted February 23, 2013 Report Share Posted February 23, 2013 Hi, All - UVM uses a different phase-calling syntax than OVM. Examples: function void build_phase(uvm_phase phase); super.build_phase(phase); ... task run_phase (uvm_phase phase); ... I see the value of having "phase" with the run_phase(s) because I am going to do: phase.raise_objection(this); phase.drop_objection(this); But I am trying to understand why I would use this syntax with function-phases where I will not raise/drop objections. In fact, in the src/base/uvm_component.svh file, the code for the connect_phase() is the following: function void uvm_component::connect_phase(uvm_phase phase); connect(); return; endfunction So the function just appears to call the simpler-syntax connect() method. I had a student in UVM training that chose to use the simple names and the labs worked just fine. Only the final_phase() does not have a simpler OVM counterpart and there is also a final keyword in the SystemVerilog language. Any experts care to comment on the more complex calling syntax with no readily apparent value? Regards - Cliff Cummings www.sunburst-design.com Quote Link to comment Share on other sites More sharing options...
janick Posted February 24, 2013 Report Share Posted February 24, 2013 As far as I recall, it was for symmetry. Also, should accessing the phase object be useful/necessary in a future release, this approach made it readily accessible. It would not have been possible to add this argument in a subsequent release as you cannot modify the signature of virtual methods in SV. Quote Link to comment Share on other sites More sharing options...
cliffc Posted February 24, 2013 Author Report Share Posted February 24, 2013 Thanks, Janick - I had a hunch that this capability might be related to reserving the capability for a future enhancement, although I can't imagine what that enhancement might be for the function phases (hence, the term enhancement!) Good point about setting the prototype signature for that possible future enhancement, although it could be argued that using the existing phase names would still allow the creation of the name_phase(uvm_phase phase) syntax in the future when such enhancements made sense. Considering the much simpler syntax of the old function-phase() name syntax, and am mildly inclined to promote the older syntax until I can justify the extra verbosity of the newer syntax. I will have to think this one through. It would mean that the final_phase() would be an exception and exceptions can be equally confusing. Regards - Cliff Cummings www.sunburst-design.com Quote Link to comment Share on other sites More sharing options...
janick Posted February 24, 2013 Report Share Posted February 24, 2013 The phase methods without the "*_phase(uvm_phase phase)" signature were never part UVM. They were left there to ease migration from OVM to UVM and are officially deprecated. Thou shalt not use them. Quote Link to comment Share on other sites More sharing options...
dave_59 Posted February 24, 2013 Report Share Posted February 24, 2013 Cliff, The older syntax is already deprecated - it's only there for backward compatibility with OVM. You will create confusion if people assume that connect and connect_phase are just syntactic synonyms for each other and people start extending their classes with connect() from classes already using connect_phase()or vice versa - these methods will not be called in the right order. I can see some purpose in using the phase argument when calling common routines for reporting or debugging to know which phase you were called from. Quote Link to comment Share on other sites More sharing options...
cliffc Posted February 24, 2013 Author Report Share Posted February 24, 2013 Okay, Janick & Dave have convinced me to keep teaching the proper name_phase(uvm_phase phase) syntax. I was wavering, but when Janick used the "Thou shalt not use them" commandment, I decided to obey! Dave - have you used the phase argument in any reporting and debugging calls from the function phases? Regards - Cliff Cummings www.sunburst-design.com Quote Link to comment Share on other sites More sharing options...
dave_59 Posted February 24, 2013 Report Share Posted February 24, 2013 have you used the phase argument in any reporting and debugging calls from the function phases?No, only with the time consuming phases. My point was that knowing what phase you are in could be used for something other than objections, not that I was promoting its use. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.