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

Subversion Repositories usb_dongle_fpga

[/] [usb_dongle_fpga/] [trunk/] [src/] [design_top/] [design_top_thincandbg.vhd] - Blame information for rev 53

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 nuubik
------------------------------------------------------------------
2
-- Universal dongle board source code
3
-- 
4
-- Copyright (C) 2006 Artec Design <jyrit@artecdesign.ee>
5
-- 
6
-- This source code is free hardware; you can redistribute it and/or
7
-- modify it under the terms of the GNU Lesser General Public
8
-- License as published by the Free Software Foundation; either
9
-- version 2.1 of the License, or (at your option) any later version.
10
-- 
11
-- This source code is distributed in the hope that it will be useful,
12
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
-- Lesser General Public License for more details.
15
-- 
16
-- You should have received a copy of the GNU Lesser General Public
17
-- License along with this library; if not, write to the Free Software
18
-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19
-- 
20
-- 
21
-- The complete text of the GNU Lesser General Public License can be found in 
22
-- the file 'lesser.txt'.
23
 
24
 
25
 
26
-- Coding for seg_out(7:0)  
27
--
28
--                bit 0,A 
29
--                 ----------
30
--                |          |
31
--                |          |
32
--             5,F|          |  1,B
33
--                |    6,G   |
34
--                 ----------
35
--                |          |
36
--                |          |
37
--             4,E|          |  2,C
38
--                |    3,D   |
39
--                 ----------  
40
--                              # 7,H
41
 
42
-- Revision history
43
--
44
-- Version 1.01
45
-- 15 oct 2006  version code 86 01      jyrit
46
-- Added IO write to address 0x0088  with commands F1 and F4 to
47
-- enable switching dongle to 4Meg mode for external reads
48
-- Changed USB interface to address all 4 Meg on any mode jumper configuration
49
--
50
-- Version 1.02
51
-- 04 dec 2006 version code 86 02 jyrit
52
-- Added listen only mode for mode pin configuration "00" to enable post code
53
-- spy mode (does not respond to external reads).
54
 
55
 
56
library ieee;
57
use ieee.std_logic_1164.all;
58
use IEEE.std_logic_unsigned.all;
59
use IEEE.std_logic_arith.all;
60
 
61 49 nuubik
entity design_top_thincandbg is
62 2 nuubik
  port (
63
        --system signals
64
        sys_clk    : in    std_logic;         --25 MHz clk
65
        resetn     : in    std_logic;
66 26 nuubik
        hdr                : inout    std_logic_vector(9 downto 0);
67 17 nuubik
        --alt_clk    : out    std_logic;    
68 2 nuubik
        mode       : in    std_logic_vector(1 downto 0);  --sel upper addr bits
69
    --lpc slave interf
70
    lad        : inout std_logic_vector(3 downto 0);
71
    lframe_n   : in    std_logic;
72
    lreset_n   : in    std_logic;
73
    lclk       : in    std_logic;
74
    --led system    
75
    seg_out    : out   std_logic_vector(7 downto 0);
76
    scn_seg    : out   std_logic_vector(3 downto 0);
77
    led_green  : out   std_logic;
78
    led_red    : out   std_logic;
79
    --flash interface
80
    fl_addr    : out   std_logic_vector(23 downto 0);
81
    fl_ce_n    : out   std_logic;       --chip select
82
    fl_oe_n    : out   std_logic;       --output enable for flash
83
    fl_we_n    : out   std_logic;       --write enable
84
    fl_data    : inout std_logic_vector(15 downto 0);
85
    fl_rp_n    : out   std_logic;       --reset signal
86
    fl_sts     : in    std_logic;        --status signal
87 35 nuubik
        fl_sts_en  : out std_logic;       --enable status signal wiht highZ out
88 2 nuubik
    --USB parallel interface
89
    usb_rd_n   : inout  std_logic;  -- enables out data if low (next byte detected by edge / in usb chip)
90
    usb_wr     : inout  std_logic;  -- write performed on edge \ of signal
91
    usb_txe_n  : in   std_logic;  -- transmit enable (redy for new data if low)
92
    usb_rxf_n  : in   std_logic;  -- rx fifo has data if low
93
    usb_bd     : inout  std_logic_vector(7 downto 0) --bus data
94
    );
95 49 nuubik
end design_top_thincandbg;
96 2 nuubik
 
97
 
98
 
99 49 nuubik
architecture rtl of design_top_thincandbg is
100 2 nuubik
 
101
component led_sys   --toplevel for led system
102
  generic(
103
        msn_hib : std_logic_vector(7 downto 0);  --Most signif. of hi byte
104
        lsn_hib : std_logic_vector(7 downto 0);  --Least signif. of hi byte
105
        msn_lob : std_logic_vector(7 downto 0);  --Most signif. of hi byte
106
        lsn_lob : std_logic_vector(7 downto 0)  --Least signif. of hi byte       
107
  );
108
  port (
109
    clk                         : in std_logic;
110
    reset_n                     : in std_logic;
111
        led_data_i              : in  std_logic_vector(15 downto 0);   --binary data in
112
    seg_out                     : out std_logic_vector(7 downto 0); --one segment out
113
    sel_out                     : out std_logic_vector(3 downto 0)  --segment scanner with one bit low
114
    );
115
end component;
116
 
117
 
118
component lpc_iow
119
  port (
120
    --system signals
121
    lreset_n   : in  std_logic;
122
    lclk       : in  std_logic;
123 17 nuubik
        lena_mem_r : in  std_logic;  --enable full adress range covering memory read block
124
        lena_reads : in  std_logic;  --enable read capabilities
125 2 nuubik
        --LPC bus from host
126
    lad_i      : in  std_logic_vector(3 downto 0);
127
    lad_o      : out std_logic_vector(3 downto 0);
128
    lad_oe     : out std_logic;
129
    lframe_n   : in  std_logic;
130
        --memory interface
131
    lpc_addr   : out std_logic_vector(23 downto 0); --shared address
132
    lpc_wr     : out std_logic;         --shared write not read
133
    lpc_data_i : in  std_logic_vector(7 downto 0);
134
    lpc_data_o : out std_logic_vector(7 downto 0);
135
    lpc_val    : out std_logic;
136
    lpc_ack    : in  std_logic
137
    );
138
end component;
139
 
140
 
141
component flash_if
142
  port (
143
    clk       : in  std_logic;
144
    reset_n   : in  std_logic;
145
    --flash Bus
146
    fl_addr   : out std_logic_vector(23 downto 0);
147
    fl_ce_n      : out std_logic;       --chip select
148
    fl_oe_n      : out std_logic;    --output enable for flash
149
    fl_we_n      : out std_logic;       --write enable
150
    fl_data      : inout std_logic_vector(15 downto 0);
151
    fl_rp_n      : out std_logic;       --reset signal
152
    fl_byte_n    : out std_logic;     --hold in byte mode
153
    fl_sts       : in std_logic;        --status signal
154
    -- mem Bus
155
    mem_addr  : in std_logic_vector(23 downto 0);
156
    mem_do    : out std_logic_vector(15 downto 0);
157 26 nuubik
    mem_di    : in  std_logic_vector(15 downto 0);
158 2 nuubik
    mem_wr    : in  std_logic;  --write not read signal
159
    mem_val   : in  std_logic;
160
    mem_ack   : out std_logic
161
    );
162
end component;
163
 
164
 
165
component usb2mem
166
  port (
167
    clk25     : in  std_logic;
168
    reset_n   : in  std_logic;
169 26 nuubik
        dongle_ver: in std_logic_vector(15 downto 0);
170 2 nuubik
    -- mem Bus
171 26 nuubik
    mem_busy_n: in std_logic;
172
        mem_idle  : out std_logic; -- '1' if controller is idle (flash is safe for LPC reads)
173 2 nuubik
    mem_addr  : out std_logic_vector(23 downto 0);
174
    mem_do    : out std_logic_vector(15 downto 0);
175
    mem_di    : in std_logic_vector(15 downto 0);
176
    mem_wr    : out std_logic;
177
    mem_val   : out std_logic;
178
    mem_ack   : in  std_logic;
179
    mem_cmd   : out std_logic;
180
    -- USB port
181 26 nuubik
        usb_mode_en: in   std_logic;  -- enable this block 
182 2 nuubik
    usb_rd_n   : out  std_logic;  -- enables out data if low (next byte detected by edge / in usb chip)
183
    usb_wr     : out  std_logic;  -- write performed on edge \ of signal
184
    usb_txe_n  : in   std_logic;  -- tx fifo empty (redy for new data if low)
185
    usb_rxf_n  : in   std_logic;  -- rx fifo empty (data redy if low)
186
    usb_bd     : inout  std_logic_vector(7 downto 0) --bus data
187
    );
188
end component;
189
 
190 26 nuubik
component pc_serializer
191
    Port ( --system signals
192
           sys_clk : in  STD_LOGIC;
193
           resetn  : in  STD_LOGIC;
194
                   --postcode data port
195
           dbg_data : in  STD_LOGIC_VECTOR (7 downto 0);
196
           dbg_wr   : in  STD_LOGIC;   --write not read
197
                   dbg_full : out STD_LOGIC;   --write not read
198
                   dbg_almost_full      : out STD_LOGIC;
199
                   dbg_usedw            : out STD_LOGIC_VECTOR (12 DOWNTO 0);
200
                   --debug USB port
201
                   dbg_usb_mode_en: in   std_logic;  -- enable this debug mode
202
                   dbg_usb_wr     : out  std_logic;  -- write performed on edge \ of signal
203
                   dbg_usb_txe_n  : in   std_logic;  -- tx fifo not full (redy for new data if low)
204
                   dbg_usb_bd     : inout  std_logic_vector(7 downto 0) --bus data
205
);
206
end component;
207 2 nuubik
 
208
 
209
--LED signals
210
signal data_to_disp : std_logic_vector(15 downto 0);
211
--END LED SIGNALS
212
 
213
--lpc signals
214
signal    lad_i      : std_logic_vector(3 downto 0);
215
signal    lad_o      : std_logic_vector(3 downto 0);
216
signal    lad_oe     : std_logic;
217
 
218
signal    lpc_debug  : std_logic_vector(31 downto 0);
219 26 nuubik
signal    lpc_debug_cnt  : std_logic_vector(15 downto 0);
220 2 nuubik
signal    lpc_addr   : std_logic_vector(23 downto 0); --shared address
221
signal    lpc_data_o : std_logic_vector(7 downto 0);
222
signal    lpc_data_i : std_logic_vector(7 downto 0);
223
signal    lpc_wr     : std_logic;        --shared write not read
224
signal    lpc_ack    : std_logic;
225
signal    lpc_val    : std_logic;
226 17 nuubik
signal    lena_mem_r : std_logic;  --enable full adress range covering memory read block
227
signal    lena_reads : std_logic;  --enable/disables all read capabilty to make the device post code capturer
228 2 nuubik
 
229
signal    c25_lpc_val  : std_logic;
230
signal    c25_lpc_wr     : std_logic;        --shared write not read
231 26 nuubik
signal    c25_lpc_wr_long : std_logic;        --for led debug data latching
232
 
233
signal    c33_lpc_wr_long : std_logic;        --for led debug data latching
234 2 nuubik
signal    c33_lpc_wr     : std_logic;        --for led debug data latching
235 26 nuubik
signal    c33_lpc_wr_wait: std_logic;        --for led debug data latching
236
signal    c33_lpc_wr_waitd: std_logic;        --for led debug data latching
237
signal    c33_wr_cnt     : std_logic_vector(23 downto 0);        --for led debug data latching
238 2 nuubik
 
239 26 nuubik
 
240 2 nuubik
--End lpc signals
241
 
242
--Flash signals
243
signal    mem_addr  : std_logic_vector(23 downto 0);
244
signal    mem_do    : std_logic_vector(15 downto 0);
245
signal    mem_di    : std_logic_vector(15 downto 0);
246
signal    mem_wr    : std_logic;  --write not read signal
247
signal    mem_val   : std_logic;
248
signal    mem_ack   : std_logic;
249
 
250
signal    c33_mem_ack   : std_logic;  --sync signal
251
 
252
 
253
 
254
signal    fl_ce_n_w : std_logic;       --chip select
255
signal    fl_oe_n_w : std_logic;    --output enable for flash
256
 
257
--END flash signals
258
 
259
--USB signals
260 26 nuubik
signal    dbg_data :  STD_LOGIC_VECTOR (7 downto 0);
261
signal    c25_dbg_addr_d :  STD_LOGIC_VECTOR (7 downto 0);
262
signal    c33_dbg_addr_d :  STD_LOGIC_VECTOR (7 downto 0);
263
 
264
signal    dbg_wr   : STD_LOGIC;   --write not read
265
signal    dbg_full : STD_LOGIC;   --write not read
266
signal    dbg_almost_full       : STD_LOGIC;
267
signal    dbg_usedw             : STD_LOGIC_VECTOR (12 DOWNTO 0);
268
 
269 49 nuubik
signal    force_4meg_n    : std_logic;
270 26 nuubik
signal    dbg_usb_mode_en    : std_logic;
271
signal    usb_mode_en    : std_logic;
272
signal    mem_idle   : std_logic;
273 2 nuubik
signal    umem_addr  : std_logic_vector(23 downto 0);
274
signal    umem_do    : std_logic_vector(15 downto 0);
275
signal    umem_wr    : std_logic;
276
signal    umem_val   : std_logic;
277
signal    umem_ack   : std_logic;
278
signal    umem_cmd   : std_logic;
279
signal    enable_4meg: std_logic;
280 35 nuubik
signal    dongle_con_n : std_logic;
281 26 nuubik
 
282 49 nuubik
constant dongle_ver  : std_logic_vector(15 downto 0):=x"8606";
283 2 nuubik
--END USB signals
284
 
285
begin
286
 
287 17 nuubik
--GPIO PINS START
288 26 nuubik
fl_sts_en <='Z';
289 2 nuubik
 
290 35 nuubik
hdr(1) <= dongle_con_n;
291
--hdr(1) <= fl_sts when resetn='1' else
292
--                '0';
293
 
294 26 nuubik
--when jumper on then mem read and firmware read enabled else only firmware read
295 17 nuubik
hdr(0) <= 'Z';
296
lena_mem_r <= not hdr(0); -- disabled if jumper is not on header pins 1-2
297 2 nuubik
 
298 26 nuubik
-- jumper on pins 5,6 then postcode only mode (no mem device)
299
hdr(2) <= '0'; --create low pin for jumper pair 5-6 (this pin is 6 on J1 header)
300 35 nuubik
lena_reads <= hdr(3) and mem_idle and (not dongle_con_n); -- disabled if jumper is on (jumper makes it a postcode only device) paired with hdr(2) pins 5,6 and when usb control is not accessing flash
301 26 nuubik
 
302
 
303
-- when jumper on pins 7,8 then post code capture mode enabled
304
hdr(4)<= '0';
305
dbg_usb_mode_en <= not hdr(5);  --weak pullup on hdr(5) paired with hdr(4)
306
usb_mode_en <= not dbg_usb_mode_en;
307
 
308 49 nuubik
-- when jumper on pins 9,10 then 4M window is forced
309
hdr(6)<= '0';
310
force_4meg_n <= hdr(7);  --weak pullup on hdr(7) paired with hdr(6)
311
 
312 17 nuubik
--GPIO PINS END
313
 
314 2 nuubik
--LED SUBSYSTEM START
315 26 nuubik
data_to_disp <= x"86"&lpc_debug(7 downto 0) when usb_mode_en='1' else    --x"C0DE"; -- ASSIGN data to be displayed (should be regitered)
316
                                "000"&dbg_usedw;  --show tx fifo state on leds when postcode capture mode
317 2 nuubik
--########################################--
318
                        --VERSION CONSTATNS
319
--########################################--
320
led_red <= enable_4meg;
321
 
322
LEDS: led_sys   --toplevel for led system
323
  generic map(
324
        msn_hib => "01111111",--8  --Most signif. of hi byte  
325
        lsn_hib => "01111101",--6   --Least signif. of hi byte
326
        msn_lob => "10111111",--0  --Most signif. of hi byte   This is version code
327 17 nuubik
        --lsn_lob => "01001111" --3   --Least signif. of hi byte        This is version code
328 26 nuubik
        --lsn_lob => "01100110" --4   --Least signif. of hi byte        This is version code
329 49 nuubik
    --lsn_lob => "01101101" --5    --sync with dongle version const.  Least signif. of hi byte This is version code
330
    lsn_lob => "01111101" --6    --sync with dongle version const.  Least signif. of hi byte This is version code
331 26 nuubik
 
332 2 nuubik
  )
333
  port map(
334
    clk                         => sys_clk , -- in std_logic;
335
    reset_n                     => resetn, -- in std_logic;
336
        led_data_i              => data_to_disp, -- in  std_logic_vector(15 downto 0);   --binary data in
337
    seg_out                     => seg_out, -- out std_logic_vector(7 downto 0); --one segment out
338
    sel_out                     => scn_seg -- out std_logic_vector(3 downto 0)  --segment scanner with one bit low
339
    );
340
 
341
--LED SUBSYSTEM END
342
 
343
 
344
--MAIN DATAPATH CONNECTIONS
345
--LPC bus logic
346
lad_i <= lad;
347 15 nuubik
lad <=  lad_o when lad_oe='1' else
348 2 nuubik
                (others=>'Z');
349
 
350
--END LPC bus logic
351
 
352
LPCBUS : lpc_iow
353
  port map(
354
    --system signals
355
    lreset_n   => lreset_n, -- in  std_logic;
356
    lclk       => lclk, -- in  std_logic;
357 35 nuubik
        lena_mem_r => lena_mem_r, --: in  std_logic;    --enable full adress range covering memory read block
358 17 nuubik
        lena_reads => lena_reads, -- : in  std_logic;  --enable read capabilities, : in  std_logic;  --enable read capabilities
359 2 nuubik
        --LPC bus from host
360
    lad_i      => lad_i, -- in  std_logic_vector(3 downto 0);
361
    lad_o      => lad_o, -- out std_logic_vector(3 downto 0);
362
    lad_oe     => lad_oe, -- out std_logic;
363
    lframe_n   => lframe_n, -- in  std_logic;
364
        --memory interface
365
    lpc_addr   => lpc_addr, -- out std_logic_vector(23 downto 0); --shared address
366
    lpc_wr     => lpc_wr, -- out std_logic;         --shared write not read
367
    lpc_data_i => lpc_data_i, -- in  std_logic_vector(7 downto 0);
368
    lpc_data_o => lpc_data_o, -- out std_logic_vector(7 downto 0);  
369
    lpc_val    => lpc_val, -- out std_logic;
370
    lpc_ack    => lpc_ack -- in  std_logic
371
    );
372
 
373
 
374
--memory data bus logic
375
        mem_addr <= mode&"11"&lpc_addr(19 downto 0) when c25_lpc_val='1' and enable_4meg='0' else  --use mode bist
376
                                mode&lpc_addr(21 downto 0) when c25_lpc_val='1' and enable_4meg='1' else  --use mode bist
377
                                mode&umem_addr(21 downto 0) when umem_val='1' else  --use mode bist
378
                                (others=>'Z');
379
 
380
        mem_di <=       (others=>'Z') when c25_lpc_val='1' else
381
                                umem_do when umem_val='1' else
382
                                (others=>'Z');
383
 
384
 
385
        mem_wr <= c25_lpc_wr when c25_lpc_val='1' and c25_lpc_wr='0' else  --pass read olny
386
                          umem_wr when umem_val='1' else
387
                          '0';
388
 
389
        mem_val <= c25_lpc_val or umem_val;
390
 
391
 
392
 
393
        umem_ack <= mem_ack when umem_val='1' else
394
                                '0';
395
 
396
 
397
        lpc_data_i <= mem_do(7 downto 0) when lpc_addr(0)='0' else
398
                                  mem_do(15 downto 8);
399
 
400
        lpc_ack <= c33_mem_ack when lpc_val='1' and lpc_wr='0' else
401 26 nuubik
                           (not dbg_almost_full) when lpc_val='1' and lpc_wr='1' else
402 2 nuubik
                           '0';
403
 
404
 
405
 
406
        SYNC1: process (lclk, lreset_n)  --c33
407
        begin
408
                if lclk'event and lclk = '1' then    -- rising clock edge
409
                        c33_mem_ack <= mem_ack;
410
 
411
                end if;
412
        end process SYNC1;
413
 
414
 
415 26 nuubik
        dbg_data <= lpc_debug(7 downto 0);
416
        SYNC2: process (sys_clk) --c25
417 2 nuubik
        begin
418
                if sys_clk'event and sys_clk = '1' then    -- rising clock edge
419 26 nuubik
                        c25_lpc_val <= lpc_val;         --syncro two clock domains
420
                        c25_lpc_wr <= c33_lpc_wr;       --syncro two clock domains
421
                        c25_dbg_addr_d <= c33_dbg_addr_d; --syncro two clock domains
422
                        if usb_mode_en ='0' and c25_dbg_addr_d=x"80" then  --don't fill fifo in regular mode
423
                                dbg_wr<= c25_lpc_wr; --c33_lpc_wr_wait;--c33_lpc_wr_wait;
424
                        else
425
                                dbg_wr<='0';   --write never rises when usb_mode_en = 1
426
                        end if;
427
                end if;
428 2 nuubik
        end process SYNC2;
429
 
430
 
431
 
432
        LATCHled: process (lclk,lreset_n)  --c33
433
        begin
434
                if lreset_n='0' then
435
                        lpc_debug(7 downto 0)<=(others=>'0');
436 26 nuubik
                        c33_dbg_addr_d <=(others=>'0');
437 2 nuubik
                        enable_4meg <='0';
438
                        c33_lpc_wr <='0';
439 35 nuubik
                        dongle_con_n <='0';  -- pin 3 in GPIO make it toggleable
440 2 nuubik
                elsif lclk'event and lclk = '1' then    -- rising clock edge
441 26 nuubik
                        c33_lpc_wr <= lpc_wr;
442 2 nuubik
                        if c33_lpc_wr='0' and  lpc_wr='1' then
443 26 nuubik
                                c33_dbg_addr_d <= lpc_addr(7 downto 0);
444 2 nuubik
                                lpc_debug(7 downto 0)<= lpc_data_o;
445 35 nuubik
                                if lpc_addr(7 downto 0)=x"88" and lpc_data_o=x"F4" then   --Flash 4 Mega enable (LSN is first MSN is second)
446 2 nuubik
                                        enable_4meg <='1';
447 35 nuubik
                                elsif lpc_addr(7 downto 0)=x"88" and lpc_data_o=x"F1" then --Flash 1 Mega enalbe
448 2 nuubik
                                        enable_4meg <='0';
449 35 nuubik
                                elsif lpc_addr(7 downto 0)=x"88" and lpc_data_o=x"D1" then --Set Dongle not attached signal
450
                                        dongle_con_n <='1';  -- pin 3 in GPIO make it 1
451
                                elsif lpc_addr(7 downto 0)=x"88" and lpc_data_o=x"D0" then --Set Dongle attached signal
452
                                        dongle_con_n <='0';  -- pin 3 in GPIO make it 1                                                                          
453 2 nuubik
                                end if;
454 49 nuubik
                        else
455
                                if force_4meg_n='0' then -- active low (always force when jumper on)
456
                                        enable_4meg <='1';
457
                                end if;
458 2 nuubik
                        end if;
459
                end if;
460
        end process LATCHled;
461
 
462
 
463
 
464
 
465
 
466
 
467
--END memory data bus logic
468
fl_ce_n<= fl_ce_n_w;
469
fl_oe_n<= fl_oe_n_w;
470
 
471
FLASH : flash_if
472
  port map(
473
    clk       => sys_clk, -- in  std_logic;
474
    reset_n   => resetn, -- in  std_logic;
475
    --flash Bus
476
    fl_addr   => fl_addr, -- out std_logic_vector(23 downto 0);
477
    fl_ce_n      => fl_ce_n_w, -- out std_logic;       --chip select
478
    fl_oe_n      => fl_oe_n_w, -- buffer std_logic;    --output enable for flash
479
    fl_we_n      => fl_we_n, -- out std_logic;       --write enable
480
    fl_data      => fl_data, -- inout std_logic_vector(15 downto 0);
481
    fl_rp_n      => fl_rp_n, -- out std_logic;       --reset signal
482
    --fl_byte_n    => fl_byte_n, -- out std_logic;     --hold in byte mode
483
    fl_sts       => fl_sts, -- in std_logic;        --status signal
484
    -- mem Bus
485
    mem_addr  => mem_addr, -- in std_logic_vector(23 downto 0);
486
    mem_do    => mem_do, -- out std_logic_vector(15 downto 0);
487
    mem_di    => mem_di, -- in  std_logic_vector(15 downto 0);
488
 
489
    mem_wr    => mem_wr, -- in  std_logic;  --write not read signal
490
    mem_val   => mem_val, -- in  std_logic;
491
    mem_ack   => mem_ack  -- out std_logic
492
    );
493
 
494
 
495
 
496
USB: usb2mem
497
  port map(
498
    clk25     => sys_clk, -- in  std_logic;
499
    reset_n   => resetn, -- in  std_logic;
500 26 nuubik
        dongle_ver => dongle_ver,
501 2 nuubik
    -- mem Bus
502 26 nuubik
    mem_busy_n=> fl_sts,  --check flash status before starting new command on flash
503
        mem_idle  => mem_idle,
504 2 nuubik
    mem_addr  => umem_addr, -- out std_logic_vector(23 downto 0);
505
    mem_do    => umem_do, -- out std_logic_vector(15 downto 0);
506
    mem_di    => mem_do, -- in std_logic_vector(15 downto 0);   --from flash
507
    mem_wr    => umem_wr, -- out std_logic;
508
    mem_val   => umem_val, -- out std_logic;
509
    mem_ack   => umem_ack, -- in  std_logic;  --from flash
510
    mem_cmd   => umem_cmd, -- out std_logic;
511
    -- USB port
512 26 nuubik
        usb_mode_en => usb_mode_en,
513 2 nuubik
    usb_rd_n   => usb_rd_n, -- out  std_logic;  -- enables out data if low (next byte detected by edge / in usb chip)
514
    usb_wr     => usb_wr, -- out  std_logic;  -- write performed on edge \ of signal
515
    usb_txe_n  => usb_txe_n, -- in   std_logic;  -- tx fifo empty (redy for new data if low)
516
    usb_rxf_n  => usb_rxf_n, -- in   std_logic;  -- rx fifo empty (data redy if low)
517
    usb_bd     => usb_bd -- inout  std_logic_vector(7 downto 0) --bus data
518
    );
519
 
520
 
521 26 nuubik
DBG : pc_serializer
522
    port map ( --system signals
523
           sys_clk => sys_clk, -- in  STD_LOGIC;
524
           resetn  => resetn, -- in  STD_LOGIC;            
525
                   --postcode data port
526
           dbg_data => dbg_data, -- in  STD_LOGIC_VECTOR (7 downto 0);
527
           dbg_wr   => dbg_wr, -- in  STD_LOGIC;   --write not read
528
                   dbg_full => dbg_full,--: out STD_LOGIC;   --write not read
529
                   dbg_almost_full       => dbg_almost_full,
530
                   dbg_usedw     => dbg_usedw,
531
 
532
                   --debug USB port
533
                   dbg_usb_mode_en=> dbg_usb_mode_en, -- in   std_logic;  -- enable this debug mode
534
                   dbg_usb_wr     => usb_wr, -- out  std_logic;  -- write performed on edge \ of signal
535
                   dbg_usb_txe_n  => usb_txe_n, -- in   std_logic;  -- tx fifo not full (redy for new data if low)
536
                   dbg_usb_bd     => usb_bd -- inout  std_logic_vector(7 downto 0) --bus data
537
);
538
 
539
 
540 2 nuubik
--END MAIN DATAPATH CONNECTIONS
541
 
542
end rtl;
543
 
544
 
545
 

powered by: WebSVN 2.1.0

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