
What is Sequence Library?
A sequence library is a conglomeration of registered
sequence types derived from uvm_sequence.
A sequence once registered shows up in the sequence queue of that sequence library. Reusability demands that a given IP should be configurable
so as to plug seamlessly into different SoCs catering varied applications. The
verification team can develop multiple sequence libraries to enable regressions
for various configurations of the IP. Each of these libraries can be configured
to execute sequences any no. of times in different order as configured by the
MODE. The available modes in UVM include –
UVM_SEQ_LIB_RAND : Randomly select any sequence from the queue
UVM_SEQ_LIB_RANDC : Randomly select from the queue
without repeating till all sequences exhausted
UVM_SEQ_LIB_ITEM :
Execute a single sequence item
UVM_SEQ_LIB_USER :
Call select_sequence() method the definition of which can be overridden by the user
Steps to setup a Sequence Library?
STEP 1 :
Declare a sequence library. You can declare multiple libraries for a given verification environment.
STEP 2 : Add user defined & relevant sequences to the library. One sequence can be added to multiple sequence libraries.
STEP 3 :
Select one of the 4 modes given above based on the context i.e. to run random or run a basic sequence item for sanity testing or a user defined mode as applicable like a set of sequences that test a part of the code for which bug was fixed.
STEP 4 : Select the sequence library as default
sequence for a given sequencer from the test. This kind of depends on the STEP 3 i.e. the context.
Advantage
Sequence library is one of the most simple, effective
but sparingly used mechanism in UVM. A user can plan to use sequence library by
changing modes to achieve sanity testing, mini regression and constrained
random regressions from the same test. Further, the library helps in achieving the
goal of CRV in terms of generating complex scenarios by calling sequences
randomly thereby finding those hidden bugs that would otherwise show up in the
SoC verification or the field.
As Albert Einstein rightly said "No amount of experimentation can ever prove me right; a single experiment can prove me wrong". It is important to run those experiments random enough so as to improve the probability of hitting that single experiment to prove that the RTL is not an exact representation of specification. Sequence library in UVM does this effectively!!!
Previous posts -