DavidLarson Posted March 26, 2012 Report Share Posted March 26, 2012 (edited) When printing the full name of a register that is within a child class of uvm_reg_file, the hierarchical path is incorrect. The path should be something like this: block_name.reg_file[0].register_name.field_name but what is printed to the screen is: reg_file[0].register_name.field_name Digging into it I found that the get_full_name() function in the uvm_reg_file class does something questionable. Here's the code: function string uvm_reg_file::get_full_name(); uvm_reg_block blk; get_full_name = this.get_name(); // Do not include top-level name in full name if (m_rf != null) return {m_rf.get_full_name(), ".", get_full_name}; // Do not include top-level name in full name blk = this.get_block(); if (blk == null) return get_full_name; if (blk.get_parent() == null) return get_full_name; get_full_name = {this.parent.get_full_name(), ".", get_full_name}; endfunction: get_full_name If you look at the get_block() function, you see that it returns the parent. So the "blk" variable contains a reference to the parent block. Then the next conditional checks if the parent has a parent (i.e. a grandparent). If it doesn't (which it normally won't) then it just returns the block name instead of the full path. This clearly seems wrong. Unless there's something I'm missing, the function should be rewritten like this: function string uvm_reg_file::get_full_name(); uvm_reg_block blk; get_full_name = this.get_name(); // Do not include top-level name in full name if (m_rf != null) return {m_rf.get_full_name(), ".", get_full_name}; // Do not include top-level name in full name if (parent == null) return get_full_name; get_full_name = {this.parent.get_full_name(), ".", get_full_name}; endfunction: get_full_name Edited March 26, 2012 by DavidLarson Fixed a typo Quote Link to comment Share on other sites More sharing options...
petermonsson Posted April 4, 2012 Report Share Posted April 4, 2012 Hi David, Thanks for your bug report. It is registered under http://www.eda.org/svdb/view.php?id=4091. Best Regards Peter 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.