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

Subversion Repositories dbg_interface

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

powered by: WebSVN 2.1.0

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