IMPORTANT NOTICE: Please be advised that the Verification Academy Forums will be offline for scheduled maintenance on Sunday, April 19th at 5:00 AM US/Pacific.
In reply to robert.schilling:
Yes, the streaming operator can do this:
my_array= {<<32{my_array}};
@Dave. Can you help me understanding this stream function. Trying to understand it’s functionality and how it is making the answer for the requirement?
I created the demo example at eda playground link and got the below output with two way of doing this.
1- as Dave mentioned
2- as per my understanding of the requirement
for(int unsigned idx = 0 ; idx < $size(my_rd_arr)/4; idx++) begin
for(int unsigned jdx = 0; jdx < 4; jdx++) begin
my_rd_arr[(4 * idx) + jdx] = my_arr[($size(my_arr) - ((4 * idx))) - (4 - jdx)];
end
end
nhp, you forgot the slice_size of 32 in your example. Once you fix that, the two algorithms match.
The slice_size number that number of bits together when reversing the bits. That gives Robert the granularity requirement. See section 11.4.14.2 Re-ordering of the generic stream in the IEEE 1800-2017 SystemVerilog LRM.