UVM Monitor

I have SPI vip and a memory with SPI-APB bridge. The data will be given to SPI memory which will give it to SPI-APB bridge and the data is given back over MISO after conversion. Now i need to create a monitor, where im supposed to compare the data given and the data received. How should i do this? How would I collect the signals from vip and from the DUT into the monitor which I am creating? Someone please help me out with this.

In reply to Muthamizh:

Hi Muthamizh,

The uvm_component called uvm_monitor first job is to capture the transaction flow using conditions like enable or reset. For example

if(enable)
  tran_h.wdata = intf_h.wdata; etc.

In your context, try to know what is going inside dut and what is coming out of dut. Then capture it using the interface. Be cautious about signal direction. The interface dedicated to monitor will contain all input signals.
However, comparison can be done in scoreboard.
Kindly let me know if it answers your question.

With Regards
Sunils

In reply to sunils:

Ya… I get it… But in my monitor am also comparing the input and output… That is where Im stuck… How should I compare both input and output?

In reply to Muthamizh:

Hi Muthamizh,

In the transaction or packet class, implement all the do_* functions manually. Then in the monitor, collect the transactions in the queue or tlm_fifo as per your requirement. Write if condition in run_phase using below syntax:

 if(actual_transaction.compare(expected_transaction))
   then `uvm_info()
  else
     `uvm_info()...

Kindly let me know if it is complete answer.

In reply to sunils:

What are the do* functions?

In reply to Muthamizh:

These are do_copy, do_compare, do_print, do_record conver2string etc.

In reply to Muthamizh:

In reply to sunils:
What are the do* functions?

The do_* functions are not called directly. They are encapsulated in the copy, compare, print etc functions.
The do_* functions can be generated in 2 ways:
(1) implemented manually,
(2) implemented by using the field_macros.

Using the field macros is not recommended due to several reasons.
The huge amount to implement these functions manually can be dramatically reduced by using a UVM Framework generator, which is implementing the code for you.

In reply to sunils:

I dont have sequence item for my dut. Without seq item, how would I collect the transactions from DUT into a queue or tlm_fifo? If so could you please provide me the syntax for doing that? I dont know whether I am asking the question correctly. But my doubt is this only according to my understanding. So far in monitor, i have seen the transactions being collected like,
uvm_analysis_port #(mas_seq_item)mas_monitor_port

Please help me out with this.

In reply to Muthamizh:

Does this mean you do not stimulate your DUT? Or do you use a traditional method to stimulate the ports of your DUT?

In reply to chr_sue:

I have SPI VIP which has the master and an SPI MEMORY which acts slave and DUT. In SPI we have MOSI, MISO, SS and SCK. I am now creating the monitor, where i need to compare the written data sent over MOSI and the data read back in MISO. I will collect the data sent over MISO in a memory. Now, How will i compare the data stored in that memory with the data coming in MISO? I am totally confused. Could someone clarify this please?