Hi All,
in my driver code I’m trying to save my packet class in queue while every time driving.
task drive();
@(posedge vif.hclk)
if(vif.rst==1)
begin
if(ahb_pkt.hwrite==1)
begin
vif.haddr=ahb_pkt.addr;
vif.hsize=ahb_pkt.size;
....
....
vif.hsel=ahb_pkt.sel;
@(posedge vif.hclk)
vif.hwdata=ahb_pkt.wdata;
tx_pkt_q.push_back(ahb_pkt);
end
else begin
vif.haddr=ahb_pkt.addr;
vif.hsize=ahb_pkt.size;
....
....
vif.hsel=ahb_pkt.sel;
@(posedge vif.hclk)
ahb_pkt.rdata=vif.hrdata;
rx_pkt_q.push_back(ahb_pkt); end
end
endtask
task check();
if(tx_pkt_q.size()>0) begin
tx_pkt=tx_pkt_q.pop_front(); end
endtask
from this code, while reading tx_pkt_q and its size I’m observing that queue size is 8 and the data from queue is overring all 8 location with recent push packet. I’m reading queue with pop_front like tx_pkt=tx_pkt_q.pop_front(); so all 8 locations reading with last push packet, overriding previous packets.
Please let me know why this is happening why i’m unable read pervious 7 different packets.
Note: I’m not using UVM, its simple sv tb drive code