saeiddieas
Newbie level 4
Hi everybody,
I'm trying to compile this VHDL program in Quartus, but there is an error when I compile it :
These VHLDs codes are written to reading and writing files in VHDL. But I dont know how can we fix this error?
I'm trying to compile this VHDL program in Quartus, but there is an error when I compile it :
This error message is on this line :Error (10414): VHDL Unsupported Feature error at filehandle.vhd(14): cannot synthesize non-constant real objects or values
Code:
signal dataread : real;
These VHLDs codes are written to reading and writing files in VHDL. But I dont know how can we fix this error?
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 --include this library for file handling in VHDL. library std; use std.textio.all; --include package textio.vhd --entity declaration entity filehandle is end filehandle; --architecture definition architecture Behavioral of filehandle is --period of clock,bit for indicating end of file. signal clock,endoffile : bit := '0'; --data read from the file. signal dataread : real; --data to be saved into the output file. signal datatosave : real; --line number of the file read or written. signal linenumber : integer:=1; begin clock <= not (clock) after 1 ns; --clock with time period 2 ns --read process reading : process file infile : text is in "1.txt"; --declare input file variable inline : line; --line number declaration variable dataread1 : real; begin wait until clock = '1' and clock'event; if (not endfile(infile)) then --checking the "END OF FILE" is not reached. readline(infile, inline); --reading a line from the file. --reading the data from the line and putting it in a real type variable. read(inline, dataread1); dataread <=dataread1; --put the value available in variable in a signal. else endoffile <='1'; --set signal to tell end of file read file is reached. end if; end process reading; --write process writing : process file outfile : text is out "2.txt"; --declare output file variable outline : line; --line number declaration begin wait until clock = '0' and clock'event; if(endoffile='0') then --if the file end is not reached. --write(linenumber,value(real type),justified(side),field(width),digits(natural)); write(outline, dataread, right, 16, 12); -- write line to external file. writeline(outfile, outline); linenumber <= linenumber + 1; else null; end if; end process writing; end Behavioral;