Jump to content
avihai

saving previous transaction values

Recommended Posts

Though its late to answer I guess, here is one solution:

 

 

Create two packets in your monitor as follow; 

class any_monitor extends uvm_monitor;

// rest things

task run_phase (uvm_phase phase);
   my_packet previous_packet  = my_packet::type_id::create("previous_packet");
   my_packet current_packet = my_packet::type_id::create("current_packet ");

  // Processing the transaction

  // Do the needful and before sending the packet through monitor analysis port make a local copy for it as
  // since we send the packet through analysis port in the end where we are all done with our processing , so upto here you have previous packet available
   $cast(previous_packet,current_packet );

   analysis_port.write(current_packet );

  // In this way you can make for more copies , even put these copies in fifo , do whatever flavor your want to implement

endtask

In the above way you can make for more copies , even put these copies in fifo , do whatever flavor your want to implement.

 

Hope it will meet your requirements.

 

Regards,

Karandeep

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×