i need to write proper data in my buffer.
it means payload_length is F0 = 128 bits. this 128 bits i need to write on buffer from AHB driver.
the max payload_length is FF = 2048 bits.
so how can i write that random bits properly on buffer.
//in sequence_item
randc bit [15:0] payload_length; //first 8 bits are my payload_length [15:8]
//constraints
constraint burst_len_c{
(m_hburst == SINGLE) -> (burst_len==1);
(m_hburst inside {WRAP4,INCR4}) -> (burst_len==4);
(m_hburst inside {WRAP8,INCR8}) -> (burst_len==8);
(m_hburst inside {WRAP16,INCR16}) -> (burst_len==16);
} //burst_len for ahb_driver
constraint size_c{
(m_hsize==WORD);
}//my data bus support 32 bit only
in seq file
task body();
//write tx buffer
`uvm_do_with(req,{req.m_hwrite == 1;req.m_haddr == 16'h4000;req.m_hburst == SINGLE;})
endtask
how can i make exact constraint based on payload_length and burst_length.?
the below piece of code for driver
virtual task drive_data(ahb_pkt req);
addr_phase(req);
for(int i = 0; i < req.burst_len-1; i++)
begin
fork
addr_phase(req);
data_phase(req);
join
end
endtask