Sync with sequence end on driver side

Hi all,

I would like to get some help on how would be the right way to sync-up with sequence end.

I have a sequence which is issuing cnt times a 'uvm_do of a packet.

in my driver - I usually drive “IDLE” in between packets.

now, I am trying to simulate back-2-back packets (no idle on ports)

my problem is with last packet.
I have the last data word left driven on the driver ports till test ends (repeating wrongly).

what I would like to do is to drive IDLE after all my cnt packets are done

what would be the nice and correct way to handle such case?

thanks in advance,
Guy

In reply to guy.levi:

The best is to put your IDLE to the sequence. Than you can even randomly generate IDLE states in between and you don’t run into Trouble with your sync.

In reply to chr_sue:

thanks,
do you mean to add a mark in my sequence_item (=pkt) whether i have idle following it ?

i wonder if there is a way to do it maybe using objections ?

In reply to guy.levi:

I do not know the Details of your Project, but I’d define an enumeration type with at least 2 states: ACTIVE, IDLE. In ACTIVE you are sending packest in IDLE you do not. And the Driver generates the corresponding pin wiggles.

In reply to chr_sue:

thanks, but i am not sure i fully understand
I will share more details.

I have a sequence which in its body runs
repeat(cnt)
`uvm_do_with (pkt)

and in my driver i have a forever loop running and does seq_item_port.get_next_item(pkt);

seq_item_port.item_done();

can you please explain where would be the enum defined/used?

thanks!!

In reply to guy.levi:

Define this enumeration type in your seq_item and have a variable of this type.

In reply to chr_sue:

thanks for your help

In reply to guy.levi:

sharing the way I solved it eventually - if someone comes across a similar issue.

In my driver I used :
if (!seq_item_port.has_do_available())

this allowed me to detect if sequence has a pending packet is wants to drive.

it solved 2 aspects for me:

  1. to move to IDLE in the of sequence
  2. to have IDLE in between packets in case sequence would add time between calling `uvm_do

In reply to guy.levi:

But you do not Need this. If there is no seq_item available the objection mechanism takes care that your Simulation stops.

In reply to chr_sue:

yes, but my problem was detecting when my last item was sent, to allow driver to set ports to IDLE state.

using seq_item_port.has_do_available() allowed me to sense there is no more packets to be sent without modifying sequence or data_item.

thanks: )
Guy