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

Subversion Repositories dbg_interface

[/] [dbg_interface/] [tags/] [highland_ver1/] [rtl/] [verilog/] [dbg_top.v] - Blame information for rev 117

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

powered by: WebSVN 2.1.0

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