Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

read data from DDR xilinx ML507

Status
Not open for further replies.

elionidas

Newbie level 5
Joined
Nov 7, 2011
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,354
Hi


I download a data file in DDR (ML507) and I want to read these data with C instruction
How can I do it ?


Best regards;
 

void DispMem(int addrMem)
{
xil_printf("addr=%08X mem=%08X\r\n",addrMem,*(int *)(addrMem));
}






DispMem(XPAR_DDR2_SDRAM_MEM_BASEADDR);
 

hi treqer
thanks for your replay

I load a txt file to DDR2 widt xmd dow command.
My txt file is as follow
I follow your C function but I obtain a wrong value for the first data that is "5"
the result obtained is addr=00000000 mem= 00000011
!!!!!!
plz help, I used also XIO_IN8(DDR2_BaseAddress) and nothing
 

Attachments

  • data.txt
    14 bytes · Views: 70

Are you sure that you address 0 data, not the software?
In terms of tire care about how to read. From BRAM read?
 

I don't understand what mean " Are you sure that you address 0 data, not the software?"
and I want to read from DDR not from BRAM

I use addresses for loading and reading as indicated in the attached figure
 

it means nothing. When you create a sample project wizard asks "where is the program, stack, hip." Perhaps the address 0 is used in your system executable code.

I do not know much about programming - I have been doing digital part. Program writes a programmer who knows nothing about the digital part. Many of the program do not tell. See file compiler_options / linker_script
 

thank for your replay

The program, heap and stack are in "xps_bram_if_cntlr_1"
the heap and the stack are the size of 1000 bytes

For the Heap and Stack, I must make the tab "memory" to DDR2_SDRAM_C_MEM_BASEADDRESS"?
 

Try to write itself

#define WriteReg(BaseAddress, RegOffset, Data) \
XIo_Out32((BaseAddress) + (RegOffset), (Xuint32)(Data))



WriteReg(XPAR_ddr_BASEADDR, 0, data);


and more .... in zero addresses will be interrupt vector
 

hi treqer

I used ReadReg and nothing
I obtained 17 instead of 5 for the first value in the address 0x00000000 !!!!!!
and when I change my file il SRAM for exemple, I obtained an other value such as 53 :(
plz help me if you know what is the source of problem
thank
 

check that
1. read the first 10 memory at address 0.
2. record the first 10 memory at address 0
3. read the first 10 memory at address 0.

Do not forget that memory addressing byte. To read and write to 32 should be addressed to increase by 4.
 

hi treqer

I do what you say
Before downloading the txt file in DDR2-SDRAM, I read the 10 first memory at address 0 like this:

Code:
        ReadReg(0x00000000,0,res1);
	xil_printf("data=%d\n",res1);
	ReadReg(0x00000000,4,res2);
	xil_printf("data=%d\n",res2);
	ReadReg(0x00000000,8,res3);
	xil_printf("data=%d\n",res3);
	ReadReg(0x00000000,12,res4);
	xil_printf("data=%d\n",res4);
	ReadReg(0x00000000,16,res5);
	xil_printf("data=%d\n",res5);
	ReadReg(0x00000000,20,res6);
	xil_printf("data=%d\n",res6);
	ReadReg(0x00000000,24,res7);
	xil_printf("data=%d\n",res7);
	ReadReg(0x00000000,28,res8);
	xil_printf("data=%d\n",res8);
	ReadReg(0x00000000,32,res9);
	xil_printf("data=%d\n",res9);
	ReadReg(0x00000000,36,res10);
	xil_printf("data=%d\n",res10);
and i obtain the same value that is "165".
however, when I download my file and I do the same instructions I obtained for the 3 first memory "53" , "32" and "32" !!!!
 

can be a problem in the position of bytes. big-endian little-Indian?
 

hi treqer
Have you an other method to download the data file to the memory ? I think the problem is there
 

I'm not a programmer. I can only analyze the process of recording, if you describe the state of the first 10 memory cells. Before and after your download file. To do this, I am interested in the contents of the file.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top