//
// This class shows how to reuse the values persistent within a sequence
// It runs the mem_trans_seq once with randomized values and then repeats it
// several times without further randomization until the memory limit is
// reached. This shows how the end address values are reused on each repeat.
//
class rpt_mem_trans_seq extends bus_seq_base;
`uvm_object_utils(rpt_mem_trans_seq)
function new(string name = "rpt_mem_trans_seq");
super.new(name);
endfunction
task body();
mem_trans_seq trans_seq = mem_trans_seq::type_id::create("trans_seq");
// First transfer:
assert(trans_seq.randomize() with {src_addr inside {[32'h0100_0000:32'h0100_FFFF]};
dst_addr inside {[32'h0103_0000:(32'h0104_0000 - (transfer_size*4))]};
transfer_size < 512;
solve transfer_size before dst_addr;});
trans_seq.start(m_sequencer);
// Continue with next block whilst we can complete within range
// Each block transfer continues from where the last one left off
while ((trans_seq.dst_addr + (trans_seq.transfer_size*4)) < 32'h0104_0000) begin
trans_seq.start(m_sequencer);
end
endtask: body
endclass: rpt_mem_trans_seq
Hello,
referring to the code from uvm-cookbook given above, I have a question - since the trans_seq is a subsequence of rpt_mem_trans_seq, the start method should have pointer to parent sequence as one of its arguments. So the line - trans_seq.start(m_sequencer) should have been
trans_seq.start(m_sequencer, this); I am not clear why the pointer to parent argument has been omitted here. (the default value of the pointer to parent sequence is null, so in this case, null value will be passed). So I am not clear how this example would work.
Can someone explain please.
regards,
-sunil puranik
The parent argument controls whether the following tasks of the parent sequence will be executed: pre.do, mid_do, post_do will not be executed when the parent argument is null.
HI,
thanks for immediate reply. Does it mean that only purpose of parent sequence argument is to call the pre_do, mid_do and post_do methods? If these are not modified, then it is not necessary to provide the parent sequence pointer.
regards,
-sunil puranik
sub_seq.pre_start() (task)
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
sub_seq.post_start() (task)
typedef class a_adma_col1;
typdef class a_adma_col2;
class A_test uvm_test;
...
...
a_dma_col1 col1;
a_dma_col2 col2;
...
...
function void build (uvm_phase phase );
super.build_phase(phase);
col1 = a_dma_col1::type_id::create("a_dma_col1");
col1 = a_dma_col1::type_id::create("a_dma_col1");
endfunction
task run_phase (uvm_phase phase);
phase.raise_objections (this, "", 1 );
super.run_phase(phase);
col1.start(env.vsqr);
col2.start(env.vsqr);
phase.drop_objection(this, "", 1);
endtask
..
endclass
class a_dma_col1 extenda a_dma;
...
...
`uvm_declare_p_sequencer(`A_SEQUENCER);
constraint c1 {col > 2}
...
...
...
task body ();
if (!this.randomize() begin
`uvm_fatal ("FATAL");
end
endtask
endclass
class a_dma_col2 extenda a_dma;
...
...
`uvm_declare_p_sequencer(`A_SEQUENCER);
...
...
...
constraint c1 {col1 > 3};
task body ();
if (!this.randomize() begin
`uvm_fatal ("FATAL");
end[
endtask
endclass
Here is my pseudo code a_dma_col1 and a_dma_col2 are subsequences of parent sequence a_dma
Issue is parent’s sequence body a_dma is not getting executed
Any pointers ?