Primer bloque de código:
reg [9:0] buffer [18:0];
...
...
buffer[10] = 10'd0;
buffer[11] = 10'd0;
buffer[12] = 10'd0;
buffer[13] = 10'd0;
buffer[14] = 10'd0;
buffer[15] = 10'd0;
buffer[16] = 10'd0;
buffer[17] = 10'd0;
buffer[18] = 10'd0;
Intenté reducirlo con esta línea,
buffer[10:18] = {10'd0,10'd0,10'd0,10'd0,10'd0,10'd0,10'd0,10'd0};
pero obteniendo este error
ERROR:HDLCompiler:698 - Part-select of memory buffer is not allowed.
ERROR:HDLCompiler:1373 - Unpacked value/target cannot be used in assignment.
Segundo bloque de código:
input [99:0] image,
...
reg [9:0] buffer [18:0];
...
buffer[9] = image[9:0];
buffer[8] = image[19:10];
buffer[7] = image[29:20];
buffer[6] = image[39:30];
buffer[5] = image[49:40];
buffer[4] = image[59:50];
buffer[3] = image[69:60];
buffer[2] = image[79:70];
buffer[1] = image[89:80];
buffer[0] = image[99:90];
Mi alternativa fue:
for (i=0;i<10;i=i+1)
buffer[9-i] = image[(10*(i+1))-1:10*i];
pero obteniendo este error
ERROR:HDLCompiler:44 - i is not a constant
¿Debo usar un parámetro para definir un valor constante?