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