Create UVM sequence to send transactions making 1 bit high at a time for 16 bit register port

Hi,

I want to write a sequence which generates 6 transactions at different time. In each transaction I want to set a bit of 6 bit register.

Example my first transaction is 000001
next transaction can be … 001001
then 001101

and last transaction will be all 1s 111111

I want to go from 000000 to 111111 in any order with help of 6 transactions. Can you please in writng for loop or some thing for this ?

In reply to manavshah33:

Hi,
Inside sequence use one variable increament that variable each time you randomize and randomize transaction with constraint of $countones of variable must be equal to local variable.

// example
repeat(6)
begin
count++;
start_item(req);
assert(req.randomize() with {$countones(req.rand_six_bit_value) == count;});

finish_item(req);
end