Jump to content
Sign in to follow this  
abhishekyadav123

Writing test cases in UVM

Recommended Posts

Hi All UVM Geeks,

I have been recently moved to UVM and trying to find out answer to a basic question.

Is it possible to call multiple sequences from within the test cases.

From UVM UBUS example I found that it is possible to override the default sequence from within the build phase. This can only invoke one sequence.

What is need in my test case is -

"Seq1" --- <some delay> - "Seq2"----- <some_delay> - "Seq3".................................

How can I have such control in my test case.

Regards,

Abhishek

Share this post


Link to post
Share on other sites

You should rather start the sequences on the sequencer(s) in your test :

class my_test extends uvm_test;

... etc ...

virtual task run_phase(phase);

// create the sequences

...

// start the sequences

seq1.start(sequencer,null);

seq2.start(sequencer,null);

... etc ...

endtask

endclass

Share this post


Link to post
Share on other sites

hi,

why not to make a new sequence which does

>"Seq1" --- <some delay> - "Seq2"----- <some_delay> - "Seq3".................................

as an alternative you may use the sequence library to create a "random" kind of sequence.

/uwe

Share this post


Link to post
Share on other sites

hi,

why not to make a new sequence which does

>"Seq1" --- <some delay> - "Seq2"----- <some_delay> - "Seq3".................................

as an alternative you may use the sequence library to create a "random" kind of sequence.

/uwe

Hi All,

Can you throw some more light on the same problem...As to where we will define these sequence??

Also cant we use arbitration algorithm for the same??

If possible can you explain with small piece of code??

Thanks a lot....:)

Share this post


Link to post
Share on other sites

task body;
      my_seq_base seq_array[$];
      seq_array.push_front(my_seq_0::type_id::create("seq_0");
      seq_array.push_front(my_seq_1::type_id::create("seq_1");
      seq_array.push_front(my_seq_2::type_id::create("seq_2");
      seq_array.push_front(my_seq_3::type_id::create("seq_3");

      // Shuffle the array contents into a random order:
      seq_array.shuffle();
      // Execute all the array items in turn
      foreach(seq_array[i]) begin
         if(!seq_array[i].randomize()) begin
            `uvm_error("body", "randomization failed for req")
         end
         seq_array[i].start(m_sequencer);
      end
   endtask: body
More example can be found here

http://verificationacademy.com/uvm-ovm/Sequences/Generation

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...