UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
3,190 Views
Registered: ‎06-24-2008

BRAM initialization from text file

Hello,

 

I have several BRAMs that I want to initialize and a text file would make this process easier. I found a template to do just this in the ise > language templates >  vhdl > synthesizable constructs > ram > block ram > using file i/o.  When I synthesize xst tells me that the rom was not initialized.  

 

 WARNING:Xst:1781 - Signal <the_rom> is used but never assigned. Tied to default value.
    Found 16x8-bit ROM for signal <$varindex0000> created at line 69.

 

This is the function I got from ise templates and doesn't actually grab the data.

 

  impure function initializeROM(filename : in string) return rom_type is
    file init_file     : text is in filename;
    variable init_line : line;
    variable init_rom  : rom_type;
  begin
    for I in rom_type'range loop
      readline (init_file, init_line);
      read (init_line, init_rom(I));
    end loop;
    return init_rom;
  end function;

 

 signal the_rom : rom_type := initializeROM("rom.txt");

 

The text file I am trying to read would just be a list of vectors :

 

00000000

00010001

01010101

...

 

I included the vhdl file in case there was something else to see.

 

If someone else has done something similar with text files and could offer some guidance that would be extremely helpful

 
Thanks!

bb

 

On a side note, when is it necessary to register the output of a BRAM / ROM (if it is necessary)?

Message Edited by bborko on 01-25-2010 01:46 PM
0 Kudos