Question about initializing on-chip block mem in XPS?

Hello, if my system is organized as the following

---------Microblaze-----lmb-----8k BRAM | Opb Bus | 64k BRAM-----opb bus-----customized circuit

I initialized my opb bram with the following sentence. float *y, *z;

y=(float *)(XPAR_OPB_BRAM_IF_CNTLR_1_BASEADDR+YBaseAddr); z=(float *)(XPAR_OPB_BRAM_IF_CNTLR_1_BASEADDR+ZBaseAddr);

/* data initialization */ for(i=0;i

Reply to
cathy
Loading thread data ...

cathy schrieb:

of course you can initialize BRAMs from file I havent done that with multiply BRAM blocks being used but it is defenetly doable.

one way that DEFENETLY works (if all others fail) is to create manually .BMM file with PLACED constraints and add matching LOC's for the BRAMs into the UCF

but I hope XPS can handle multi BRAM inits also in more easy manner

Antti

Reply to
Antti

Would you tell me how to do it in more detail? How the files look like and how to use it? Or some link to the guidance? Thanks a lot

I want to do the BRAM initialzation in simulation. The XPS generated system_init.bmm file automatically like this: opbBram64k/opbBram64k/ramb16_s1_s1_0 [31:31] ; opbBram64k/opbBram64k/ramb16_s1_s1_1 [30:30] ; opbBram64k/opbBram64k/ramb16_s1_s1_2 [29:29] ; ........................... opbBram64k/opbBram64k/ramb16_s1_s1_30 [1:1] ; opbBram64k/opbBram64k/ramb16_s1_s1_31 [0:0] ; the data is store in another file called system_init.vhd. And in this case, I need to split my each bit of my 32-bit data into different BRAM, so I need 32 different files to do that. Is that correct? Then I need to write another program to generated these files. That doable, but require some time. How do I give data in the .bmm file?

Thanks a lot

Reply to
cathy

cathy schrieb:

look at data2mem options it can convert quite many different things of course the easiest is just to test in FPGA :)

I am NEVER doing microblaze hdl sims. maybe I am forced todo them someday, but usually its easier to test in FPGA with XMD and ChipScope then doing sims

Antti

Reply to
Antti

Antti =E5=86=99=E9=81=93=EF=BC=9A

Thanks, I have to do the simulation becasue I don't have the board. :)

Reply to
cathy

Here's an approach that might work, though I haven't tried locating data this way, only code.

You can declare a constant array in your "C" code, preferably in a separate ".h" file, so you can write a script or program to generate it. (I have even used a spreadsheet, written the output as a .csv file, and hand edited the "C" array declaration around the comma separated values)

Using "Generate Linker Scripts" in EDK you can generate a new code segment, called "myrom", and map its base address to your OPBRAM.

Then you have to persuade the linker to locate that constant array in that segment - XAPP642 and Answer Record 16547 show how to locate code, but it should work for constant data.

When you have built the application and generated the sim files, you can check system_init.vhd to see if the expected BRAM is there.

- Brian

Reply to
Brian Drummond

Thank you very much, Brain. I will try today.

Reply to
cathy

Thank you very much, Brian. I have succeeded to write the data to desired location by modifying the linker script. Thank, Cathy.

Reply to
cathy

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.