1 |
2 |
dimamali |
-- Copyright © 2006. GSI Technology
|
2 |
|
|
-- Jeff Daugherty
|
3 |
|
|
-- apps@gsitechnology.com
|
4 |
|
|
-- Version: 3.2
|
5 |
|
|
--
|
6 |
|
|
-- FileName: core.vhd
|
7 |
|
|
-- Unified Sram Core Model for Sync Burst/NBT Sram
|
8 |
|
|
--
|
9 |
|
|
-- Revision History:
|
10 |
|
|
-- 04/23/02 1.0 1) Created VHDL Core.VHD from Verilog Core.V
|
11 |
|
|
-- 06/05/02 1.1 1) added new signals, DELAY and tKQX. These signals will
|
12 |
|
|
-- be used to setup the Clock to Data Invalid spec.
|
13 |
|
|
-- 07/17/02 1.2 1) Fixed the JTAG State machine
|
14 |
|
|
-- 2) changed the SR register to shift out the MSB and shift
|
15 |
|
|
-- in the LSB
|
16 |
|
|
-- 09/25/02 1.3 1) Removed all nPE pin features
|
17 |
|
|
-- 2) Max number of Core addresses is now dynamic
|
18 |
|
|
-- 3) Max width of Core data is now dynamic
|
19 |
|
|
-- 4) Removed alll reference of JTAG from core, seperate JTAG
|
20 |
|
|
-- model file: GSI_JTAG
|
21 |
|
|
-- 01/10/03 1.4 1) Created a Write_Array process to remove race conditions
|
22 |
|
|
-- 2) Created a Read_Array proccess to remove race conditions
|
23 |
|
|
-- 02/20/03 1.5 1) Added We and Waddr to Read_Array sensitivity list.
|
24 |
|
|
-- 2) Changed the Read_Array process to look at the last
|
25 |
|
|
-- write's byte write setting and determine where to pull the
|
26 |
|
|
-- read data from, either coherency(byte write on) or the
|
27 |
|
|
-- array(byte write off).
|
28 |
|
|
-- 3) Added signal Iscd to fix SCD to the right state for NBT
|
29 |
|
|
-- 04/03/03 1.6 1) Added a write clock W_k to trigger the Write_Array function
|
30 |
|
|
-- 07/09/03 1.7 1) changed NBT write clock to clock off of we2.
|
31 |
|
|
-- 2) Delayed the internal clock by 1ns to control the write
|
32 |
|
|
-- 3) changed ce to take into account NBT mode
|
33 |
|
|
-- 07/23/03 1.8 1) Changed W_K to ignore the byte writes
|
34 |
|
|
-- 08/12/03 1.9 1) updated state machine to include seperate read and write
|
35 |
|
|
-- burst states
|
36 |
|
|
-- 2) Changed internal bytewrite signal to ignore nW
|
37 |
|
|
-- 10/29/03 2.0 1) updated the state machine, changed reference to suspend
|
38 |
|
|
-- to deselect.
|
39 |
|
|
-- 2) added timing functions to core
|
40 |
|
|
-- 03/25/04 2.1 1) Updated state machine. Added deselect and suspend states
|
41 |
|
|
-- 2) Fixed other issues with the state machine
|
42 |
|
|
-- 04/28/04 2.2 1) Rearranged state that determins Deselect, Burst and Suspend
|
43 |
|
|
--
|
44 |
|
|
-- 11/01/05 3.0 1) Created BurstRAM only Model
|
45 |
|
|
-- 06/21/06 3.1 1) Added Qswitch to control when the IOs turn on or off
|
46 |
|
|
-- 2) Delayed the Qxi inteernal data busses instead of the DQx
|
47 |
|
|
-- external Data busses.
|
48 |
|
|
-- 3) Added CLK_i2 to control the setting of Qswitch
|
49 |
|
|
-- 4) All these changes removed Negative time issue for some simulations
|
50 |
|
|
--07/18/06 3.2 1) Initialized ce and re to 0 so that Qswitch is not
|
51 |
|
|
-- undfined which can cause bus contention on startup.
|
52 |
|
|
--
|
53 |
|
|
--
|
54 |
|
|
LIBRARY ieee;
|
55 |
|
|
USE ieee.std_logic_1164.all;
|
56 |
|
|
ENTITY VHDL_BURST_CORE IS
|
57 |
|
|
GENERIC (
|
58 |
|
|
CONSTANT bank_size : integer ;-- *16M /4 bytes in parallel
|
59 |
|
|
CONSTANT A_size : integer;
|
60 |
|
|
CONSTANT DQ_size : integer);
|
61 |
|
|
PORT (
|
62 |
|
|
SIGNAL A : IN std_logic_vector(A_size - 1 DOWNTO 0);-- address
|
63 |
|
|
SIGNAL DQa : INOUT std_logic_vector(DQ_size DOWNTO 1);-- byte A data
|
64 |
|
|
SIGNAL DQb : INOUT std_logic_vector(DQ_size DOWNTO 1);-- byte B data
|
65 |
|
|
SIGNAL DQc : INOUT std_logic_vector(DQ_size DOWNTO 1);-- byte C data
|
66 |
|
|
SIGNAL DQd : INOUT std_logic_vector(DQ_size DOWNTO 1);-- byte D data
|
67 |
|
|
SIGNAL DQe : inout std_logic_vector(DQ_size DOWNTO 1);-- byte E data
|
68 |
|
|
SIGNAL DQf : inout std_logic_vector(DQ_size DOWNTO 1);-- byte F data
|
69 |
|
|
SIGNAL DQg : inout std_logic_vector(DQ_size DOWNTO 1);-- byte G data
|
70 |
|
|
SIGNAL DQh : inout std_logic_vector(DQ_size DOWNTO 1);-- byte H data
|
71 |
|
|
SIGNAL nBa : IN std_logic;-- bank A write enable
|
72 |
|
|
SIGNAL nBb : IN std_logic;-- bank B write enable
|
73 |
|
|
SIGNAL nBc : IN std_logic;-- bank C write enable
|
74 |
|
|
SIGNAL nBd : IN std_logic;-- bank D write enable
|
75 |
|
|
SIGNAL nBe : IN std_logic;-- bank E write enable
|
76 |
|
|
SIGNAL nBf : IN std_logic;-- bank F write enable
|
77 |
|
|
SIGNAL nBg : IN std_logic;-- bank G write enable
|
78 |
|
|
SIGNAL nBh : IN std_logic;-- bank H write enable
|
79 |
|
|
SIGNAL CK : IN std_logic;-- clock
|
80 |
|
|
SIGNAL nBW : IN std_logic;-- byte write enable
|
81 |
|
|
SIGNAL nGW : IN std_logic;-- Global write enable
|
82 |
|
|
SIGNAL nE1 : IN std_logic;-- chip enable 1
|
83 |
|
|
SIGNAL E2 : IN std_logic;-- chip enable 2
|
84 |
|
|
SIGNAL nE3 : IN std_logic;-- chip enable 3
|
85 |
|
|
SIGNAL nG : IN std_logic;-- output enable
|
86 |
|
|
SIGNAL nADV : IN std_logic;-- Advance not / load
|
87 |
|
|
SIGNAL nADSC : IN std_logic;
|
88 |
|
|
SIGNAL nADSP : IN std_logic;
|
89 |
|
|
SIGNAL ZZ : IN std_logic;-- power down
|
90 |
|
|
SIGNAL nFT : IN std_logic;-- Pipeline / Flow through
|
91 |
|
|
SIGNAL nLBO : IN std_logic;-- Linear Burst Order
|
92 |
|
|
SIGNAL SCD : IN std_logic;
|
93 |
|
|
SIGNAL HighZ : std_logic_vector(DQ_size downto 1);
|
94 |
|
|
SIGNAL tKQ : time;
|
95 |
|
|
SIGNAL tKQX : time);
|
96 |
|
|
END VHDL_BURST_CORE;
|
97 |
|
|
|
98 |
|
|
LIBRARY GSI;
|
99 |
|
|
LIBRARY Std;
|
100 |
|
|
ARCHITECTURE GSI_BURST_CORE OF VHDL_BURST_CORE IS
|
101 |
|
|
USE GSI.FUNCTIONS.ALL;
|
102 |
|
|
USE Std.textio.ALL;
|
103 |
|
|
TYPE MEMORY_0 IS ARRAY (0 TO bank_size) OF std_logic_vector(DQ_size - 1 DOWNTO 0);
|
104 |
|
|
TYPE MEMORY_1 IS ARRAY (0 TO bank_size) OF std_logic_vector(DQ_size - 1 DOWNTO 0);
|
105 |
|
|
TYPE MEMORY_2 IS ARRAY (0 TO bank_size) OF std_logic_vector(DQ_size - 1 DOWNTO 0);
|
106 |
|
|
TYPE MEMORY_3 IS ARRAY (0 TO bank_size) OF std_logic_vector(DQ_size - 1 DOWNTO 0);
|
107 |
|
|
TYPE MEMORY_4 IS ARRAY (0 TO bank_size) OF std_logic_vector(DQ_size - 1 DOWNTO 0);
|
108 |
|
|
TYPE MEMORY_5 IS ARRAY (0 TO bank_size) OF std_logic_vector(DQ_size - 1 DOWNTO 0);
|
109 |
|
|
TYPE MEMORY_6 IS ARRAY (0 TO bank_size) OF std_logic_vector(DQ_size - 1 DOWNTO 0);
|
110 |
|
|
TYPE MEMORY_7 IS ARRAY (0 TO bank_size) OF std_logic_vector(DQ_size - 1 DOWNTO 0);
|
111 |
|
|
-- ******** Define Sram Operation Mode **********************
|
112 |
|
|
shared variable bank0 : MEMORY_0 ;
|
113 |
|
|
shared variable bank1 : MEMORY_1 ;
|
114 |
|
|
shared variable bank2 : MEMORY_2 ;
|
115 |
|
|
shared variable bank3 : MEMORY_3 ;
|
116 |
|
|
shared variable bank4 : MEMORY_4 ;
|
117 |
|
|
shared variable bank5 : MEMORY_5 ;
|
118 |
|
|
shared variable bank6 : MEMORY_6 ;
|
119 |
|
|
shared variable bank7 : MEMORY_7 ;
|
120 |
|
|
-- ---------------------------------------------------------------
|
121 |
|
|
-- Gated SRAM Clock
|
122 |
|
|
-- ---------------------------------------------------------------
|
123 |
|
|
SIGNAL clk_i : std_logic;
|
124 |
|
|
SIGNAL clk_i2 : std_logic;
|
125 |
|
|
-- ---------------------------------------------------------------
|
126 |
|
|
-- Combinatorial Logic
|
127 |
|
|
-- ---------------------------------------------------------------
|
128 |
|
|
SIGNAL E : std_logic;-- internal chip enable
|
129 |
|
|
SIGNAL ADV : std_logic;-- internal address advance
|
130 |
|
|
SIGNAL ADS : std_logic;
|
131 |
|
|
SIGNAL ADSP : std_logic;
|
132 |
|
|
SIGNAL ADSC : std_logic;
|
133 |
|
|
SIGNAL W : std_logic;
|
134 |
|
|
SIGNAL R : std_logic;
|
135 |
|
|
SIGNAL W_k : std_logic;
|
136 |
|
|
SIGNAL R_k : std_logic;
|
137 |
|
|
SIGNAL BW : std_logic_vector(7 DOWNTO 0);-- internal byte write enable
|
138 |
|
|
SIGNAL Qai : std_logic_vector(DQ_size - 1 DOWNTO 0);-- read data
|
139 |
|
|
SIGNAL Qbi : std_logic_vector(DQ_size - 1 DOWNTO 0);-- .
|
140 |
|
|
SIGNAL Qci : std_logic_vector(DQ_size - 1 DOWNTO 0);-- .
|
141 |
|
|
SIGNAL Qdi : std_logic_vector(DQ_size - 1 DOWNTO 0);-- .
|
142 |
|
|
SIGNAL Qei : std_logic_vector(DQ_size - 1 DOWNTO 0);-- .
|
143 |
|
|
SIGNAL Qfi : std_logic_vector(DQ_size - 1 DOWNTO 0);-- .
|
144 |
|
|
SIGNAL Qgi : std_logic_vector(DQ_size - 1 DOWNTO 0);-- .
|
145 |
|
|
SIGNAL Qhi : std_logic_vector(DQ_size - 1 DOWNTO 0);-- read data
|
146 |
|
|
SIGNAL Dai : std_logic_vector(DQ_size - 1 DOWNTO 0);-- write data
|
147 |
|
|
SIGNAL Dbi : std_logic_vector(DQ_size - 1 DOWNTO 0);-- .
|
148 |
|
|
SIGNAL Dci : std_logic_vector(DQ_size - 1 DOWNTO 0);-- .
|
149 |
|
|
SIGNAL Ddi : std_logic_vector(DQ_size - 1 DOWNTO 0);-- .
|
150 |
|
|
SIGNAL Dei : std_logic_vector(DQ_size - 1 DOWNTO 0);-- .
|
151 |
|
|
SIGNAL Dfi : std_logic_vector(DQ_size - 1 DOWNTO 0);-- .
|
152 |
|
|
SIGNAL Dgi : std_logic_vector(DQ_size - 1 DOWNTO 0);-- .
|
153 |
|
|
SIGNAL Dhi : std_logic_vector(DQ_size - 1 DOWNTO 0);-- write data
|
154 |
|
|
SIGNAL bwi : std_logic_vector(7 DOWNTO 0);
|
155 |
|
|
SIGNAL addr0 : std_logic_vector(A_size - 1 DOWNTO 0);-- saved address
|
156 |
|
|
SIGNAL addr1 : std_logic_vector(A_size - 1 DOWNTO 0);-- address buffer 1
|
157 |
|
|
SIGNAL baddr : std_logic_vector(A_size - 1 DOWNTO 0);-- burst memory address
|
158 |
|
|
SIGNAL waddr : std_logic_vector(A_size - 1 DOWNTO 0);-- write memory address
|
159 |
|
|
SIGNAL raddr : std_logic_vector(A_size - 1 DOWNTO 0);-- read memory address
|
160 |
|
|
SIGNAL bcnt : std_logic_vector(1 DOWNTO 0) := to_stdlogicvector(0, 2);-- burst counter
|
161 |
|
|
SIGNAL we0 : std_logic := '0';
|
162 |
|
|
SIGNAL re0 : std_logic := '0';
|
163 |
|
|
SIGNAL re1 : std_logic := '0';
|
164 |
|
|
SIGNAL re2 : std_logic := '0';
|
165 |
|
|
SIGNAL ce0 : std_logic := '0';
|
166 |
|
|
SIGNAL ce1 : std_logic := '0';
|
167 |
|
|
SIGNAL ce : std_logic := '0';
|
168 |
|
|
SIGNAL re : std_logic := '0';
|
169 |
|
|
SIGNAL oe : std_logic;
|
170 |
|
|
SIGNAL we : std_logic;
|
171 |
|
|
SIGNAL Qswitch: std_logic ;
|
172 |
|
|
SIGNAL state : string (9 DOWNTO 1) := "IDLE ";
|
173 |
|
|
|
174 |
|
|
SIGNAL Check_Time : time := 1 ns;
|
175 |
|
|
SIGNAL DELAY : time := 1 ns;
|
176 |
|
|
SIGNAL GUARD : boolean:= TRUE;
|
177 |
|
|
|
178 |
|
|
-- TIMING FUNCTIONS
|
179 |
|
|
function POSEDGE (SIGNAL s : std_ulogic) return BOOLEAN IS
|
180 |
|
|
begin
|
181 |
|
|
RETURN (s'EVENT AND ((To_X01(s'LAST_VALUE) = '0') OR (s = '1')));
|
182 |
|
|
end;
|
183 |
|
|
function NEGEDGE (SIGNAL s : std_ulogic) return BOOLEAN IS
|
184 |
|
|
begin
|
185 |
|
|
RETURN (s'EVENT AND ((To_X01(s'LAST_VALUE) = '1') OR (s = '0')) );
|
186 |
|
|
end;
|
187 |
|
|
-- END TIMING FUNCTIONS
|
188 |
|
|
|
189 |
|
|
PROCEDURE shiftnow (SIGNAL addr1 : INOUT std_logic_vector(A_size - 1 DOWNTO 0);
|
190 |
|
|
SIGNAL re2 : INOUT std_logic;
|
191 |
|
|
SIGNAL re1 : INOUT std_logic;
|
192 |
|
|
SIGNAL ce1 : INOUT std_logic;
|
193 |
|
|
SIGNAL Dai : INOUT std_logic_vector(DQ_size - 1 DOWNTO 0);
|
194 |
|
|
SIGNAL Dbi : INOUT std_logic_vector(DQ_size - 1 DOWNTO 0);
|
195 |
|
|
SIGNAL Dci : INOUT std_logic_vector(DQ_size - 1 DOWNTO 0);
|
196 |
|
|
SIGNAL Ddi : INOUT std_logic_vector(DQ_size - 1 DOWNTO 0);
|
197 |
|
|
SIGNAL Dei : INOUT std_logic_vector(DQ_size - 1 DOWNTO 0);
|
198 |
|
|
SIGNAL Dfi : INOUT std_logic_vector(DQ_size - 1 DOWNTO 0);
|
199 |
|
|
SIGNAL Dgi : INOUT std_logic_vector(DQ_size - 1 DOWNTO 0);
|
200 |
|
|
SIGNAL Dhi : INOUT std_logic_vector(DQ_size - 1 DOWNTO 0))
|
201 |
|
|
IS
|
202 |
|
|
BEGIN
|
203 |
|
|
addr1 <= baddr;
|
204 |
|
|
re2 <= re1;
|
205 |
|
|
re1 <= re0;
|
206 |
|
|
ce1 <= ce0;
|
207 |
|
|
Dai <= DQa;
|
208 |
|
|
Dbi <= DQb;
|
209 |
|
|
Dci <= DQc;
|
210 |
|
|
Ddi <= DQd;
|
211 |
|
|
Dei <= DQe;
|
212 |
|
|
Dfi <= DQf;
|
213 |
|
|
Dgi <= DQg;
|
214 |
|
|
Dhi <= DQh;
|
215 |
|
|
END;
|
216 |
|
|
|
217 |
|
|
BEGIN
|
218 |
|
|
PROCESS
|
219 |
|
|
BEGIN
|
220 |
|
|
WAIT UNTIL POSEDGE(CK);
|
221 |
|
|
clk_i <= NOT ZZ after 100 ps;
|
222 |
|
|
clk_i2 <= NOT ZZ after 200 ps;
|
223 |
|
|
WAIT UNTIL NEGEDGE(CK);
|
224 |
|
|
clk_i <= '0' after 100 ps;
|
225 |
|
|
clk_i2 <= '0' after 200 ps;
|
226 |
|
|
END PROCESS;
|
227 |
|
|
|
228 |
|
|
-- ---------------------------------------------------------------
|
229 |
|
|
-- State Machine
|
230 |
|
|
-- ---------------------------------------------------------------
|
231 |
|
|
st : PROCESS
|
232 |
|
|
variable tstate : string(9 DOWNTO 1) :="DESELECT ";
|
233 |
|
|
variable twe0 : std_logic := '0';
|
234 |
|
|
variable tre0 : std_logic := '0';
|
235 |
|
|
variable tce0 : std_logic := '0';
|
236 |
|
|
BEGIN
|
237 |
|
|
WAIT UNTIL POSEDGE(CK);
|
238 |
|
|
CASE state IS
|
239 |
|
|
WHEN "DESELECT " =>
|
240 |
|
|
if (E = '1') then
|
241 |
|
|
--Checking for ADSC Control
|
242 |
|
|
if (ADSC = '1') then
|
243 |
|
|
shiftnow(addr1, re2, re1, ce1, Dai, Dbi, Dci, Ddi, Dei, Dfi, Dgi, Dhi);
|
244 |
|
|
tre0 := R;
|
245 |
|
|
twe0 := W;
|
246 |
|
|
tce0 := '1';
|
247 |
|
|
addr0 <= A;
|
248 |
|
|
bwi <= BW;
|
249 |
|
|
bcnt <= to_stdlogicvector(0, 2);
|
250 |
|
|
tstate := "NEWCYCLE ";
|
251 |
|
|
end if;
|
252 |
|
|
-- Checking for ADSP Control
|
253 |
|
|
if (ADSP = '1') then
|
254 |
|
|
shiftnow(addr1, re2, re1, ce1, Dai, Dbi, Dci, Ddi, Dei, Dfi, Dgi, Dhi);
|
255 |
|
|
tre0 := R;
|
256 |
|
|
tce0 := '1';
|
257 |
|
|
addr0 <= A;
|
258 |
|
|
bcnt <= to_stdlogicvector(0, 2);
|
259 |
|
|
tstate := "LATEWRITE";
|
260 |
|
|
end if;
|
261 |
|
|
END IF;
|
262 |
|
|
-- Checking for Deselect
|
263 |
|
|
if ((E /= '1' and ADSC = '1') or (nADSP and (E2 = '0' or nE3 = '1'))) then
|
264 |
|
|
shiftnow(addr1, re2, re1, ce1, Dai, Dbi, Dci, Ddi, Dei, Dfi, Dgi, Dhi);
|
265 |
|
|
tstate := "DESELECT ";
|
266 |
|
|
twe0 := '0';
|
267 |
|
|
tre0 := '0';
|
268 |
|
|
tce0 := '0';
|
269 |
|
|
END IF;
|
270 |
|
|
-- **************************************************
|
271 |
|
|
WHEN "NEWCYCLE " | "BURST " | "SUSPBR " | "LATEWRITE" =>
|
272 |
|
|
--Checking for ADSC Control
|
273 |
|
|
if (ADSC = '1') then
|
274 |
|
|
shiftnow(addr1, re2, re1, ce1, Dai, Dbi, Dci, Ddi, Dei, Dfi, Dgi, Dhi);
|
275 |
|
|
tre0 := R;
|
276 |
|
|
twe0 := W;
|
277 |
|
|
tce0 := '1';
|
278 |
|
|
addr0 <= A;
|
279 |
|
|
bwi <= BW;
|
280 |
|
|
bcnt <= to_stdlogicvector(0, 2);
|
281 |
|
|
tstate := "NEWCYCLE ";
|
282 |
|
|
end if;
|
283 |
|
|
-- Checking for ADSP Control
|
284 |
|
|
if (ADSP = '1') then
|
285 |
|
|
shiftnow(addr1, re2, re1, ce1, Dai, Dbi, Dci, Ddi, Dei, Dfi, Dgi, Dhi);
|
286 |
|
|
tre0 := R;
|
287 |
|
|
tce0 := '1';
|
288 |
|
|
addr0 <= A;
|
289 |
|
|
bcnt <= to_stdlogicvector(0, 2);
|
290 |
|
|
tstate := "LATEWRITE";
|
291 |
|
|
end if;
|
292 |
|
|
-- Checking for Deselect
|
293 |
|
|
if ((E /= '1' and nADSC = '0') or (nADSP = '0' and (E2 = '0' or nE3 = '1'))) then
|
294 |
|
|
shiftnow(addr1, re2, re1, ce1, Dai, Dbi, Dci, Ddi, Dei, Dfi, Dgi, Dhi);
|
295 |
|
|
tstate := "DESELECT ";
|
296 |
|
|
twe0 := '0';
|
297 |
|
|
tre0 := '0';
|
298 |
|
|
tce0 := '0';
|
299 |
|
|
end if;
|
300 |
|
|
-- Checking for Burst Start
|
301 |
|
|
if (ADSC = '0' and ADSP = '0' AND ADV = '1') THEN
|
302 |
|
|
shiftnow(addr1, re2, re1, ce1, Dai, Dbi, Dci, Ddi, Dei, Dfi, Dgi, Dhi);
|
303 |
|
|
tstate := "BURST ";
|
304 |
|
|
if we0 = '1' then
|
305 |
|
|
twe0 := W;
|
306 |
|
|
tre0 := '0';
|
307 |
|
|
bwi <= BW;
|
308 |
|
|
end if;
|
309 |
|
|
if re0 = '1' then
|
310 |
|
|
twe0 := '0';
|
311 |
|
|
tre0 := R;
|
312 |
|
|
end if;
|
313 |
|
|
tce0 := '1';
|
314 |
|
|
bcnt <= to_stdlogicvector(bcnt + "01", 2);
|
315 |
|
|
end if;
|
316 |
|
|
-- Checking for a Suspended Burst
|
317 |
|
|
if (ADSC = '0' and ADSP = '0' AND ADV = '0') THEN
|
318 |
|
|
shiftnow(addr1, re2, re1, ce1, Dai, Dbi, Dci, Ddi, Dei, Dfi, Dgi, Dhi);
|
319 |
|
|
tstate := "SUSPBR ";
|
320 |
|
|
if we0 = '1' or W = '1' then
|
321 |
|
|
twe0 := W;
|
322 |
|
|
tre0 := '0';
|
323 |
|
|
re1 <= '0';
|
324 |
|
|
bwi <= BW;
|
325 |
|
|
elsif re0 = '1' then
|
326 |
|
|
twe0 := '0';
|
327 |
|
|
tre0 := R;
|
328 |
|
|
end if;
|
329 |
|
|
tce0 := '1';
|
330 |
|
|
end if;
|
331 |
|
|
WHEN OTHERS =>
|
332 |
|
|
shiftnow(addr1, re2, re1, ce1, Dai, Dbi, Dci, Ddi, Dei, Dfi, Dgi, Dhi);
|
333 |
|
|
tstate := "DESELECT ";
|
334 |
|
|
twe0 := '0';
|
335 |
|
|
tre0 := '0';
|
336 |
|
|
tce0 := '0';
|
337 |
|
|
bcnt <= to_stdlogicvector(0, 2);
|
338 |
|
|
END CASE;
|
339 |
|
|
state <= tstate;
|
340 |
|
|
we0 <= twe0;
|
341 |
|
|
re0 <= tre0;
|
342 |
|
|
ce0 <= tce0;
|
343 |
|
|
END PROCESS;
|
344 |
|
|
-- ---------------------------------------------------------------
|
345 |
|
|
-- Data IO Logic
|
346 |
|
|
-- ---------------------------------------------------------------
|
347 |
|
|
Write_Array: process (W_k)
|
348 |
|
|
begin -- process Write_Array
|
349 |
|
|
IF (POSEDGE(W_k)) THEN
|
350 |
|
|
IF (we = '1') THEN
|
351 |
|
|
IF bwi(0) = '1' THEN
|
352 |
|
|
bank0(to_integer(waddr)) := Dai;
|
353 |
|
|
END IF;
|
354 |
|
|
IF bwi(1) = '1' THEN
|
355 |
|
|
bank1(to_integer(waddr)) := Dbi;
|
356 |
|
|
END IF;
|
357 |
|
|
IF bwi(2) = '1' THEN
|
358 |
|
|
bank2(to_integer(waddr)) := Dci;
|
359 |
|
|
END IF;
|
360 |
|
|
IF bwi(3) = '1' THEN
|
361 |
|
|
bank3(to_integer(waddr)) := Ddi;
|
362 |
|
|
END IF;
|
363 |
|
|
IF bwi(4) = '1' THEN
|
364 |
|
|
bank4(to_integer(waddr)) := Dei;
|
365 |
|
|
END IF;
|
366 |
|
|
IF bwi(5) = '1' THEN
|
367 |
|
|
bank5(to_integer(waddr)) := Dfi;
|
368 |
|
|
END IF;
|
369 |
|
|
IF bwi(6) = '1' THEN
|
370 |
|
|
bank6(to_integer(waddr)) := Dgi;
|
371 |
|
|
END IF;
|
372 |
|
|
IF bwi(7) = '1' THEN
|
373 |
|
|
bank7(to_integer(waddr)) := Dhi;
|
374 |
|
|
END IF;
|
375 |
|
|
END IF;
|
376 |
|
|
END IF;
|
377 |
|
|
end process Write_Array;
|
378 |
|
|
|
379 |
|
|
Read_Array: process (r_k)
|
380 |
|
|
begin -- process Read_Array
|
381 |
|
|
IF (we = '0') then
|
382 |
|
|
Qai <= transport bank0(to_integer(raddr)) after DELAY - 200 ps;
|
383 |
|
|
Qbi <= transport bank1(to_integer(raddr)) after DELAY - 200 ps;
|
384 |
|
|
Qci <= transport bank2(to_integer(raddr)) after DELAY - 200 ps;
|
385 |
|
|
Qdi <= transport bank3(to_integer(raddr)) after DELAY - 200 ps;
|
386 |
|
|
Qei <= transport bank4(to_integer(raddr)) after DELAY - 200 ps;
|
387 |
|
|
Qfi <= transport bank5(to_integer(raddr)) after DELAY - 200 ps;
|
388 |
|
|
Qgi <= transport bank6(to_integer(raddr)) after DELAY - 200 ps;
|
389 |
|
|
Qhi <= transport bank7(to_integer(raddr)) after DELAY - 200 ps;
|
390 |
|
|
END IF;
|
391 |
|
|
end process Read_Array;
|
392 |
|
|
|
393 |
|
|
-- check it -t option is active and set correctly
|
394 |
|
|
time_ck : process (CLK_i)
|
395 |
|
|
begin
|
396 |
|
|
check_time <= CK'last_event;
|
397 |
|
|
assert check_time /= 0 ns report "Resolution needs to be set to 100ps for modelSIM use vsim -t 100ps <>" severity FAILURE;
|
398 |
|
|
end process time_ck;
|
399 |
|
|
|
400 |
|
|
ADS_SET : process (CLK_i)
|
401 |
|
|
begin
|
402 |
|
|
if posedge(clk_i) then
|
403 |
|
|
ADS <= ADSP OR ADSC;
|
404 |
|
|
end if;
|
405 |
|
|
end process ADS_SET;
|
406 |
|
|
|
407 |
|
|
q_switch : process (CLK_i2)
|
408 |
|
|
begin --read clock controls outputs
|
409 |
|
|
Qswitch <= transport re and ce after DELAY - 200 ps;
|
410 |
|
|
end process q_switch;
|
411 |
|
|
|
412 |
|
|
|
413 |
|
|
E <= (NOT nE1 AND E2 AND NOT nE3);
|
414 |
|
|
ADV <= not nADV;
|
415 |
|
|
ADSP <= NOT nADSP AND ( E2 or NOT nE3);
|
416 |
|
|
ADSC <= NOT nADSC AND ( not nE1 or E2 or NOT nE3);
|
417 |
|
|
W <= (NOT nGW OR NOT nBW );
|
418 |
|
|
W_k <=((NOT ADSP or not ADSC) AND (NOT nGW OR NOT nBW )) and clk_i after 100 ps;
|
419 |
|
|
R <= nGW and nBW;
|
420 |
|
|
R_k <= (TERNARY((ADS or ADV) and not W, TERNARY( nFT, re1, re0), '0') and clk_i) after 100 ps;
|
421 |
|
|
BW(0) <= not nGW or (NOT nBa and not nBW);
|
422 |
|
|
BW(1) <= not nGW or (NOT nBb and not nBW);
|
423 |
|
|
BW(2) <= not nGW or (NOT nBc and not nBW);
|
424 |
|
|
BW(3) <= not nGW or (NOT nBd and not nBW);
|
425 |
|
|
BW(4) <= not nGW or (NOT nBe and not nBW);
|
426 |
|
|
BW(5) <= not nGW or (NOT nBf and not nBW);
|
427 |
|
|
BW(6) <= not nGW or (NOT nBg and not nBW);
|
428 |
|
|
BW(7) <= not nGW or (NOT nBh and not nBW);
|
429 |
|
|
baddr <= to_stdlogicvector(TERNARY(nLBO, addr0(A_size - 1 DOWNTO 2) & (bcnt(1) XOR addr0(1)) &
|
430 |
|
|
(bcnt(0) XOR addr0(0)), addr0(A_size - 1 DOWNTO 2) & (addr0(1 DOWNTO 0) + bcnt)), A_size);
|
431 |
|
|
|
432 |
|
|
waddr <= to_stdlogicvector(TERNARY(not ADV, addr0, baddr), A_size);
|
433 |
|
|
raddr <= to_stdlogicvector(TERNARY(nFT, addr1, baddr), A_size);
|
434 |
|
|
we <= we0;
|
435 |
|
|
re <= TERNARY(nFT, re1, re0);
|
436 |
|
|
ce <= (TERNARY(not SCD AND re2 = '1', ce1, ce0));
|
437 |
|
|
oe <= re AND ce;
|
438 |
|
|
|
439 |
|
|
DELAY <= TERNARY(nG OR not ((we and re) or oe) OR ZZ, tKQ, tKQX);
|
440 |
|
|
|
441 |
|
|
DQa <= GUARDED TERNARY(Qswitch, Qai, HighZ);
|
442 |
|
|
DQb <= GUARDED TERNARY(Qswitch, Qbi, HighZ);
|
443 |
|
|
DQc <= GUARDED TERNARY(Qswitch, Qci, HighZ);
|
444 |
|
|
DQd <= GUARDED TERNARY(Qswitch, Qdi, HighZ);
|
445 |
|
|
DQe <= GUARDED TERNARY(Qswitch, Qei, HighZ);
|
446 |
|
|
DQf <= GUARDED TERNARY(Qswitch, Qfi, HighZ);
|
447 |
|
|
DQg <= GUARDED TERNARY(Qswitch, Qgi, HighZ);
|
448 |
|
|
DQh <= GUARDED TERNARY(Qswitch, Qhi, HighZ);
|
449 |
|
|
END GSI_BURST_CORE;
|