I have a 360x640 matrix i.e. 230,400 pixel values. Using $readmemh
, I want to read only a specific part of matrix and store it in matrix Y_luma
(read only the 8x8 matrix values inside the square box i.e. from 154 to 148 and store it in first row of matrix Y_luma
, from 152 to 153 store in 2nd row of matrix Y_luma
and so on until 155 to 152 in 8th row of Y_luma
).
The code I tried is:
module matrix_copy;
reg [7:0] Y_luma [0:7][0:7];
$readmemh("Luma_space.txt", Y_luma,
Not able to proceed afterwards. How to specify the start address i.e. [8][8] and stop address i.e. [8][15] in first row of matrix Y_luma
and also, how to store the next array from [9][8] to [9][15] in 2nd row of matrix Y_luma
and so on?
Help is appreciated!