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 3

Go to most recent revision | 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
-- I strongly suggest you run this in the post-PAR simulator first and then start making changes to it
33
--  after looking at what goes on at the post-PAR level. Don't say I didn't warn you. 
34
-- Why didn't I use the IDDR2 primitives? Map'nPack keeps bitching about how it won't fit into the IOBs
35
--  with the ODDR2 primitives. I decided the ODDR2s were more important to keep.
36
-- I'm just capturing the front side of the burst, and letting the back side of the burst fall on the
37
--  floor. If you want to support both sides of the 2 burst or bigger bursts, you'll need to rework this.
38
entity sdram_reader is
39
        port(
40
                clk000 : in std_logic;
41
                clk270 : in std_logic;
42
                rst    : in std_logic;
43
                dq     : in std_logic_vector(15 downto 0);
44
                data0  : out std_logic_vector(7 downto 0);
45
                data1  : out std_logic_vector(7 downto 0)
46
        );
47
end sdram_reader;
48
 
49
architecture impl of sdram_reader is
50
 
51
        type FSM0_STATES is ( FSM0_START, FSM0_WAIT0, FSM0_CAPTURE, FSM0_END );
52
        signal fsm0_state : FSM0_STATES;
53
        signal reg0 : std_logic_vector(7 downto 0);
54
        signal reg1 : std_logic_vector(7 downto 0);
55
 
56
begin
57
 
58
        data0 <= reg0;
59
        data1 <= reg1;
60
 
61
        process(clk270,rst)
62
        begin
63
                if (rst = '1') then
64
                        fsm0_state <= FSM0_START;
65
                elsif (rising_edge(clk270)) then
66
                        case fsm0_state is
67
                                when FSM0_START =>
68
                                        fsm0_state <= FSM0_WAIT0;
69
                                when FSM0_WAIT0 =>
70
                                        fsm0_state <= FSM0_CAPTURE;
71
                                when FSM0_CAPTURE =>
72
                                        reg0 <= dq(7 downto 0);
73
                                        reg1 <= dq(15 downto 8);
74
                                        fsm0_state <= FSM0_END;
75
                                when others =>
76
                                        fsm0_state <= fsm0_state;
77
                        end case;
78
                end if;
79
        end process;
80
 
81
end impl;

powered by: WebSVN 2.1.0

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