Line 230... |
Line 230... |
constant CMD_AUTO_REFR : std_logic_vector(2 downto 0) := "100";
|
constant CMD_AUTO_REFR : std_logic_vector(2 downto 0) := "100";
|
constant CMD_LOAD_MR : std_logic_vector(2 downto 0) := "000";
|
constant CMD_LOAD_MR : std_logic_vector(2 downto 0) := "000";
|
|
|
-- various wait counter values
|
-- various wait counter values
|
constant AUTO_REFRESH_CLKS : integer := 700; -- spec says 7.8us, which is 780 clocks @ 100Mhz, I'm setting it to 700
|
constant AUTO_REFRESH_CLKS : integer := 700; -- spec says 7.8us, which is 780 clocks @ 100Mhz, I'm setting it to 700
|
constant WRITE_RECOVER_CLKS : integer := 6; -- these are fudged a bit, you *might* be able to shave a clock or two off
|
constant WRITE_RECOVER_CLKS : integer := 5; -- these are fudged a bit, you *might* be able to shave a clock or two off
|
constant READ_DONE_CLKS : integer := 5;
|
constant READ_DONE_CLKS : integer := 5;
|
|
|
type CMD_STATES is ( STATE_START, STATE_INIT, STATE_WAIT_INIT, STATE_IDLE, STATE_IDLE_AUTO_REFRESH,
|
type CMD_STATES is ( STATE_START, STATE_INIT, STATE_WAIT_INIT, STATE_IDLE, STATE_IDLE_AUTO_REFRESH,
|
STATE_IDLE_CHECK_OP_PENDING, STATE_IDLE_WAIT_AR_CTR, STATE_IDLE_WAIT_AUTO_REFRESH,
|
STATE_IDLE_CHECK_OP_PENDING, STATE_IDLE_WAIT_AR_CTR, STATE_IDLE_WAIT_AUTO_REFRESH,
|
STATE_WRITE_ROW_OPEN, STATE_WRITE_WAIT_ROW_OPEN, STATE_WRITE_ISSUE_CMD, STATE_WRITE_WAIT_RECOVER,
|
STATE_WRITE_ROW_OPEN, STATE_WRITE_WAIT_ROW_OPEN, STATE_WRITE_ISSUE_CMD, STATE_WRITE_WAIT_RECOVER,
|
Line 457... |
Line 457... |
debug_reg <= x"00";
|
debug_reg <= x"00";
|
dram_cs <= '0';
|
dram_cs <= '0';
|
data_o <= data1_o when addr_save(0) = '1' else data0_o;
|
data_o <= data1_o when addr_save(0) = '1' else data0_o;
|
|
|
-- capture addr, data_i and op for the cmd fsm
|
-- capture addr, data_i and op for the cmd fsm
|
-- op needs capture during AR or it might get dropped
|
-- op needs to be captured during AR or it might get dropped
|
process (clk_000)
|
process (clk_000)
|
begin
|
begin
|
if (rising_edge(clk_000)) then
|
if (rising_edge(clk_000)) then
|
if (cap_en = '1') then
|
if (cap_en = '1') then
|
addr_save <= addr;
|
addr_save <= addr;
|