Line 50... |
Line 50... |
address : in std_logic_vector(25 downto 2);
|
address : in std_logic_vector(25 downto 2);
|
byte_we : in std_logic_vector(3 downto 0);
|
byte_we : in std_logic_vector(3 downto 0);
|
data_w : in std_logic_vector(31 downto 0);
|
data_w : in std_logic_vector(31 downto 0);
|
data_r : out std_logic_vector(31 downto 0);
|
data_r : out std_logic_vector(31 downto 0);
|
active : in std_logic;
|
active : in std_logic;
|
|
no_start : in std_logic;
|
|
no_stop : in std_logic;
|
pause : out std_logic;
|
pause : out std_logic;
|
|
|
SD_CK_P : out std_logic; --clock_positive
|
SD_CK_P : out std_logic; --clock_positive
|
SD_CK_N : out std_logic; --clock_negative
|
SD_CK_N : out std_logic; --clock_negative
|
SD_CKE : out std_logic; --clock_enable
|
SD_CKE : out std_logic; --clock_enable
|
Line 109... |
Line 111... |
signal bank_open : std_logic_vector(3 downto 0);
|
signal bank_open : std_logic_vector(3 downto 0);
|
signal data_read : std_logic_vector(31 downto 0);
|
signal data_read : std_logic_vector(31 downto 0);
|
|
|
begin
|
begin
|
ddr_proc: process(clk, clk_p, clk_2x, reset_in,
|
ddr_proc: process(clk, clk_p, clk_2x, reset_in,
|
address, byte_we, data_w, active,
|
address, byte_we, data_w, active, no_start, no_stop,
|
SD_DQ, SD_UDQS, SD_LDQS,
|
SD_DQ, SD_UDQS, SD_LDQS,
|
state_prev, refresh_cnt,
|
state_prev, refresh_cnt,
|
byte_we_reg2, data_write2,
|
byte_we_reg2, data_write2,
|
cycle_count, cycle_count2, write_prev,
|
cycle_count, cycle_count2, write_prev,
|
write_active, cke_reg, bank_open,
|
write_active, cke_reg, bank_open,
|
Line 143... |
Line 145... |
|
|
when STATE_IDLE =>
|
when STATE_IDLE =>
|
if refresh_cnt(7) = '1' then
|
if refresh_cnt(7) = '1' then
|
state_current := STATE_PRECHARGE;
|
state_current := STATE_PRECHARGE;
|
command := COMMAND_AUTO_REFRESH;
|
command := COMMAND_AUTO_REFRESH;
|
elsif active = '1' then
|
elsif active = '1' and no_start = '0' then
|
state_current := STATE_ROW_ACTIVATE;
|
state_current := STATE_ROW_ACTIVATE;
|
command := COMMAND_ACTIVE;
|
command := COMMAND_ACTIVE;
|
end if;
|
end if;
|
|
|
when STATE_ROW_ACTIVATE =>
|
when STATE_ROW_ACTIVATE =>
|
Line 157... |
Line 159... |
if refresh_cnt(7) = '1' then
|
if refresh_cnt(7) = '1' then
|
if write_prev = '0' then
|
if write_prev = '0' then
|
state_current := STATE_PRECHARGE;
|
state_current := STATE_PRECHARGE;
|
command := COMMAND_PRECHARGE;
|
command := COMMAND_PRECHARGE;
|
end if;
|
end if;
|
elsif active = '1' then
|
elsif active = '1' and no_start = '0' then
|
if bank_open(bank_index) = '0' then
|
if bank_open(bank_index) = '0' then
|
state_current := STATE_ROW_ACTIVATE;
|
state_current := STATE_ROW_ACTIVATE;
|
command := COMMAND_ACTIVE;
|
command := COMMAND_ACTIVE;
|
elsif address(25 downto 13) /= address_row(bank_index) then
|
elsif address(25 downto 13) /= address_row(bank_index) then
|
if write_prev = '0' then
|
if write_prev = '0' then
|
Line 183... |
Line 185... |
|
|
when STATE_READ2 =>
|
when STATE_READ2 =>
|
state_current := STATE_READ3;
|
state_current := STATE_READ3;
|
|
|
when STATE_READ3 =>
|
when STATE_READ3 =>
|
|
if no_stop = '0' then
|
state_current := STATE_ROW_ACTIVE;
|
state_current := STATE_ROW_ACTIVE;
|
|
end if;
|
|
|
when STATE_PRECHARGE =>
|
when STATE_PRECHARGE =>
|
state_current := STATE_PRECHARGE2;
|
state_current := STATE_PRECHARGE2;
|
|
|
when STATE_PRECHARGE2 =>
|
when STATE_PRECHARGE2 =>
|