Acquiring data from files

OP #2955377
Rate this post
• ▲ useful
▼ not useful
I am trying to multiply a series of values that I am getting from txt 
files.
My ideia is to get the data from 1 file, multiply for every data from 
the second file, get the second valor from the first file and again 
multiply it with all the values in the second file and so on.
Can anyone give me a light?
1
    estimulo: process
2
    variable linha   : LINE;
3
    variable valor1, valor2  : std_logic_vector(tamanho-1 downto 0);
4
    variable decisao : boolean;
5
    begin
6
     file_open(constante, "C:/Users/Eduardo/Desktop/Pos/VHDL/projfinal/proj7/vhdl/constante.txt", read_mode);
7
     file_open(variavelx, "C:/Users/Eduardo/Desktop/Pos/VHDL/projfinal/proj7/vhdl/variavelx.txt", read_mode);
8
     wait until (rst = '0');
9
     report "fim do reset";
10
       while not endfile(variavelx) loop
11
        readline(variavelx, linha);
12
        read (linha, valor2);
13
        b_i <= (unsigned(valor2(tamanho-1 downto 0)));
14
                  
15
         while not endfile(constante) loop
16
          readline(constante, linha);
17
          read (linha, valor1);
18
          a_i <= (unsigned(valor1(tamanho-1 downto 0)));  
19
          read (linha, decisao);
20
          caso <= decisao;  
21
          report "subindo valores";
22
          wait for 3*clk_period;
23
         end loop;

Reply

Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.

Formatting
  • [c]C-Code[/c]
  • [vhdl]VHDL-Code[/vhdl]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.