cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
saconnor
Visitor
Visitor
4,926 Views
Registered: ‎10-26-2010

Spartan6 data2mem for initializing BRAM

Hi All,

 

I am trying something that should be very simple, but am running into a strange issue.  Any help would be greatly appreciated.

 

I am targeting a Spartan 6 LX150T FPGA, using ISE 12.4, and running on Windows XP. 

 

I am attempting to initialize a single block memory within the design using the data2mem utility, a .bmm file, a .mem file, and an ISE generated .bit file. 

 

I have instantiated a single 18Kb block memory in my VHDL and constrained it via the .ucf file to a specific location. 

    INST "CFG_ROM/ROM" LOC = "RAMB16_X1Y82";

 

I have created a corresponding .bmm file that places the bram at the same location that is specified in the .ucf file. 

    ADDRESS_SPACE cfgRom RAMB18 WORD_ADDRESSING [0x00000000:0x000001FF]
        BUS_BLOCK
            CFG_ROM/ROM [35:0] PLACED = X1Y82;
        END_BUS_BLOCK;
    END_ADDRESS_SPACE;

 

I have created a very simple .mem file that initializes only the first memory location with a test pattern.   

    @000 000112233

 

After building the .bit file containing the BRAM in ISE, I run the following in a cmd window.

    data2mem -bm ./cfg_rom.bmm -bt ./cfg_rom.bit -bd ./cfg_rom.mem -o b ./cfg_rom_init.bit

 

I don't get any errors when running the data2mem command and the cfg_rom_init.bit file is successfully generated.  However, when I select the .bit file in iMPACT, it says that the file is missing the synchronization word and then crashes.  If I open the .bit file in a hex viewer and compare it to the ISE generated bitfile (cfg_rom.bit) I notice that the new .bit file overwrites a section of the original .bit file.  Unfortunately, the section that gets overwritten contains the 0xAA995566 sync word that is required for all .bit files, which explains the iMPACT message.

 

Here is the section in the original .bit file generated by ISE...

FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF

AA 99 55 66 30 A1 00 07  20 00 31 A1 09 60 31 41

3D 00 31 61 09 EE 31 C2  04 03 d0 93 30 E1 00 CF

30 C1 00 81 20 00 20 00  20 00 20 00 20 00 20 00

 

Here is the section in the new .bit file generated by data2mem...

FF FF 1F 31 00 1A 1F 31  00 1A 1F 31 00 1A 1F 31

00 1A 1F 3100 1A 1F 31 00 1A 1F 3100 1A 1F 31

00 1A 1F 3100 1A 1F 31 00 1A 1F 3100 1A 1F 31

00 1A 1F 3100 1A 1F 31 00 1A 1F 3100 1A 1F 31

 

I have tried generating the .vhd, .ucf, .bmm files using the same inputs to data2mem and those all look correct.  I know data2mem works with the Spartan-6 and ISE 12.4 because I have used it successfully to insert .elf files for Microblaze projects. 

 

What am I doing wrong that I can't see?

 

Thank you in advance for your help,

 

Scott

0 Kudos
3 Replies
stephenm
Moderator
Moderator
4,901 Views
Registered: ‎09-12-2007

Can I point you to the doc  attached below:

 

0 Kudos
saconnor
Visitor
Visitor
4,892 Views
Registered: ‎10-26-2010

Thank you for the link.  It would have been very useful when I first started this task because it gives a nice overview of the process.  Unfortunately for me, I didn't see anything in there that differs from my current approach.  The only difference was that the example call to data2mem has a "tag <address space name>" section and my data2mem call did not.  I added that but still had the same corruption problems in the generated .bit file.

 

I have a WebCase in with Xilinx Support and it hasn't been resolved yet, so maybe they discovered an issue.  Within my building we have done this successfully with a V5 and ISE 10.1, so I know it should work.

 

Scott

0 Kudos
saconnor
Visitor
Visitor
4,883 Views
Registered: ‎10-26-2010

I'm not sure why this was moved into the EDK and Platform Studio forum because neither are used in this case.  I grant that data2mem is mostly used for updating a bitstream with a processor executable, but it does have uses outside of that world.  I posted in the Spartan forum because I have found this to be an issue with either the Spartan-6 (it works with Virtex-5) or with ISE 12.4 (it works with ISE 10.1).

0 Kudos