cliffc Posted August 7, 2013 Report Share Posted August 7, 2013 In addition to the `uvm_info / `uvm_fatal / uvm_error, etc. macros, there are "context" versions: `uvm_info_context / `uvm_fatal_context, etc. The documentation is not exceptionally useful for the latter. Why would one use the "context" versions of the macros? Regards - Cliff Cummings Quote Link to comment Share on other sites More sharing options...
uwes Posted August 8, 2013 Report Share Posted August 8, 2013 hi, the *_context variant of the macros can be used when you want the message to appear as if emitted by another object. a common use model would be if all your components use a common helper class which emits a message then typically you want instead of your common helper class appearing in the message the parent component to be printed. the _context macros are just `define uvm_*_context(ID, MSG, CNTXT) \ begin \ if (CNTXT.uvm_report_enabled(...)) \ CNTXT.uvm_report_* (...); \ end cliffc 1 Quote Link to comment Share on other sites More sharing options...
cliffc Posted August 8, 2013 Author Report Share Posted August 8, 2013 Hi, Uwes - Thanks, this helps. It may take me a while to find a useful structure that would benefit from the capability. Does this affect the `__FILE__ macro in the message macros? Regards - Cliff Quote Link to comment Share on other sites More sharing options...
apfitch Posted August 10, 2013 Report Share Posted August 10, 2013 Hi Cliff, one use is if you're trying to debug a sequence. If you use `uvm_info you'll get the complete path to the sequencer in the reports, which is pretty unwieldy. If you use `uvm_info_context and specify the context as uvm_top, you get nice short messages. The __FILE__ and __LINE__ still works, as the information is supplied as part of the `uvm_info_context call to the report code. Here's the source `define uvm_info_context(ID, MSG, VERBOSITY, CNTXT) \ begin \ if (CNTXT.uvm_report_enabled(VERBOSITY,UVM_INFO,ID)) \ CNTXT.uvm_report_info (ID, MSG, VERBOSITY, `uvm_file, `uvm_line); \ end regards Alan 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.