How to read from a specific line from a text file in VHDL

后端 未结 2 1783
攒了一身酷
攒了一身酷 2020-12-21 09:34

I am doing a program in VHDL to read and write data. My program has to read data from a line, process it, and then save the new value in the old position. My code is somewha

2条回答
  •  被撕碎了的回忆
    2020-12-21 10:30

    Use 2 files, an input file and an output file.

    file_open(vectors, "stimulus/input_vectors.txt", read_mode);
    file_open(results, "stimulus/output_results.txt", write_mode);
    
    while not endfile(vectors) loop
       readline(vectors, iline);
       read(iline, a_in);
       etc for all your input data...
    
       write(oline, 
    end loop;
    
    file_close(vectors);
    file_close(results);
    

提交回复
热议问题