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

Subversion Repositories wdsp

[/] [wdsp/] [trunk/] [rtl/] [verilog/] [minsoc/] [memif/] [ssram_interface_top.vhd] - Blame information for rev 7

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 parrado
-- Xiang Li, olivercamel@gmail.com
2
-- Last Revised: 2008/06/27
3
--
4
-- This is an interface for the SSRAM IS61LPS51236A of DE2-70 Board.
5
-- The interface only includes tri-state logic for external pins.
6
-- All read/write timing logics are implemented by Memory Controller (MC) Core.
7
--
8
-- The SSRAM is 2 MBytes.
9
-- The SSRAM address is configured as: 0x1000_0000 - 0x101F_FFFC,
10
-- as the Memory Controller is attached to conmax slave 1.
11
--
12
-- The MC registers in our system could config as the following:
13
-- CSR     0x1800_0000: 0x0000_0000
14
-- POC     0x1800_0004: 0x0000_0002 This is done in mc_defines.v
15
-- BA_MASK 0x1800_0008: 0x0000_0020 Only judge addr(26)
16
-- CSC0    0x1800_0010: 0x0000_0823 for SSRAM
17
-- TMS0    0x1800_0014: 0xFFFF_FFFF
18
 
19
library ieee;
20
use ieee.std_logic_1164.all;
21
 
22
entity ssram_interface_top is
23
        port(
24
                -- Memory Controller (MC) Interface
25
                -- Same signals as MC but inverted in/out (except for mc_clk_i)
26
                mc_clk_i:         in  std_logic;
27
                mc_br_pad_i:      out std_logic;
28
                mc_bg_pad_o:      in  std_logic;
29
                mc_ack_pad_i:     out std_logic;
30
                mc_addr_pad_o:    in  std_logic_vector (23 downto 0);
31
                mc_data_pad_i:    out std_logic_vector (31 downto 0);
32
                mc_data_pad_o:    in  std_logic_vector (31 downto 0);
33
                mc_dp_pad_i:      out std_logic_vector (3 downto 0);
34
                mc_dp_pad_o:      in  std_logic_vector (3 downto 0);
35
                mc_doe_pad_doe_o: in  std_logic;
36
                mc_dqm_pad_o:     in  std_logic_vector (3 downto 0);
37
                mc_oe_pad_o:      in  std_logic;
38
                mc_we_pad_o:      in  std_logic;
39
                mc_cas_pad_o:     in  std_logic;
40
                mc_ras_pad_o:     in  std_logic;
41
                mc_cke_pad_o:     in  std_logic;
42
                mc_cs_pad_o:      in  std_logic_vector (7 downto 0);
43
                mc_sts_pad_i:     out std_logic;
44
                mc_rp_pad_o:      in  std_logic;
45
                mc_vpen_pad_o:    in  std_logic;
46
                mc_adsc_pad_o:    in  std_logic;
47
                mc_adv_pad_o:     in  std_logic;
48
                mc_zz_pad_o:      in  std_logic;
49
                mc_coe_pad_coe_o: in  std_logic;
50
 
51
                -- SSRAM interface
52
                sram_a_o:        out std_logic_vector (18 downto 0);
53
                sram_dq_io:    inout std_logic_vector (31 downto 0);
54
                sram_adsc_n_o:   out std_logic;
55
                sram_adsp_n_o:   out std_logic;
56
                sram_adv_n_o:    out std_logic;
57
                sram_be_n_o:     out std_logic_vector (3 downto 0);
58
                sram_ce1_n_o:    out std_logic;
59
                sram_ce2_o:      out std_logic;
60
                sram_ce3_n_o:    out std_logic;
61
                sram_clk_o:      out std_logic;
62
                sram_dpa_io:   inout std_logic_vector (3 downto 0);
63
                sram_gw_n_o:     out std_logic;
64
                sram_oe_n_o:     out std_logic;
65
                sram_we_n_o:     out std_logic
66
        );
67
end ssram_interface_top;
68
 
69
architecture behave of ssram_interface_top is
70
 
71
begin
72
 
73
        -- take care of the unused output signals
74
        mc_br_pad_i  <= '0';
75
        mc_ack_pad_i <= '0';
76
        mc_sts_pad_i <= '0';
77
 
78
        -- the following signals are not in use in our system
79
        --mc_bg_pad_o:      in  std_logic;
80
        --mc_rp_pad_o:      in  std_logic;
81
        --mc_vpen_pad_o:    in  std_logic;
82
        --mc_zz_pad_o:      in  std_logic;
83
        --mc_cs_pad_o:      in  std_logic_vector (7 downto 1);
84
        --mc_cas_pad_o:     in  std_logic;
85
        --mc_ras_pad_o:     in  std_logic;
86
        --mc_cke_pad_o:     in  std_logic;
87
 
88
        -- clk output for external SSRAM chip,
89
        -- this should be exactly a half of system clock frequency
90
        sram_clk_o    <= mc_clk_i;
91
 
92
        -- SSRAM control signals with tri-state
93
        sram_a_o      <= mc_addr_pad_o (18 downto 0) when mc_coe_pad_coe_o = '1' else (others => 'Z');
94
        sram_be_n_o   <= mc_dqm_pad_o                when mc_coe_pad_coe_o = '1' else (others => 'Z');
95
        sram_oe_n_o   <= mc_oe_pad_o                 when mc_coe_pad_coe_o = '1' else 'Z';
96
        sram_we_n_o   <= mc_we_pad_o                 when mc_coe_pad_coe_o = '1' else 'Z';
97
        sram_ce1_n_o  <= mc_cs_pad_o (0)             when mc_coe_pad_coe_o = '1' else 'Z';
98
        sram_adsc_n_o <= mc_adsc_pad_o               when mc_coe_pad_coe_o = '1' else 'Z';
99
        sram_adv_n_o  <= mc_adv_pad_o                when mc_coe_pad_coe_o = '1' else 'Z';
100
        sram_adsp_n_o <= '1'                         when mc_coe_pad_coe_o = '1' else 'Z';
101
        sram_ce2_o    <= '1'                         when mc_coe_pad_coe_o = '1' else 'Z';
102
        sram_ce3_n_o  <= '0'                         when mc_coe_pad_coe_o = '1' else 'Z';
103
        sram_gw_n_o   <= '1'                         when mc_coe_pad_coe_o = '1' else 'Z';
104
 
105
        -- SSRAM data with tri-state
106
        sram_dq_io    <= mc_data_pad_o               when mc_doe_pad_doe_o = '1' else (others => 'Z');
107
        sram_dpa_io   <= mc_dp_pad_o                 when mc_doe_pad_doe_o = '1' else (others => 'Z');
108
 
109
        -- tri-state input
110
        mc_data_pad_i <= sram_dq_io;
111
        mc_dp_pad_i   <= sram_dpa_io;
112
 
113
end behave;

powered by: WebSVN 2.1.0

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