- //SDRAM自動刷新
- //刷新行間隔 64 ms / 4096 行 = 0.00_0015 s
- //clk = 50M Hz
- //SDR_CLK = 50M Hz (一般可設置為100M Hz以上)
- //tRP = 20 ns, 取30 ns
- //tRFC = 66 ns, 取100 ns
- //預充電命令 {CS_N,RAS_N,CAS_N,WE_N} = 4'b0010
- module sdr_auto_r(
- clk, //系統時鐘
- rst,
- auto_done,
- auto_SDR_CLK, //SDRAM時鐘
- auto_CKE, //時鐘使能
- auto_CS_N, //片選信號
- auto_RAS_N, //行地址選通
- auto_CAS_N, //列地址選通
- auto_WE_N, //寫使能
- auto_BA, //Bank地址
- auto_SA, //地址總線
- auto_DQM, //數據掩碼
- auto_DQ, //數據總線
- auto_en
- );
- input clk,rst;
- input auto_en;
- output auto_done;
- output auto_SDR_CLK;
- output auto_CKE;
- output auto_CS_N;
- output auto_RAS_N;
- output auto_CAS_N;
- output auto_WE_N;
- output [1:0] auto_BA;
- output [12:0] auto_SA;
- output [1:0] auto_DQM;
- inout [15:0] auto_DQ;
- reg [3:0] auto_cnt;
- reg auto_done;
- reg auto_CKE;
- reg auto_CS_N;
- reg auto_RAS_N;
- reg auto_CAS_N;
- reg auto_WE_N;
- reg [12:0] auto_SA;
- //====================================================================
- // 計數器
- //=======