Jump to content

Suggested approach for randomization of delays between transactions


Recommended Posts

I have to insert random delays between the transactions in the sequence.

From some basic reading that I've done, I felt like the approach to follow is to have a driver's run task similar to this (say no response):

task run();
    forever begin
      seq_item_port.get_next_item(req);
      driveTxn(req);
      seq_item_port.item_done();
      dlyCfg::get_config_int("txnDelay", this.txnDelay);
      repeat (this.txnDelay)
        @(posedge vif.clk);
    end
  endtask : run

If I followed this approach, after every transaction, both driver and sequence access the database. Won't it slow down things? I'm wondering if there's a better approach that's optimal/cleaner. Thanks in advance.

Edited by itsmyturn
formatting the code
Link to comment
Share on other sites

Why do you need to use config_db for this? Since its a random delay, you can either use std:randomize to locally randomize it in the run task, or even better - you can add the delay to be part of the transaction. Then you can easily control the delay with constraint given to your transactions/sequences

Link to comment
Share on other sites

Why do you need to use config_db for this? Since its a random delay, you can either use std:randomize to locally randomize it in the run task, or even better - you can add the delay to be part of the transaction. Then you can easily control the delay with constraint given to your transactions/sequences

I probably don't want any randomization/intelligence in my driver. But having the delay field as part of transaction sounds like a good way of doing it. I'll try that. Thanks!

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