Hi everybody,
I want to read a text file which contains lots of real numbers. I write a function for read these values and replace them to real_vector. The function works well with ModelSim.
Text File
Function
but when synthesizing my function called readfile gives me error like that:
ERROR:Xst:1924 - "C:/Users/Engin/PTMpredictor/PTMpredictor.vhd" line 117: Line <liinee> has illegal bit value "7".
I'm almost new in vhdl and I can't understand why it gives me error? Can someone help me?
I want to read a text file which contains lots of real numbers. I write a function for read these values and replace them to real_vector. The function works well with ModelSim.
Text File
Code:
732.39 1
44.04 55.0
72.04 90.0
87.04 50.0
157.12 55.0
160.10 55.0
175.10 55.0
185.12 90.0
200.12 50.0
203.10 55.0
270.21 55.0
289.14 55.0
298.21 90.0
304.14 55.0
313.21 50.0
332.14 55.0
Code:
function readfile(lncount: integer) return real_vector is
variable expspec: real_vector (1 to lncount-1);
variable charge: real;
variable precursormass: real;
variable pos: integer:=1;
file myfile:text open read_mode is "c:/testSpectrum";
variable liinee: line;
begin
readline(myfile,liinee);
read(liinee,precursormass);
read(liinee,charge);
while not endfile(myfile) loop
readline(myfile,liinee);
read(liinee, expspec(pos));
pos:=pos+1;
end loop;
return expspec;
end readfile;
but when synthesizing my function called readfile gives me error like that:
ERROR:Xst:1924 - "C:/Users/Engin/PTMpredictor/PTMpredictor.vhd" line 117: Line <liinee> has illegal bit value "7".
I'm almost new in vhdl and I can't understand why it gives me error? Can someone help me?