Split long bit vector array into list of bytes

Hi VA,

What is the best way to split long bit vector array of 512bits into dynamic list of bytes?


bit[512-1:0]      cache_line;
bit[7:0]          cache_line_list_of_bytes[];
...

Thanks,
Michael

In reply to Michael54:

You can use the streaming operator

{>>{cache_line_list_of_bytes}} = cache_line;

This puts cache_line[511:504] into cache_line_list_of_bytes[0] … cache_line[7:0] into cache_line_list_of_bytes[63]. Or you can do

{<< 8 {cache_line_list_of_bytes}} = cache_line;

This puts cache_line[511:504] into cache_line_list_of_bytes[63] … cache_line[7:0] into cache_line_list_of_bytes[0].

In reply to dave_59:

Thank you very much Dave!