0

UVM Testbench scenario

This is my scenario for verifying a Parity Encoder-Decoder DUT. Decoder Input agent here is the re-active agent and injects error into the data stream captured from Passive monitor in Encoder Output agent.

Now I have sequence and sequence items separately for both encoder and decoder input agents. But how do I synchronize both the agents such that decoder re-active agent adds error and creates a new packet for every data in order.

e.g suppose encoder sends data in the order - 1000, 1010, 0100, 1011 and decoder re-active agent creates error packets in the order (one hot bit) - 0010, 1000, 0001, 0100. Now both create data packets unrelated to each other. However the re-active agent should xor 1st data with its 1st packet like 1000 ^ 0010 even if it receives two data i.e 1000 and 1010 together from the passive agent monitor. Also since both agents are generating items, decoder should not send an item before it receives data from encoder agent (via passive encoder agent monitor).

3
  • It is practical in the sense, I want to know how to code to get both agents synchronous with respect to each other and follow a timing order. Commented Sep 5, 2017 at 21:00
  • Do you want to sync sequence items or sequnce? Commented Sep 7, 2017 at 2:20
  • I want to sync sequence items such that decoder item should be sent to decoder driver once that item has been sent from encoder driver and received in encoder monitor. Also, it should take into account out-of-order reception in monitor. Commented Sep 7, 2017 at 2:58

2 Answers 2

0

I think, you want to use the lockign mechanism between different objects.

You can use the IPC (Interprocess Communication) methods to control that, like events, mailboxes, semaphores.

In UVM, the advanced methods are available, like uvm_event, TLM FIFOs, which can be used in your purpose.

Sign up to request clarification or add additional context in comments.

2 Comments

How does the locking mechanism help?
Your purpose is to wait for something to happen at one side, and then do something at the other side. Right? So the above methods are useful for that purpose, like you can wait for a uvm_event to do something.
0

One options is to use config_db to put the endcoder transaction there and get it from decoder re-active agent. Which I think is not nice way. Another option is to have virtual sequence, which includes the encoder and decoder sequences, gets the encoder packet and provides to decoder sequence.

5 Comments

Both encoder and decoder have different virtual sequences. I was wondering if it could be done by uvm_event or through some kind of FIFO such that encoder puts data and decoder gets or peeks data.
well in that case I think ports are another option, using put and get ports. You could find such example in uvm examples folder
Can you please direct me to such an example link where two agents are synchronized using put and get ports. would be interesting to learn
uvm_1.2/examples/simple/tlm1/producer_consumer/fifo.sv or uvm_1.2/examples/simple/tlm1/bidir/bidir.sv They are simple cases, but I think for your case can also be used
One more thing, if there is a frequency difference between encoder generated packets and decoder consumed packet, than you can put uvm_tlm_fifo between put and get ports (refer to test.sv in the fifo flder from simple examples)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.