cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mam12
Visitor
Visitor
3,246 Views
Registered: ‎03-13-2016

DDR3 MEMORY INTERFACE FOR SP605

HI,

I have spartan 6 "SP605" board . I have to use DDR3 memory to store data. i have generated DDR3 IP core and instantiated in my program.  the program is working fine for memory write operation, i am getting some issues only in memory read operation. i m trying to send read or write command from external word (through serial communication) memory is responding for write command but not for read command.

here i have attached my code.

 

serial_input : process (c3_clk0)
begin
if rising_edge(c3_clk0) then
    case write_data is                                 --  write_data  is a word received from serial port 
        when "1111111111111111" =>
            start_mem <= '1';
            command <= "001";                -- read command
        when "1010101010101010" =>
            start_mem <= '1';
            command <= "000";             -- write command
        when others =>
        end case;
end if;
end process;
 
DDR_P0_CMD : Process (c3_clk0)
 begin
 if start_mem = '1' then
    if rising_edge (c3_clk0) then
        c3_p0_cmd_en<='1';                       -- enable command
        c3_p0_cmd_instr <= command;
        c3_p0_cmd_bl<="000001";
        c3_p0_cmd_byte_addr<="000000000000000000000000000010";
        c3_p0_wr_data<=x"00000003";
    end if;
end if;
end process;

DDR_P0_WRITE_READ : Process (c3_clk0)
variable state : integer range 0 to 5 := 0;
begin
 if start_mem = '1' then
    if rising_edge (c3_clk0) then
        case c3_p0_cmd_instr is
        when "000" =>
            c3_p0_wr_en<='1';    
            if((c3_p0_wr_empty='0') )then
                c3_p0_wr_en<='0';
                led(1) <= '1';
            end if;
        when "001" =>     
            led (0) <= '1';
            if state = 0 then
                c3_p0_rd_en<='1';
                state := 1;
            elsif state = 1 then
                if((c3_p0_rd_empty='0') )then
                    c3_p0_rd_en<='0';
                    led (3 downto 2) <= c3_p0_rd_data (3 downto 2);
                end if;
            end if;
        when others =>
        end case;
    end if;
end if;
end process;
 

"c3_p0_rd_empty" is not deasserting when  i send write_data as "1111111111111111" through serial interface.

somebody can tell me, is there any programming mistake.

 

0 Kudos
3 Replies
balkris
Xilinx Employee
Xilinx Employee
3,216 Views
Registered: ‎08-01-2008

check this example design 

XTP060 - SP605 MIG PDF (13.4 C) ( ver13.4, 3609 KB ) [PDF]

MIG DDR3 for the SP605 using CORE Generator
Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
saradapr
Explorer
Explorer
3,092 Views
Registered: ‎10-14-2015

Hi @mam12,,

 

Please check page 9 of  the App note :

https://www.xilinx.com/support/documentation/application_notes/xapp496.pdf

 

Thanks,

Sarada

 

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------

0 Kudos
yenigal
Xilinx Employee
Xilinx Employee
3,076 Views
Registered: ‎02-06-2013

Hi

 

Start with the example design generated with MIG and check if the reads are working fine with it?

Regards,

Satish

--------------------------------------------------​--------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful.
--------------------------------------------------​-------------------------------------------
0 Kudos