Altera_Forum
Honored Contributor
16 years agoRead from file in vhdl
Hi,
I have a whole heap of bits I need to hard-code into my hardware. Instead of writing them directly into my vhdl code I was wanting to be able to load them into the code via a .dat file or something similar. I have tried to do this using the readline and read statements (using the textio package) in Quartus but it doesn't seem to work. Firstly, I get an error saying that Quartus doesn't know what the "std_logic_textio" package is (it says the IEEE library doesn't contain it). When I remove this line from the code, I get an error saying that "read is not a subprogram, a type, or an array object" (it does however understand the readline command). I'm thinking that this is probably because I had to remove the package I mentioned above. I've been looking on the web to see if there is any way to fix this, but it seems that this stuff cannot be synthesised and is usually used in testbench designs, so Quartus doesn't like it. I'm wondering, firstly, If I have done something wrong here, or is there any other way to read data from a file into a synthesisable vhdl file. Thanks in advance for your help.:)