#define DDR_BASEARDDR XPAR_DDR_MEM_BASEADDR + 0x10000000
for(i=0; i<32; i++)
{
Xil_Out32(DDR_BASEARDDR+i*4,i);
} for(i=0; i<32; i++)
{
rev = Xil_In32(DDR_BASEARDDR+i*4);
xil_printf("the address at %x data is : %x \n\r" ,DDR_BASEARDDR+i*4, rev);
}
对于该实验,第一次完全按照实验来操作,实验结果如下
Hello World
the address at 10000000 data is : 0
the address at 10000004 data is : 1
the address at 10000008 data is : 2
the address at 1000000C data is : 3
the address at 10000010 data is : 4
the address at 10000014 data is : 5
the address at 10000018 data is : 6
the address at 1000001C data is : 7
the address at 10000020 data is : 8
the address at 10000024 data is : 9
the address at 10000028 data is : A
the address at 1000002C data is : B
the address at 10000030 data is : C
the address at 10000034 data is : D
the address at 10000038 data is : E
the address at 1000003C data is : F
the address at 10000040 data is : 10
the address at 10000044 data is : 11
the address at 10000048 data is : 12
the address at 1000004C data is : 13
the address at 10000050 data is : 14
the address at 10000054 data is : 15
the address at 10000058 data is : 16
the address at 1000005C data is : 17
the address at 10000060 data is : 18
the address at 10000064 data is : 19
the address at 10000068 data is : 1A
the address at 1000006C data is : 1B
the address at 10000070 data is : 1C
the address at 10000074 data is : 1D
the address at 10000078 data is : 1E
the address at 1000007C data is : 1F
第二次实验,屏蔽写操作,只进行读操作
//for(i=0; i<32; i++)
//{
//Xil_Out32(DDR_BASEARDDR+i*4,i);
//} for(i=0; i<32; i++)
{
rev = Xil_In32(DDR_BASEARDDR+i*4);
xil_printf("the address at %x data is : %x \n\r" ,DDR_BASEARDDR+i*4, rev);
}
得出来的结果如下:
Hello World
the address at 10000000 data is : 8BC6BE7F
the address at 10000004 data is : B3F8A2FF
the address at 10000008 data is : 288AC96B
the address at 1000000C data is : A8EAEF68
the address at 10000010 data is : FC9D7EEF
the address at 10000014 data is : B2DCC4DD
the address at 10000018 data is : 45D5CE6F
the address at 1000001C data is : 3AD3BFDE
the address at 10000020 data is : DD5232B3
the address at 10000024 data is : 5B6BFBBB
the address at 10000028 data is : 491FF4B9
the address at 1000002C data is : 7F70E2FB
the address at 10000030 data is : 7AAEA1FA
the address at 10000034 data is : 2E9BB28D
the address at 10000038 data is : BCDEE2EB
the address at 1000003C data is : AFD7E0AB
the address at 10000040 data is : ABBB6DD5
the address at 10000044 data is : EE4A39AC
the address at 10000048 data is : EE2B22C6
the address at 1000004C data is : DFADE99B
the address at 10000050 data is : BC8F98EA
the address at 10000054 data is : DF05A144
the address at 10000058 data is : F1BE43BF
the address at 1000005C data is : AD1DD97B
the address at 10000060 data is : 7CB6EFD8
the address at 10000064 data is : 9AEEF2B8
the address at 10000068 data is : CB2BEF13
the address at 1000006C data is : 86EFDFAC
the address at 10000070 data is : 9E1F43E9
the address at 10000074 data is : 33BB77DD
the address at 10000078 data is : B621EDEF
the address at 1000007C data is : A765231F