How to concatenate multiple arrays which is mixed i.e. packed as well as unpacked into one array

I have a frame structure as shown below.

frame of 128 rows each with 5140 bits.
1st row consists of slicing as 480 bits A data, 480 bits B data, 320 bits C data amd 3860 bits D data. Among which A has fixed values rest all are randomized.
Rest rows are of 5140 bits randomized data.

I have defined arrays as
bit [0:479] a;
rand bit [480:959] b;
rand bit [960:1279] c;
rand bit [1280:5139] d;
rand bit [0:5139] e [1:127];

Now I want to concatenate all the above arrays into frame array which I have defined as below.

bit [0:5139] frame [0:127];

How can I do that?

In reply to maitrygandhi:

You can use pack/unpack method, to concatenate your fields.
please find the link for examples.
Link : uvm pack byte method - www.verificationguide.com - EDA Playground
Here, mentioned example is suitable to your problem. change it according to your requirement

Thanks and Regards,
Mitesh Patel

In reply to maitrygandhi:

You want to use the streaming operator:


frame = {>>{a,b,c,d,e}};

In reply to cgales:

Yes I tried this but it is giving the following error:

Illegal assignment to type ‘reg signed[4095:0]’ from type ‘bit[0:5139] $[1:127]’: Cannot assign an unpacked type to a packed type

In reply to maitrygandhi:

Your error message doesn’t match your signal descriptions that you provided. Where does ‘reg signed[4095:0]’ come from?

In reply to cgales:

That’s what I cannot understand because the signal definition is same as I mentioned in problem. I have not defined any extra signals other than this than why this error is showing?

In reply to maitrygandhi:

Hi Your declaration of datatype is wrong.
As per your questions, it seems that you want 128 frame location and each location should have 5140 bits of data. Here, Attached example is doing the same. Please find the link for it.
Link : Edit code - EDA Playground

Thanks and Regards,
Mitesh Patel

In reply to mitesh.patel:

Hi Mitesh,

I want 128 rows with 5140 bits in a single frame. That’s why I declare as mentioned in question.

Also I found out that it is not concatenation which is creating problem but it is the field macro definition because of which I am getting error.

I have defined field macro as `uvm_field_int{e,UVM_ALL_ON} but the field int is for pack type only and I want to do it for unpack type.

Thanks

In reply to maitrygandhi:

You should never use the field macros. Remove them and your issues will be fixed.

In reply to cgales:

Okay thanks for the reply.