8-32
Writing a Predefined Data Pattern to SDRAM in the Preloader
data_temp[2]=0XAAAAAAAA; //initial data for A->5 switching
expected_data[0]=0XFFFFFFFE; //initial data for walking 0
pattern
expected_data[1]=0X00000001; //initial data for walking 1
pattern
expected_data[2]=0XAAAAAAAA; //initial data for A->5 switching
for (i=0;i<3;i++) {
printf("\nSTARTED %08X DATA PATTERN !!!!\n",data_temp[i]);
/*write*/
for (cnt = (0+i*num_address); cnt < ((i+1)*num_address) ;
{
addr = base + cnt; /* pointer arith! */
sync ();
data_temp[i]=ROTATE_RIGHT(data_temp[i]);
}
/*read*/
for (cnt = (0+i*num_address); cnt < ((i+1)*num_address) ; cnt = cnt++
) {
addr = base + cnt; /* pointer arith! */
sync ();
read_data=*addr;
expected_data[i],read_data);
hang();
}
}
}
}
====//End Of Code//=====
Altera Corporation
*addr = data_temp[i];
printf("Address:%X
if (expected_data[i] !=read_data) {
puts("!!!!!!FAILED!!!!!!\n\n");
expected_data[i]=ROTATE_RIGHT(expected_data[i]);
Expected: %08X
cnt++ )
Read:%08X \n",addr,
SDRAM Controller Subsystem
Send Feedback
cv_54008
2013.12.30
Need help?
Do you have a question about the Cyclone V and is the answer not in the manual?