Running parellel sequences

how to start two sequences (read sequence and write sequence) in UVM testclass without any contradiction ?How many ways we can perform this task ?

In reply to vlsique:

You want to start these sequences in parallel? You can use fork/join, this is easiest way:


fork
  read_seq.start(read_agent.read_sequencer);
  write_seq.start(write_agent.write_sequencer);
join

Fork/join will spawn 2 threads running parallel, each process will start a sequence with specific sequencer. It will wait for all threads finish before executing the next statement.

In reply to chris_le:

can we implemwnt semaphores method to avoid contradiction ??

In reply to vlsique:

What do you mean about “avoid contradiction”? Can you describe your problem?

In reply to vlsique:

Virtual sequence can help you to manage multiple sequences.
https://verificationacademy.com/cookbook/sequences/virtual

In reply to vlsique:

In reply to chris_le:
I mean two process one is write sequence and other is read sequence ,read sequence is waiting for write sequence to complete, or any events defined in write sequence , read sequence is waiting for any event to trigger defined in write sequence
How we will synchronize it ?
In general how to synchronize sequences in testcase ?

If you have to implement exclusive access you have to spend effort to guarantee this. One approach is to use semaphores.