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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [fpga/] [altera_de0_nano_soc/] [doc/] [Terasic/] [DE0_NANO_SOC/] [Demonstrations/] [FPGA/] [DE0_NANO_SOC_ADC/] [DE0_NANO_SOC_QSYS/] [synthesis/] [submodules/] [DE0_NANO_SOC_QSYS_nios2_qsys_jtag_debug_module_tck.v] - Blame information for rev 221

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 221 olivier.gi
//Legal Notice: (C)2014 Altera Corporation. All rights reserved.  Your
2
//use of Altera Corporation's design tools, logic functions and other
3
//software and tools, and its AMPP partner logic functions, and any
4
//output files any of the foregoing (including device programming or
5
//simulation files), and any associated documentation or information are
6
//expressly subject to the terms and conditions of the Altera Program
7
//License Subscription Agreement or other applicable license agreement,
8
//including, without limitation, that your use is for the sole purpose
9
//of programming logic devices manufactured by Altera and sold by Altera
10
//or its authorized distributors.  Please refer to the applicable
11
//agreement for further details.
12
 
13
// synthesis translate_off
14
`timescale 1ns / 1ps
15
// synthesis translate_on
16
 
17
// turn off superfluous verilog processor warnings 
18
// altera message_level Level1 
19
// altera message_off 10034 10035 10036 10037 10230 10240 10030 
20
 
21
module DE0_NANO_SOC_QSYS_nios2_qsys_jtag_debug_module_tck (
22
                                                            // inputs:
23
                                                             MonDReg,
24
                                                             break_readreg,
25
                                                             dbrk_hit0_latch,
26
                                                             dbrk_hit1_latch,
27
                                                             dbrk_hit2_latch,
28
                                                             dbrk_hit3_latch,
29
                                                             debugack,
30
                                                             ir_in,
31
                                                             jtag_state_rti,
32
                                                             monitor_error,
33
                                                             monitor_ready,
34
                                                             reset_n,
35
                                                             resetlatch,
36
                                                             tck,
37
                                                             tdi,
38
                                                             tracemem_on,
39
                                                             tracemem_trcdata,
40
                                                             tracemem_tw,
41
                                                             trc_im_addr,
42
                                                             trc_on,
43
                                                             trc_wrap,
44
                                                             trigbrktype,
45
                                                             trigger_state_1,
46
                                                             vs_cdr,
47
                                                             vs_sdr,
48
                                                             vs_uir,
49
 
50
                                                            // outputs:
51
                                                             ir_out,
52
                                                             jrst_n,
53
                                                             sr,
54
                                                             st_ready_test_idle,
55
                                                             tdo
56
                                                          )
57
;
58
 
59
  output  [  1: 0] ir_out;
60
  output           jrst_n;
61
  output  [ 37: 0] sr;
62
  output           st_ready_test_idle;
63
  output           tdo;
64
  input   [ 31: 0] MonDReg;
65
  input   [ 31: 0] break_readreg;
66
  input            dbrk_hit0_latch;
67
  input            dbrk_hit1_latch;
68
  input            dbrk_hit2_latch;
69
  input            dbrk_hit3_latch;
70
  input            debugack;
71
  input   [  1: 0] ir_in;
72
  input            jtag_state_rti;
73
  input            monitor_error;
74
  input            monitor_ready;
75
  input            reset_n;
76
  input            resetlatch;
77
  input            tck;
78
  input            tdi;
79
  input            tracemem_on;
80
  input   [ 35: 0] tracemem_trcdata;
81
  input            tracemem_tw;
82
  input   [  6: 0] trc_im_addr;
83
  input            trc_on;
84
  input            trc_wrap;
85
  input            trigbrktype;
86
  input            trigger_state_1;
87
  input            vs_cdr;
88
  input            vs_sdr;
89
  input            vs_uir;
90
 
91
  reg     [  2: 0] DRsize /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"D101,D103,R101\""  */;
92
  wire             debugack_sync;
93
  reg     [  1: 0] ir_out;
94
  wire             jrst_n;
95
  wire             monitor_ready_sync;
96
  reg     [ 37: 0] sr /* synthesis ALTERA_ATTRIBUTE = "SUPPRESS_DA_RULE_INTERNAL=\"D101,D103,R101\""  */;
97
  wire             st_ready_test_idle;
98
  wire             tdo;
99
  wire             unxcomplemented_resetxx1;
100
  wire             unxcomplemented_resetxx2;
101
  always @(posedge tck)
102
    begin
103
      if (vs_cdr)
104
          case (ir_in)
105
 
106
              2'b00: begin
107
                  sr[35] <= debugack_sync;
108
                  sr[34] <= monitor_error;
109
                  sr[33] <= resetlatch;
110
                  sr[32 : 1] <= MonDReg;
111
                  sr[0] <= monitor_ready_sync;
112
              end // 2'b00 
113
 
114
              2'b01: begin
115
                  sr[35 : 0] <= tracemem_trcdata;
116
                  sr[37] <= tracemem_tw;
117
                  sr[36] <= tracemem_on;
118
              end // 2'b01 
119
 
120
              2'b10: begin
121
                  sr[37] <= trigger_state_1;
122
                  sr[36] <= dbrk_hit3_latch;
123
                  sr[35] <= dbrk_hit2_latch;
124
                  sr[34] <= dbrk_hit1_latch;
125
                  sr[33] <= dbrk_hit0_latch;
126
                  sr[32 : 1] <= break_readreg;
127
                  sr[0] <= trigbrktype;
128
              end // 2'b10 
129
 
130
              2'b11: begin
131
                  sr[15 : 2] <= trc_im_addr;
132
                  sr[1] <= trc_wrap;
133
                  sr[0] <= trc_on;
134
              end // 2'b11 
135
 
136
          endcase // ir_in
137
      if (vs_sdr)
138
          case (DRsize)
139
 
140
              3'b000: begin
141
                  sr <= {tdi, sr[37 : 2], tdi};
142
              end // 3'b000 
143
 
144
              3'b001: begin
145
                  sr <= {tdi, sr[37 : 9], tdi, sr[7 : 1]};
146
              end // 3'b001 
147
 
148
              3'b010: begin
149
                  sr <= {tdi, sr[37 : 17], tdi, sr[15 : 1]};
150
              end // 3'b010 
151
 
152
              3'b011: begin
153
                  sr <= {tdi, sr[37 : 33], tdi, sr[31 : 1]};
154
              end // 3'b011 
155
 
156
              3'b100: begin
157
                  sr <= {tdi, sr[37],         tdi, sr[35 : 1]};
158
              end // 3'b100 
159
 
160
              3'b101: begin
161
                  sr <= {tdi, sr[37 : 1]};
162
              end // 3'b101 
163
 
164
              default: begin
165
                  sr <= {tdi, sr[37 : 2], tdi};
166
              end // default
167
 
168
          endcase // DRsize
169
      if (vs_uir)
170
          case (ir_in)
171
 
172
              2'b00: begin
173
                  DRsize <= 3'b100;
174
              end // 2'b00 
175
 
176
              2'b01: begin
177
                  DRsize <= 3'b101;
178
              end // 2'b01 
179
 
180
              2'b10: begin
181
                  DRsize <= 3'b101;
182
              end // 2'b10 
183
 
184
              2'b11: begin
185
                  DRsize <= 3'b010;
186
              end // 2'b11 
187
 
188
          endcase // ir_in
189
    end
190
 
191
 
192
  assign tdo = sr[0];
193
  assign st_ready_test_idle = jtag_state_rti;
194
  assign unxcomplemented_resetxx1 = jrst_n;
195
  altera_std_synchronizer the_altera_std_synchronizer1
196
    (
197
      .clk (tck),
198
      .din (debugack),
199
      .dout (debugack_sync),
200
      .reset_n (unxcomplemented_resetxx1)
201
    );
202
 
203
  defparam the_altera_std_synchronizer1.depth = 2;
204
 
205
  assign unxcomplemented_resetxx2 = jrst_n;
206
  altera_std_synchronizer the_altera_std_synchronizer2
207
    (
208
      .clk (tck),
209
      .din (monitor_ready),
210
      .dout (monitor_ready_sync),
211
      .reset_n (unxcomplemented_resetxx2)
212
    );
213
 
214
  defparam the_altera_std_synchronizer2.depth = 2;
215
 
216
  always @(posedge tck or negedge jrst_n)
217
    begin
218
      if (jrst_n == 0)
219
          ir_out <= 2'b0;
220
      else
221
        ir_out <= {debugack_sync, monitor_ready_sync};
222
    end
223
 
224
 
225
 
226
//synthesis translate_off
227
//////////////// SIMULATION-ONLY CONTENTS
228
  assign jrst_n = reset_n;
229
 
230
//////////////// END SIMULATION-ONLY CONTENTS
231
 
232
//synthesis translate_on
233
//synthesis read_comments_as_HDL on
234
//  assign jrst_n = 1;
235
//synthesis read_comments_as_HDL off
236
 
237
endmodule
238
 

powered by: WebSVN 2.1.0

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