Say i have a basic sequence like this where i want to randomize the mode in the sequence in my test. Please note I am ignoring boiler plate code for brevity. I am very particular that i want to start my sequence this way. I have embedded my questions in the code using comments. Please clarify.
class foo_seq extends uvm_sequence #(my_seq_item);
rand bit [3:0] mode;
task body();
case (mode)
0 : //do mode 0 specific randomization in the sequence item
1 : //do mode 1 specific randomization in the sequence item
//so on so forth
endcase
endtask
endclass
class test extends uvm_test;
task run_phase();
//now when i want to start my sequence like below.
//Does mode get randomized automatically? If so in which part of start() it gets randomized()?
//Or do I need to call my_foo_seq.randomize() first before calling my_foo_seq.start(...)
//note that i am particular about randomizing this mode variable in my sequence.
my_foo_seq.start(my_foo_seqr);
endtask
endclass