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

Subversion Repositories or1200_soc

[/] [or1200_soc/] [trunk/] [src/] [soc_adv_dbg.v] - Blame information for rev 26

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 25 qaztronic
// --------------------------------------------------------------------
2
//
3
// --------------------------------------------------------------------
4
 
5
 
6
`include "timescale.v"
7
`include "soc_defines.v"
8
 
9
 
10
module soc_adv_dbg
11
  #(
12
    parameter ALTERA_JTAG = 1
13
  )
14
  (
15
`ifdef USE_EXT_JTAG
16
     input         jtag_tck_i,
17
     input         jtag_tms_i,
18
     input         jtag_tdo_i,
19
     output        jtag_tdi_o,
20
`endif
21
 
22
     input         wb_clk_i,
23
     output [31:0] wb_adr_o,
24
     output [31:0] wb_dat_o,
25
     input  [31:0] wb_dat_i,
26
     output        wb_cyc_o,
27
     output        wb_stb_o,
28
     output [3:0]  wb_sel_o,
29
     output        wb_we_o,
30
     input         wb_ack_i,
31
     output        wb_cab_o,
32
     input         wb_err_i,
33
     output [2:0]  wb_cti_o,
34
     output [1:0]  wb_bte_o,
35
 
36
     // CPU signals
37
     input         cpu0_clk_i,
38
     output [31:0] cpu0_addr_o,
39
     input  [31:0] cpu0_data_i,
40
     output [31:0] cpu0_data_o,
41
     input         cpu0_bp_i,
42
     output        cpu0_stall_o,
43
     output        cpu0_stb_o,
44
     output        cpu0_we_o,
45
     input         cpu0_ack_i,
46
     output        cpu0_rst_o
47
 
48
  );
49
 
50
 
51
  //---------------------------------------------------
52
  // adbg_top
53
 
54
  // Connections between TAP and debug module
55
  wire capture_dr;
56
  wire shift_dr;
57
  wire pause_dr;
58
  wire update_dr;
59
  wire dbg_rst;
60
  wire dbg_tdi;
61
  wire dbg_tck;
62
  wire dbg_tdo;
63
  wire dbg_sel;
64
 
65
`ifdef USE_EXT_JTAG
66
  assign dbg_tck = jtag_tck_i;
67
`endif
68
 
69
  adbg_top
70
    i_adbg_top(
71
      .tck_i(dbg_tck),  // JTAG signals 
72
      .tdi_i(dbg_tdo),
73
      .tdo_o(dbg_tdi),
74
      .rst_i(dbg_rst),
75
 
76
      .shift_dr_i(shift_dr),   // TAP states
77
      .pause_dr_i(pause_dr),
78
      .update_dr_i(update_dr),
79
      .capture_dr_i(capture_dr),
80
      .debug_select_i(dbg_sel),  // Instructions
81
 
82
      .wb_clk_i(wb_clk_i),  // WISHBONE common signals
83
      .wb_adr_o(wb_adr_o),  // WISHBONE master interface
84
      .wb_dat_o(wb_dat_o),
85
      .wb_dat_i(wb_dat_i),
86
      .wb_cyc_o(wb_cyc_o),
87
      .wb_stb_o(wb_stb_o),
88
      .wb_sel_o(wb_sel_o),
89
      .wb_we_o(wb_we_o),
90
      .wb_ack_i(wb_ack_i),
91
      .wb_cab_o(wb_cab_o),
92
      .wb_err_i(wb_err_i),
93
      .wb_cti_o(wb_cti_o),
94
      .wb_bte_o(wb_bte_o),
95
      .cpu0_clk_i(cpu0_clk_i),  // CPU signals
96
      .cpu0_addr_o(cpu0_addr_o),
97
      .cpu0_data_i(cpu0_data_i),
98
      .cpu0_data_o(cpu0_data_o),
99
      .cpu0_bp_i(cpu0_bp_i),
100
      .cpu0_stall_o(cpu0_stall_o),
101
      .cpu0_stb_o(cpu0_stb_o),
102
      .cpu0_we_o(cpu0_we_o),
103
      .cpu0_ack_i(cpu0_ack_i),
104
      .cpu0_rst_o(cpu0_rst_o)
105
    );
106
 
107
 
108
  //---------------------------------------------------
109
  // JTAG TAP controller instantiation
110
  generate
111
    if( ALTERA_JTAG )
112
      begin
113
        altera_virtual_jtag
114
          i_altera_virtual_jtag(
115
            .tck_o(dbg_tck),
116
            .debug_tdo_i(dbg_tdi),
117
            .tdi_o(dbg_tdo),
118
            .test_logic_reset_o(dbg_rst),
119
            .run_test_idle_o(),
120
            .shift_dr_o(shift_dr),
121
            .capture_dr_o(capture_dr),
122
            .pause_dr_o(pause_dr),
123
            .update_dr_o(update_dr),
124
            .debug_select_o(dbg_sel)
125
          );
126
      end
127
    else
128
      begin
129
        tap_top
130
          i_tap (
131
            // JTAG pads
132
            .tms_pad_i(jtag_tms_i),
133
            .tck_pad_i(dbg_tck),
134
            .trstn_pad_i(1'b1),
135
            .tdi_pad_i(jtag_tdo_i),
136
            .tdo_pad_o(jtag_tdi_o),
137
            .tdo_padoe_o(),
138
 
139
            // TAP states
140
            .test_logic_reset_o(dbg_rst),
141
            .run_test_idle_o(),
142
            .shift_dr_o(shift_dr),
143
            .pause_dr_o(pause_dr),
144
            .update_dr_o(update_dr),
145
            .capture_dr_o(capture_dr),
146
 
147
            // Select signals for boundary scan or mbist
148
            .extest_select_o(),
149
            .sample_preload_select_o(),
150
            .mbist_select_o(),
151
            .debug_select_o(dbg_sel),
152
 
153
            // TDO signal that is connected to TDI of sub-modules.
154
            .tdi_o(dbg_tdo),
155
 
156
            // TDI signals from sub-modules
157
            .debug_tdo_i(dbg_tdi),    // from debug module
158
            .bs_chain_tdo_i(1'b0), // from Boundary Scan Chain
159
            .mbist_tdo_i(1'b0)     // from Mbist Chain
160
          );
161
      end
162
  endgenerate
163
 
164
 
165
  //---------------------------------------------------
166
  //
167
 
168
 
169
endmodule
170
 
171
 

powered by: WebSVN 2.1.0

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