qwerty Posted August 6, 2014 Report Share Posted August 6, 2014 Hi, I my using uvm_hdl_force("path",data) to configure the registers of the design. But the problem is they are large in number so i want to loop them in. for(int i=0; i<8; i++) begin for(int j=0; j<8; j++) begin uvm_hdl_force("DUt.abc.pkt.reg_0.w[1]" , data); end end I want to replace 0 with i and 1 with j . Is their a simple way to do it. Quote Link to comment Share on other sites More sharing options...
tudor.timi Posted August 6, 2014 Report Share Posted August 6, 2014 Use $sformatf("DUt.abc.pkt.reg_%0d.w[%0d]", i, j) to return your path string. qwerty 1 Quote Link to comment Share on other sites More sharing options...
qwerty Posted August 6, 2014 Author Report Share Posted August 6, 2014 used $sformatf to pass it to a string a pass that string to uvm_hdl_force(). thanks for the solution. Quote Link to comment Share on other sites More sharing options...
tudor.timi Posted August 6, 2014 Report Share Posted August 6, 2014 You should be able to bypass the temporary string completely and just give $sformatf(...) as an argument to uvm_hdl_force (though I suspect you also wanted to print the string to make sure it works correctly). Quote Link to comment Share on other sites More sharing options...
uwes Posted August 7, 2014 Report Share Posted August 7, 2014 hi, if these are bus-accessible registers (not just 'reg' s) then use the register model together with the hdl backdoor instead of directly forcing the values. /uwe Quote Link to comment Share on other sites More sharing options...
qwerty Posted August 11, 2014 Author Report Share Posted August 11, 2014 Hi Uwe, Any specific reason why not to use the uvm_hdl_force directly? -QW 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.