In reply to germanbravolopez:
Apologies if I’m not still getting the problem, but what is preventing you from doing a nested for loop, it may seem like more code but is simpler than trying to propagate parameters all over from the environment down to each component, in your code is not clear what type of data expected_tdata_pkg is but assuming is some sort of dynamic array to which you want to assign slices of tdata (in RDW chunks starting at index 0)
bit [7:0] data;// Or whatever size meets your requirement
for (int i = 0; i < length; i++) begin // I'm assuming you know the length or use a foreach
for (int j = 0; j < RDW; j++) begin
data[j] = tdata[i*RDW + j];
end
expected[i] = data;
end
// if not a dynamic array then just assign bit by bit in the for loop
Again apologies if I’m misunderstanding your problem