bullfrog Posted March 9, 2012 Report Share Posted March 9, 2012 It seems like uvm_root could get extended, but how, then, might I set uvm_top appropriately (without modifying the uvm_root class definition)? class uvm_root extends uvm_component; static function uvm_root uvm_root::get(); ... endclass const uvm_root uvm_top = uvm_root::get(); Thanks. Nilynneuxi 1 Quote Link to comment Share on other sites More sharing options...
dave_59 Posted March 10, 2012 Report Share Posted March 10, 2012 The fact that uvm_top is a const variable means that they do not want you to modify it. Unless the UVM documents that you should extend a class, you should not be extending any UVM classes. Quote Link to comment Share on other sites More sharing options...
uwes Posted March 12, 2012 Report Share Posted March 12, 2012 hi, technically you can extend uvm_root (because there is no "final" in the language) BUT you cant make uvm use your derived class without edits.if you could explain your use case we hopefully can identify other paths to accomplish the functionality without interacting with the critical core classes. /uwe Quote Link to comment Share on other sites More sharing options...
bullfrog Posted February 8, 2013 Author Report Share Posted February 8, 2013 Basically, if there's anything that I need/want to do at simulation time-zero and UVM time-zero, then extending the uvm_top class would allow for that. This actually came up when I was trying to register a global report-server. Because I cannot extend uvm_root and I cannot guarantee instantiation order of global variables, then some messages were reported by UVM classes and a 3rd party VIP class instance prior to my report-server registration. My post processing scripts will miss that because they expect a specific formatting. Even though this was for the global report-server, I think it stands for any functionality requiring UVM time-zero to execute. In my environment, I created an extensible proj_root class globally instantiated: `define PROJ_ROOT_CLASS proj_root class proj_root; ... endclass const `PROJ_ROOT_CLASS proj_top = `PROJ_ROOT_CLASS::get(); I can extend proj_root to a new class that handles some time-zero activity know that it will be instantiated by redefining PROJ_ROOT_CLASS macro. It seems like UVM could do something similar while guaranteeing uvm_top purity (to some extent) by just using the macro at the function call: const uvm_root uvm_top = `UVM_ROOT_CLASS::get(); This would mean that the const variable itself would still be const at uvm_root scoping, but now I get to synchronize my time-zero activities with UVM time-zero. I suppose the alternative would be to add hooks (do_local_configure?) in uvm_root to allow UVM time-zero activity, but I think class extension would be more general-case. Sorry for the very long explication delay. Thanks. Quote Link to comment Share on other sites More sharing options...
uwes Posted February 8, 2013 Report Share Posted February 8, 2013 (edited) well, a better solution for a couple of issues would be 1. make a uvmCoreServiceClass class with virtual members like "virtual uvm_root getUVMRoot();" ... and potentially other global reporter, resource_pool, factory ... 2. make a single const instance "const uvmCoreServiceClass uvmCoreService = `UVM_CORE_SERVICE::get();" //so you CAN override the class 3. now replace all static calls like uvm_root::bla or uvm_factory::boo with calls to the service class. (the static calls just make sure it will be this class forever and this is not really extensible and base class friendly) 4. now it would be possible to derive from uvmCoreServiceClass and reimplement getUVMRoot() returning a derived uvm_root. /uwe Edited February 8, 2013 by uwes Quote Link to comment Share on other sites More sharing options...
jadec Posted February 11, 2013 Report Share Posted February 11, 2013 You should be able to safely modify the global report server before calling run_test(). That should handle anything that happens within the UVM phasing (it's still possible for static initializers to run before that, but there's never going to be a way to control the order of that). It seems to me that any extension of uvm_root would suffer from the same timing problem you have now with extending the report server. Quote Link to comment Share on other sites More sharing options...
nash123 Posted May 7, 2013 Report Share Posted May 7, 2013 Hi guys, I want to override all_dropped() call back in uvm_root class.I tried inheriting uvm_root but am facing multiple fatal issues.I have multiple objections raised in different components of my test-bench I want a single point control of all those objection.I put an print statement in uvm_root's all dropped task and observed that it gets called after all the objections I raised in parent test and all its decedent classes are dropped.I don't want to touch the uvm_root source code.Is there any other way to do this? Basically, I want to make a flag/signal go high after all my objections are dropped.I have objections scattered at different places ,in different base classes controlling different things. task all_dropped() begin all_done = 1; endtask Quote Link to comment Share on other sites More sharing options...
jadec Posted May 23, 2013 Report Share Posted May 23, 2013 Nash, you're probably better off creating your own question thread. But you should be able to register your own objection callback for this without modifying the component. 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.