title: VHDL textio, reading image from file
body: <p>I am trying to learn how to implement image processing algorithms in an FPGA and to do this I am working with a txt file that contains a bmp image (converted using MATLAB).</p>
  
  <p>I am havin problems using the textio package, so by now I am only able to read the first column of data (but not the entire row of data).</p>
  
  <p>The txt file have this aspect:</p>
  
  <pre><code>    1,1,0,0,0
      0,1,1,1,1
      1,0,0,0,0
      0,0,1,1,0
      1,1,1,1,1
  </code></pre>
  
  <p>a 5x5 matrix separated by commas.
  The output of the entity I have now in my simulations is</p>
  
  <pre><code>    1 0 1 0 1 
  </code></pre>
  
  <p>that corresponds to the first column.
  I don't understand why the code doesn't read all the line and when it ends jump to the next line.</p>
  
  <p>Here is the process for read the file (I have add a variable named comma so I could detect the comma and skip it but still doesn't work ):</p>
  
  <pre><code>reading : process 
  
      constant filename : string := "C:\DOCUMENTACION\PROYECTOS\Envio_salida_VGA_atraves_FPGA\MatLab\Procesado de imagen con Toolbox\prueba.txt";
      file f : text open read_mode is filename;
      variable L : line;
      variable data_read : integer;
      variable comma : character;
  begin
      while not endfile(f) loop
          wait until rising_edge(clk); 
              readline(f, L);
              read(L, data_read);
  
              while L = ',' loop
                  read(L, comma);
              end loop;
  
              d_out &lt;= data_read;
      end loop;
  </code></pre>
  
  <p>what is wrong with my code?</p>