pushkar.naik Posted July 12, 2012 Report Share Posted July 12, 2012 There is a common requirement that the Read-Only registers like status registers in hardware need to be reflected relatime in its register package counterpart for their current status on every HW update they go through. This may be required since there could e a sequence whose course of action would change immediately upon this status update detection. Is there a mechanism available in UVM Register package to take care of such requirement, without user having to write a sequence to monitor the hardware register ? If not, has the UVM community thought about this requirement ? Quote Link to comment Share on other sites More sharing options...
uwes Posted July 12, 2012 Report Share Posted July 12, 2012 hi, you should be looking at the uvm_reg_backdoor's auto-update capability (see uvm_reg_backdoor::is_auto_updated. a very simple impl. is attached class my_bkdr extends uvm_reg_backdoor; function new(string name = ""); super.new(name); endfunction task read(uvm_reg_item rw); do_pre_read(rw); rw.value = new[1]; rw.value[0] = dut.register; rw.status= UVM_IS_OK; do_post_read(rw); `uvm_info("BKDR","performed read",UVM_HIGH) endtask task write(uvm_reg_item rw); do_pre_write(rw); dut.register = rw.value[0]; do_post_write(rw); `uvm_info("BKDR","performed write",UVM_HIGH) endtask virtual local task wait_for_change(uvm_object element); @(dut.register); `uvm_info("BKDR","detected change",UVM_HIGH) endtask function bit is_auto_updated(uvm_reg_field field); return 1; endfunction endclass Quote Link to comment Share on other sites More sharing options...
pushkar.naik Posted July 12, 2012 Author Report Share Posted July 12, 2012 Thanx for a quick response. I'll look into this mechanism in more details, and get back if i have any further queries. Quote Link to comment Share on other sites More sharing options...
sword_hs Posted March 20, 2013 Report Share Posted March 20, 2013 hi, you should be looking at the uvm_reg_backdoor's auto-update capability (see uvm_reg_backdoor::is_auto_updated. a very simple impl. is attached class my_bkdr extends uvm_reg_backdoor; function new(string name = ""); super.new(name); endfunction task read(uvm_reg_item rw); do_pre_read(rw); rw.value = new[1]; rw.value[0] = dut.register; rw.status= UVM_IS_OK; do_post_read(rw); `uvm_info("BKDR","performed read",UVM_HIGH) endtask task write(uvm_reg_item rw); do_pre_write(rw); dut.register = rw.value[0]; do_post_write(rw); `uvm_info("BKDR","performed write",UVM_HIGH) endtask virtual local task wait_for_change(uvm_object element); @(dut.register); `uvm_info("BKDR","detected change",UVM_HIGH) endtask function bit is_auto_updated(uvm_reg_field field); return 1; endfunction endclass Hi I just wrote the code as you referred above, and how could I set the "dut.register". actually when I set as "tb_top.dut.register", there is error info as below "illegal location for a hierarchical name (in a package)." Could you help me about this error? Quote Link to comment Share on other sites More sharing options...
uwes Posted March 21, 2013 Report Share Posted March 21, 2013 as the message says you cant reference an absolute hier path from within a package (dut.register). there are various solutions (use a interface/virtual interface or move the code outside of the package or...) 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.