Jump to content

Transaction Comparision Problem


Recommended Posts

Hi,

I'm really new in the verification world and this may sound silly but I just can't get it.

I have a sequence in my sequence library that creates a certain amount of transactions, the code for this sequence is:

repeat (trans_num)

begin

req = b66_trans::type_id::create("req"); //Create Transaction

assert(req.randomize());

wait_for_grant();

send_request(req);

wait_for_item_done();

end

So far everything seems works fine (In my Scoreboard Report I get that all transactions Matches). The problems comes when I take the line where the transaction (req) is created out of the repeat loop (I'm trying to do this in order reduce simulation time which is taking too long). When i take this line out of the repeat loop I don't get Transaction Matches in my scoreboard report anymore. So what i'm basically asking is:

1) Is there any problem if i send to the Driver (and to the Scoreboard) the same instance of a transaction but with different payload (It changes everytime i call the randomize() method)?

2) Why do i get Transaction Match when i create the transaction everytime the driver consumes one transaction and I get Transaction mismatch when I have one instance of a transaction but i change its payload everytime the driver consumes data?(Im mean, shouldn't it be the same for the scoreboard?)

Thank you,

Paulo

Link to comment
Share on other sites

The new() that is done by create allocates new memory to store your transaction (including payload). If you don't do that, the information about your previous transaction is completely lost, so the scoreboard cannot match it. An alternative to create would be to send a clone of the transaction to the scoreboard, but I doubt that will save simulation time.

Link to comment
Share on other sites

hi,

this is a general principle in UVM that clone/copy is not performed by default (since this costs). if an object wants to keep a "private"/"unchangable"/persistant copy of an object it has to perform the copy/clone itself. in your example you either allocate a new transaction all the time and pass this new object around OR you allocate it once (outside of the repeat) and have everyone who needs a private/persistant copy to perform the clone/copy.

/uwe

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...