OVM Do Macros :
In order to create the user defined sequences
- we need to create the sequence class which is derived from the ovm_sequence and specify the request and response parameters.
- User `ovm_sequence_utils macro's to associate the sequence with the relevant sequencer.
- 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 :
- Wait till item is needed
- Allocate using the factory
- Randomize (with constraints or not)
- Put on the consumer interface
- Block code execution till item_done()
So essentially a ovm_do macro does the following things :
- Create - Allocates and initializes the sequencer and parent sequence of the item or sequence.
- Synchronize with sequencer - If the variable is an item, the item waits until the sequencer acknowledges that it can continue.
- pre_do - Execute the pre_do() user hook of the sequence.
- Randomize - Randomize the variable. If randomization fails, a warning is issued.
- mid_do - Execute the mid_do() user hook of the sequence.
- 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.
- post_do
Execute the post_do() user hook of the sequence
OVM DO MACROS :
Main aim of these macros is the simplify the item and sequence execution
// ===========
// Syntax
// ===========
`ovm_*(variable)
`ovm_*_with(variable, { constraint-block} )
Variable must be derived from ovm_sequence_item or ovm_sequence.
|
`ovm_do
|
Performs all 7 steps from previous slide (create to post_do)
|
|
`ovm_do_with
|
Same as `ovm_do, but adds in-line constraints during randomization (randomize with {} )
|
|
`ovm_create
|
Only performs step 1 (create)
|
|
`ovm_send
|
Performs steps 2-7 (synchronize to post_do), but skips step 4 (randomization)
|
|
`ovm_rand_send
|
Performs steps 2-7 (synchronise to post_do)
|
|
`ovm_rand_send_with
|
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
|