In reply to xcxfly:
Please see below:
class my_transaction extends uvm_sequence_item;
rand bit[47:0] dmac;
rand bit[47:0] smac;
rand bit[15:0] ether_type;
rand byte pload[];
rand bit[31:0] crc;
rand int len;
constraint pload_cons{pload.size() == len;}
function new(string name="my_transaction");
super.new(name);
pload = new[len];
endfunction : new
.....
endclass
In your sequence pass the constraint for your transaction to the `uvm_do.
virtual task body();
if(starting_phase != null)
starting_phase.raise_objection(this);
repeat (10) begin
`uvm_do_with(m_trans, {len == inside {[46:1500]};})
end
#100;
if(starting_phase != null)
starting_phase.drop_objection(this);
endtask