Hello, experts.
I have a question.
Is there a way to pass a dynamic data array to a lower sequence?
For instance, when a bus transaction consists of bus data with multiple clock lengths, it includes bus data in a dynamic data array within a nested sequence and passes this bus data to a lower sequence.
If there isn’t a way to do this, what would be the appropriate approach for handling such cases?
The example code is provided below.
class my_item extends uvm_sequence_item;
rand logic [15:0] data;
`uvm_object_utils_begin(my_item)
`uvm_field_int(data, UVM_ALL_ON | UVM_NOPACK | UVM_HEX);
`uvm_object_utils_end
function new(string name = "my_item");
super.new(name);
endfunction : new
endclass : my_item
class base_seq extends uvm_sequence #(my_item);
`uvm_object_utils(base_seq)
// control knobs
rand bit [15:0] data [];
function new(string name = "base_seq")
super.new(name);
endfunction : new
endclass : base_seq
class nested_seq extends base_seq;
`uvm_object_utils(nested_seq)
sub_seq1 sub_seq1;
virtual task body();
`uvm_do_with(sub_seq1, {sub_seq1.data == local::data;}) // --> error occurs!
endtask : body
endclass : nested_seq
class sub_seq1 extends base_seq;
`uvm_object_utils(sub_seq1)
virtual task body();
int i;
data = new[10];
for(i=0; i<10; i++) begin
`uvm_do_with(req, {req.data == local::data[i];}) // maybe possible way...
end
endtask : body
endclass : sub_seq1