sri.cvcblr Posted July 14, 2016 Report Share Posted July 14, 2016 I see uvm_sequencer_base::wait_for_grant (UVM 1.1d) is a virtual task but accesses a local int g_request_id - is this not a bad coding style? If I were to override this virtual method for debug with much of the code intact tool throws an error for his local bar in a derived SQR class. I extended a SQR class and copied all the code for wait_for_grant and started tweaking - couldn't proceed with that debug due to this member being local. Should it be protected instead of local? ThanksSriniwwww.go2uvm.org Quote Link to comment Share on other sites More sharing options...
uwes Posted July 15, 2016 Report Share Posted July 15, 2016 hi, normally there is nothing bad with the fact to access a local member from a virtual function/task. functionality should be exposed via functions/tasks and never via member fields. in that sense opening the access to the local implementation detail g_request_id would be the wrong solution. the right course of action would be to encapsulate the static member g_request_id into an atomic accessor like in java AtomicInteger::incrementAndGet() and expose that in the base class instead. in this particular situation you can probably use an own id generator instead.... /uwe 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.