Jump to content

saving previous transaction values


Recommended Posts

  • 4 months later...

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...