1 |
23 |
mcwaccent |
----------------------------------------------------------------------------------
|
2 |
|
|
--
|
3 |
|
|
-- This file is a part of Technica Corporation Wizardry Project
|
4 |
|
|
--
|
5 |
|
|
-- Copyright (C) 2004-2009, Technica Corporation
|
6 |
|
|
--
|
7 |
|
|
-- This program is free software: you can redistribute it and/or modify
|
8 |
|
|
-- it under the terms of the GNU General Public License as published by
|
9 |
|
|
-- the Free Software Foundation, either version 3 of the License, or
|
10 |
|
|
-- (at your option) any later version.
|
11 |
|
|
--
|
12 |
|
|
-- This program is distributed in the hope that it will be useful,
|
13 |
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15 |
|
|
-- GNU General Public License for more details.
|
16 |
|
|
--
|
17 |
|
|
-- You should have received a copy of the GNU General Public License
|
18 |
|
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
19 |
|
|
--
|
20 |
|
|
----------------------------------------------------------------------------------
|
21 |
|
|
----------------------------------------------------------------------------------
|
22 |
|
|
-- Module Name: MIG_addr_gen_0 - Structural
|
23 |
|
|
-- Project Name: Wizardry
|
24 |
|
|
-- Target Devices: Virtex 4 ML401
|
25 |
|
|
-- Description: Top-level structural description for address generation.
|
26 |
|
|
-- Revision: 1.0
|
27 |
|
|
-- Additional Comments:
|
28 |
|
|
--
|
29 |
|
|
----------------------------------------------------------------------------------
|
30 |
|
|
library ieee;
|
31 |
|
|
use ieee.std_logic_1164.all;
|
32 |
|
|
use ieee.std_logic_unsigned.all;
|
33 |
|
|
use work.MAC_Constants.all;
|
34 |
|
|
use work.eRCP_Constants.ALL;
|
35 |
|
|
library UNISIM;
|
36 |
|
|
use UNISIM.vcomponents.all;
|
37 |
|
|
|
38 |
|
|
entity MIG_addr_gen is
|
39 |
|
|
port (
|
40 |
|
|
clk0 : in std_logic;
|
41 |
|
|
rst : in std_logic;
|
42 |
|
|
bkend_wraddr_en : in std_logic;
|
43 |
|
|
rx : in std_logic;
|
44 |
|
|
tx : out std_logic;
|
45 |
|
|
-- leds : out std_logic_vector(8 downto 0);
|
46 |
|
|
cntrl0_app_af_addr : out std_logic_vector(35 downto 0);
|
47 |
|
|
cntrl0_app_af_wren : out std_logic;
|
48 |
|
|
cntrl0_app_wdf_data : out std_logic_vector(63 downto 0);
|
49 |
|
|
cntrl0_app_wdf_wren : out std_logic;
|
50 |
|
|
cntrl0_app_mask_data : out std_logic_vector(7 downto 0);
|
51 |
|
|
cntrl0_read_data_valid : in std_logic;
|
52 |
|
|
cntrl0_read_data_fifo_out : in std_logic_vector(63 downto 0);
|
53 |
|
|
init_done : in std_logic;
|
54 |
|
|
FIFO_empty : out std_logic;
|
55 |
|
|
read_enable : out std_logic;
|
56 |
|
|
write_enable : out std_logic;
|
57 |
|
|
|
58 |
|
|
-- eRCP and EmPAC Signals to/from top level
|
59 |
|
|
phy_clock : in std_logic;
|
60 |
|
|
phy_reset : out std_logic;
|
61 |
|
|
phy_data_in : in STD_LOGIC_VECTOR (3 downto 0);
|
62 |
|
|
phy_data_valid_in : in STD_LOGIC;
|
63 |
|
|
WIZ_rx_sdata : in STD_LOGIC;
|
64 |
|
|
WIZ_tx_sdata : out STD_LOGIC;
|
65 |
|
|
-- ;
|
66 |
|
|
-- Debug Signals to top level
|
67 |
|
|
-- rdcount : out std_logic_vector(11 downto 0);
|
68 |
|
|
-- wrcount : out std_logic_vector(11 downto 0);
|
69 |
|
|
-- empac_empty_debug: out std_logic;
|
70 |
|
|
-- empac_full_debug : out std_logic;
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
---==========================================================--
|
74 |
|
|
----===========Virtex-4 SRAM Port============================--
|
75 |
|
|
wd : out std_logic;
|
76 |
|
|
sram_clk : out std_logic;
|
77 |
|
|
sram_feedback_clk : out std_logic;
|
78 |
|
|
|
79 |
|
|
sram_addr : out std_logic_vector(22 downto 0);
|
80 |
|
|
|
81 |
|
|
sram_we_n : out std_logic;
|
82 |
|
|
sram_oe_n : out std_logic;
|
83 |
|
|
|
84 |
|
|
sram_data : inout std_logic_vector(31 downto 0);
|
85 |
|
|
|
86 |
|
|
sram_bw0: out std_logic;
|
87 |
|
|
sram_bw1 : out std_logic;
|
88 |
|
|
|
89 |
|
|
sram_bw2 : out std_Logic;
|
90 |
|
|
sram_bw3 : out std_logic;
|
91 |
|
|
|
92 |
|
|
sram_adv_ld_n : out std_logic;
|
93 |
|
|
sram_mode : out std_logic;
|
94 |
|
|
sram_cen : out std_logic;
|
95 |
|
|
sram_cen_test : out std_logic;
|
96 |
|
|
sram_zz : out std_logic
|
97 |
|
|
|
98 |
|
|
);
|
99 |
|
|
end MIG_addr_gen;
|
100 |
|
|
|
101 |
|
|
architecture arch of MIG_addr_gen is
|
102 |
|
|
|
103 |
|
|
signal rx_s,tx_s : std_logic;
|
104 |
|
|
-- signal wd : std_logic;
|
105 |
|
|
|
106 |
|
|
signal adr_check : std_logic;
|
107 |
|
|
|
108 |
|
|
signal addr_0_out : std_logic;
|
109 |
|
|
signal leds_s : std_logic_vector(8 downto 0);
|
110 |
|
|
signal leds_s2 : std_logic_vector(8 downto 0);
|
111 |
|
|
|
112 |
|
|
signal wr_rd_addr : std_logic_vector(8 downto 0);
|
113 |
|
|
signal wr_rd_addr_en : std_logic;
|
114 |
|
|
signal wr_addr_count : std_logic_vector(5 downto 0);
|
115 |
|
|
signal bkend_wraddr_en_reg : std_logic;
|
116 |
|
|
signal wr_rd_addr_en_reg : std_logic;
|
117 |
|
|
signal bkend_wraddr_en_3r : std_logic;
|
118 |
|
|
signal unused_data_in : std_logic_vector(31 downto 0);
|
119 |
|
|
signal unused_data_in_p : std_logic_vector(3 downto 0);
|
120 |
|
|
signal gnd : std_logic;
|
121 |
|
|
signal addr_out : std_logic_vector(35 downto 0);
|
122 |
|
|
signal rst_r : std_logic;
|
123 |
|
|
signal Memory_Access_in : Memory_Access_Port_in;
|
124 |
|
|
signal Memory_Access_out : Memory_Access_Port_out;
|
125 |
|
|
signal MAC_in : Preprocessor_Interface_Port_in;
|
126 |
|
|
signal MAC_out : Preprocessor_Interface_Port_out;
|
127 |
|
|
signal read_data_test_vector : std_logic_vector(7 downto 0);
|
128 |
|
|
|
129 |
|
|
signal dat_i : std_logic_vector(32-1 downto 0);
|
130 |
|
|
signal adr_o : std_logic_vector(virtual_address_width-1 downto 0);
|
131 |
|
|
signal cyc_o : std_logic;
|
132 |
|
|
signal stb_o : std_logic;
|
133 |
|
|
signal we_o : std_logic;
|
134 |
|
|
signal lock_o : std_logic;
|
135 |
|
|
signal dat_o : std_logic_vector(32-1 downto 0);
|
136 |
|
|
signal sel_o : std_logic_Vector(3 downto 0);
|
137 |
|
|
signal priority : std_logic_vector(7 downto 0);
|
138 |
|
|
signal id : std_logic_vector(4 downto 0);
|
139 |
|
|
signal ack_i : std_logic;
|
140 |
|
|
signal acknowledge_read_data : std_logic;
|
141 |
|
|
signal store_rd_data : std_logic;
|
142 |
|
|
signal store_rd_data_0 : std_logic;
|
143 |
|
|
signal command_s : std_logic_vector(2 downto 0);
|
144 |
|
|
|
145 |
|
|
signal jop_reset_cnt : std_logic_vector(14 downto 0);
|
146 |
|
|
signal jop_reset : std_logic;
|
147 |
|
|
signal sync_reset_n : std_logic;
|
148 |
|
|
|
149 |
|
|
type shift_reg is
|
150 |
|
|
array (0 to 3) of std_logic_vector(63 downto 0);
|
151 |
|
|
signal dat_i_shift_reg : shift_reg;
|
152 |
|
|
|
153 |
|
|
signal sync_reset: std_logic;
|
154 |
|
|
signal device_clock_fb,device_clock_fb_0 : std_logic;
|
155 |
|
|
signal leds_dummy : std_logic_vector(8 downto 0);
|
156 |
|
|
|
157 |
|
|
signal eRCP_busy_s : boolean;
|
158 |
|
|
signal interactive_instructions_s : instruction_interface;
|
159 |
|
|
|
160 |
|
|
component Top_Level_MAC is
|
161 |
|
|
Port ( clock : in STD_LOGIC;
|
162 |
|
|
device_clock : in STD_LOGIC;
|
163 |
|
|
reset : in STD_LOGIC;
|
164 |
|
|
Memory_Access_in : in Memory_Access_Port_in;
|
165 |
|
|
Memory_Access_out : out Memory_Access_Port_out;
|
166 |
|
|
MAC_in : in Preprocessor_Interface_Port_in;
|
167 |
|
|
MAC_out : out Preprocessor_Interface_Port_out
|
168 |
|
|
);
|
169 |
|
|
end component;
|
170 |
|
|
|
171 |
|
|
component Uart_Interface is
|
172 |
|
|
port(
|
173 |
|
|
clock : in std_logic;
|
174 |
|
|
reset : in std_logic;
|
175 |
|
|
write_enable_out : in std_logic;
|
176 |
|
|
read_enable_out : in std_logic;
|
177 |
|
|
FIFO_empty_out : in std_logic;
|
178 |
|
|
read_data_test_vector : out std_logic_vector(7 downto 0);
|
179 |
|
|
rx : in std_logic;
|
180 |
|
|
tx : out std_logic;
|
181 |
|
|
leds : out std_logic_vector(8 downto 0);
|
182 |
|
|
dat_i : in std_logic_vector(data_width-1 downto 0);
|
183 |
|
|
adr_o : out std_logic_vector(virtual_address_width-1 downto 0);
|
184 |
|
|
cyc_o : out std_logic;
|
185 |
|
|
stb_o : out std_logic;
|
186 |
|
|
we_o : out std_logic;
|
187 |
|
|
lock_o : out std_logic;
|
188 |
|
|
dat_o : out std_logic_vector(data_width-1 downto 0);
|
189 |
|
|
sel_o : out std_logic_Vector(3 downto 0);
|
190 |
|
|
priority : out std_logic_vector(7 downto 0);
|
191 |
|
|
id : out std_logic_vector(4 downto 0);
|
192 |
|
|
ack_i : in std_logic;
|
193 |
|
|
err_i : in std_logic;
|
194 |
|
|
cntrl0_APP_AF_WREN : out std_logic;
|
195 |
|
|
cntrl0_APP_WDF_WREN : out std_logic;
|
196 |
|
|
mask : out std_logic_vector(7 downto 0);
|
197 |
|
|
ack_access_in : out std_logic;
|
198 |
|
|
command : out std_logic_vector(2 downto 0);
|
199 |
|
|
acknowledge_read_data : in std_logic
|
200 |
|
|
|
201 |
|
|
);
|
202 |
|
|
end component;
|
203 |
|
|
|
204 |
|
|
component jop is
|
205 |
|
|
|
206 |
|
|
generic (
|
207 |
|
|
ram_cnt : integer := 4; -- clock cycles for external ram
|
208 |
|
|
rom_cnt : integer := 15; -- not used for S3K
|
209 |
|
|
jpc_width : integer := 11; -- address bits of java bytecode pc = cache size
|
210 |
|
|
block_bits : integer := 4; -- 2*block_bits is number of cache blocks
|
211 |
|
|
spm_width : integer := 0 -- size of scratchpad RAM (in number of address bits for 32-bit words)
|
212 |
|
|
);
|
213 |
|
|
|
214 |
|
|
port (
|
215 |
|
|
clk : in std_logic;
|
216 |
|
|
|
217 |
|
|
--
|
218 |
|
|
---- serial interface
|
219 |
|
|
--
|
220 |
|
|
ser_txd : out std_logic;
|
221 |
|
|
ser_rxd : in std_logic;
|
222 |
|
|
--
|
223 |
|
|
--
|
224 |
|
|
-- watchdog
|
225 |
|
|
--
|
226 |
|
|
wd : out std_logic;
|
227 |
|
|
|
228 |
|
|
-- Control Signals from JOP
|
229 |
|
|
-- configuration_trigger : out std_logic_vector(7 downto 0);
|
230 |
|
|
eRCP_trigger_reg : out std_logic;
|
231 |
|
|
|
232 |
|
|
--
|
233 |
|
|
---==========================================================--
|
234 |
|
|
----===========Virtex-4 SRAM Port============================--
|
235 |
|
|
sram_clk : out std_logic;
|
236 |
|
|
sram_feedback_clk : out std_logic;
|
237 |
|
|
|
238 |
|
|
sram_addr : out std_logic_vector(22 downto 0);
|
239 |
|
|
|
240 |
|
|
sram_we_n : out std_logic;
|
241 |
|
|
sram_oe_n : out std_logic;
|
242 |
|
|
|
243 |
|
|
sram_data : inout std_logic_vector(31 downto 0);
|
244 |
|
|
|
245 |
|
|
sram_bw0: out std_logic;
|
246 |
|
|
sram_bw1 : out std_logic;
|
247 |
|
|
|
248 |
|
|
sram_bw2 : out std_Logic;
|
249 |
|
|
sram_bw3 : out std_logic;
|
250 |
|
|
|
251 |
|
|
sram_adv_ld_n : out std_logic;
|
252 |
|
|
sram_mode : out std_logic;
|
253 |
|
|
sram_cen : out std_logic;
|
254 |
|
|
sram_cen_test : out std_logic;
|
255 |
|
|
sram_zz : out std_logic;
|
256 |
|
|
|
257 |
|
|
---=========================================================---
|
258 |
|
|
---=========================================================---
|
259 |
|
|
|
260 |
|
|
--
|
261 |
|
|
-- I/O pins of board TODO: change this and io for xilinx board!
|
262 |
|
|
--
|
263 |
|
|
-- io_b : inout std_logic_vector(10 downto 1);
|
264 |
|
|
-- io_l : inout std_logic_vector(20 downto 1);
|
265 |
|
|
-- io_r : inout std_logic_vector(20 downto 1);
|
266 |
|
|
-- io_t : inout std_logic_vector(6 downto 1)
|
267 |
|
|
|
268 |
|
|
-- Wizardry Interface
|
269 |
|
|
ack_i : in std_logic;
|
270 |
|
|
err_i : in std_logic;
|
271 |
|
|
dat_i : in std_logic_vector(31 downto 0);
|
272 |
|
|
cyc_o : out std_logic;
|
273 |
|
|
stb_o : out std_logic;
|
274 |
|
|
we_o : out std_logic;
|
275 |
|
|
dat_o : out std_logic_vector(31 downto 0);
|
276 |
|
|
adr_o : out std_logic_Vector(21 downto 0);
|
277 |
|
|
lock_o : out std_logic;
|
278 |
|
|
-- id_o : out std_logic_Vector(4 downto 0);
|
279 |
|
|
priority_o : out std_logic_Vector(7 downto 0)
|
280 |
|
|
);
|
281 |
|
|
end component;
|
282 |
|
|
|
283 |
|
|
component Wizardry_Top is
|
284 |
|
|
Port ( clock : in STD_LOGIC;
|
285 |
|
|
phy_clock : in STD_LOGIC;
|
286 |
|
|
reset : in STD_LOGIC;
|
287 |
|
|
phy_reset : out std_logic;
|
288 |
|
|
phy_data_in : in STD_LOGIC_VECTOR (3 downto 0);
|
289 |
|
|
phy_data_valid_in : in STD_LOGIC;
|
290 |
|
|
rx_sdata : in STD_LOGIC;
|
291 |
|
|
tx_sdata : out STD_LOGIC;
|
292 |
|
|
leds : out STD_LOGIC_VECTOR (8 downto 0);
|
293 |
|
|
device_clock_fb : out std_logic;
|
294 |
|
|
|
295 |
|
|
-- Configuration Trigger Signal
|
296 |
|
|
new_configuration : in std_logic;
|
297 |
|
|
|
298 |
|
|
------WB Signals
|
299 |
|
|
---WB Out Signals
|
300 |
|
|
adr_o : out std_logic_vector(virtual_address_width -1 downto 0);
|
301 |
|
|
dat_o : out std_logic_vector(data_width -1 downto 0);
|
302 |
|
|
we_o : out std_logic;
|
303 |
|
|
sel_o : out std_logic_vector(data_resolution -1 downto 0);
|
304 |
|
|
stb_o : out std_logic;
|
305 |
|
|
cyc_o : out std_logic;
|
306 |
|
|
ID_o : out std_logic_vector(ID_width -1 downto 0);
|
307 |
|
|
priority_o : out std_logic_vector(priority_width -1 downto 0);
|
308 |
|
|
lock_o : out std_logic;
|
309 |
|
|
---WB IN Signals
|
310 |
|
|
err_i : in std_logic;
|
311 |
|
|
ack_i : in std_logic;
|
312 |
|
|
dat_i : in std_logic_vector(data_width -1 downto 0);
|
313 |
|
|
|
314 |
|
|
|
315 |
|
|
------WB Signals 2
|
316 |
|
|
---WB Out Signals
|
317 |
|
|
adr_o_0 : out std_logic_vector(virtual_address_width -1 downto 0);
|
318 |
|
|
dat_o_0 : out std_logic_vector(data_width -1 downto 0);
|
319 |
|
|
we_o_0 : out std_logic;
|
320 |
|
|
sel_o_0 : out std_logic_vector(data_resolution -1 downto 0);
|
321 |
|
|
stb_o_0 : out std_logic;
|
322 |
|
|
cyc_o_0 : out std_logic;
|
323 |
|
|
ID_o_0 : out std_logic_vector(ID_width -1 downto 0);
|
324 |
|
|
priority_o_0 : out std_logic_vector(priority_width -1 downto 0);
|
325 |
|
|
lock_o_0 : out std_logic;
|
326 |
|
|
---WB IN Signals
|
327 |
|
|
err_i_0 : in std_logic;
|
328 |
|
|
ack_i_0 : in std_logic;
|
329 |
|
|
dat_i_0 : in std_logic_vector(data_width -1 downto 0);
|
330 |
|
|
|
331 |
|
|
--EMPAC WB SIGNALS
|
332 |
|
|
empac_ack_i : in std_logic;
|
333 |
|
|
empac_dat_i : in std_logic_vector(data_width-1 downto 0);
|
334 |
|
|
empac_err_i : in std_logic;
|
335 |
|
|
empac_dat_o : out std_logic_Vector(data_width-1 downto 0);
|
336 |
|
|
empac_adr_o : out std_logic_Vector(virtual_address_width-1 downto 0);
|
337 |
|
|
empac_cyc_o : out std_logic;
|
338 |
|
|
empac_stb_o : out std_logic;
|
339 |
|
|
empac_we_o : out std_Logic;
|
340 |
|
|
empac_lock_o : out std_logic;
|
341 |
|
|
empac_priority_o : out std_logic_Vector(priority_width-1 downto 0);
|
342 |
|
|
empac_id_o : out std_logic_vector(id_width-1 downto 0);
|
343 |
|
|
-- Debug Signals to top level
|
344 |
|
|
eRCP_busy : out boolean;
|
345 |
|
|
interactive_instructions : in instruction_interface
|
346 |
|
|
-- ;
|
347 |
|
|
-- rdcount : out std_logic_vector(11 downto 0);
|
348 |
|
|
-- wrcount : out std_logic_vector(11 downto 0);
|
349 |
|
|
-- empac_empty_debug: out std_logic;
|
350 |
|
|
-- empac_full_debug : out std_logic
|
351 |
|
|
|
352 |
|
|
);
|
353 |
|
|
end component;
|
354 |
|
|
|
355 |
|
|
component RDIC_Xilinx_bridge is
|
356 |
|
|
Port ( clock : in STD_LOGIC;
|
357 |
|
|
reset : in STD_LOGIC;
|
358 |
|
|
fifo_empty_out : in std_Logic;
|
359 |
|
|
write_enable_out : in std_logic;
|
360 |
|
|
APP_AF_WREN : out std_logic;
|
361 |
|
|
APP_WDF_WREN : out std_logic;
|
362 |
|
|
ack_access_in : out std_logic;
|
363 |
|
|
command : out std_logic_vector(2 downto 0);
|
364 |
|
|
mask : out std_logic_vector(7 downto 0));
|
365 |
|
|
end component;
|
366 |
|
|
|
367 |
|
|
|
368 |
|
|
component wc_uart_controller is
|
369 |
|
|
Port ( clock : in STD_LOGIC;
|
370 |
|
|
device_clock : out std_Logic;
|
371 |
|
|
reset : in STD_LOGIC;
|
372 |
|
|
cyc_o : out STD_LOGIC;
|
373 |
|
|
stb_o : out STD_LOGIC;
|
374 |
|
|
we_o : out STD_LOGIC;
|
375 |
|
|
adr_o : out STD_LOGIC_VECTOR (21 downto 0);
|
376 |
|
|
dat_o : out STD_LOGIC_VECTOR (31 downto 0);
|
377 |
|
|
dat_i : in STD_LOGIC_VECTOR (31 downto 0);
|
378 |
|
|
ack_i : in STD_LOGIC;
|
379 |
|
|
err_i : in std_logic;
|
380 |
|
|
priority_o : out std_logic_vector(7 downto 0);
|
381 |
|
|
id_o : out std_logic_vector(4 downto 0);
|
382 |
|
|
lock_o : out std_logic;
|
383 |
|
|
eRCP_busy : in boolean;
|
384 |
|
|
interactive_instructions : out instruction_interface;
|
385 |
|
|
rx : in STD_LOGIC;
|
386 |
|
|
tx : out STD_LOGIC);
|
387 |
|
|
end component;
|
388 |
|
|
|
389 |
|
|
|
390 |
|
|
Signal eRCP_trigger_s : std_logic;
|
391 |
|
|
|
392 |
|
|
|
393 |
|
|
|
394 |
|
|
|
395 |
|
|
|
396 |
|
|
begin
|
397 |
|
|
|
398 |
|
|
--leds <= leds_s2(8 downto 1) & wd ;
|
399 |
|
|
|
400 |
|
|
------------------MY Stuff------------------
|
401 |
|
|
--app_af_addr <=
|
402 |
|
|
FIFO_empty <= MAC_out.FIFO_empty_out;
|
403 |
|
|
read_enable <= MAC_out.read_enable_out;
|
404 |
|
|
write_enable <= MAC_out.write_enable_out;
|
405 |
|
|
|
406 |
|
|
cntrl0_app_af_addr <= '0' & command_s & "000000" & MAC_out.address_out(23 downto 9) & "00" & MAC_out.address_out(8 downto 0);
|
407 |
|
|
cntrl0_app_wdf_data <= MAC_out.write_data_out & MAC_out.write_data_out;
|
408 |
|
|
Mac_in.Acknowledge_read_data_in <= store_rd_data;
|
409 |
|
|
Mac_in.read_data_in <= dat_i;
|
410 |
|
|
|
411 |
|
|
sync_reset <= '1' when rst = '1' OR init_done= '0' else '0';
|
412 |
|
|
sync_reset_n <= not sync_reset;
|
413 |
|
|
|
414 |
|
|
Arbitration_Component : Top_Level_MAC
|
415 |
|
|
Port Map( clock => clk0,
|
416 |
|
|
device_clock => clk0, --device_clock_fb,
|
417 |
|
|
reset => sync_reset,
|
418 |
|
|
Memory_Access_in => Memory_Access_in,
|
419 |
|
|
Memory_Access_out => Memory_Access_out,
|
420 |
|
|
MAC_in => MAC_in,
|
421 |
|
|
MAC_out => MAC_out
|
422 |
|
|
);
|
423 |
|
|
|
424 |
|
|
-- write_data_out : std_logic_vector(data_width -1 downto 0);
|
425 |
|
|
-- address_out : std_logic_vector(physical_address_width -1 downto 0);
|
426 |
|
|
-- write_enable_out : std_logic;
|
427 |
|
|
-- read_enable_out : std_logic;
|
428 |
|
|
-- FIFO_empty_out : std_logic;
|
429 |
|
|
--
|
430 |
|
|
|
431 |
|
|
--process(clk0,rst_r,Memory_Access_in.adr_i(3))
|
432 |
|
|
--begin
|
433 |
|
|
-- if rising_Edge(clk0) then
|
434 |
|
|
-- if rst_r = '1' then
|
435 |
|
|
-- adr_check <= '0';
|
436 |
|
|
-- elsif (Memory_Access_in.adr_i(3)(17 downto 16) = "11") then
|
437 |
|
|
-- adr_check <= '1';
|
438 |
|
|
-- else
|
439 |
|
|
-- adr_check <= adr_check;
|
440 |
|
|
-- end if;
|
441 |
|
|
-- end if;
|
442 |
|
|
--end process;
|
443 |
|
|
|
444 |
|
|
-- Backup Version
|
445 |
|
|
--process(clk0,sync_reset,Memory_Access_in.adr_i(3))
|
446 |
|
|
--begin
|
447 |
|
|
-- if rising_Edge(clk0) then
|
448 |
|
|
-- if sync_reset = '1' then
|
449 |
|
|
-- adr_check <= '0';
|
450 |
|
|
-- elsif (Memory_Access_in.adr_i(3)(17 downto 16) = "11") then
|
451 |
|
|
-- adr_check <= '1';
|
452 |
|
|
-- else
|
453 |
|
|
-- adr_check <= adr_check;
|
454 |
|
|
-- end if;
|
455 |
|
|
-- end if;
|
456 |
|
|
--end process;
|
457 |
|
|
--
|
458 |
|
|
|
459 |
|
|
|
460 |
|
|
|
461 |
|
|
--UART_Component : Uart_Interface
|
462 |
|
|
--port map(
|
463 |
|
|
-- clock => clk0,
|
464 |
|
|
-- reset => rst_r, --sync_reset,
|
465 |
|
|
-- write_enable_out => MAC_out.write_enable_out,
|
466 |
|
|
-- read_enable_out => MAC_out.read_enable_out,
|
467 |
|
|
-- FIFO_empty_out => MAC_out.FIFO_empty_out,
|
468 |
|
|
-- read_data_test_vector => read_data_test_vector,
|
469 |
|
|
-- rx => rx_s,
|
470 |
|
|
-- tx => tx_s,
|
471 |
|
|
-- leds => leds_s,
|
472 |
|
|
-- dat_i => dat_i,
|
473 |
|
|
-- adr_o => Memory_Access_in.adr_i(0),
|
474 |
|
|
-- cyc_o => Memory_Access_in.cyc_i(0),
|
475 |
|
|
-- stb_o => Memory_Access_in.stb_i(0),
|
476 |
|
|
-- we_o => Memory_Access_in.we_i(0),
|
477 |
|
|
-- lock_o => Memory_Access_in.lock_i(0),
|
478 |
|
|
-- dat_o => Memory_Access_in.dat_i(0),
|
479 |
|
|
-- sel_o => Memory_Access_in.sel_i(0),
|
480 |
|
|
-- priority => Memory_Access_in.priority_i(0),
|
481 |
|
|
-- id => Memory_Access_in.id_i(0),
|
482 |
|
|
-- ack_i => Memory_Access_out.ack_o(0),
|
483 |
|
|
-- err_i => Memory_Access_out.err_o(0),
|
484 |
|
|
-- cntrl0_APP_AF_WREN => cntrl0_APP_AF_WREN,
|
485 |
|
|
-- cntrl0_APP_WDF_WREN => cntrl0_APP_WDF_WREN,
|
486 |
|
|
-- mask => cntrl0_app_mask_data,
|
487 |
|
|
-- ack_access_in => MAC_in.ack_access_in,
|
488 |
|
|
-- command => command_s,
|
489 |
|
|
-- acknowledge_read_data => acknowledge_read_data
|
490 |
|
|
--);
|
491 |
|
|
|
492 |
|
|
|
493 |
|
|
jop_cmp: jop
|
494 |
|
|
generic map(
|
495 |
|
|
ram_cnt => 4, -- clock cycles for external ram
|
496 |
|
|
rom_cnt => 15, -- not used for S3K
|
497 |
|
|
jpc_width => 11, -- address bits of java bytecode pc = cache size
|
498 |
|
|
block_bits => 4, -- 2*block_bits is number of cache blocks
|
499 |
|
|
spm_width => 0 -- size of scratchpad RAM (in number of address bits for 32-bit words)
|
500 |
|
|
)
|
501 |
|
|
|
502 |
|
|
port map(
|
503 |
|
|
clk => clk0,
|
504 |
|
|
|
505 |
|
|
--
|
506 |
|
|
---- serial interface
|
507 |
|
|
--
|
508 |
|
|
ser_txd => tx,
|
509 |
|
|
ser_rxd => rx,
|
510 |
|
|
|
511 |
|
|
--
|
512 |
|
|
-- watchdog
|
513 |
|
|
--
|
514 |
|
|
wd => wd,
|
515 |
|
|
--
|
516 |
|
|
|
517 |
|
|
-- Control Signals to Wizardry
|
518 |
|
|
-- configuration_trigger => configuration_trigger_s,
|
519 |
|
|
eRCP_trigger_reg => eRCP_trigger_s, --eRCP_trigger_reg_s,
|
520 |
|
|
---==========================================================--
|
521 |
|
|
----===========Virtex-4 SRAM Port============================--
|
522 |
|
|
sram_clk => sram_clk,
|
523 |
|
|
sram_feedback_clk => sram_feedback_clk,
|
524 |
|
|
|
525 |
|
|
sram_addr => sram_addr,
|
526 |
|
|
|
527 |
|
|
sram_we_n => sram_we_n,
|
528 |
|
|
sram_oe_n => sram_oe_n,
|
529 |
|
|
|
530 |
|
|
sram_data => sram_data,
|
531 |
|
|
|
532 |
|
|
sram_bw0 => sram_bw0,
|
533 |
|
|
sram_bw1 => sram_bw1,
|
534 |
|
|
|
535 |
|
|
sram_bw2 => sram_bw2,
|
536 |
|
|
sram_bw3 => sram_bw3,
|
537 |
|
|
|
538 |
|
|
sram_adv_ld_n => sram_adv_ld_n,
|
539 |
|
|
sram_mode => sram_mode,
|
540 |
|
|
sram_cen => sram_cen,
|
541 |
|
|
sram_cen_test => sram_cen_test,
|
542 |
|
|
sram_zz => sram_zz,
|
543 |
|
|
|
544 |
|
|
---=========================================================---
|
545 |
|
|
---=========================================================---
|
546 |
|
|
|
547 |
|
|
--
|
548 |
|
|
-- I/O pins of board TODO: change this and io for xilinx board!
|
549 |
|
|
--
|
550 |
|
|
-- io_b : inout std_logic_vector(10 downto 1);
|
551 |
|
|
-- io_l : inout std_logic_vector(20 downto 1);
|
552 |
|
|
-- io_r : inout std_logic_vector(20 downto 1);
|
553 |
|
|
-- io_t : inout std_logic_vector(6 downto 1)
|
554 |
|
|
|
555 |
|
|
-- Wizardry Interface
|
556 |
|
|
ack_i => Memory_Access_out.ack_o(8),
|
557 |
|
|
err_i => Memory_Access_out.err_o(8),
|
558 |
|
|
dat_i => Memory_Access_out.dat_o(8),
|
559 |
|
|
cyc_o => Memory_Access_in.cyc_i(8),
|
560 |
|
|
stb_o => Memory_Access_in.stb_i(8),
|
561 |
|
|
we_o => Memory_Access_in.we_i(8),
|
562 |
|
|
dat_o => Memory_Access_in.dat_i(8),
|
563 |
|
|
adr_o => Memory_Access_in.adr_i(8),
|
564 |
|
|
lock_o => Memory_Access_in.lock_i(8),
|
565 |
|
|
-- id_o => open, --Memory_Access_in.id_i(8),
|
566 |
|
|
priority_o => Memory_Access_in.priority_i(8)
|
567 |
|
|
);
|
568 |
|
|
|
569 |
|
|
Wizardry_Top_Level : Wizardry_Top
|
570 |
|
|
Port Map( clock => clk0,
|
571 |
|
|
phy_clock => phy_clock, --clk0, --open, --phy_clock,
|
572 |
|
|
reset => sync_reset,--sync_reset_n,
|
573 |
|
|
phy_reset => phy_reset, --open, --phy_reset,
|
574 |
|
|
phy_data_in => phy_data_in,
|
575 |
|
|
phy_data_valid_in => phy_data_valid_in,
|
576 |
|
|
rx_sdata => WIZ_rx_sdata,
|
577 |
|
|
tx_sdata => WIZ_tx_sdata,
|
578 |
|
|
leds => leds_dummy, --open,
|
579 |
|
|
device_clock_fb => device_clock_fb,
|
580 |
|
|
|
581 |
|
|
-- Configuration Trigger Signal
|
582 |
|
|
new_configuration => eRCP_trigger_s,
|
583 |
|
|
|
584 |
|
|
------WB Signals
|
585 |
|
|
---WB Out Signals
|
586 |
|
|
adr_o => Memory_Access_in.adr_i(4),
|
587 |
|
|
dat_o => Memory_Access_in.dat_i(4),
|
588 |
|
|
we_o => Memory_Access_in.we_i(4),
|
589 |
|
|
sel_o => Memory_Access_in.sel_i(4),
|
590 |
|
|
stb_o => Memory_Access_in.stb_i(4),
|
591 |
|
|
cyc_o => Memory_Access_in.cyc_i(4),
|
592 |
|
|
ID_o => Memory_Access_in.ID_i(4),
|
593 |
|
|
priority_o => Memory_Access_in.priority_i(4),
|
594 |
|
|
lock_o => Memory_Access_in.lock_i(4),
|
595 |
|
|
---WB IN Signals
|
596 |
|
|
err_i => Memory_Access_out.err_o(4),
|
597 |
|
|
ack_i => Memory_Access_out.ack_o(4),
|
598 |
|
|
dat_i => Memory_Access_out.dat_o(4),
|
599 |
|
|
|
600 |
|
|
------WB Signals 2
|
601 |
|
|
---WB Out Signals
|
602 |
|
|
adr_o_0 => Memory_Access_in.adr_i(0),
|
603 |
|
|
dat_o_0 => Memory_Access_in.dat_i(0),
|
604 |
|
|
we_o_0 => Memory_Access_in.we_i(0),
|
605 |
|
|
sel_o_0 => Memory_Access_in.sel_i(0),
|
606 |
|
|
stb_o_0 => Memory_Access_in.stb_i(0),
|
607 |
|
|
cyc_o_0 => Memory_Access_in.cyc_i(0),
|
608 |
|
|
ID_o_0 => Memory_Access_in.ID_i(0),
|
609 |
|
|
priority_o_0 => Memory_Access_in.priority_i(0),
|
610 |
|
|
lock_o_0 => Memory_Access_in.lock_i(0),
|
611 |
|
|
---WB IN Signals
|
612 |
|
|
err_i_0 => Memory_Access_out.err_o(0),
|
613 |
|
|
ack_i_0 => Memory_Access_out.ack_o(0),
|
614 |
|
|
dat_i_0 => Memory_Access_out.dat_o(0),
|
615 |
|
|
|
616 |
|
|
--EMPAC WB SIGNALS
|
617 |
|
|
empac_ack_i => Memory_Access_out.ack_o(3),
|
618 |
|
|
empac_dat_i => Memory_Access_out.dat_o(3),
|
619 |
|
|
empac_err_i => Memory_Access_out.err_o(3),
|
620 |
|
|
empac_dat_o => Memory_Access_in.dat_i(3),
|
621 |
|
|
empac_adr_o => Memory_Access_in.adr_i(3),
|
622 |
|
|
empac_cyc_o => Memory_Access_in.cyc_i(3),
|
623 |
|
|
empac_stb_o => Memory_Access_in.stb_i(3),
|
624 |
|
|
empac_we_o => Memory_Access_in.we_i(3),
|
625 |
|
|
empac_lock_o => Memory_Access_in.lock_i(3),
|
626 |
|
|
empac_priority_o => Memory_Access_in.priority_i(3),
|
627 |
|
|
empac_id_o => Memory_Access_in.id_i(3),
|
628 |
|
|
|
629 |
|
|
-- Debug Signals to top level
|
630 |
|
|
eRCP_busy => eRCP_busy_s,
|
631 |
|
|
interactive_instructions => interactive_instructions_s
|
632 |
|
|
-- ,
|
633 |
|
|
-- rdcount => rdcount,
|
634 |
|
|
-- wrcount => wrcount,
|
635 |
|
|
-- empac_empty_debug => empac_empty_debug,
|
636 |
|
|
-- empac_full_debug => empac_full_debug
|
637 |
|
|
|
638 |
|
|
);
|
639 |
|
|
|
640 |
|
|
Xilinx_RDIC_Bridge : RDIC_Xilinx_bridge
|
641 |
|
|
Port Map( clock => clk0,
|
642 |
|
|
reset => sync_reset,
|
643 |
|
|
fifo_empty_out => MAC_out.FIFO_empty_out,
|
644 |
|
|
write_enable_out => MAC_out.write_enable_out,
|
645 |
|
|
APP_AF_WREN => cntrl0_APP_AF_WREN,
|
646 |
|
|
APP_WDF_WREN => cntrl0_APP_WDF_WREN,
|
647 |
|
|
ack_access_in => MAC_in.ack_access_in,
|
648 |
|
|
command => command_s,
|
649 |
|
|
mask => cntrl0_app_mask_data
|
650 |
|
|
);
|
651 |
|
|
|
652 |
|
|
--WB_UART_Component : wc_uart_controller
|
653 |
|
|
-- Port Map( clock => clk0,
|
654 |
|
|
-- device_clock => device_clock_fb_0,
|
655 |
|
|
-- reset => sync_reset,
|
656 |
|
|
-- cyc_o => Memory_Access_in.cyc_i(7),
|
657 |
|
|
-- stb_o => Memory_Access_in.stb_i(7),
|
658 |
|
|
-- we_o => Memory_Access_in.we_i(7),
|
659 |
|
|
-- adr_o => Memory_Access_in.adr_i(7),
|
660 |
|
|
-- dat_o => Memory_Access_in.dat_i(7),
|
661 |
|
|
-- dat_i => Memory_Access_out.dat_o(7),
|
662 |
|
|
-- ack_i => Memory_Access_out.ack_o(7),
|
663 |
|
|
-- err_i => Memory_Access_out.err_o(7),
|
664 |
|
|
-- priority_o => Memory_Access_in.priority_i(7),
|
665 |
|
|
-- id_o => Memory_Access_in.ID_i(7),
|
666 |
|
|
-- lock_o => Memory_Access_in.lock_i(7),
|
667 |
|
|
-- eRCP_busy => eRCP_busy_s,
|
668 |
|
|
-- interactive_instructions => interactive_instructions_s,
|
669 |
|
|
-- rx => rx_s, --rx,
|
670 |
|
|
-- tx => tx_s --tx
|
671 |
|
|
--);
|
672 |
|
|
|
673 |
|
|
|
674 |
|
|
process(cntrl0_read_data_valid,clk0,rst_r)
|
675 |
|
|
begin
|
676 |
|
|
if(clk0'event and clk0 = '1') then
|
677 |
|
|
if(rst_r = '1') then
|
678 |
|
|
store_rd_data <= '0';
|
679 |
|
|
store_rd_data_0 <= '0';
|
680 |
|
|
elsif(cntrl0_read_data_valid = '1') then
|
681 |
|
|
store_rd_data <= store_rd_data_0;
|
682 |
|
|
store_rd_data_0 <= '1';
|
683 |
|
|
else
|
684 |
|
|
store_rd_data <= store_rd_data_0;
|
685 |
|
|
store_rd_data_0 <= '0';
|
686 |
|
|
end if;
|
687 |
|
|
end if;
|
688 |
|
|
end process;
|
689 |
|
|
|
690 |
|
|
|
691 |
|
|
process(store_rd_data,clk0,rst_r)
|
692 |
|
|
begin
|
693 |
|
|
--if(clk0'event and clk0 = '1') then
|
694 |
|
|
if(rst_r = '1') then
|
695 |
|
|
-- dat_i_shift_reg(0) <= (others => '0');
|
696 |
|
|
-- dat_i_shift_reg(1) <= (others => '0');
|
697 |
|
|
-- dat_i_shift_reg(2) <= (others => '0');
|
698 |
|
|
-- dat_i_shift_reg(3) <= (others => '0');
|
699 |
|
|
-- dat_i <= (others => '0');
|
700 |
|
|
elsif(clk0'event and clk0 = '1') then
|
701 |
|
|
if(cntrl0_read_data_valid = '1') then
|
702 |
|
|
dat_i_shift_reg(0) <= dat_i_shift_reg(1);
|
703 |
|
|
dat_i_shift_reg(1) <= dat_i_shift_reg(2);
|
704 |
|
|
dat_i_shift_reg(2) <= dat_i_shift_reg(3);
|
705 |
|
|
dat_i_shift_reg(3) <= cntrl0_read_data_fifo_out;
|
706 |
|
|
dat_i <= dat_i_shift_reg(2)(63 downto 32);
|
707 |
|
|
else
|
708 |
|
|
dat_i_shift_reg(0) <= dat_i_shift_reg(0);
|
709 |
|
|
dat_i_shift_reg(1) <= dat_i_shift_reg(1);
|
710 |
|
|
dat_i_shift_reg(2) <= dat_i_shift_reg(2);
|
711 |
|
|
dat_i_shift_reg(3) <= dat_i_shift_reg(3);
|
712 |
|
|
dat_i <= dat_i_shift_reg(2)(63 downto 32);
|
713 |
|
|
end if;
|
714 |
|
|
end if;
|
715 |
|
|
end process;
|
716 |
|
|
|
717 |
|
|
--process(store_rd_data,clk0,rst_r)
|
718 |
|
|
--begin
|
719 |
|
|
--if(clk0'event and clk0 = '1') then
|
720 |
|
|
-- if(rst_r = '1') then
|
721 |
|
|
-- dat_i <= X"00000000";
|
722 |
|
|
-- elsif(store_rd_data = '1') then
|
723 |
|
|
-- dat_i <= cntrl0_read_data_fifo_out(63 downto 32);
|
724 |
|
|
-- else
|
725 |
|
|
-- dat_i <= dat_i;
|
726 |
|
|
-- end if;
|
727 |
|
|
-- end if;
|
728 |
|
|
--end process;
|
729 |
|
|
--
|
730 |
|
|
|
731 |
|
|
|
732 |
|
|
-----------------My stuff above-------------------
|
733 |
|
|
|
734 |
|
|
unused_data_in <= X"00000000";
|
735 |
|
|
unused_data_in_p <= "0000";
|
736 |
|
|
gnd <= '0';
|
737 |
|
|
-- cntrl0_app_wdf_data <= X"00FF00FF00FF00FF";
|
738 |
|
|
-- cntrl0_app_mask_data <= "00000000";
|
739 |
|
|
-- cntrl0_app_wdf_wren <= '1';
|
740 |
|
|
|
741 |
|
|
-- ADDRESS generation for Write and Read Address FIFOs
|
742 |
|
|
|
743 |
|
|
-- RAMB16_S36 is set to 512x36 mode
|
744 |
|
|
|
745 |
|
|
-- INITP_00 (2 downto 0)
|
746 |
|
|
-- read -5
|
747 |
|
|
-- write -4
|
748 |
|
|
-- lmr - 0
|
749 |
|
|
-- pre -2
|
750 |
|
|
-- ref -1
|
751 |
|
|
-- active -3
|
752 |
|
|
|
753 |
|
|
|
754 |
|
|
wr_rd_addr_lookup : RAMB16_S36
|
755 |
|
|
generic map(
|
756 |
|
|
INIT_00 => X"0003C154_0003C198_0003C088_0003C0EC_00023154_00023198_00023088_000230EC",
|
757 |
|
|
INIT_01 => X"00023154_00023198_00023088_000230EC_0003C154_0003C198_0003C088_0003C0EC",
|
758 |
|
|
INIT_02 => X"0083C154_0083C198_0083C088_0083C0EC_00823154_00823198_00823088_008230EC",
|
759 |
|
|
INIT_03 => X"0083C154_0083C198_0083C088_0083C0EC_00823154_00823198_00823088_008230EC",
|
760 |
|
|
INIT_04 => X"0043C154_0043C198_0043C088_0043C0EC_00423154_00423198_00423088_004230EC",
|
761 |
|
|
INIT_05 => X"0043C154_0043C198_0043C088_0043C0EC_00423154_00423198_00423088_004230EC",
|
762 |
|
|
INIT_06 => X"00C3C154_00C3C198_00C3C088_00C3C0EC_00C23154_00C23198_00C23088_00C230EC",
|
763 |
|
|
INIT_07 => X"00C3C154_00C3C198_00C3C088_00C3C0EC_00C23154_00C23198_00C23088_00C230EC",
|
764 |
|
|
INITP_00 => X"55555555_44444444_55555555_44444444_55555555_44444444_55555555_44444444")
|
765 |
|
|
port map (
|
766 |
|
|
DO => addr_out(31 downto 0),
|
767 |
|
|
DOP => addr_out(35 downto 32),
|
768 |
|
|
ADDR => wr_rd_addr(8 downto 0),
|
769 |
|
|
clk => clk0,
|
770 |
|
|
DI => unused_data_in(31 downto 0),
|
771 |
|
|
DIP => unused_data_in_p(3 downto 0),
|
772 |
|
|
EN => wr_rd_addr_en_reg,
|
773 |
|
|
SSR => gnd,
|
774 |
|
|
WE => gnd
|
775 |
|
|
);
|
776 |
|
|
|
777 |
|
|
|
778 |
|
|
|
779 |
|
|
|
780 |
|
|
|
781 |
|
|
wr_rd_addr_en <= bkend_wraddr_en;
|
782 |
|
|
|
783 |
|
|
|
784 |
|
|
process(clk0)
|
785 |
|
|
begin
|
786 |
|
|
if(clk0'event and clk0 = '1') then
|
787 |
|
|
rst_r <= sync_reset;
|
788 |
|
|
end if;
|
789 |
|
|
end process;
|
790 |
|
|
|
791 |
|
|
process(clk0,rst_r)
|
792 |
|
|
begin
|
793 |
|
|
if(rst_r = '1') then
|
794 |
|
|
jop_reset_cnt <= "000000000000000";
|
795 |
|
|
elsif(clk0'event and clk0 = '1') then
|
796 |
|
|
if(jop_reset_cnt = "111111111111111") then
|
797 |
|
|
--jop_reset_cnt <= jop_reset_cnt;
|
798 |
|
|
jop_reset <= '0';
|
799 |
|
|
else
|
800 |
|
|
jop_reset_cnt <= jop_reset_cnt + '1';
|
801 |
|
|
jop_reset <= '1';
|
802 |
|
|
end if;
|
803 |
|
|
end if;
|
804 |
|
|
end process;
|
805 |
|
|
|
806 |
|
|
-- jop_reset <= '0' when jop_reset_cnt =
|
807 |
|
|
|
808 |
|
|
process(clk0)
|
809 |
|
|
begin
|
810 |
|
|
if(clk0'event and clk0 = '1') then
|
811 |
|
|
if(rst_r = '1') then
|
812 |
|
|
wr_rd_addr_en_reg <= '0';
|
813 |
|
|
else
|
814 |
|
|
wr_rd_addr_en_reg <= wr_rd_addr_en;
|
815 |
|
|
end if;
|
816 |
|
|
end if;
|
817 |
|
|
end process;
|
818 |
|
|
|
819 |
|
|
--register backend enables
|
820 |
|
|
process(clk0)
|
821 |
|
|
begin
|
822 |
|
|
if(clk0'event and clk0 = '1') then
|
823 |
|
|
if(rst_r = '1') then
|
824 |
|
|
bkend_wraddr_en_reg <= '0';
|
825 |
|
|
bkend_wraddr_en_3r <= '0';
|
826 |
|
|
else
|
827 |
|
|
bkend_wraddr_en_reg <= bkend_wraddr_en;
|
828 |
|
|
bkend_wraddr_en_3r <= bkend_wraddr_en_reg;
|
829 |
|
|
end if;
|
830 |
|
|
end if;
|
831 |
|
|
end process;
|
832 |
|
|
|
833 |
|
|
----FIFO enables
|
834 |
|
|
-- process(clk0)
|
835 |
|
|
-- begin
|
836 |
|
|
-- if(clk0'event and clk0 = '1') then
|
837 |
|
|
-- if(rst_r = '1') then
|
838 |
|
|
-- app_af_wren <= '0';
|
839 |
|
|
-- else
|
840 |
|
|
-- app_af_wren <= bkend_wraddr_en_3r;
|
841 |
|
|
-- end if;
|
842 |
|
|
-- end if;
|
843 |
|
|
-- end process;
|
844 |
|
|
|
845 |
|
|
----FIFO addresses
|
846 |
|
|
-- process(clk0)
|
847 |
|
|
-- begin
|
848 |
|
|
-- if(clk0'event and clk0 = '1') then
|
849 |
|
|
-- if(rst_r = '1') then
|
850 |
|
|
-- app_af_addr <= (others => '0');
|
851 |
|
|
-- elsif(bkend_wraddr_en_3r = '1') then
|
852 |
|
|
-- app_af_addr <= addr_out(35 downto 0);
|
853 |
|
|
-- else
|
854 |
|
|
-- app_af_addr <= (others => '0');
|
855 |
|
|
-- end if;
|
856 |
|
|
-- end if;
|
857 |
|
|
-- end process;
|
858 |
|
|
|
859 |
|
|
--address input
|
860 |
|
|
process(clk0)
|
861 |
|
|
begin
|
862 |
|
|
if(clk0'event and clk0 = '1') then
|
863 |
|
|
if(rst_r = '1') then
|
864 |
|
|
wr_addr_count <= "111111";
|
865 |
|
|
elsif(bkend_wraddr_en = '1') then
|
866 |
|
|
wr_addr_count <= wr_addr_count + '1';
|
867 |
|
|
else
|
868 |
|
|
wr_addr_count <= wr_addr_count;
|
869 |
|
|
end if;
|
870 |
|
|
end if;
|
871 |
|
|
end process;
|
872 |
|
|
|
873 |
|
|
|
874 |
|
|
wr_rd_addr <= ("000" & wr_addr_count) when (bkend_wraddr_en_reg = '1') else
|
875 |
|
|
"000000000";
|
876 |
|
|
|
877 |
|
|
--Memory_Access_in.id_i(0) <= "11111";
|
878 |
|
|
--Memory_Access_in.id_i(1) <= "11110";
|
879 |
|
|
--Memory_Access_in.id_i(3) <= "11101";
|
880 |
|
|
--Memory_Access_in.id_i(4) <= "11100";
|
881 |
|
|
--Memory_Access_in.id_i(5) <= "11011";
|
882 |
|
|
--Memory_Access_in.id_i(6) <= "11010";
|
883 |
|
|
--Memory_Access_in.id_i(7) <= "11001";
|
884 |
|
|
|
885 |
|
|
process(clk0)
|
886 |
|
|
begin
|
887 |
|
|
-- if(clk0'event and clk0 = '1') then
|
888 |
|
|
for i in 0 to (num_of_ports) loop
|
889 |
|
|
Memory_Access_in.adr_i(i) <= (others => 'Z');
|
890 |
|
|
Memory_Access_in.dat_i(i) <= (others => 'Z');
|
891 |
|
|
Memory_Access_in.we_i(i) <= 'Z';
|
892 |
|
|
Memory_Access_in.stb_i(i) <= 'Z';
|
893 |
|
|
Memory_Access_in.cyc_i(i) <= 'Z';
|
894 |
|
|
Memory_Access_in.push_i(i) <= 'Z';
|
895 |
|
|
Memory_Access_in.lock_i(i) <= 'Z';
|
896 |
|
|
Memory_Access_in.priority_i(i) <= (others => 'Z');
|
897 |
|
|
end loop;
|
898 |
|
|
-- end if;
|
899 |
|
|
end process;
|
900 |
|
|
|
901 |
|
|
process(clk0)
|
902 |
|
|
begin
|
903 |
|
|
for i in 0 to (num_of_ports -1) loop
|
904 |
|
|
Memory_Access_in.id_i(i) <= (others => 'Z');
|
905 |
|
|
Memory_Access_in.sel_i(i) <= (others => 'Z');
|
906 |
|
|
end loop;
|
907 |
|
|
end process;
|
908 |
|
|
|
909 |
|
|
|
910 |
|
|
|
911 |
|
|
|
912 |
|
|
|
913 |
|
|
end arch;
|