OpenCores
URL https://opencores.org/ocsvn/sdram_controller/sdram_controller/trunk

Subversion Repositories sdram_controller

[/] [sdram_controller/] [trunk/] [sdram_reader.vhd] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 lynn0p
----------------------------------------------------------------------------------
2
-- Company: OPL Aerospatiale AG
3
-- Engineer: Owen Lynn <lynn0p@hotmail.com>
4
-- 
5
-- Create Date:    16:30:07 09/03/2009 
6
-- Design Name: 
7
-- Module Name:    sdram_reader - impl 
8
-- Project Name: 
9
-- Target Devices: 
10
-- Tool versions: 
11
-- Description: Logic to capture data from the chip after issuing a read command.
12
--
13
-- Dependencies: 
14
--
15
-- Revision: 
16
-- Revision 0.01 - File Created
17
-- Additional Comments: 
18
--  Copyright (c) 2009 Owen Lynn <lynn0p@hotmail.com>
19
--  Released under the GNU Lesser General Public License, Version 3
20
--
21
----------------------------------------------------------------------------------
22
library IEEE;
23
use IEEE.STD_LOGIC_1164.ALL;
24
use IEEE.STD_LOGIC_ARITH.ALL;
25
use IEEE.STD_LOGIC_UNSIGNED.ALL;
26
 
27
---- Uncomment the following library declaration if instantiating
28
---- any Xilinx primitives in this code.
29
--library UNISIM;
30
--use UNISIM.VComponents.all;
31
 
32 7 lynn0p
-- I strongly suggest you run this in the post-PAR simulator first and then start
33
--  making changes to it after looking at what goes on at the post-PAR level. Don't
34
--  say I didn't warn you. 
35
-- Why didn't I use the IDDR2 primitives? Map'nPack keeps bitching about how it
36
--  won't fit into the IOBs with the ODDR2 primitives. I decided the ODDR2s were
37
--  more important to keep.
38
-- I'm just capturing the front side of the burst, and letting the back side of
39
--  the burst fall on the floor. If you want to support both sides of the 2 burst
40
--  or bigger bursts, you'll need to rework this.
41 2 lynn0p
entity sdram_reader is
42
        port(
43
                clk270 : in std_logic;
44
                rst    : in std_logic;
45
                dq     : in std_logic_vector(15 downto 0);
46
                data0  : out std_logic_vector(7 downto 0);
47
                data1  : out std_logic_vector(7 downto 0)
48
        );
49
end sdram_reader;
50
 
51
architecture impl of sdram_reader is
52
 
53
        type FSM0_STATES is ( FSM0_START, FSM0_WAIT0, FSM0_CAPTURE, FSM0_END );
54
        signal fsm0_state : FSM0_STATES;
55
        signal reg0 : std_logic_vector(7 downto 0);
56
        signal reg1 : std_logic_vector(7 downto 0);
57
 
58
begin
59
 
60
        data0 <= reg0;
61
        data1 <= reg1;
62
 
63
        process(clk270,rst)
64
        begin
65
                if (rst = '1') then
66
                        fsm0_state <= FSM0_START;
67
                elsif (rising_edge(clk270)) then
68
                        case fsm0_state is
69
                                when FSM0_START =>
70
                                        fsm0_state <= FSM0_WAIT0;
71
                                when FSM0_WAIT0 =>
72
                                        fsm0_state <= FSM0_CAPTURE;
73
                                when FSM0_CAPTURE =>
74
                                        reg0 <= dq(7 downto 0);
75
                                        reg1 <= dq(15 downto 8);
76
                                        fsm0_state <= FSM0_END;
77
                                when others =>
78
                                        fsm0_state <= fsm0_state;
79
                        end case;
80
                end if;
81
        end process;
82
 
83
end impl;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.