最近简单调了一下KC705开发板上面的DDR3,型号是MT8JTF12864HZ-1G6;有时候加载程序后,发现读出数据不是写进去的,在这将我的操作思路说下,有弄过的说说哪块有问题,不胜感激:
1.ip核的sys_clk_i给400M时钟,clk_ref_i给200M时钟;app_wdf_mask全为0;app_sr_req,app_ref_req,app_zq_req接pull_down,app_en<=0,app_cmd=0,app_wdf_wren<=0, app_wdf_end <= 0 ,app_addr <= 0,app_wdf_data<=0,步骤2;
2.等初始化完成后(即init_calib_complete为高电平)1.5s,对ddr3写操作,在app_wdf_rdy为高,且app_rdy为低电平时,使能app_en,且app_cmd=0,步骤3;
3.判断:
a,若(app_rdy == 1) && (app_wdf_rdy == 1) ,则app_wdf_wren<=1, app_wdf_end <= 1 ,app_wdf_data<=写数据,app_addr
<=初始地址,步骤4。
b,若(app_rdy == 0) && (app_wdf_rdy == 1) ,则app_wdf_wren<=0, app_wdf_end <= 0 ;等待app_rdy == 1。
c,若 (app_wdf_rdy == 0) ,返回2。
4.判断:
a,若(app_wdf_rdy == 1),则app_wdf_wren<=0, app_wdf_end <= 0 ,app_addr
<= app_addr + 8 ;步骤3;
b,( app_addr == ADDRESS ),ADDRESS为设定的最大地址值;app_en<=0,app_wdf_wren<=0, app_wdf_end <= 0 ,app_addr <= 0,步骤5;
c,若 (app_wdf_rdy == 0) ,返回2。
5.空闲40周期,步骤6;
6.读操作,判断:
a,若(app_addr == ADDRESS),读结束,步骤7;
b,若( app_rdy == 1),app_en <= 1 ;app_cmd
<= 3'd1,app_addr
<= app_addr + 4 ;步骤6;
c,否则,步骤6;
7.空闲1024周期,步骤3。
但是有时候读的数据不是写进去的数据。
写操作:
从上到下为:app_cmd,app_en,app_rdy,app_wdf_wren(app_wdf_end与app_wdf_wren相同 ),app_wdf_data,app_rd_data_valid,app_rd_data;最面面为init_calib_complete(一直为高电平)。
正确读:
错误读:
file:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\214325312\QQ\WinTemp\RichOle\D_`PKM8VIL~]FP@DVY3JMS5.jpgfile:///C:\Users\Administrator\AppData\Roaming\Tencent\Users\214325312\QQ\WinTemp\RichOle\D_`PKM8VIL~]FP@DVY3JMS5.jpg
|