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

Subversion Repositories dbg_interface

[/] [dbg_interface/] [tags/] [rel_19/] [rtl/] [verilog/] [dbg_top.v] - Blame information for rev 158

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 mohor
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  dbg_top.v                                                   ////
4
////                                                              ////
5
////                                                              ////
6
////  This file is part of the SoC/OpenRISC Development Interface ////
7 36 mohor
////  http://www.opencores.org/projects/DebugInterface/           ////
8 2 mohor
////                                                              ////
9
////  Author(s):                                                  ////
10 81 mohor
////       Igor Mohor (igorm@opencores.org)                       ////
11 2 mohor
////                                                              ////
12
////                                                              ////
13 81 mohor
////  All additional information is avaliable in the README.txt   ////
14 2 mohor
////  file.                                                       ////
15
////                                                              ////
16
//////////////////////////////////////////////////////////////////////
17
////                                                              ////
18 81 mohor
//// Copyright (C) 2000 - 2003 Authors                            ////
19 2 mohor
////                                                              ////
20
//// This source file may be used and distributed without         ////
21
//// restriction provided that this copyright statement is not    ////
22
//// removed from the file and that any derivative work contains  ////
23
//// the original copyright notice and the associated disclaimer. ////
24
////                                                              ////
25
//// This source file is free software; you can redistribute it   ////
26
//// and/or modify it under the terms of the GNU Lesser General   ////
27
//// Public License as published by the Free Software Foundation; ////
28
//// either version 2.1 of the License, or (at your option) any   ////
29
//// later version.                                               ////
30
////                                                              ////
31
//// This source is distributed in the hope that it will be       ////
32
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
33
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
34
//// PURPOSE.  See the GNU Lesser General Public License for more ////
35
//// details.                                                     ////
36
////                                                              ////
37
//// You should have received a copy of the GNU Lesser General    ////
38
//// Public License along with this source; if not, download it   ////
39
//// from http://www.opencores.org/lgpl.shtml                     ////
40
////                                                              ////
41
//////////////////////////////////////////////////////////////////////
42
//
43
// CVS Revision History
44
//
45
// $Log: not supported by cvs2svn $
46 123 mohor
// Revision 1.40  2004/01/20 14:23:47  mohor
47
// Define name changed.
48
//
49 117 mohor
// Revision 1.39  2004/01/19 07:32:41  simons
50
// Reset values width added because of FV, a good sentence changed because some tools can not handle it.
51
//
52 108 simons
// Revision 1.38  2004/01/18 09:22:47  simons
53
// Sensitivity list updated.
54
//
55 106 simons
// Revision 1.37  2004/01/17 17:01:14  mohor
56
// Almost finished.
57
//
58 101 mohor
// Revision 1.36  2004/01/16 14:51:33  mohor
59
// cpu registers added.
60
//
61 99 mohor
// Revision 1.35  2004/01/14 22:59:16  mohor
62
// Temp version.
63
//
64 95 mohor
// Revision 1.34  2003/12/23 15:07:34  mohor
65
// New directory structure. New version of the debug interface.
66
// Files that are not needed removed.
67
//
68 81 mohor
// Revision 1.33  2003/10/23 16:17:01  mohor
69
// CRC logic changed.
70
//
71 73 mohor
// Revision 1.32  2003/09/18 14:00:47  simons
72
// Lower two address lines must be always zero.
73
//
74 67 simons
// Revision 1.31  2003/09/17 14:38:57  simons
75
// WB_CNTL register added, some syncronization fixes.
76
//
77 65 simons
// Revision 1.30  2003/08/28 13:55:22  simons
78
// Three more chains added for cpu debug access.
79
//
80 63 simons
// Revision 1.29  2003/07/31 12:19:49  simons
81
// Multiple cpu support added.
82
//
83 57 simons
// Revision 1.28  2002/11/06 14:22:41  mohor
84
// Trst signal is not inverted here any more. Inverted on higher layer !!!.
85
//
86 52 mohor
// Revision 1.27  2002/10/10 02:42:55  mohor
87 73 mohor
// WISHBONE Scan Chain is changed to reflect state of the WISHBONE access (WBInProgress bit added). 
88
// Internal counter is used (counts 256 wb_clk cycles) and when counter exceeds that value, 
89
// wb_cyc_o is negated.
90 52 mohor
//
91 51 mohor
// Revision 1.26  2002/05/07 14:43:59  mohor
92
// mon_cntl_o signals that controls monitor mux added.
93
//
94 47 mohor
// Revision 1.25  2002/04/22 12:54:11  mohor
95
// Signal names changed to lower case.
96
//
97 44 mohor
// Revision 1.24  2002/04/17 13:17:01  mohor
98
// Intentional error removed.
99
//
100 43 mohor
// Revision 1.23  2002/04/17 11:16:33  mohor
101
// A block for checking possible simulation/synthesis missmatch added.
102
//
103 42 mohor
// Revision 1.22  2002/03/12 10:31:53  mohor
104
// tap_top and dbg_top modules are put into two separate modules. tap_top
105
// contains only tap state machine and related logic. dbg_top contains all
106
// logic necessery for debugging.
107
//
108 37 mohor
// Revision 1.21  2002/03/08 15:28:16  mohor
109
// Structure changed. Hooks for jtag chain added.
110
//
111 36 mohor
// Revision 1.20  2002/02/06 12:23:09  mohor
112 81 mohor
// latched_jtag_ir used when muxing TDO instead of JTAG_IR.
113 36 mohor
//
114 33 mohor
// Revision 1.19  2002/02/05 13:34:51  mohor
115
// Stupid bug that was entered by previous update fixed.
116
//
117 32 mohor
// Revision 1.18  2002/02/05 12:41:01  mohor
118
// trst synchronization is not needed and was removed.
119
//
120 31 mohor
// Revision 1.17  2002/01/25 07:58:35  mohor
121
// IDCODE bug fixed, chains reused to decreas size of core. Data is shifted-in
122
// not filled-in. Tested in hw.
123
//
124 30 mohor
// Revision 1.16  2001/12/20 11:17:26  mohor
125
// TDO and TDO Enable signal are separated into two signals.
126
//
127 28 mohor
// Revision 1.15  2001/12/05 13:28:21  mohor
128
// trst signal is synchronized to wb_clk_i.
129
//
130 25 mohor
// Revision 1.14  2001/11/28 09:36:15  mohor
131
// Register length fixed.
132
//
133 22 mohor
// Revision 1.13  2001/11/27 13:37:43  mohor
134
// CRC is returned when chain selection data is transmitted.
135
//
136 21 mohor
// Revision 1.12  2001/11/26 10:47:09  mohor
137
// Crc generation is different for read or write commands. Small synthesys fixes.
138
//
139 20 mohor
// Revision 1.11  2001/11/14 10:10:41  mohor
140
// Wishbone data latched on wb_clk_i instead of risc_clk.
141
//
142 19 mohor
// Revision 1.10  2001/11/12 01:11:27  mohor
143
// Reset signals are not combined any more.
144
//
145 18 mohor
// Revision 1.9  2001/10/19 11:40:01  mohor
146
// dbg_timescale.v changed to timescale.v This is done for the simulation of
147
// few different cores in a single project.
148
//
149 17 mohor
// Revision 1.8  2001/10/17 10:39:03  mohor
150
// bs_chain_o added.
151
//
152 15 mohor
// Revision 1.7  2001/10/16 10:09:56  mohor
153
// Signal names changed to lowercase.
154 13 mohor
//
155 15 mohor
//
156 13 mohor
// Revision 1.6  2001/10/15 09:55:47  mohor
157
// Wishbone interface added, few fixes for better performance,
158
// hooks for boundary scan testing added.
159
//
160 12 mohor
// Revision 1.5  2001/09/24 14:06:42  mohor
161
// Changes connected to the OpenRISC access (SPR read, SPR write).
162
//
163 11 mohor
// Revision 1.4  2001/09/20 10:11:25  mohor
164
// Working version. Few bugs fixed, comments added.
165
//
166 9 mohor
// Revision 1.3  2001/09/19 11:55:13  mohor
167
// Asynchronous set/reset not used in trace any more.
168
//
169 8 mohor
// Revision 1.2  2001/09/18 14:13:47  mohor
170
// Trace fixed. Some registers changed, trace simplified.
171
//
172 5 mohor
// Revision 1.1.1.1  2001/09/13 13:49:19  mohor
173
// Initial official release.
174
//
175 2 mohor
// Revision 1.3  2001/06/01 22:22:35  mohor
176
// This is a backup. It is not a fully working version. Not for use, yet.
177
//
178
// Revision 1.2  2001/05/18 13:10:00  mohor
179
// Headers changed. All additional information is now avaliable in the README.txt file.
180
//
181
// Revision 1.1.1.1  2001/05/18 06:35:02  mohor
182
// Initial release
183
//
184
//
185
 
186 20 mohor
// synopsys translate_off
187 17 mohor
`include "timescale.v"
188 20 mohor
// synopsys translate_on
189 2 mohor
`include "dbg_defines.v"
190 101 mohor
`include "dbg_cpu_defines.v"
191 2 mohor
 
192
// Top module
193 9 mohor
module dbg_top(
194 81 mohor
                // JTAG signals
195
                tck_i,
196
                tdi_i,
197
                tdo_o,
198 57 simons
 
199 81 mohor
                // TAP states
200
                shift_dr_i,
201
                pause_dr_i,
202
                update_dr_i,
203
 
204
                // Instructions
205
                debug_select_i,
206
 
207 12 mohor
                // WISHBONE common signals
208 101 mohor
                wb_rst_i,
209
                wb_clk_i,
210 81 mohor
 
211 12 mohor
                // WISHBONE master interface
212 101 mohor
                wb_adr_o,
213
                wb_dat_o,
214
                wb_dat_i,
215
                wb_cyc_o,
216
                wb_stb_o,
217
                wb_sel_o,
218
                wb_we_o,
219
                wb_ack_i,
220
                wb_cab_o,
221
                wb_err_i,
222
                wb_cti_o,
223
                wb_bte_o,
224
 
225
                // CPU signals
226
                cpu_clk_i,
227
                cpu_addr_o,
228
                cpu_data_i,
229
                cpu_data_o,
230
                cpu_bp_i,
231
                cpu_stall_o,
232
                cpu_stall_all_o,
233
                cpu_stb_o,
234
                cpu_sel_o,
235
                cpu_we_o,
236
                cpu_ack_i,
237
                cpu_rst_o
238 2 mohor
              );
239
 
240
 
241 81 mohor
// JTAG signals
242
input   tck_i;
243
input   tdi_i;
244
output  tdo_o;
245 2 mohor
 
246 81 mohor
// TAP states
247
input   shift_dr_i;
248
input   pause_dr_i;
249
input   update_dr_i;
250 2 mohor
 
251 81 mohor
// Instructions
252
input   debug_select_i;
253 2 mohor
 
254 12 mohor
// WISHBONE common signals
255 9 mohor
input         wb_rst_i;                   // WISHBONE reset
256 12 mohor
input         wb_clk_i;                   // WISHBONE clock
257 81 mohor
 
258 12 mohor
// WISHBONE master interface
259
output [31:0] wb_adr_o;
260
output [31:0] wb_dat_o;
261
input  [31:0] wb_dat_i;
262
output        wb_cyc_o;
263
output        wb_stb_o;
264
output  [3:0] wb_sel_o;
265
output        wb_we_o;
266
input         wb_ack_i;
267
output        wb_cab_o;
268
input         wb_err_i;
269 81 mohor
output  [2:0] wb_cti_o;
270
output  [1:0] wb_bte_o;
271 9 mohor
 
272 101 mohor
// CPU signals
273
input         cpu_clk_i;
274
output [31:0] cpu_addr_o;
275
input  [31:0] cpu_data_i;
276
output [31:0] cpu_data_o;
277
input         cpu_bp_i;
278
output        cpu_stall_o;
279
output        cpu_stall_all_o;
280
output        cpu_stb_o;
281
output [`CPU_NUM -1:0]  cpu_sel_o;
282
output        cpu_we_o;
283
input         cpu_ack_i;
284
output        cpu_rst_o;
285 2 mohor
 
286 81 mohor
reg     cpu_debug_scan_chain;
287
reg     wishbone_scan_chain;
288 2 mohor
 
289 81 mohor
reg [`DATA_CNT -1:0]        data_cnt;
290
reg [`CRC_CNT -1:0]         crc_cnt;
291
reg [`STATUS_CNT -1:0]      status_cnt;
292
reg [`CHAIN_DATA_LEN -1:0]  chain_dr;
293
reg [`CHAIN_ID_LENGTH -1:0] chain;
294 9 mohor
 
295 99 mohor
wire chain_latch_en;
296 81 mohor
wire data_cnt_end;
297
wire crc_cnt_end;
298
wire status_cnt_end;
299
reg  crc_cnt_end_q;
300
reg  chain_select;
301
reg  chain_select_error;
302
wire crc_out;
303
wire crc_match;
304
wire crc_en_wb;
305 99 mohor
wire crc_en_cpu;
306 81 mohor
wire shift_crc_wb;
307 99 mohor
wire shift_crc_cpu;
308 36 mohor
 
309 81 mohor
wire data_shift_en;
310
wire selecting_command;
311 2 mohor
 
312 81 mohor
reg tdo_o;
313
reg wishbone_ce;
314 99 mohor
reg cpu_ce;
315 73 mohor
 
316 99 mohor
wire tdi_wb;
317
wire tdi_cpu;
318
 
319
wire tdo_wb;
320
wire tdo_cpu;
321
 
322
wire shift_crc;
323
 
324 81 mohor
// data counter
325 95 mohor
always @ (posedge tck_i or posedge wb_rst_i)
326 81 mohor
begin
327 95 mohor
  if (wb_rst_i)
328 108 simons
    data_cnt <= #1 {`DATA_CNT{1'b0}};
329 81 mohor
  else if(shift_dr_i & (~data_cnt_end))
330
    data_cnt <= #1 data_cnt + 1'b1;
331
  else if (update_dr_i)
332 108 simons
    data_cnt <= #1 {`DATA_CNT{1'b0}};
333 81 mohor
end
334 9 mohor
 
335 11 mohor
 
336 81 mohor
assign data_cnt_end = data_cnt == `CHAIN_DATA_LEN;
337 2 mohor
 
338
 
339 81 mohor
// crc counter
340 95 mohor
always @ (posedge tck_i or posedge wb_rst_i)
341 2 mohor
begin
342 95 mohor
  if (wb_rst_i)
343 108 simons
    crc_cnt <= #1 {`CRC_CNT{1'b0}};
344 81 mohor
  else if(shift_dr_i & data_cnt_end & (~crc_cnt_end) & chain_select)
345
    crc_cnt <= #1 crc_cnt + 1'b1;
346
  else if (update_dr_i)
347 108 simons
    crc_cnt <= #1 {`CRC_CNT{1'b0}};
348 2 mohor
end
349
 
350 81 mohor
assign crc_cnt_end = crc_cnt == `CRC_LEN;
351 2 mohor
 
352 12 mohor
 
353 123 mohor
always @ (posedge tck_i or posedge wb_rst_i)
354
begin
355
  if (wb_rst_i)
356
    crc_cnt_end_q  <= #1 1'b0;
357
  else
358 81 mohor
    crc_cnt_end_q  <= #1 crc_cnt_end;
359 123 mohor
end
360 20 mohor
 
361 2 mohor
 
362 81 mohor
// status counter
363 95 mohor
always @ (posedge tck_i or posedge wb_rst_i)
364 2 mohor
begin
365 95 mohor
  if (wb_rst_i)
366 108 simons
    status_cnt <= #1 {`STATUS_CNT{1'b0}};
367 81 mohor
  else if(shift_dr_i & crc_cnt_end & (~status_cnt_end))
368
    status_cnt <= #1 status_cnt + 1'b1;
369
  else if (update_dr_i)
370 108 simons
    status_cnt <= #1 {`STATUS_CNT{1'b0}};
371 2 mohor
end
372
 
373 81 mohor
assign status_cnt_end = status_cnt == `STATUS_LEN;
374 42 mohor
 
375
 
376 81 mohor
assign selecting_command = shift_dr_i & (data_cnt == `DATA_CNT'h0) & debug_select_i;
377 42 mohor
 
378
 
379 95 mohor
always @ (posedge tck_i or posedge wb_rst_i)
380 2 mohor
begin
381 95 mohor
  if (wb_rst_i)
382 81 mohor
    chain_select <= #1 1'b0;
383
  else if(selecting_command & tdi_i)       // Chain select
384
    chain_select <= #1 1'b1;
385
  else if (update_dr_i)
386
    chain_select <= #1 1'b0;
387 2 mohor
end
388
 
389
 
390 81 mohor
always @ (chain)
391 2 mohor
begin
392 81 mohor
  cpu_debug_scan_chain  <= #1 1'b0;
393
  wishbone_scan_chain   <= #1 1'b0;
394
  chain_select_error    <= #1 1'b0;
395
 
396
  case (chain)                /* synthesis parallel_case */
397
    `CPU_DEBUG_CHAIN      :   cpu_debug_scan_chain  <= #1 1'b1;
398 117 mohor
    `WISHBONE_DEBUG_CHAIN :   wishbone_scan_chain   <= #1 1'b1;
399 81 mohor
    default               :   chain_select_error    <= #1 1'b1;
400
  endcase
401 2 mohor
end
402
 
403 20 mohor
 
404 99 mohor
assign chain_latch_en = chain_select & crc_cnt_end & (~crc_cnt_end_q);
405
 
406
 
407 95 mohor
always @ (posedge tck_i or posedge wb_rst_i)
408 67 simons
begin
409 95 mohor
  if (wb_rst_i)
410 81 mohor
    chain <= `CHAIN_ID_LENGTH'b111;
411 99 mohor
  else if(chain_latch_en & crc_match)
412 81 mohor
    chain <= #1 chain_dr[`CHAIN_DATA_LEN -1:1];
413 67 simons
end
414
 
415 2 mohor
 
416 81 mohor
assign data_shift_en = shift_dr_i & (~data_cnt_end);
417 2 mohor
 
418
 
419 123 mohor
always @ (posedge tck_i or posedge wb_rst_i)
420 2 mohor
begin
421 123 mohor
  if (wb_rst_i)
422
    chain_dr <= #1 `CHAIN_DATA_LEN'h0;
423
  else if (data_shift_en)
424 81 mohor
    chain_dr[`CHAIN_DATA_LEN -1:0] <= #1 {tdi_i, chain_dr[`CHAIN_DATA_LEN -1:1]};
425 2 mohor
end
426
 
427
 
428 81 mohor
// Calculating crc for input data
429
dbg_crc32_d1 i_dbg_crc32_d1_in
430
             (
431
              .data       (tdi_i),
432
              .enable     (shift_dr_i),
433
              .shift      (1'b0),
434 95 mohor
              .rst        (wb_rst_i),
435 81 mohor
              .sync_rst   (update_dr_i),
436
              .crc_out    (),
437
              .clk        (tck_i),
438
              .crc_match  (crc_match)
439
             );
440 2 mohor
 
441 12 mohor
 
442 81 mohor
reg tdo_chain_select;
443
wire crc_en;
444
wire crc_en_dbg;
445
reg crc_started;
446 99 mohor
assign crc_en = crc_en_dbg | crc_en_wb | crc_en_cpu;
447 81 mohor
assign crc_en_dbg = shift_dr_i & crc_cnt_end & (~status_cnt_end);
448 12 mohor
 
449 123 mohor
always @ (posedge tck_i or posedge wb_rst_i)
450 12 mohor
begin
451 123 mohor
  if (wb_rst_i)
452
    crc_started <= #1 1'b0;
453
  else if (crc_en)
454 81 mohor
    crc_started <= #1 1'b1;
455
  else if (update_dr_i)
456
    crc_started <= #1 1'b0;
457 12 mohor
end
458
 
459
 
460 81 mohor
reg tdo_tmp;
461 12 mohor
 
462 51 mohor
 
463 81 mohor
// Calculating crc for input data
464
dbg_crc32_d1 i_dbg_crc32_d1_out
465
             (
466
              .data       (tdo_tmp),
467
              .enable     (crc_en), // enable has priority
468
//              .shift      (1'b0),
469
              .shift      (shift_dr_i & crc_started & (~crc_en)),
470 95 mohor
              .rst        (wb_rst_i),
471 81 mohor
              .sync_rst   (update_dr_i),
472
              .crc_out    (crc_out),
473
              .clk        (tck_i),
474
              .crc_match  ()
475
             );
476 51 mohor
 
477 81 mohor
// Following status is shifted out: 
478
// 1. bit:          1 if crc is OK, else 0
479
// 2. bit:          1 if command is "chain select", else 0
480
// 3. bit:          1 if non-existing chain is selected else 0
481
// 4. bit:          always 1
482 51 mohor
 
483 81 mohor
reg [799:0] current_on_tdo;
484 51 mohor
 
485 81 mohor
always @ (status_cnt or chain_select or crc_match or chain_select_error or crc_out)
486 51 mohor
begin
487 81 mohor
  case (status_cnt)                   /* synthesis full_case parallel_case */
488
    `STATUS_CNT'd0  : begin
489
                        tdo_chain_select = crc_match;
490
                        current_on_tdo = "crc_match";
491
                      end
492
    `STATUS_CNT'd1  : begin
493
                        tdo_chain_select = chain_select;
494
                        current_on_tdo = "chain_select";
495
                      end
496
    `STATUS_CNT'd2  : begin
497
                        tdo_chain_select = chain_select_error;
498
                        current_on_tdo = "chain_select_error";
499
                      end
500
    `STATUS_CNT'd3  : begin
501
                        tdo_chain_select = 1'b1;
502
                        current_on_tdo = "one 1";
503
                      end
504
    `STATUS_CNT'd4  : begin
505
                        tdo_chain_select = crc_out;
506
                  //      tdo_chain_select = 1'hz;
507
                        current_on_tdo = "crc_out";
508
                      end
509
  endcase
510 51 mohor
end
511
 
512
 
513 5 mohor
 
514 99 mohor
 
515
assign shift_crc = shift_crc_wb | shift_crc_cpu;
516
 
517 106 simons
always @ (shift_crc or crc_out or wishbone_ce or tdo_wb  or tdo_cpu or tdo_chain_select or cpu_ce)
518 11 mohor
begin
519 99 mohor
  if (shift_crc)          // shifting crc
520 81 mohor
    tdo_tmp = crc_out;
521
  else if (wishbone_ce)   //  shifting data from wb
522
    tdo_tmp = tdo_wb;
523 99 mohor
  else if (cpu_ce)        // shifting data from cpu
524
    tdo_tmp = tdo_cpu;
525 11 mohor
  else
526 81 mohor
    tdo_tmp = tdo_chain_select;
527 11 mohor
end
528 9 mohor
 
529 11 mohor
 
530 81 mohor
always @ (negedge tck_i)
531 2 mohor
begin
532 81 mohor
  tdo_o <= #1 tdo_tmp;
533 2 mohor
end
534
 
535
 
536
 
537
 
538 81 mohor
// Signals for WISHBONE module
539 9 mohor
 
540
 
541 95 mohor
always @ (posedge tck_i or posedge wb_rst_i)
542 2 mohor
begin
543 95 mohor
  if (wb_rst_i)
544 99 mohor
    begin
545
      wishbone_ce <= #1 1'b0;
546
      cpu_ce <= #1 1'b0;
547
    end
548
  else if(selecting_command & (~tdi_i))
549
    begin
550
      if (wishbone_scan_chain)      // wishbone CE
551
        wishbone_ce <= #1 1'b1;
552
      if (cpu_debug_scan_chain)     // CPU CE
553
        cpu_ce <= #1 1'b1;
554
    end
555 81 mohor
  else if (update_dr_i)   // igor !!! This needs to be changed?
556 99 mohor
    begin
557
      wishbone_ce <= #1 1'b0;
558
      cpu_ce <= #1 1'b0;
559
    end
560 2 mohor
end
561
 
562
 
563 99 mohor
assign tdi_wb  = wishbone_ce & tdi_i;
564
assign tdi_cpu = cpu_ce & tdi_i;
565 2 mohor
 
566 99 mohor
 
567 81 mohor
// Connecting wishbone module
568
dbg_wb i_dbg_wb (
569
                  // JTAG signals
570 101 mohor
                  .tck_i            (tck_i),
571
                  .tdi_i            (tdi_wb),
572
                  .tdo_o            (tdo_wb),
573 2 mohor
 
574 81 mohor
                  // TAP states
575 101 mohor
                  .shift_dr_i       (shift_dr_i),
576
                  .pause_dr_i       (pause_dr_i),
577
                  .update_dr_i      (update_dr_i),
578 2 mohor
 
579 101 mohor
                  .wishbone_ce_i    (wishbone_ce),
580
                  .crc_match_i      (crc_match),
581
                  .crc_en_o         (crc_en_wb),
582
                  .shift_crc_o      (shift_crc_wb),
583
                  .rst_i            (wb_rst_i),
584 2 mohor
 
585 81 mohor
                  // WISHBONE common signals
586 101 mohor
                  .wb_clk_i         (wb_clk_i),
587 5 mohor
 
588 81 mohor
                  // WISHBONE master interface
589 101 mohor
                  .wb_adr_o         (wb_adr_o),
590
                  .wb_dat_o         (wb_dat_o),
591
                  .wb_dat_i         (wb_dat_i),
592
                  .wb_cyc_o         (wb_cyc_o),
593
                  .wb_stb_o         (wb_stb_o),
594
                  .wb_sel_o         (wb_sel_o),
595
                  .wb_we_o          (wb_we_o),
596
                  .wb_ack_i         (wb_ack_i),
597
                  .wb_cab_o         (wb_cab_o),
598
                  .wb_err_i         (wb_err_i),
599
                  .wb_cti_o         (wb_cti_o),
600
                  .wb_bte_o         (wb_bte_o)
601 81 mohor
            );
602 2 mohor
 
603 99 mohor
 
604
// Connecting cpu module
605
dbg_cpu i_dbg_cpu (
606
                  // JTAG signals
607 101 mohor
                  .tck_i            (tck_i),
608
                  .tdi_i            (tdi_cpu),
609
                  .tdo_o            (tdo_cpu),
610 99 mohor
 
611
                  // TAP states
612 101 mohor
                  .shift_dr_i       (shift_dr_i),
613
                  .pause_dr_i       (pause_dr_i),
614
                  .update_dr_i      (update_dr_i),
615 99 mohor
 
616 101 mohor
                  .cpu_ce_i         (cpu_ce),
617
                  .crc_match_i      (crc_match),
618
                  .crc_en_o         (crc_en_cpu),
619
                  .shift_crc_o      (shift_crc_cpu),
620
                  .rst_i            (wb_rst_i),
621
 
622
                  // CPU signals
623
                  .cpu_clk_i        (cpu_clk_i),
624
                  .cpu_addr_o       (cpu_addr_o),
625
                  .cpu_data_i       (cpu_data_i),
626
                  .cpu_data_o       (cpu_data_o),
627
                  .cpu_bp_i         (cpu_bp_i),
628
                  .cpu_stall_o      (cpu_stall_o),
629
                  .cpu_stall_all_o  (cpu_stall_all_o),
630
                  .cpu_stb_o        (cpu_stb_o),
631
                  .cpu_sel_o        (cpu_sel_o),
632
                  .cpu_we_o         (cpu_we_o),
633
                  .cpu_ack_i        (cpu_ack_i),
634
                  .cpu_rst_o        (cpu_rst_o)
635
 
636
 
637 99 mohor
              );
638
 
639
 
640 9 mohor
endmodule

powered by: WebSVN 2.1.0

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