I have declared the pkt_length variable as randc type.then i gave range for that variable with constraint.but it giving repeated values inside boundary only(means inside range only).
here my requirement was i need to do randomized the pkt_length with 255 times.but it getting repeated values only.
here small piece of code…
The randc directive only works on the same object randomized with the same constraints. The uvm_do macro creates a new object each time its used. You can either avoid using the uvm_do macro (See Sequences/Generation | Verification Academy) or you will have to build a list of previous pkt_length values and add another constraint
!(pkt_length inside {list};.
in my case i cant remove uvm_do macro.
if i need to create pkt_length list…i need to write 0,1,2,3,…255.
is it good to write like that…in constraint …?
A more simple solution is to run the loop in the sequence and starting this sequence in the test. Running the loop in the test complicates your problem.
I do not understand that the loop in the sequence should have any influence on the protocol. The protocol behavior is only definde by the driver.
BTW why do you ues the randc declaration? It should also work with a simple rand declaration.
The uniqie does nor solve your issue. Because you are egnerating in your sequence only 1 seq_item. In any case this is unique.
thanks chr_sue,
actually that particular sequence used for other testcases also.so all the testcase may not require for_loop.
so i need to take care about that sequence.
You could extend the current sequence, creating only 1 seq_item to another one which has a for loop inside.
The typical approch is to select for a testcase any sequence, creating/randomizing it and sdtarting this sequence on the corresponding sequencer.