i have defined ethernet header structure(eh) and payload in seq_item,and in seq i have defined a task “pack_header” for this task i was giving input as eh and payload in task body,
now i want both ethernet header + payload in “pkt_out”. I need to append out_arr to data…
task pack_header(input bit[7:0]in_arr[],ref int index,ref bit[7:0]out_arr[$]);
foreach(in_arr[i]) begin
out_arr[index+i]=in_arr[i];
end
// index+ = in_arr.size;
index = index+$size(in_arr);
endtask
virtual task body();
int index = 0;
bit [7:0] out_arr[$];
bit eh; //eh is handle for ethernet header which is struct coming from sequence_item
bit [7:0]payload[];
logic pkt_out;
trans = avst_sequence_item::type_id::create("trans");
repeat(3) begin
start_item(trans);
assert(trans.randomize());
pack_header(eh,index,pkt_out);
pack_header(payload,index,pkt_out);
trans.data={>>{out_arr}};
finish_item(trans);
// `uvm_info("AVST_Seqr",$psprintf("Seq_Data is : [%d]\n",trans.convert2string()),UVM_LOW);
end
endtask
Those are the errors I’m getting…help me with it…to resolved
# ** Error (suppressible): avst_sequence.sv(35): (vlog-2997) Arg. 'in_arr' of 'pack_header': Cannot assign a packed type 'bit' to an unpacked type 'bit[7:0] $[]'.
# ** Error: avst_sequence.sv(35): The actual (pkt_out) and formal (out_arr) for a ref must be equivalent types.
#
# ** Error: avst_sequence.sv(38): The actual (pkt_out) and formal (out_arr) for a ref must be equivalent types.
#