cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bang0306
Visitor
Visitor
5,349 Views
Registered: ‎04-09-2016

How to initialize DDR3 with data file

I am using zc702 board to process a large mount of data. After the arm core is start, I need to write these data to the DDR on board so that the PL side can fetch these data and process them. The only way I know to write DDR by arm core is using Xil_Out function. But the data is too much to write them one by one.  Is there a way to load data from a file (I have stored all the data to a text file) to DDR or any other solutions to do the DDR initialization.

 

0 Kudos
15 Replies
ericv
Scholar
Scholar
5,284 Views
Registered: ‎04-13-2015

If you are using SDK, you can load the data from a file to the DDR memory by using the Dump / Restore under the Xilinx Tool menu.

Regards

0 Kudos
bang0306
Visitor
Visitor
5,237 Views
Registered: ‎04-09-2016

Thank you! I tried to do that by following the steps given by https://www.xilinx.com/support/documentation/sw_manuals/xilinx14_7/SDK_Doc/tasks/sdk_t_memory_dump_restore.htm After I doing all the steps, I use the mrd command in XMD to read the memory I just restored. But the memory is still unchanged with random values. Is there anything else I should to?
0 Kudos
bang0306
Visitor
Visitor
5,233 Views
Registered: ‎04-09-2016

By the way, When I select the processor context, the two ARM cores are all access denied.
0 Kudos
ericv
Scholar
Scholar
5,192 Views
Registered: ‎04-13-2015

The way I use dump/restore is through these steps:
1 - Select Processor: "Name= Xilinx Hardware Server"
     Bottom window, I expand APU and select Core #0 and click OK
2 - Browse for my file
3 - Select restore memory button
     Fill the Start Address & Size in Bytes

 

And it's there when I check the memory contents with the "Memory View"

 

Regards

 

sameertest
Observer
Observer
1,461 Views
Registered: ‎02-08-2018

I am looking for an answer to this

Restore option requires ascii file as a input file to be restored. Can you please post a sample code to generate the ascii file from a file containing a list of hex values to be loaded into DDR

 

Thanks

 

0 Kudos
sameertest
Observer
Observer
1,459 Views
Registered: ‎02-08-2018

I have huge data file which would fill ddr completely. I need a quick way to load ddr.

0 Kudos
stephenm
Moderator
Moderator
1,445 Views
Registered: ‎09-12-2007

You can use the XSCT to do this

dow -data <file> address>

 

reference:

https://www.xilinx.com/support/documentation/sw_manuals/xilinx2018_3/ug1208-xsct-reference-guide.pdf

0 Kudos
sameertest
Observer
Observer
1,436 Views
Registered: ‎02-08-2018

Thanks for letting me know about this/

What is the format of file that is passed with dow

dow -file <file> <address>

in the dow description, says ELF

how do I change a file with hex values into ELF file

 

0 Kudos
stephenm
Moderator
Moderator
1,426 Views
Registered: ‎09-12-2007

This would be a bin/hex file. If you are using the ELF then you would not use the -data switch as the tools will place the elf in the correct memory location based on the linker information.

What file are you looking to copy?

0 Kudos
sameertest
Observer
Observer
1,415 Views
Registered: ‎02-08-2018

I wish to copy all filter weights of a neural network to DDR

These weights (in serveral hundred MBs) are converted from 32 bit float to the corresponding hex representations

If I say:

dow -data <filename> <address> 

where filename being "weights.hex", will it work in a quicker way compared to the restore option from SDK gui?

 

Thanks

0 Kudos
stephenm
Moderator
Moderator
1,408 Views
Registered: ‎09-12-2007

Are you connecting the XSCT over a network, or local connection. If local, then it should be fine. You can also increase the jtag freq in XSCT.

0 Kudos
stephenm
Moderator
Moderator
1,406 Views
Registered: ‎09-12-2007

You could also use FTP if in linux or u-boot

0 Kudos
sameertest
Observer
Observer
1,371 Views
Registered: ‎02-08-2018

dow -file test.hex 0x0

does not work with xsct

if there is a file , the command is

dow -data test.hex 0x0

this does not load hex values exactly into the memory

but encodes it in ascii while writing to DDR

please help, what is the exact command to enter a hex file using dow?

0 Kudos
stephenm
Moderator
Moderator
1,356 Views
Registered: ‎09-12-2007

You could try use objcopy to convert from hex to binary. However, how the data is parsed is up to your application.

0 Kudos
sameertest
Observer
Observer
1,306 Views
Registered: ‎02-08-2018

Kindly let me know the command

objcopy -help 

does not show a way to do it

 

best regards,

0 Kudos