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...
class ab_pkt extends uvm_sequence_item;
.
.
.
.
randc bit [15:0] pkt_length;
constraint pkt_length_c{
(pkt_length[15:8] inside {[8'h00:8'hFF]});
}
.
.
endclass
i have used that one in my sequence like below..
class ab_base_seq extends uvm_sequence #(ab_pkt);
.
.
.
`uvm_do_with(req,{req.m_hwrite == 1;req.m_hburst == SINGLE;req.m_haddr == `PKT_REG;req.m_hwdata == req.pkt_length;})
`uvm_info(get_type_name(), $sformatf("PKT LENGTH Reg = %h", req.pkt_length),UVM_LOW)
.
.
.
endclass
am repeating this sequence from testcase 255 times.
is there any other method to do that pkt_length randomization from 0 to 255.without repeating same value..?
thanks,