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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [rtl/] [bplib/] [issi/] [is61lv25616al.vhd] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 wfjm
-- $Id: is61lv25616al.vhd 427 2011-11-19 21:04:11Z mueller $
2 2 wfjm
--
3 13 wfjm
-- Copyright 2007-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 2 wfjm
--
5
-- This program is free software; you may redistribute and/or modify it under
6
-- the terms of the GNU General Public License as published by the Free
7
-- Software Foundation, either version 2, or at your option any later version.
8
--
9
-- This program is distributed in the hope that it will be useful, but
10
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
-- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
-- for complete details.
13
-- 
14
------------------------------------------------------------------------------
15
-- Module Name:    is61lv25616al - sim
16
-- Description:    ISSI 61LV25612AL SRAM model
17
--                 Currently a truely minimalistic functional model, without
18
--                 any timing checks. It assumes, that addr/data is stable at
19
--                 the trailing edge of we.
20
--
21
-- Dependencies:   -
22
-- Test bench:     -
23
-- Target Devices: generic
24 13 wfjm
-- Tool versions:  xst 8.2, 9.1, 9.2, 13.1; ghdl 0.18-0.29
25 2 wfjm
-- Revision History: 
26
-- Date         Rev Version  Comment
27 13 wfjm
-- 2011-11-19   427   1.0.2  now numeric_std clean
28 2 wfjm
-- 2008-05-12   145   1.0.1  BUGFIX: Output now 'Z' if byte enables deasserted 
29
-- 2007-12-14   101   1.0    Initial version  (written on warsaw airport)
30
------------------------------------------------------------------------------
31
-- Truth table accoring to data sheet:
32
--  
33
--     Mode          WE_N CE_N OE_N LB_N UB_N  D(7:0)  D(15:8)
34
-- Not selected        X    H    X    X    X   high-Z  high-Z
35
-- Output disabled     H    L    H    X    X   high-Z  high-Z
36
--                     X    L    X    H    H   high-Z  high-Z
37
-- Read                H    L    L    L    H   D_out   high-Z
38
--                     H    L    L    H    L   high-Z  D_out 
39
--                     H    L    L    L    L   D_out   D_out 
40
-- Write               L    L    X    L    H   D_in    high-Z
41
--                     L    L    X    H    L   high-Z  D_in  
42
--                     L    L    X    L    L   D_in    D_in  
43
 
44
library ieee;
45
use ieee.std_logic_1164.all;
46 13 wfjm
use ieee.numeric_std.all;
47 2 wfjm
 
48
use work.slvtypes.all;
49
 
50
entity is61lv25616al is                 -- ISSI 61LV25612AL SRAM model
51
  port (
52
    CE_N : in slbit;                    -- chip enable        (act.low)
53
    OE_N : in slbit;                    -- output enable      (act.low)
54
    WE_N : in slbit;                    -- write enable       (act.low)
55
    UB_N : in slbit;                    -- upper byte enable  (act.low)
56
    LB_N : in slbit;                    -- lower byte enable  (act.low)
57
    ADDR : in slv18;                    -- address lines
58
    DATA : inout slv16                  -- data lines
59
  );
60
end is61lv25616al;
61
 
62
 
63
architecture sim of is61lv25616al is
64
 
65
  signal CE : slbit := '0';
66
  signal OE : slbit := '0';
67
  signal WE : slbit := '0';
68
  signal BE_L : slbit := '0';
69
  signal BE_U : slbit := '0';
70
 
71
  component is61lv25616al_bank is       -- ISSI 61LV25612AL bank
72
  port (
73
    CE : in slbit;                      -- chip enable        (act.high)
74
    OE : in slbit;                      -- output enable      (act.high)
75
    WE : in slbit;                      -- write enable       (act.high)
76
    BE : in slbit;                      -- byte enable        (act.high)
77
    ADDR : in slv18;                    -- address lines
78
    DATA : inout slv8                   -- data lines
79
  );
80
  end component;
81
 
82
begin
83
 
84
  CE   <= not CE_N;
85
  OE   <= not OE_N;
86
  WE   <= not WE_N;
87
  BE_L <= not LB_N;
88
  BE_U <= not UB_N;
89
 
90
  BANK_L : is61lv25616al_bank port map (
91
    CE   => CE,
92
    OE   => OE,
93
    WE   => WE,
94
    BE   => BE_L,
95
    ADDR => ADDR,
96
    DATA => DATA(7 downto 0));
97
 
98
  BANK_U : is61lv25616al_bank port map (
99
    CE   => CE,
100
    OE   => OE,
101
    WE   => WE,
102
    BE   => BE_U,
103
    ADDR => ADDR,
104
    DATA => DATA(15 downto 8));
105
 
106
end sim;
107
 
108
-- ----------------------------------------------------------------------------
109
 
110
library ieee;
111
use ieee.std_logic_1164.all;
112 13 wfjm
use ieee.numeric_std.all;
113 2 wfjm
 
114
use work.slvtypes.all;
115
 
116
entity is61lv25616al_bank is            -- ISSI 61LV25612AL bank
117
  port (
118
    CE : in slbit;                      -- chip enable        (act.high)
119
    OE : in slbit;                      -- output enable      (act.high)
120
    WE : in slbit;                      -- write enable       (act.high)
121
    BE : in slbit;                      -- byte enable        (act.high)
122
    ADDR : in slv18;                    -- address lines
123
    DATA : inout slv8                   -- data lines
124
  );
125
end is61lv25616al_bank;
126
 
127
architecture sim of is61lv25616al_bank is
128
 
129
  constant T_rc   : time := 10 ns;      -- read cycle time        (min)
130
  constant T_aa   : time := 10 ns;      -- address access time    (max)
131
  constant T_oha  : time :=  2 ns;      -- output hold time       (min)
132
  constant T_ace  : time := 10 ns;      -- ce access time         (max)
133
  constant T_doe  : time :=  4 ns;      -- oe access time         (max)
134
  constant T_hzoe : time :=  4 ns;      -- oe to high-Z output    (max)
135
  constant T_lzoe : time :=  0 ns;      -- oe to low-Z output     (min)
136
  constant T_hzce : time :=  4 ns;      -- ce to high-Z output    (min=0,max=4)
137
  constant T_lzce : time :=  3 ns;      -- ce to low-Z output     (min)
138
  constant T_ba   : time :=  4 ns;      -- lb,ub access time      (max)
139
  constant T_hzb  : time :=  3 ns;      -- lb,ub to high-Z output (min=0,max=3)
140
  constant T_lzb  : time :=  0 ns;      -- lb,ub low-Z output     (min)
141
 
142
  constant memsize : positive := 2**(ADDR'length);
143
  constant datzero : slv(DATA'range) := (others=>'0');
144
  type ram_type is array (0 to memsize-1) of slv(DATA'range);
145
 
146
  signal WE_EFF : slbit := '0';
147
 
148
begin
149
 
150
  WE_EFF <= CE and WE and BE;
151
 
152
  proc_sram: process (CE, OE, WE, BE, WE_EFF, ADDR, DATA)
153
    variable ram : ram_type := (others=>datzero);
154
  begin
155
 
156 13 wfjm
    if falling_edge(WE_EFF) then        -- end of write cycle
157
                                        -- note: to_x01 used below to prevent
158
                                        --       that 'z' a written into mem.
159
      ram(to_integer(unsigned(ADDR))) := to_x01(DATA);
160 2 wfjm
    end if;
161
 
162
    if CE='1' and OE='1' and BE='1' and WE='0' then -- output driver
163 13 wfjm
      DATA <= ram(to_integer(unsigned(ADDR)));
164 2 wfjm
    else
165
      DATA <= (others=>'Z');
166
    end if;
167
 
168
  end process proc_sram;
169
 
170
end sim;

powered by: WebSVN 2.1.0

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