preface
uvm_sequence_base是一个比较关键的类,该类实现了一个item的构成的流;同时该类本省也继承自item,这样该类也可以包含若干uvm_sequence_base构成的流。
一个sequence的执行大致分为几种方法,这些方法都直接或者间接地调用了<start_item>/<finish_item> 或者调用宏`uvm_do_* macros。下边把这几种方法简单介绍下:
1.Executing sequences via <start>:
A sequence's <start> method has a ~parent_sequence~ argument that controls
whether <pre_do>, <mid_do>, and <post_do> are called *in the parent*
sequence. It also has a ~call_pre_post~ argument that controls whether its
<pre_body> and <post_body> methods are called.
The sequence execution flow looks like
User code
sub_seq.randomize(...); // optional
sub_seq.start(seqr, parent_seq, priority, *call_pre_post*)
The following methods are called, in order
sub_seq.pre_body (task) if call_pre_post==1
parent_seq.pre_do(0) (task) if parent_sequence!=null
parent_seq.mid_do(this) (func) if parent_sequence!=null
sub_seq.body (task) YOUR STIMULUS CODE
parent_seq.post_do(this) (func) if parent_sequence!=null
sub_seq.post_body (task) if call_pre_post==1
2.Executing sub-sequences via <start_item>/<finish_item> or `uvm_do macros:
A sequence can also be indirectly started as a child in the <body> of a
parent sequence. The child sequence's <start> method is called indirectly
via calls to its <start_item>/<finish_item> methods or by invoking
any of the `uvm_do macros. Child sequences can also be started by
the predefined sequences, <uvm_random_sequence> and
<uvm_exhaustive_sequence>. In all these cases, <start> is called with
~call_pre_post~ set to 0, preventing the started sequence's <pre_body> and
<post_body> methods from being called. During execution of the
child sequence, the parent's <pre_do>, <mid_do>, and <post_do> methods
are called
User code
| parent_seq.start_item(sub_seq, priority);
| sub_seq.randomize(...);
| parent_seq.finish_item(sub_seq);