Issue with Sequence Termination in Test

Can you help me with running the following sequences?

I have one sequence that returns pcie_ltp when calling seq.start(null), and returns tlp. I want to use this in another sequence.
I tried as follows, but the test is getting terminated abruptly.

task body();
  fork 
    begin
      pcie_tlp.start(null);
    end 
    begin
      `uvm_create_on(seq_item, seqr)
      seq_item.data = pcie_tlp.data;
      `uvm_Send(seq_item)
    end

what might be the issue here?

It’s not completely clear what issue you are describing, so perhaps describing what you expect to happen would help.

It seems that pcie_tlp is a virtual sequence, and you use ‘data’ from that virtual_sequence as part of another sequence_item. If this is the case, then you shouldn’t be using fork to run these two in parallel. I would think that pcie_tlp needs to complete first, and then seq_item can be sent.

One recommendation is to not use the uvm_create_* and uvm_send* macros as they can cause some unknown behaviors. Instead, use the create()/start_item() and finish_item() calls.

If this is the case, then you shouldn’t be using fork to run these two in parallel. I would think that pcie_tlp needs to complete first, and then seq_item can be sent.

Yes, this is the exact scenario. Will wait help me achieve the same result, or is there another way to wait?

pcie_tlp.start(null);

#2us; //Expecting this to finish within this time.

and then send the seq_item

The call to start() is blocking and won’t return until the sequence is complete.

The following code should work:

task body();
  pcie_tlp.start(null);
  `uvm_create_on(seq_item, seqr)
  seq_item.data = pcie_tlp.data;
  `uvm_Send(seq_item)