vvs3693 Posted January 11, 2012 Report Share Posted January 11, 2012 Hi, I have a variable (int) in my sequence. How can I set the value to it in my test case ?? My sequence looks like this: class my_seq extends uvm_sequence#(my_txn); int N; `uvm_object_utils_begin(my_seqI) // register with factory `uvm_field_int (N,UVM_DEFAULT) `uvm_object_utils_end function new(string name); super.new(name); endfunction task body(); repeat (N) begin .... end endtask:body endclass:my_seq I have an handle for sequence in test. From My test case I want to control the value of N, Is there any other method other than assigning the value directly ? Quote Link to comment Share on other sites More sharing options...
dave_59 Posted January 11, 2012 Report Share Posted January 11, 2012 Don't understand the title of your post in relation to the question being asked. For classes not derived from uvm_component, you must explicitly get the value from the config db. if (!uvm_config_db#(int)(context,"",N)) `uvm_error("code","message); You context could be m_sequencer or it could be null if this is a global setting. Quote Link to comment Share on other sites More sharing options...
vvs3693 Posted January 12, 2012 Author Report Share Posted January 12, 2012 Don't understand the title of your post in relation to the question being asked. For classes not derived from uvm_component, you must explicitly get the value from the config db. if (!uvm_config_db#(int)(context,"",N)) `uvm_error("code","message); You context could be m_sequencer or it could be null if this is a global setting. Hi Dave, Thanks a lot... That solved my problem... 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.