18.12.2012 Views

TN1050 - Lattice Semiconductor

TN1050 - Lattice Semiconductor

TN1050 - Lattice Semiconductor

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix C. VHDL Example for DDR Input and Output Modules<br />

library IEEE;<br />

use IEEE.std_logic_1164.all;<br />

library ec;<br />

use ec.components.all;<br />

10-24<br />

<strong>Lattice</strong>ECP/EC and <strong>Lattice</strong>XP<br />

DDR Usage Guide<br />

entity ddr_mem is<br />

port( dq : inout std_logic_vector(7 downto 0 );<br />

dqs : inout std_logic;<br />

clk : in std_logic; -- core clock<br />

clk90 : in std_logic; -- 90 degree phase shifted clock from the pll<br />

reset : in std_logic;<br />

uddcntl : in std_logic;<br />

read : in std_logic;<br />

dataout_p : in std_logic_vector(7 downto 0);<br />

dataout_n : in std_logic_vector(7 downto 0);<br />

datatri_p : in std_logic_vector(7 downto 0);<br />

datatri_n : in std_logic_vector(7 downto 0);<br />

dqstri_p : in std_logic;<br />

dqstri_n : in std_logic;<br />

ddrclk : out std_logic;<br />

datain_p : out std_logic_vector(7 downto 0);<br />

datain_n : out std_logic_vector(7 downto 0);<br />

dqsc : out std_logic;<br />

prmbdet : out std_logic;<br />

lock : out std_logic;<br />

ddrclkpol : out std_logic);<br />

--*****DDR interface signals assigned SSTL25 IO Standard *************<br />

ATTRIBUTE IO_TYPE : string;<br />

ATTRIBUTE IO_TYPE OF ddrclk : SIGNAL IS "SSTL25D_II";<br />

ATTRIBUTE IO_TYPE OF dq : SIGNAL IS "SSTL25_II";<br />

ATTRIBUTE IO_TYPE OF dqs : SIGNAL IS "SSTL25_II";<br />

end ddr_mem;<br />

architecture structure of ddr_mem is<br />

--*****DDR Input register*********************************************<br />

component IDDRXB<br />

port(<br />

D : in STD_LOGIC;<br />

ECLK : in STD_LOGIC;<br />

SCLK : in STD_LOGIC;<br />

CE : in STD_LOGIC;<br />

LSR : in STD_LOGIC;<br />

DDRCLKPOL : in STD_LOGIC;<br />

QA : out STD_LOGIC;<br />

QB : out STD_LOGIC);<br />

end component;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!