Hi,
I have below code snippet inside my driver. But somehow the driver lost my first cycle of data. Looks like for the first iteration, num_trans incremented twice. Could somebody help me take a look why this happens?
Thanks,
Evan
while(num_trans < initiator_trans.data.size()) begin
tvalid_o <= 1'b1;
tid_o <= initiator_trans.id;
tdata_o <= initiator_trans.data[num_trans];
$display("%0t, checkpoint, tdata_o is%8h", initiator_trans.data[num_trans]);
// Somehow the first cycle of data will lost. assuming the sequence start drive at 40000ns, below is what the above display message shows
// @40000ns checkpoint, tdata_0 is 0000_004e(initiator_trans.data[0])
// @40000ns checkpoint, tdata_o is 8000_00cf(initiator_trans.data[1])
if(num_trans == initiator_trans.data.size() - 1) // last of the data burst
tlast_o <= 1'b1;
@(posedge aclk_i);
while(tready_i != 1) begin
@(posedge aclk_i);
end
num_trans++;
end
//deassert tvalid/tid/tlast after txn is finished
@(posedge aclk_i);
tvalid_o <= 1'b0;
tid_o <= 1'b0;
tlast_o <= 1'b0;