Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading values from TXT file to RAM

Status
Not open for further replies.

Caligator

Programmer
Jun 28, 2004
2
US
I have a FFT program that reads and writes to a block of 2kx32 SRAMs, but I would like to initialize the values of the SRAM blocks to 32-bit vectors from a file (ie -- "Values.txt"). I have a program that also reads in the 32-bit values (one column by N rows). Is there a way in ModelSim to have the RAM initialized prior to the simulation or do I have to have an initial setup state where the values are passed from the file to the RAM and then the FFT can run? Thanks for the help. If you need clarification then please ask me.
 
often RAM blocks from the vendor (altera, xilinx, asic vendor etc) will have a default way of doing this, you just have to either modify a generic to tell it where to find the file, or put the file in the place they require (or modify their code to put the file where you want it).

if its your code, then you will want to look at std.textio package. write, read and readline, writeline are the main functions. look for some examples of those functions for syntax and other 'stuff' that you need to do.

--
 
Thanks about the tip about the the generic port map. I'll definitely look into it, but our memory is an Artisan compiler generated file (not an FPGA application).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top