Sequence/item/call back

Hello,

Is there a way to synchronize the fields in a sequence item with what I send on a callback function?

Example :

Sequence item has this
rand bit[4:0] channel;

In the callback virtual function, I want to set the axi trans’s User bits 4:0 like this :

trans.User[4:0] to be the same as the “randomized” channel value from the sequence item.

Please let me know if there is a way to synch these two? If the information is not clear, please let me know.

Thanks

In reply to UVM_learner6:

In the case of your objective you do not need the callback function because you do notwant to modify the content of the randomized data member. What the callback is doing you can do also in the post_randomize() function.
So far I did not see a scenario which requires the callback. I have never used it in my projects.

In reply to chr_sue:

In reply to UVM_learner6:
In the case of your objective you do not need the callback function because you do notwant to modify the content of the randomized data member. What the callback is doing you can do also in the post_randomize() function.
So far I did not see a scenario which requires the callback. I have never used it in my projects.

Hi Chr_sue, to give a bit more context.

  1. The design is receiving sequence item with the randomizable data member from one side.

  2. I want to tap into the transaction(generated from another sequence) that goes to the design from the other side to use the values that have been randomized in the sequence item. I cannot tap into the sequence/item to do this b/c it is a VIP generated sequence.

If I can use post_randomize, where should I place it? test case? Please help.

In reply to UVM_learner6:

If you have 2 different sequences running on different sequencer like master/slave configuration it is impossible to use post_randomize. But it is also not possible to use the callback. In this case you can share data between the 2 different seuences using responses or transferring data through events.

Any ideas if I can use singleton class for this scenario? If so, can anyone walk me through how to do this?

Thanks

In reply to UVM_learner6:

If I understand right you are running 2 sequences on sequencers in different agents. Is this correct?
If this is the case you need a horizontal communication path. This is not implemented in the standard UVM approach. I believe the best way is to use the uvm_global_event pool. Because this provides mechanisms to exchange data between different agents. A callback does not have this functionality.