Delay in update of mirrored value in explicit prediction

Hello All,

I am doing explicit prediction and predictor is connected to interface UVC monitor.
But when i do reg.write() and immediately in the next line if i use get_mirrored_value() i dont see the value getting returned but i see that value is updated later and when i do a read with check it matches.

Also, when i add some delay after write and do get_mirrored_value() i see the value which i intend to write. I want to know why this delay in updating mirrored value and how this delay can be compensated?
I read in some of the blogs this delay is expected while dong explicit prediction, is it true so ?

I think its based on the time a transaction is coming back from the driver vs monitor. Predictor is based on the monitor, if the monitor modeling is to send the transaction at later time, then you will have delay in prediction.

Hi @yourcheers1
Thanks for the reply but how could i avoid this from happening ? Shouldn’t I wait for response in monitor ?

There are several ways to avoid your problem. When using the monitor for prediction you have to adopt your timing. You could use an event to indicate the monitor has processed the transaction and is ready for further calculations. Or you could use an explicit predictor.

Hi @chr_sue
I am using explicit prediction. Could you please point me to any of the such instances where events are used to synchronize?

I mean to use a uvm_predictor instead of feeding the responses through the monitor. I have never seen an event-based code example for your problem.

okay thanks no problem!!

@dave_59 Any comments on this ?