Home Methodologies OVM Tutorial OVM Do macros
Main Menu
System Verilog
    - OVM Tutorial
        -- OVM Overview
        -- CRV in OVM
        -- OVM Based Env
        -- UVC in OVM
        -- Data Item
        -- Sequence Item Macros
        -- ovm-driver
        -- OVM sequencer
        -- OVM Monitor
        -- OVM Sequences
        -- OVM build in sequences
        -- OVM Do macros
        -- OVM Test
        -- Messaging utilities
    - OVM Example
    - UVM
    - VMM
    - VMM RAL
    - VMM Example
    - AVM Tutorial
Open Vera
Digital Concepts
Verification Basics
Interview Questions
Computer Architechture
C and C++
AsicGuru Blog
Tags Cloud
Usefull Sites
Know Your IP/Location
Local Information India
Buy Car/Inverter Batteries
Real Estate India
Sports Accessories India
OVM Do Macros
Share This Articale:

OVM Do Macros :

In order to create the user defined sequences

  1. we need to create the sequence class which is derived from the ovm_sequence and specify the request and response parameters. 
  2. User `ovm_sequence_utils macro's to associate the sequence with the relevant sequencer.
  3. Implements to sequences body task which the scenario you want to execute.

In the body  task you can execute the sequence_item and other sequence with the ovm_do macros. A ovm_do macro translates in to following steps :

  1. Wait till item is needed
  2. Allocate using the factory
  3. Randomize (with constraints or not)
  4. Put on the consumer interface
  5. Block code execution till item_done()

So essentially a ovm_do macro does the following things :

  1. Create - Allocates and initializes the sequencer and parent sequence of the item or sequence.
  2. Synchronize with sequencer - If the variable is an item, the item waits until the sequencer acknowledges that it can continue.
  3. pre_do - Execute the pre_do() user hook of the sequence.
  4. Randomize - Randomize the variable. If randomization fails, a warning is issued.
  5. mid_do - Execute the mid_do() user hook of the sequence.
  6. Post synchronization/body execution - If the variable is an item, the variable is provided to the sequencer, and the action waits until the item has been consumed.
    If the variable is a sequence, its body() method is executed.
  7. post_do
    Execute the post_do() user hook of the sequence


Main aim of these macros is the simplify the item and sequence execution

// ===========
// Syntax
// ===========
`ovm_*_with(variable, { constraint-block} )

Variable must be derived from ovm_sequence_item or ovm_sequence.

Performs all 7 steps from previous slide (create to post_do)
Same as `ovm_do, but adds in-line constraints during randomization (randomize with {} )
Only performs step 1 (create)
Performs steps 2-7 (synchronize to post_do), but skips step 4 (randomization)
Performs steps 2-7 (synchronise to post_do)
Performs steps 2-7 (synchronize to post_do) and adds additional constraints for randomization (step 4)


Keywords : ovm_do   ovm_do_test   ovm_do_with  

This Articles is written/submitted by puneet (Puneet Aggarwal). You can also contribute to Asicguru.com. Click here to start

Prev << OVM build in sequences

Next >> OVM Test

Sign In
Login with :-
| | |  
  • Bookmark