I write a uvm sequence, but I found the uvm_do have problem. The logic is right. But the waveform is not responded to my logic. It has one cycle delay.
while(1)begin
if(m_trans.gnt)begin
i = i + 1;
$display($realtime, " i=%d my gnt = %d",i, m_trans.gnt);
`uvm_do_with(m_trans,{m_trans.be == 4'hF;
m_trans.req == 1'b1;
m_trans.wen == 1'b0;
m_trans.tcdm_addr == 32'h10000000+4*i;})
$display($realtime, " i=%d my gnt = %d",i, m_trans.gnt);
end
$display($realtime,"i=%d gnt = %d data=%d", i, m_trans.gnt, data);
`uvm_do_with(m_trans,{m_trans.be == 4'hF;
m_trans.req == 1'b1;
m_trans.wen == 1'b1;
m_trans.tcdm_addr == 32'h10000000+4*i;})
if(i==5)begin
break;
end
end
This is my code. And this is output.
520 i= 1 my gnt = 1
530 i= 1 my gnt = 0
530i= 1 gnt = 0 data=-1107428987
540i= 1 gnt = 0 data=-1107428987
550i= 1 gnt = 0 data=-1107428987
560i= 1 gnt = 0 data=-1107428987
570i= 1 gnt = 0 data=-1107428987
580i= 1 gnt = 0 data=-1107428987
590i= 1 gnt = 0 data=-1107428987
600 i= 2 my gnt = 1
610 i= 2 my gnt = 0
And I think this UVM_DO(when gnt signal is 1) will last one cycle between 520ns to 530ns.
But from the waveform, I found this UVM_DO(when gnt signal is 1) lasts one cycle between 530ns to 540ns.
I don’t know why does it happen, does anyone know how UVM_DO in detail about its timing.