Hi all!
i’m trying to make a virtual sequence with a little bit more complex flow control, then described in UVM cookbook (maybe, there are examples there like the one i need, but i could’n find it=\ ).
class enchancer_virtual_sequence extends uvm_sequence#( uvm_sequence_item );
v_data_sequencer #(...) v_data_seqr;
enchancer_coefs_sequencer enchancer_coefs_seqr;
v_data_sequence v_data_seq;
enchancer_coefs_sequence enchancer_coefs_seq;
function new( string name = "" );
super.new( name );
endfunction: new
task body();
fork: f_block
begin
v_data_seq = v_data_sequence::type_id::create( .name( "v_data_seq" ) );
v_data_seq.start( .sequencer( v_data_seqr ), .parent_sequence( this ) );
disable f_block;
end
begin
forever
begin
enchancer_coefs_seq = enchancer_coefs_sequence::type_id::create( .name( "enchancer_coefs_seq" ) );
enchancer_coefs_seq.start( .sequencer( enchancer_coefs_seqr ), .parent_sequence( this ) );
end
end
join
endtask: body
`uvm_object_utils( enchancer_virtual_sequence )
endclass: enchancer_virtual_sequence
i have two flows here: one with video data, and another with coefficients.
video ata sequene looks like this
class v_data_sequence extends uvm_sequence#( v_data_transaction #(...));
function new( string name = "" );
super.new( name );
endfunction: new
task body();
v_data_transaction #(...) v_data_tx;
int line_num = 0;
int elem_n = 0;
for (int line_num = 0; line_num < 1024; line_num++)
begin
for (int elem_n = 0; elem_n < 20+4+4; elem_n++)
begin
v_data_tx = v_data_transaction #(...)::type_id::create( .name( "v_data_tx" ));
start_item( v_data_tx );
assert( v_data_tx.randomize() );
if ((elem_n >= 4) && (elem_n <= 23))
begin
v_data_tx.x_active = 1;
end
else
begin
v_data_tx.x_active = 0;
End
finish_item( v_data_tx );
end
end
endtask: body
`uvm_object_utils( v_data_sequence )
endclass: v_data_sequence
i want to send coefficients onle when x_active (signal in video data flow) is low. Yet i don’t know, what is the proper way to synchronize my coefficient flow with this event.
here’s video data seqence item:
class v_data_transaction #(...) extends uvm_sequence_item;
rand bit [N_COMP-1:0][V_DATA_WIDTH-1:0] v_data;
rand bit [Y_WIDTH-1:0] y;
rand bit[X_WIDTH-1:0] x;
bit x_active;
...
how should i synchronize my data lows?
thank you for reading