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

Subversion Repositories dbg_interface

[/] [dbg_interface/] [tags/] [rel_19/] [bench/] [verilog/] [dbg_tb.v] - Blame information for rev 114

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

Line No. Rev Author Line
1 2 mohor
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  dbg_tb.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 80 mohor
////       Igor Mohor (igorm@opencores.org)                       ////
11 2 mohor
////                                                              ////
12
////                                                              ////
13
////  All additional information is avaliable in the README.txt   ////
14
////  file.                                                       ////
15
////                                                              ////
16
//////////////////////////////////////////////////////////////////////
17
////                                                              ////
18 101 mohor
//// Copyright (C) 2000 - 2004 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 114 mohor
// Revision 1.30  2004/01/20 08:03:35  mohor
47
// IDCODE test improved.
48
//
49 113 mohor
// Revision 1.29  2004/01/19 13:13:18  mohor
50
// Define tap_defines.v added to test bench.
51
//
52 111 mohor
// Revision 1.28  2004/01/19 12:38:10  mohor
53
// Waiting for "ready" improved.
54
//
55 110 mohor
// Revision 1.27  2004/01/17 18:01:31  mohor
56
// New version.
57
//
58 102 mohor
// Revision 1.26  2004/01/17 17:01:25  mohor
59
// Almost finished.
60
//
61 101 mohor
// Revision 1.25  2004/01/16 14:51:24  mohor
62
// cpu registers added.
63
//
64 99 mohor
// Revision 1.24  2004/01/15 10:47:13  mohor
65
// Working.
66
//
67 96 mohor
// Revision 1.23  2004/01/14 22:59:01  mohor
68
// Temp version.
69
//
70 95 mohor
// Revision 1.22  2004/01/13 11:28:30  mohor
71
// tmp version.
72
//
73 93 mohor
// Revision 1.21  2004/01/10 07:50:41  mohor
74
// temp version.
75
//
76 92 mohor
// Revision 1.20  2004/01/09 12:49:23  mohor
77
// tmp version.
78
//
79 91 mohor
// Revision 1.19  2004/01/08 17:53:12  mohor
80
// tmp version.
81
//
82 90 mohor
// Revision 1.18  2004/01/07 11:59:48  mohor
83
// temp4 version.
84
//
85 89 mohor
// Revision 1.17  2004/01/06 17:14:59  mohor
86
// temp3 version.
87
//
88 88 mohor
// Revision 1.16  2004/01/05 12:16:50  mohor
89
// tmp2 version.
90
//
91 87 mohor
// Revision 1.15  2003/12/23 14:26:01  mohor
92
// New version of the debug interface. Not finished, yet.
93
//
94 80 mohor
// Revision 1.14  2003/10/23 16:16:30  mohor
95
// CRC logic changed.
96
//
97 73 mohor
// Revision 1.13  2003/08/28 13:54:33  simons
98
// Three more chains added for cpu debug access.
99
//
100 63 simons
// Revision 1.12  2002/05/07 14:44:52  mohor
101
// mon_cntl_o signals that controls monitor mux added.
102
//
103 47 mohor
// Revision 1.11  2002/03/12 14:32:26  mohor
104
// Few outputs for boundary scan chain added.
105
//
106 38 mohor
// Revision 1.10  2002/03/08 15:27:08  mohor
107
// Structure changed. Hooks for jtag chain added.
108
//
109 36 mohor
// Revision 1.9  2001/10/19 11:39:20  mohor
110
// dbg_timescale.v changed to timescale.v This is done for the simulation of
111
// few different cores in a single project.
112
//
113 17 mohor
// Revision 1.8  2001/10/17 10:39:17  mohor
114
// bs_chain_o added.
115
//
116 15 mohor
// Revision 1.7  2001/10/16 10:10:18  mohor
117
// Signal names changed to lowercase.
118
//
119 13 mohor
// Revision 1.6  2001/10/15 09:52:50  mohor
120
// Wishbone interface added, few fixes for better performance,
121
// hooks for boundary scan testing added.
122
//
123 12 mohor
// Revision 1.5  2001/09/24 14:06:12  mohor
124
// Changes connected to the OpenRISC access (SPR read, SPR write).
125
//
126 11 mohor
// Revision 1.4  2001/09/20 10:10:29  mohor
127
// Working version. Few bugs fixed, comments added.
128
//
129 9 mohor
// Revision 1.3  2001/09/19 11:54:03  mohor
130
// Minor changes for simulation.
131
//
132 6 mohor
// Revision 1.2  2001/09/18 14:12:43  mohor
133
// Trace fixed. Some registers changed, trace simplified.
134
//
135 5 mohor
// Revision 1.1.1.1  2001/09/13 13:49:19  mohor
136
// Initial official release.
137
//
138 2 mohor
// Revision 1.3  2001/06/01 22:23:40  mohor
139
// This is a backup. It is not a fully working version. Not for use, yet.
140
//
141
// Revision 1.2  2001/05/18 13:10:05  mohor
142
// Headers changed. All additional information is now avaliable in the README.txt file.
143
//
144
// Revision 1.1.1.1  2001/05/18 06:35:15  mohor
145
// Initial release
146
//
147
//
148
 
149
 
150 17 mohor
`include "timescale.v"
151 111 mohor
`include "tap_defines.v"
152 2 mohor
`include "dbg_defines.v"
153 80 mohor
`include "dbg_wb_defines.v"
154 99 mohor
`include "dbg_cpu_defines.v"
155 2 mohor
 
156
// Test bench
157
module dbg_tb;
158
 
159 80 mohor
parameter TCLK = 50;   // Clock half period (Clok period = 100 ns => 10 MHz)
160 2 mohor
 
161 80 mohor
reg   tms_pad_i;
162
reg   tck_pad_i;
163
reg   trst_pad_i;
164
reg   tdi_pad_i;
165
wire  tdo_pad_o;
166
wire  tdo_padoe_o;
167 2 mohor
 
168 80 mohor
wire  shift_dr_o;
169
wire  pause_dr_o;
170
wire  update_dr_o;
171 102 mohor
wire  capture_dr_o;
172 2 mohor
 
173 80 mohor
wire  extest_select_o;
174
wire  sample_preload_select_o;
175
wire  mbist_select_o;
176
wire  debug_select_o;
177 2 mohor
 
178 80 mohor
// WISHBONE common signals
179
reg   wb_rst_i;
180
reg   wb_clk_i;
181
 
182
// WISHBONE master interface
183
wire [31:0] wb_adr_o;
184
wire [31:0] wb_dat_o;
185
wire [31:0] wb_dat_i;
186
wire        wb_cyc_o;
187
wire        wb_stb_o;
188
wire  [3:0] wb_sel_o;
189
wire        wb_we_o;
190
wire        wb_ack_i;
191
wire        wb_cab_o;
192
wire        wb_err_i;
193
wire  [2:0] wb_cti_o;
194
wire  [1:0] wb_bte_o;
195 2 mohor
 
196 101 mohor
// CPU signals
197
wire        cpu_clk_i;
198
wire [31:0] cpu_addr_o;
199
wire [31:0] cpu_data_i;
200
wire [31:0] cpu_data_o;
201
wire        cpu_bp_i;
202
wire        cpu_stall_o;
203
wire        cpu_stall_all_o;
204
wire        cpu_stb_o;
205
wire  [`CPU_NUM -1:0]  cpu_sel_o;
206
wire        cpu_we_o;
207
wire        cpu_ack_i;
208
wire        cpu_rst_o;
209
 
210 87 mohor
// Text used for easier debugging
211 99 mohor
reg [199:0] test_text;
212 88 mohor
reg   [2:0] last_wb_cmd;
213 99 mohor
reg [199:0] last_wb_cmd_text;
214 88 mohor
reg  [31:0] wb_data;
215 2 mohor
 
216
 
217 12 mohor
 
218 80 mohor
wire  tdo_o;
219 12 mohor
 
220 80 mohor
wire  debug_tdi_i;
221
wire  bs_chain_tdi_i;
222
wire  mbist_tdi_i;
223 73 mohor
 
224 80 mohor
reg   test_enabled;
225 73 mohor
 
226 80 mohor
reg [31:0] result;
227 113 mohor
reg [31:0] in_data_le, in_data_be;
228
reg [31:0] id;
229 88 mohor
 
230 110 mohor
wire crc_match_in;
231 114 mohor
reg [31:0] crc_in;
232
reg [31:0] crc_out;
233 99 mohor
 
234
 
235 80 mohor
wire tdo;
236 73 mohor
 
237 80 mohor
assign tdo = tdo_padoe_o? tdo_pad_o : 1'hz;
238 73 mohor
 
239 80 mohor
// Connecting TAP module
240
tap_top i_tap_top (
241 101 mohor
                    .tms_pad_i        (tms_pad_i),
242
                    .tck_pad_i        (tck_pad_i),
243
                    .trst_pad_i       (!trst_pad_i),
244
                    .tdi_pad_i        (tdi_pad_i),
245
                    .tdo_pad_o        (tdo_pad_o),
246
                    .tdo_padoe_o      (tdo_padoe_o),
247 38 mohor
 
248 80 mohor
                    // TAP states
249 101 mohor
                    .shift_dr_o       (shift_dr_o),
250
                    .pause_dr_o       (pause_dr_o),
251
                    .update_dr_o      (update_dr_o),
252 102 mohor
                    .capture_dr_o     (capture_dr_o),
253 38 mohor
 
254 80 mohor
                    // Select signals for boundary scan or mbist
255 101 mohor
                    .extest_select_o  (extest_select_o),
256 80 mohor
                    .sample_preload_select_o(sample_preload_select_o),
257 101 mohor
                    .mbist_select_o   (mbist_select_o),
258
                    .debug_select_o   (debug_select_o),
259 2 mohor
 
260 80 mohor
                    // TDO signal that is connected to TDI of sub-modules.
261 101 mohor
                    .tdo_o            (tdo_o),
262 38 mohor
 
263 80 mohor
                    // TDI signals from sub-modules
264 101 mohor
                    .debug_tdi_i      (debug_tdi_i),        // from debug module
265
                    .bs_chain_tdi_i   (bs_chain_tdi_i),  // from Boundary Scan Chain
266
                    .mbist_tdi_i      (mbist_tdi_i)         // from Mbist Chain
267 73 mohor
 
268 38 mohor
               );
269 2 mohor
 
270
 
271 99 mohor
// Connecting debug top module
272 80 mohor
dbg_top i_dbg_top  (
273 101 mohor
                    .tck_i            (tck_pad_i),
274
                    .tdi_i            (tdo_o),
275
                    .tdo_o            (debug_tdi_i),
276 80 mohor
 
277
                    // TAP states
278 101 mohor
                    .shift_dr_i       (shift_dr_o),
279
                    .pause_dr_i       (pause_dr_o),
280
                    .update_dr_i      (update_dr_o),
281 80 mohor
 
282
                    // Instructions
283 101 mohor
                    .debug_select_i   (debug_select_o),
284 12 mohor
 
285 80 mohor
                    // WISHBONE common signals
286 101 mohor
                    .wb_rst_i         (wb_rst_i),
287
                    .wb_clk_i         (wb_clk_i),
288 80 mohor
 
289
                    // WISHBONE master interface
290 101 mohor
                    .wb_adr_o         (wb_adr_o),
291
                    .wb_dat_o         (wb_dat_o),
292
                    .wb_dat_i         (wb_dat_i),
293
                    .wb_cyc_o         (wb_cyc_o),
294
                    .wb_stb_o         (wb_stb_o),
295
                    .wb_sel_o         (wb_sel_o),
296
                    .wb_we_o          (wb_we_o),
297
                    .wb_ack_i         (wb_ack_i),
298
                    .wb_cab_o         (wb_cab_o),
299
                    .wb_err_i         (wb_err_i),
300
                    .wb_cti_o         (wb_cti_o),
301
                    .wb_bte_o         (wb_bte_o),
302
 
303
                    // CPU signals
304
                    .cpu_clk_i        (cpu_clk_i),
305
                    .cpu_addr_o       (cpu_addr_o),
306
                    .cpu_data_i       (cpu_data_i),
307
                    .cpu_data_o       (cpu_data_o),
308
                    .cpu_bp_i         (cpu_bp_i),
309
                    .cpu_stall_o      (cpu_stall_o),
310
                    .cpu_stall_all_o  (cpu_stall_all_o),
311
                    .cpu_stb_o        (cpu_stb_o),
312
                    .cpu_sel_o        (cpu_sel_o),
313
                    .cpu_we_o         (cpu_we_o),
314
                    .cpu_ack_i        (cpu_ack_i),
315
                    .cpu_rst_o        (cpu_rst_o)
316
 
317
 
318
 
319
 
320 80 mohor
                   );
321 12 mohor
 
322
 
323 99 mohor
 
324 80 mohor
wb_slave_behavioral wb_slave
325
                   (
326 101 mohor
                    .CLK_I            (wb_clk_i),
327
                    .RST_I            (wb_rst_i),
328
                    .ACK_O            (wb_ack_i),
329
                    .ADR_I            (wb_adr_o),
330
                    .CYC_I            (wb_cyc_o),
331
                    .DAT_O            (wb_dat_i),
332
                    .DAT_I            (wb_dat_o),
333
                    .ERR_O            (wb_err_i),
334
                    .RTY_O            (),      // NOT USED for now!
335
                    .SEL_I            (wb_sel_o),
336
                    .STB_I            (wb_stb_o),
337
                    .WE_I             (wb_we_o),
338
                    .CAB_I            (1'b0)
339 80 mohor
                   );
340 2 mohor
 
341
 
342 101 mohor
 
343
cpu_behavioral i_cpu_behavioral
344
                   (
345
                    // CPU signals
346
                    .cpu_rst_i        (wb_rst_i),
347
                    .cpu_clk_o        (cpu_clk_i),
348
                    .cpu_addr_i       (cpu_addr_o),
349
                    .cpu_data_o       (cpu_data_i),
350
                    .cpu_data_i       (cpu_data_o),
351
                    .cpu_bp_o         (cpu_bp_i),
352
                    .cpu_stall_i      (cpu_stall_o),
353
                    .cpu_stall_all_i  (cpu_stall_all_o),
354
                    .cpu_stb_i        (cpu_stb_o),
355
                    .cpu_sel_i        (cpu_sel_o),
356
                    .cpu_we_i         (cpu_we_o),
357
                    .cpu_ack_o        (cpu_ack_i),
358
                    .cpu_rst_o        (cpu_rst_o)
359
                   );
360
 
361
 
362
 
363
 
364 80 mohor
// Initial values
365 2 mohor
initial
366
begin
367 80 mohor
  test_enabled = 1'b0;
368 88 mohor
  wb_data = 32'h01234567;
369 80 mohor
  trst_pad_i = 1'b1;
370
  tms_pad_i = 1'hz;
371
  tck_pad_i = 1'hz;
372
  tdi_pad_i = 1'hz;
373
 
374
  #100;
375
  trst_pad_i = 1'b0;
376
  #100;
377
  trst_pad_i = 1'b1;
378
  #1 test_enabled<=#1 1'b1;
379 2 mohor
end
380
 
381 80 mohor
initial
382
begin
383
  wb_rst_i = 1'b0;
384
  #1000;
385
  wb_rst_i = 1'b1;
386
  #1000;
387
  wb_rst_i = 1'b0;
388 2 mohor
 
389 80 mohor
  // Initial values for wishbone slave model
390 96 mohor
  wb_slave.cycle_response(`ACK_RESPONSE, 9'h55, 8'h2);   // (`ACK_RESPONSE, wbs_waits, wbs_retries);
391 80 mohor
end
392
 
393
initial
394 2 mohor
begin
395 80 mohor
  wb_clk_i = 1'b0;
396
  forever #5 wb_clk_i = ~wb_clk_i;
397 2 mohor
end
398
 
399 80 mohor
always @ (posedge test_enabled)
400
begin
401 2 mohor
 
402 80 mohor
  $display("//////////////////////////////////////////////////////////////////");
403
  $display("//                                                              //");
404
  $display("//  (%0t) dbg_tb starting                                     //", $time);
405
  $display("//                                                              //");
406
  $display("//////////////////////////////////////////////////////////////////");
407 2 mohor
 
408 80 mohor
  initialize_memory(32'h12340000, 32'h00100000);  // Initialize 0x100000 bytes starting from address 0x12340000
409 2 mohor
 
410 80 mohor
  reset_tap;
411 95 mohor
 
412
  #500;
413 80 mohor
  goto_run_test_idle;
414 12 mohor
 
415 80 mohor
  // Testing read and write to internal registers
416
  #10000;
417 111 mohor
 
418 80 mohor
  set_instruction(`IDCODE);
419 113 mohor
  read_id_code(id);
420 12 mohor
 
421 113 mohor
  $display("\tRead ID     = 0x%0x", id);
422
  $display("\tExpected ID = 0x%0x", `IDCODE_VALUE);
423
 
424 80 mohor
  set_instruction(`DEBUG);
425
  #10000;
426 2 mohor
 
427 99 mohor
  chain_select(`WISHBONE_SCAN_CHAIN, 1'b0);   // {chain, gen_crc_err}
428 12 mohor
 
429 80 mohor
//  #10000;
430
//  xxx(4'b1001, 32'he579b242);
431 12 mohor
 
432 80 mohor
  #10000;
433 2 mohor
 
434 99 mohor
//  debug_wishbone(`WB_READ8, 1'b0, 32'h12345678, 16'h4, 1'b0, result, "abc 1"); // {command, ready, addr, length, gen_crc_err, result, text}
435
//  debug_wishbone(`WB_READ8, 1'b0, 32'h12345679, 16'h4, 1'b0, result, "abc 2"); // {command, ready, addr, length, gen_crc_err, result, text}
436
//  debug_wishbone(`WB_READ8, 1'b0, 32'h1234567a, 16'h4, 1'b0, result, "abc 3"); // {command, ready, addr, length, gen_crc_err, result, text}
437 88 mohor
//
438 99 mohor
//  debug_wishbone(`WB_READ16, 1'b0, 32'h12345678, 16'h4, 1'b0, result, "abc 4"); // {command, ready, addr, length, gen_crc_err, result, text}
439
//  debug_wishbone(`WB_READ16, 1'b0, 32'h1234567a, 16'h4, 1'b0, result, "abc 5"); // {command, ready, addr, length, gen_crc_err, result, text}
440 88 mohor
//
441 99 mohor
  debug_wishbone(`WB_READ32, 1'b0, 32'h12345678, 16'h4, 1'b0, result, "read32 1"); // {command, ready, addr, length, gen_crc_err, result, text}
442 88 mohor
//
443 99 mohor
//  debug_wishbone(`WB_READ16, 1'b0, 32'h12345679, 16'h4, 1'b0, result, "abc 6"); // {command, ready, addr, length, gen_crc_err, result, text}
444 2 mohor
 
445 80 mohor
  #10000;
446
//  xxx(4'b1001, 32'he579b242);
447
 
448 99 mohor
  debug_wishbone(`WB_READ32, 1'b1, 32'h12345678, 16'h4, 1'b0, result, "read32 2"); // {command, ready, addr, length, gen_crc_err, result, text}
449 87 mohor
 
450
  #10000;
451 96 mohor
  wb_slave.cycle_response(`ACK_RESPONSE, 9'h55, 8'h2);   // (`ACK_RESPONSE, wbs_waits, wbs_retries);
452 99 mohor
  debug_wishbone(`WB_READ32, 1'b1, 32'h12346668, 16'h4, 1'b0, result, "read32 3"); // {command, ready, addr, length, gen_crc_err, result, text}
453 80 mohor
 
454
  #10000;
455 96 mohor
  wb_slave.cycle_response(`ERR_RESPONSE, 9'h03, 8'h2);   // (`ERR_RESPONSE, wbs_waits, wbs_retries);
456 99 mohor
  debug_wishbone(`WB_READ32, 1'b1, 32'h12346668, 16'h4, 1'b0, result, "read32 4"); // {command, ready, addr, length, gen_crc_err, result, text}
457 80 mohor
 
458
  #10000;
459 99 mohor
  debug_wishbone(`WB_STATUS, 1'b0, 32'h0, 16'h0, 1'b0, result, "status 1"); // {command, ready, addr, length, gen_crc_err, result, text}
460 80 mohor
 
461 87 mohor
  #10000;
462 99 mohor
  debug_wishbone(`WB_STATUS, 1'b0, 32'h0, 16'h0, 1'b0, result, "status 2"); // {command, ready, addr, length, gen_crc_err, result, text}
463 80 mohor
 
464 87 mohor
  #10000;
465 96 mohor
  wb_slave.cycle_response(`ACK_RESPONSE, 9'h012, 8'h2);   // (`ACK_RESPONSE, wbs_waits, wbs_retries);
466 99 mohor
  debug_wishbone(`WB_READ32, 1'b1, 32'h12347778, 16'hc, 1'b0, result, "read32 5"); // {command, ready, addr, length, gen_crc_err, result, text}
467 80 mohor
 
468 87 mohor
  #10000;
469 99 mohor
  debug_wishbone(`WB_WRITE32, 1'b0, 32'h12346668, 16'h8, 1'b0, result, "wr32 len8"); // {command, ready, addr, length, gen_crc_err, result, text}
470 87 mohor
 
471
  #10000;
472 99 mohor
  debug_wishbone(`WB_WRITE16, 1'b0, 32'h12344446, 16'h8, 1'b0, result, "wr16 len8"); // {command, ready, addr, length, gen_crc_err, result, text}
473 87 mohor
 
474 88 mohor
  #10000;
475 99 mohor
  debug_wishbone(`WB_WRITE8, 1'b0, 32'h1234010e, 16'h8, 1'b0, result, "wr8 len8"); // {command, ready, addr, length, gen_crc_err, result, text}
476 87 mohor
 
477 88 mohor
  #10000;
478 99 mohor
  debug_wishbone(`WB_GO, 1'b0, 32'h0, 16'h0, 1'b0, result, "go 1"); // {command, ready, addr, length, gen_crc_err, result, text}
479 87 mohor
 
480 89 mohor
  #10000;
481 99 mohor
  debug_wishbone(`WB_READ32, 1'b1, 32'h12340100, 16'hc, 1'b0, result, "read32 6"); // {command, ready, addr, length, gen_crc_err, result, text}
482
//  debug_wishbone(`WB_READ32, 1'b1, 32'h12340100, 16'hfffc, 1'b0, result, "read32 6"); // {command, ready, addr, length, gen_crc_err, result, text}
483 88 mohor
 
484 89 mohor
  #10000;
485 99 mohor
//  debug_wishbone(`WB_READ16, 1'b1, 32'h12340102, 16'he, 1'b0, result, "read16 7"); // {command, ready, addr, length, gen_crc_err, result, text}
486
//  debug_wishbone(`WB_READ16, 1'b1, 32'h12340102, 16'hfffe, 1'b0, result, "read16 7"); // {command, ready, addr, length, gen_crc_err, result, text}
487 88 mohor
 
488 90 mohor
  #10000;
489 99 mohor
//  debug_wishbone(`WB_READ8, 1'b1, 32'h12348804, 16'h6, 1'b0, result, "read8 8"); // {command, ready, addr, length, gen_crc_err, result, text}  
490
//  debug_wishbone(`WB_READ8, 1'b1, 32'h12348804, 16'hfffc, 1'b0, result, "read8 8"); // {command, ready, addr, length, gen_crc_err, result, text}
491 89 mohor
 
492 90 mohor
  #10000;
493 99 mohor
  debug_wishbone(`WB_GO, 1'b0, 32'h0, 16'h0, 1'b0, result, "go 2"); // {command, ready, addr, length, gen_crc_err, result, text}
494 89 mohor
 
495 99 mohor
  #10000;
496
  chain_select(`CPU_DEBUG_CHAIN, 1'b0);   // {chain, gen_crc_err}
497 89 mohor
 
498 101 mohor
 
499
 
500
 
501
  // Select cpu0
502 99 mohor
  #10000;
503 101 mohor
  debug_cpu(`CPU_WRITE_REG, `CPU_SEL_ADR, 32'h0, 1'b0, result, "select cpu 0"); // {command, addr, data, gen_crc_err, result, text}
504 90 mohor
 
505 99 mohor
  #10000;
506 101 mohor
  debug_cpu(`CPU_GO, 32'h0, 32'h1, 1'b0, result, "go cpu"); // {command, addr, data, gen_crc_err, result, text}
507
 
508
  // Read register
509
  #10000;
510
  debug_cpu(`CPU_READ_REG, `CPU_SEL_ADR, 32'h0, 1'b0, result, "cpu_read_reg"); // {command, addr, data, gen_crc_err, result, text}
511
 
512
  #10000;
513 99 mohor
  debug_cpu(`CPU_GO, 32'h0, 32'hff, 1'b0, result, "go cpu"); // {command, addr, data, gen_crc_err, result, text}
514 90 mohor
 
515 101 mohor
  // Stall cpu0
516
  #10000;
517
  debug_cpu(`CPU_WRITE_REG, `CPU_OP_ADR, 32'h0, 1'b0, result, "stall cpu0"); // {command, addr, data, gen_crc_err, result, text}
518 99 mohor
 
519 101 mohor
  #10000;
520
  debug_cpu(`CPU_GO, 32'h0, 32'h1, 1'b0, result, "go cpu"); // {command, addr, data, gen_crc_err, result, text}
521
 
522
  // write to cpu 32-bit
523
  #10000;
524
  debug_cpu(`CPU_WRITE32, 32'h32323232, 32'h0, 1'b0, result, "cpu_write_32"); // {command, addr, data, gen_crc_err, result, text}
525
 
526
  #10000;
527
  debug_cpu(`CPU_GO, 32'h0, 32'hdeadbeef, 1'b0, result, "go cpu"); // {command, addr, data, gen_crc_err, result, text}
528
 
529 102 mohor
  // read from cpu 32-bit
530 101 mohor
  #10000;
531
  debug_cpu(`CPU_READ32, 32'h32323232, 32'h0, 1'b0, result, "cpu_read_32"); // {command, addr, data, gen_crc_err, result, text}
532
 
533
  #10000;
534
  debug_cpu(`CPU_GO, 32'h0, 32'hdeadbeef, 1'b0, result, "go cpu"); // {command, addr, data, gen_crc_err, result, text}
535
 
536
  // write to cpu 8-bit
537
  #10000;
538
  debug_cpu(`CPU_WRITE8, 32'h08080808, 32'h0, 1'b0, result, "cpu_write_8"); // {command, addr, data, gen_crc_err, result, text}
539
 
540
  #10000;
541
  debug_cpu(`CPU_GO, 32'h0, 32'hdeadbeef, 1'b0, result, "go cpu"); // {command, addr, data, gen_crc_err, result, text}
542
 
543 102 mohor
  // read from cpu 8-bit
544 101 mohor
  #10000;
545
  debug_cpu(`CPU_READ8, 32'h08080808, 32'h0, 1'b0, result, "cpu_read_8"); // {command, addr, data, gen_crc_err, result, text}
546
 
547
  #10000;
548
  debug_cpu(`CPU_GO, 32'h0, 32'hdeadbeef, 1'b0, result, "go cpu"); // {command, addr, data, gen_crc_err, result, text}
549
 
550 110 mohor
 
551
 
552
 
553
 
554
 
555
 
556
 
557
 
558
 
559
 
560
 
561
 
562 80 mohor
/*
563
  // Testing read and write to CPU0 registers
564
  #10000;
565
  set_instruction(`CHAIN_SELECT);
566
  chain_select(`CPU_DEBUG_CHAIN_0, 8'h12);  // {chain, crc}
567
  set_instruction(`DEBUG);
568
  WriteCPURegister(32'h11001100, 32'h00110011, 8'h86);  // {data, addr, crc}
569
 
570
  ReadCPURegister(32'h11001100, 8'hdb);                 // {addr, crc}
571
  ReadCPURegister(32'h11001100, 8'hdb);                 // {addr, crc}
572
*/
573
  #5000 gen_clk(1);            // One extra TCLK for debugging purposes
574 95 mohor
  $display("\n\nSimulation end.");
575 5 mohor
  #1000 $stop;
576 80 mohor
 
577 2 mohor
end
578
 
579 80 mohor
 
580
task initialize_memory;
581
  input [31:0] start_addr;
582
  input [31:0] length;
583
  integer i;
584
  reg [31:0] addr;
585
  begin
586 96 mohor
//    for (i=0; i<length; i=i+4)    // inverted address
587
//      begin
588
//        addr = start_addr + i;
589
//        wb_slave.wr_mem(addr, {addr[7:0], addr[15:8], addr[23:16], addr[31:24]}, 4'hf);    // adr, data, sel
590
//      end
591 80 mohor
    for (i=0; i<length; i=i+4)
592
      begin
593
        addr = start_addr + i;
594 96 mohor
        wb_slave.wr_mem(addr, {addr[7:0], addr[7:0]+2'd1, addr[7:0]+2'd2, addr[7:0]+2'd3}, 4'hf);    // adr, data, sel
595 80 mohor
      end
596
  end
597
endtask
598
 
599
 
600
 
601 2 mohor
// Generation of the TCLK signal
602 80 mohor
task gen_clk;
603
  input [7:0] num;
604 2 mohor
  integer i;
605
  begin
606 80 mohor
    for(i=0; i<num; i=i+1)
607 2 mohor
      begin
608 80 mohor
        #TCLK tck_pad_i<=1;
609
        #TCLK tck_pad_i<=0;
610 2 mohor
      end
611
  end
612
endtask
613
 
614
 
615
// TAP reset
616 80 mohor
task reset_tap;
617 2 mohor
  begin
618 80 mohor
    $display("(%0t) Task reset_tap", $time);
619
    tms_pad_i<=#1 1'b1;
620 95 mohor
    gen_clk(5);
621 2 mohor
  end
622
endtask
623
 
624
 
625
// Goes to RunTestIdle state
626 80 mohor
task goto_run_test_idle;
627 2 mohor
  begin
628 80 mohor
    $display("(%0t) Task goto_run_test_idle", $time);
629
    tms_pad_i<=#1 1'b0;
630
    gen_clk(1);
631 2 mohor
  end
632
endtask
633
 
634
 
635
// sets the instruction to the IR register and goes to the RunTestIdle state
636 80 mohor
task set_instruction;
637
  input [3:0] instr;
638 2 mohor
  integer i;
639
 
640
  begin
641 80 mohor
    $display("(%0t) Task set_instruction", $time);
642
    tms_pad_i<=#1 1;
643
    gen_clk(2);
644
    tms_pad_i<=#1 0;
645
    gen_clk(2);  // we are in shiftIR
646 2 mohor
 
647
    for(i=0; i<`IR_LENGTH-1; i=i+1)
648
    begin
649 80 mohor
      tdi_pad_i<=#1 instr[i];
650
      gen_clk(1);
651 2 mohor
    end
652
 
653 80 mohor
    tdi_pad_i<=#1 instr[i]; // last shift
654
    tms_pad_i<=#1 1;        // going out of shiftIR
655
    gen_clk(1);
656 90 mohor
    tdi_pad_i<=#1 'hz;    // tri-state
657 80 mohor
    gen_clk(1);
658
    tms_pad_i<=#1 0;
659
    gen_clk(1);       // we are in RunTestIdle
660 2 mohor
  end
661
endtask
662
 
663
 
664 80 mohor
// Reads the ID code
665
task read_id_code;
666 113 mohor
  output [31:0] code;
667
  reg    [31:0] code;
668 80 mohor
  begin
669
    $display("(%0t) Task read_id_code", $time);
670
    tms_pad_i<=#1 1;
671
    gen_clk(1);
672
    tms_pad_i<=#1 0;
673
    gen_clk(2);  // we are in shiftDR
674
 
675
    tdi_pad_i<=#1 0;
676
    gen_clk(31);
677
 
678
    tms_pad_i<=#1 1;        // going out of shiftIR
679
    gen_clk(1);
680
 
681 113 mohor
    code = in_data_le;
682
 
683 80 mohor
    tdi_pad_i<=#1 'hz; // tri-state
684
    gen_clk(1);
685
    tms_pad_i<=#1 0;
686
    gen_clk(1);       // we are in RunTestIdle
687
  end
688
endtask
689
 
690
 
691 2 mohor
// sets the selected scan chain and goes to the RunTestIdle state
692 80 mohor
task chain_select;
693
  input [3:0]  data;
694 99 mohor
  input        gen_crc_err;
695 2 mohor
  integer i;
696
 
697
  begin
698 99 mohor
    case (data)
699
      `CPU_DEBUG_CHAIN      : $display("(%0t) Task chain_select (CPU_DEBUG_CHAIN, gen_crc_err=%0d)", $time, gen_crc_err);
700
      `WISHBONE_SCAN_CHAIN  : $display("(%0t) Task chain_select (WISHBONE_SCAN_CHAIN gen_crc_err=%0d)", $time, gen_crc_err);
701
      default               : $display("(%0t) Task chain_select (ERROR!!! Unknown chain selected)", $time);
702
    endcase
703
 
704 80 mohor
    tms_pad_i<=#1 1;
705
    gen_clk(1);
706
    tms_pad_i<=#1 0;
707
    gen_clk(2);  // we are in shiftDR
708 2 mohor
 
709 114 mohor
    crc_out = 32'hffffffff; // Initialize outgoing CRC
710 80 mohor
    tdi_pad_i<=#1 1'b1; // chain_select bit
711 114 mohor
    calculate_crc(1'b1);
712 80 mohor
    gen_clk(1);
713
 
714 2 mohor
    for(i=0; i<`CHAIN_ID_LENGTH; i=i+1)
715
    begin
716 80 mohor
      tdi_pad_i<=#1 data[i];
717 114 mohor
      calculate_crc(data[i]);
718 80 mohor
      gen_clk(1);
719 2 mohor
    end
720
 
721 99 mohor
    for(i=31; i>=0; i=i-1)
722 2 mohor
    begin
723 99 mohor
      if (gen_crc_err & (i==0))  // Generate crc error at last crc bit
724 114 mohor
        tdi_pad_i<=#1 ~crc_out[i];   // error crc
725 99 mohor
      else
726 114 mohor
        tdi_pad_i<=#1 crc_out[i];    // ok crc
727 99 mohor
 
728 80 mohor
      gen_clk(1);
729 2 mohor
    end
730
 
731 99 mohor
    tdi_pad_i<=#1 'hz;  // tri-state
732
 
733 114 mohor
    crc_in = 32'hffffffff;  // Initialize incoming CRC
734 110 mohor
    gen_clk(`STATUS_LEN);   // Generating 4 clocks to read out status.
735 80 mohor
 
736 110 mohor
 
737 80 mohor
    for(i=0; i<`CRC_LEN -1; i=i+1)
738
      gen_clk(1);
739
 
740
    tms_pad_i<=#1 1;
741
    gen_clk(1);         // to exit1_dr
742
 
743 110 mohor
    if (~crc_match_in)
744
      begin
745
        $display("(%0t) Incoming CRC failed !!!", $time);
746
        $stop;
747
      end
748
 
749 80 mohor
    tms_pad_i<=#1 1;
750
    gen_clk(1);         // to update_dr
751
    tms_pad_i<=#1 0;
752
    gen_clk(1);         // to run_test_idle
753 2 mohor
  end
754 99 mohor
endtask   // chain_select
755 2 mohor
 
756
 
757 87 mohor
 
758
 
759
 
760
 
761
 
762 80 mohor
task debug_wishbone;
763
  input [2:0]   command;
764 87 mohor
  input         ready;
765 80 mohor
  input [31:0]  addr;
766
  input [15:0]  length;
767 99 mohor
  input         gen_crc_err;
768 80 mohor
  output [31:0] result;
769 87 mohor
  input [99:0]  text;
770 80 mohor
  integer i;
771
 
772 2 mohor
  begin
773 80 mohor
   $write("(%0t) Task debug_wishbone: ", $time);
774 2 mohor
 
775 87 mohor
    test_text = text;
776 36 mohor
 
777 80 mohor
    case (command)
778
      `WB_STATUS   :
779
        begin
780 99 mohor
          $display("wb_status (gen_crc_err=%0d (%0s))", gen_crc_err, text);
781
          debug_wishbone_status(command, gen_crc_err);
782 88 mohor
          last_wb_cmd = `WB_STATUS;  last_wb_cmd_text = "WB_STATUS";
783 80 mohor
        end
784
      `WB_READ8    :
785
        begin
786 110 mohor
          $display("wb_read8 (adr=0x%0x, length=0x%0x, gen_crc_err=%0d (%0s))", addr, length, gen_crc_err, text);
787
          debug_wishbone_set_addr(command, addr, length, gen_crc_err);
788 88 mohor
          last_wb_cmd = `WB_READ8;  last_wb_cmd_text = "WB_READ8";
789 80 mohor
        end
790
      `WB_READ16   :
791
        begin
792 110 mohor
          $display("wb_read16 (adr=0x%0x, length=0x%0x, gen_crc_err=%0d (%0s))", addr, length, gen_crc_err, text);
793
          debug_wishbone_set_addr(command, addr, length, gen_crc_err);
794 88 mohor
          last_wb_cmd = `WB_READ16;  last_wb_cmd_text = "WB_READ16";
795 80 mohor
        end
796
      `WB_READ32   :
797
        begin
798 110 mohor
          $display("wb_read32 (adr=0x%0x, length=0x%0x, gen_crc_err=%0d (%0s))", addr, length, gen_crc_err, text);
799
          debug_wishbone_set_addr(command, addr, length, gen_crc_err);
800 88 mohor
          last_wb_cmd = `WB_READ32;  last_wb_cmd_text = "WB_READ32";
801 80 mohor
        end
802
      `WB_WRITE8   :
803
        begin
804 99 mohor
          $display("wb_write8 (adr=0x%0x, length=0x%0x, gen_crc_err=%0d (%0s))", addr, length, gen_crc_err, text);
805 110 mohor
          debug_wishbone_set_addr(command, addr, length, gen_crc_err);
806 88 mohor
          last_wb_cmd = `WB_WRITE8;  last_wb_cmd_text = "WB_WRITE8";
807 80 mohor
        end
808
      `WB_WRITE16  :
809
        begin
810 99 mohor
          $display("wb_write16 (adr=0x%0x, length=0x%0x, gen_crc_err=%0d (%0s))", addr, length, gen_crc_err, text);
811 110 mohor
          debug_wishbone_set_addr(command, addr, length, gen_crc_err);
812 88 mohor
          last_wb_cmd = `WB_WRITE16;  last_wb_cmd_text = "WB_WRITE16";
813 80 mohor
        end
814
      `WB_WRITE32  :
815
        begin
816 99 mohor
          $display("wb_write32 (adr=0x%0x, length=0x%0x, gen_crc_err=%0d (%0s))", addr, length, gen_crc_err, text);
817 110 mohor
          debug_wishbone_set_addr(command, addr, length, gen_crc_err);
818 88 mohor
          last_wb_cmd = `WB_WRITE32;  last_wb_cmd_text = "WB_WRITE32";
819 80 mohor
        end
820
      `WB_GO       :
821
        begin
822 110 mohor
          $display("wb_go, ready=%0d, gen_crc_err=%0d (%0s))", ready, gen_crc_err, text);
823
          debug_wishbone_go(command, ready, gen_crc_err);
824 99 mohor
//          $display("wb_go_tmp, gen_crc_err=0x%0x (%0s))", gen_crc_err, text);
825 93 mohor
//          debug_wishbone_go_tmp(command, crc);
826 88 mohor
          last_wb_cmd = `WB_GO;  last_wb_cmd_text = "WB_GO";
827 80 mohor
        end
828
    endcase
829 2 mohor
  end
830 87 mohor
endtask       // debug_wishbone
831 2 mohor
 
832
 
833 80 mohor
 
834
 
835
 
836
 
837 87 mohor
task debug_wishbone_set_addr;
838 80 mohor
  input [2:0]   command;
839
  input [31:0]  addr;
840
  input [15:0]  length;
841 99 mohor
  input         gen_crc_err;
842 80 mohor
  integer i;
843
 
844
  begin
845 87 mohor
    $display("(%0t) Task debug_wishbone_set_addr: ", $time);
846 80 mohor
 
847
    tms_pad_i<=#1 1;
848
    gen_clk(1);
849
    tms_pad_i<=#1 0;
850
    gen_clk(2);  // we are in shiftDR
851
 
852 114 mohor
    crc_out = 32'hffffffff; // Initialize outgoing CRC
853 99 mohor
 
854 80 mohor
    tdi_pad_i<=#1 1'b0; // chain_select bit = 0
855 114 mohor
    calculate_crc(1'b0);
856 80 mohor
    gen_clk(1);
857
 
858 88 mohor
    for(i=2; i>=0; i=i-1)
859 80 mohor
    begin
860
      tdi_pad_i<=#1 command[i]; // command
861 114 mohor
      calculate_crc(command[i]);
862 80 mohor
      gen_clk(1);
863
    end
864
 
865 88 mohor
    for(i=31; i>=0; i=i-1)       // address
866 80 mohor
    begin
867
      tdi_pad_i<=#1 addr[i];
868 114 mohor
      calculate_crc(addr[i]);
869 80 mohor
      gen_clk(1);
870
    end
871 87 mohor
 
872 88 mohor
    for(i=15; i>=0; i=i-1)       // length
873 80 mohor
    begin
874
      tdi_pad_i<=#1 length[i];
875 114 mohor
      calculate_crc(length[i]);
876 80 mohor
      gen_clk(1);
877
    end
878
 
879 88 mohor
    for(i=31; i>=0; i=i-1)
880 80 mohor
    begin
881 99 mohor
      if (gen_crc_err & (i==0))  // Generate crc error at last crc bit
882 114 mohor
        tdi_pad_i<=#1 ~crc_out[i];   // error crc
883 99 mohor
      else
884 114 mohor
        tdi_pad_i<=#1 crc_out[i];    // ok crc
885 99 mohor
 
886 80 mohor
      gen_clk(1);
887
    end
888
 
889 92 mohor
    tdi_pad_i<=#1 'hz;
890 80 mohor
 
891 114 mohor
    crc_in = 32'hffffffff;  // Initialize incoming CRC
892 110 mohor
    gen_clk(`STATUS_LEN);   // Generating 4 clocks to read out status.
893
 
894 88 mohor
    for(i=0; i<`CRC_LEN -1; i=i+1)  // Getting in the CRC
895 80 mohor
    begin
896
      gen_clk(1);
897
    end
898
 
899
    tms_pad_i<=#1 1;
900
    gen_clk(1);         // to exit1_dr
901
 
902 110 mohor
    if (~crc_match_in)
903
      begin
904
        $display("(%0t) Incoming CRC failed !!!", $time);
905
        $stop;
906
      end
907
 
908 80 mohor
    tms_pad_i<=#1 1;
909
    gen_clk(1);         // to update_dr
910
    tms_pad_i<=#1 0;
911
    gen_clk(1);         // to run_test_idle
912
  end
913 87 mohor
endtask       // debug_wishbone_set_addr
914 80 mohor
 
915
 
916
 
917
 
918
 
919 88 mohor
task debug_wishbone_status;
920
  input [2:0]   command;
921 99 mohor
  input         gen_crc_err;
922 88 mohor
  integer i;
923
 
924
  begin
925
    $display("(%0t) Task debug_wishbone_status: ", $time);
926 80 mohor
 
927 88 mohor
    tms_pad_i<=#1 1;
928
    gen_clk(1);
929
    tms_pad_i<=#1 0;
930
    gen_clk(2);  // we are in shiftDR
931 87 mohor
 
932 114 mohor
    crc_out = 32'hffffffff; // Initialize outgoing CRC
933 99 mohor
 
934 88 mohor
    tdi_pad_i<=#1 1'b0; // chain_select bit = 0
935 114 mohor
    calculate_crc(1'b0);
936 88 mohor
    gen_clk(1);
937 87 mohor
 
938 88 mohor
    for(i=2; i>=0; i=i-1)
939
    begin
940
      tdi_pad_i<=#1 command[i]; // command
941 114 mohor
      calculate_crc(command[i]);
942 88 mohor
      gen_clk(1);
943
    end
944 87 mohor
 
945 99 mohor
    for(i=31; i>=0; i=i-1)
946 88 mohor
    begin
947 99 mohor
      if (gen_crc_err & (i==0))  // Generate crc error at last crc bit
948 114 mohor
        tdi_pad_i<=#1 ~crc_out[i];   // error crc
949 99 mohor
      else
950 114 mohor
        tdi_pad_i<=#1 crc_out[i];    // ok crc
951 99 mohor
 
952 88 mohor
      gen_clk(1);
953
    end
954
 
955 92 mohor
    tdi_pad_i<=#1 1'hz;
956 110 mohor
 
957 114 mohor
    crc_in = 32'hffffffff;  // Initialize incoming CRC
958 110 mohor
 
959 88 mohor
    gen_clk(`STATUS_LEN);   // Generating 4 clocks to read out status.
960
 
961
    for(i=0; i<`CRC_LEN -1; i=i+1)  // Getting in the CRC
962
    begin
963
      gen_clk(1);
964
    end
965
 
966
    tms_pad_i<=#1 1;
967
    gen_clk(1);         // to exit1_dr
968
 
969 110 mohor
    if (~crc_match_in)
970
      begin
971
        $display("(%0t) Incoming CRC failed !!!", $time);
972
        $stop;
973
      end
974
 
975 88 mohor
    tms_pad_i<=#1 1;
976
    gen_clk(1);         // to update_dr
977
    tms_pad_i<=#1 0;
978
    gen_clk(1);         // to run_test_idle
979
  end
980
endtask       // debug_wishbone_status
981
 
982
 
983
 
984
 
985
task debug_wishbone_go;
986
  input [2:0]   command;
987 110 mohor
  input         wait_for_wb_ready;
988 99 mohor
  input         gen_crc_err;
989 90 mohor
  integer i;
990
  reg   [4:0]   pointer;
991
 
992 2 mohor
  begin
993 88 mohor
    $display("(%0t) Task debug_wishbone_go (previous command was %0s): ", $time, last_wb_cmd_text);
994
 
995 80 mohor
    tms_pad_i<=#1 1;
996
    gen_clk(1);
997
    tms_pad_i<=#1 0;
998
    gen_clk(2);  // we are in shiftDR
999 2 mohor
 
1000 114 mohor
    crc_out = 32'hffffffff; // Initialize outgoing CRC
1001 99 mohor
 
1002 88 mohor
    tdi_pad_i<=#1 1'b0; // chain_select bit = 0
1003 114 mohor
    calculate_crc(1'b0);
1004 80 mohor
    gen_clk(1);
1005 88 mohor
 
1006
    for(i=2; i>=0; i=i-1)
1007
    begin
1008
      tdi_pad_i<=#1 command[i]; // command
1009 114 mohor
      calculate_crc(command[i]);
1010 88 mohor
      gen_clk(1);
1011
    end
1012
 
1013
 
1014
    if ((last_wb_cmd == `WB_WRITE8) | (last_wb_cmd == `WB_WRITE16) | (last_wb_cmd == `WB_WRITE32))  // When WB_WRITEx was previously activated, data needs to be shifted.
1015
      begin
1016 90 mohor
        for (i=0; i<(dbg_tb.i_dbg_top.i_dbg_wb.len << 3); i=i+1)
1017 88 mohor
          begin
1018 90 mohor
            if (!(i%32))
1019 88 mohor
              begin
1020 90 mohor
                wb_data = wb_data + 32'h11111111;
1021
                $display("\t\twb_data = 0x%x", wb_data);
1022 88 mohor
              end
1023 90 mohor
            pointer = 31-i[4:0];
1024
            tdi_pad_i<=#1 wb_data[pointer];
1025 114 mohor
            calculate_crc(wb_data[pointer]);
1026 90 mohor
            gen_clk(1);
1027
 
1028 88 mohor
          end
1029
      end
1030
 
1031 110 mohor
    for(i=31; i>=1; i=i-1)
1032 88 mohor
    begin
1033 114 mohor
      tdi_pad_i<=#1 crc_out[i];
1034 88 mohor
      gen_clk(1);
1035
    end
1036
 
1037 110 mohor
    if (gen_crc_err)  // Generate crc error at last crc bit
1038 114 mohor
      tdi_pad_i<=#1 ~crc_out[0];   // error crc
1039 110 mohor
    else
1040 114 mohor
      tdi_pad_i<=#1 crc_out[0];    // ok crc
1041 99 mohor
 
1042 110 mohor
    if (wait_for_wb_ready)
1043
      begin
1044
        tms_pad_i<=#1 1;
1045
        gen_clk(1);       // to exit1_dr. Last CRC is shifted on this clk
1046
        tms_pad_i<=#1 0;
1047
        gen_clk(1);       // to pause_dr
1048 90 mohor
 
1049 110 mohor
        #2;             // wait a bit for tdo to activate
1050
        while (tdo)     // waiting for wb to send "ready"
1051
        begin
1052
          gen_clk(1);       // staying in pause_dr
1053
        end
1054
 
1055
        tms_pad_i<=#1 1;
1056
        gen_clk(1);       // to exit2_dr
1057
        tms_pad_i<=#1 0;
1058
        gen_clk(1);       // to shift_dr
1059
      end
1060
    else
1061
      begin
1062
        gen_clk(1);       // Last CRC is shifted on this clk
1063
      end
1064 90 mohor
 
1065
 
1066 110 mohor
    tdi_pad_i<=#1 1'hz;
1067 114 mohor
    crc_in = 32'hffffffff;  // Initialize incoming CRC
1068 110 mohor
 
1069 90 mohor
    if ((last_wb_cmd == `WB_READ8) | (last_wb_cmd == `WB_READ16) | (last_wb_cmd == `WB_READ32))  // When WB_WRITEx was previously activated, data needs to be shifted.
1070
      begin
1071 95 mohor
        $display("\t\tGenerating %0d clocks to read %0d data bytes.", dbg_tb.i_dbg_top.i_dbg_wb.data_cnt_limit, dbg_tb.i_dbg_top.i_dbg_wb.data_cnt_limit>>3);
1072
        for (i=0; i<(dbg_tb.i_dbg_top.i_dbg_wb.data_cnt_limit); i=i+1)
1073 92 mohor
          gen_clk(1);
1074 90 mohor
      end
1075
 
1076
 
1077 88 mohor
    gen_clk(`STATUS_LEN);   // Generating 4 clocks to read out status.
1078
 
1079
    for(i=0; i<`CRC_LEN -1; i=i+1)  // Getting in the CRC
1080
    begin
1081
      gen_clk(1);
1082
    end
1083
 
1084
    tms_pad_i<=#1 1;
1085
    gen_clk(1);         // to exit1_dr
1086
 
1087 110 mohor
    if (~crc_match_in)
1088
      begin
1089
        $display("(%0t) Incoming CRC failed !!!", $time);
1090
        $stop;
1091
      end
1092
 
1093 88 mohor
    tms_pad_i<=#1 1;
1094
    gen_clk(1);         // to update_dr
1095 80 mohor
    tms_pad_i<=#1 0;
1096 88 mohor
    gen_clk(1);         // to run_test_idle
1097 2 mohor
  end
1098 88 mohor
endtask       // debug_wishbone_go
1099 2 mohor
 
1100
 
1101 88 mohor
 
1102
 
1103 99 mohor
task debug_cpu;
1104
  input [2:0]   command;
1105
  input [31:0]  addr;
1106
  input [31:0]  data;
1107
  input         gen_crc_err;
1108
  output [31:0] result;
1109
  input [199:0]  text;
1110
  integer i;
1111
 
1112
  begin
1113
   $write("(%0t) Task debug_cpu: ", $time);
1114 88 mohor
 
1115 99 mohor
    test_text = text;
1116
 
1117
    case (command)
1118
//      `WB_STATUS   : 
1119
//        begin
1120
//          $display("wb_status (gen_crc_err=%0d (%0s))", gen_crc_err, text);
1121
//          debug_wishbone_status(command, gen_crc_err);
1122
//          last_wb_cmd = `WB_STATUS;  last_wb_cmd_text = "WB_STATUS";
1123
//        end 
1124
      `CPU_READ_REG   :
1125
        begin
1126
          $display("cpu_read_reg (adr=0x%0x, gen_crc_err=%0d (%0s))", addr, gen_crc_err, text);
1127
          debug_cpu_set_addr(command, addr, gen_crc_err);
1128
          last_wb_cmd = `CPU_READ_REG;  last_wb_cmd_text = "CPU_READ_REG";
1129
        end
1130
      `CPU_WRITE_REG  :
1131
        begin
1132
          $display("cpu_write_reg (adr=0x%0x, gen_crc_err=%0d (%0s))", addr, gen_crc_err, text);
1133
          debug_cpu_set_addr(command, addr, gen_crc_err);
1134
          last_wb_cmd = `CPU_WRITE_REG;  last_wb_cmd_text = "CPU_WRITE_REG";
1135
        end
1136
      `CPU_READ8      :
1137
        begin
1138
          $display("cpu_read8 (adr=0x%0x, gen_crc_err=%0d (%0s))", addr, gen_crc_err, text);
1139
          debug_cpu_set_addr(command, addr, gen_crc_err);
1140
          last_wb_cmd = `CPU_READ8;  last_wb_cmd_text = "CPU_READ8";
1141
        end
1142
      `CPU_READ32     :
1143
        begin
1144
          $display("cpu_read32 (adr=0x%0x, gen_crc_err=%0d (%0s))", addr, gen_crc_err, text);
1145
          debug_cpu_set_addr(command, addr, gen_crc_err);
1146
          last_wb_cmd = `CPU_READ32;  last_wb_cmd_text = "CPU_READ32";
1147
        end
1148
      `CPU_WRITE8     :
1149
        begin
1150
          $display("cpu_write8 (adr=0x%0x, gen_crc_err=%0d (%0s))", addr, gen_crc_err, text);
1151
          debug_cpu_set_addr(command, addr, gen_crc_err);
1152
          last_wb_cmd = `CPU_WRITE8;  last_wb_cmd_text = "CPU_WRITE8";
1153
        end
1154
      `CPU_WRITE32    :
1155
        begin
1156
          $display("cpu_write32 (adr=0x%0x, gen_crc_err=%0d (%0s))", addr, gen_crc_err, text);
1157
          debug_cpu_set_addr(command, addr, gen_crc_err);
1158
          last_wb_cmd = `CPU_WRITE32;  last_wb_cmd_text = "CPU_WRITE32";
1159
        end
1160
      `CPU_GO         :
1161
        begin
1162
          $display("cpu_go, data = 0x%0x, gen_crc_err=%0d (%0s))", data, gen_crc_err, text);
1163
          debug_cpu_go(command, data, gen_crc_err);
1164
          last_wb_cmd = `CPU_GO;  last_wb_cmd_text = "CPU_GO";
1165
        end
1166
      default     :
1167
        begin
1168
          $display("\t\tERROR: Non-existing command while debugging %0s", gen_crc_err, text);
1169
          $stop;
1170
        end
1171
    endcase
1172
  end
1173
endtask       // debug_cpu
1174
 
1175
 
1176
 
1177
task debug_cpu_set_addr;
1178 93 mohor
  input [2:0]   command;
1179 99 mohor
  input [31:0]  addr;
1180
  input         gen_crc_err;
1181 93 mohor
  integer i;
1182 99 mohor
 
1183
  begin
1184
    $display("(%0t) Task debug_cpu_set_addr: ", $time);
1185
 
1186
    tms_pad_i<=#1 1;
1187
    gen_clk(1);
1188
    tms_pad_i<=#1 0;
1189
    gen_clk(2);  // we are in shiftDR
1190
 
1191 114 mohor
    crc_out = 32'hffffffff; // Initialize outgoing CRC
1192 99 mohor
 
1193
    tdi_pad_i<=#1 1'b0; // chain_select bit = 0
1194 114 mohor
    calculate_crc(1'b0);
1195 99 mohor
    gen_clk(1);
1196
 
1197
    for(i=2; i>=0; i=i-1)
1198
    begin
1199
      tdi_pad_i<=#1 command[i]; // command
1200 114 mohor
      calculate_crc(command[i]);
1201 99 mohor
      gen_clk(1);
1202
    end
1203
 
1204
    for(i=31; i>=0; i=i-1)       // address
1205
    begin
1206
      tdi_pad_i<=#1 addr[i];
1207 114 mohor
      calculate_crc(addr[i]);
1208 99 mohor
      gen_clk(1);
1209
    end
1210 93 mohor
 
1211 99 mohor
    for(i=31; i>=0; i=i-1)
1212
    begin
1213
      if (gen_crc_err & (i==0))  // Generate crc error at last crc bit
1214 114 mohor
        tdi_pad_i<=#1 ~crc_out[i];   // error crc
1215 99 mohor
      else
1216 114 mohor
        tdi_pad_i<=#1 crc_out[i];    // ok crc
1217 99 mohor
 
1218
      gen_clk(1);
1219
    end
1220
 
1221
    tdi_pad_i<=#1 'hz;
1222 110 mohor
 
1223 114 mohor
    crc_in = 32'hffffffff;  // Initialize incoming CRC
1224 99 mohor
    gen_clk(`STATUS_LEN);   // Generating 4 clocks to read out status.
1225
 
1226
    for(i=0; i<`CRC_LEN -1; i=i+1)  // Getting in the CRC
1227
    begin
1228
      gen_clk(1);
1229
    end
1230
 
1231
    tms_pad_i<=#1 1;
1232
    gen_clk(1);         // to exit1_dr
1233
 
1234 110 mohor
    if (~crc_match_in)
1235
      begin
1236
        $display("(%0t) Incoming CRC failed !!!", $time);
1237
        $stop;
1238
      end
1239
 
1240 99 mohor
    tms_pad_i<=#1 1;
1241
    gen_clk(1);         // to update_dr
1242
    tms_pad_i<=#1 0;
1243
    gen_clk(1);         // to run_test_idle
1244
  end
1245
endtask       // debug_cpu_set_addr
1246
 
1247
 
1248
 
1249
 
1250
task debug_cpu_go;
1251
  input [2:0]   command;
1252
  input [31:0]  data;
1253
  input         gen_crc_err;
1254
  integer i, len;
1255
 
1256
 
1257 93 mohor
  begin
1258 99 mohor
    $display("(%0t) Task debug_cpu_go (previous command was %0s): ", $time, last_wb_cmd_text);
1259 88 mohor
 
1260 93 mohor
    tms_pad_i<=#1 1;
1261
    gen_clk(1);
1262
    tms_pad_i<=#1 0;
1263
    gen_clk(2);  // we are in shiftDR
1264 88 mohor
 
1265 114 mohor
    crc_out = 32'hffffffff; // Initialize outgoing CRC
1266 93 mohor
    tdi_pad_i<=#1 1'b0; // chain_select bit = 0
1267 114 mohor
    calculate_crc(1'b0);
1268 93 mohor
    gen_clk(1);
1269 88 mohor
 
1270 93 mohor
    for(i=2; i>=0; i=i-1)
1271
    begin
1272
      tdi_pad_i<=#1 command[i]; // command
1273 114 mohor
      calculate_crc(command[i]);
1274 93 mohor
      gen_clk(1);
1275
    end
1276 88 mohor
 
1277
 
1278 99 mohor
    if (last_wb_cmd == `CPU_WRITE32)
1279 93 mohor
      begin
1280 99 mohor
        len = 31;
1281
        $display("\t\tdata = 0x%x", data);
1282
      end
1283
    else if ((last_wb_cmd == `CPU_WRITE8) | (last_wb_cmd == `CPU_WRITE_REG))
1284
      begin
1285
        len = 7;
1286
        $display("\t\tdata = 0x%x", data[7:0]);
1287
      end
1288
    else
1289
      len = 0;
1290
 
1291
    if (len>0)  // When CPU_WRITEx was previously activated, data needs to be shifted.
1292
      begin
1293
        for (i=len; i>=0; i=i-1)
1294 93 mohor
          begin
1295 99 mohor
            tdi_pad_i<=#1 data[i];
1296 114 mohor
            calculate_crc(data[i]);
1297 93 mohor
            gen_clk(1);
1298
          end
1299
      end
1300 2 mohor
 
1301 99 mohor
    for(i=31; i>=0; i=i-1)
1302 93 mohor
    begin
1303 99 mohor
      if (gen_crc_err & (i==0))  // Generate crc error at last crc bit
1304 114 mohor
        tdi_pad_i<=#1 ~crc_out[i];   // error crc
1305 99 mohor
      else
1306 114 mohor
        tdi_pad_i<=#1 crc_out[i];    // ok crc
1307 99 mohor
 
1308 93 mohor
      gen_clk(1);
1309
    end
1310
 
1311
    tdi_pad_i<=#1 1'hz;
1312
 
1313 114 mohor
    crc_in = 32'hffffffff;  // Initialize incoming CRC
1314 93 mohor
 
1315 99 mohor
    if (last_wb_cmd == `CPU_READ32)
1316
      len = 32;
1317
    else if ((last_wb_cmd == `CPU_READ8) | (last_wb_cmd == `CPU_READ_REG))
1318
      len = 8;
1319
    else
1320
      len = 0;
1321 93 mohor
 
1322 99 mohor
    if (len>0)    // When CPU_WRITEx was previously activated, data needs to be shifted.
1323 93 mohor
      begin
1324 99 mohor
        $display("\t\tGenerating %0d clocks to read out the data.", len);
1325
        for (i=0; i<len; i=i+1)
1326 93 mohor
          gen_clk(1);
1327
      end
1328
 
1329
 
1330
    gen_clk(`STATUS_LEN);   // Generating 4 clocks to read out status.
1331
 
1332
    for(i=0; i<`CRC_LEN -1; i=i+1)  // Getting in the CRC
1333
    begin
1334
      gen_clk(1);
1335
    end
1336
 
1337
    tms_pad_i<=#1 1;
1338
    gen_clk(1);         // to exit1_dr
1339
 
1340 110 mohor
    if (~crc_match_in)
1341
      begin
1342
        $display("(%0t) Incoming CRC failed !!!", $time);
1343
        $stop;
1344
      end
1345
 
1346 93 mohor
    tms_pad_i<=#1 1;
1347
    gen_clk(1);         // to update_dr
1348
    tms_pad_i<=#1 0;
1349
    gen_clk(1);         // to run_test_idle
1350
  end
1351 99 mohor
endtask       // debug_cpu_go
1352 93 mohor
 
1353
 
1354
 
1355 113 mohor
always @ (posedge tck_pad_i)
1356
begin
1357
  in_data_be[31:1] <= #1 in_data_be[30:0];
1358
  in_data_be[0]    <= #1 tdo;
1359 93 mohor
 
1360 113 mohor
  in_data_le[31]   <= #1 tdo;
1361
  in_data_le[30:0] <= #1 in_data_le[31:1];
1362
end
1363 93 mohor
 
1364
 
1365
 
1366 114 mohor
// Calculating outgoing CRC
1367
task calculate_crc;
1368
  input data;
1369
 
1370
  begin
1371
    crc_out[0]  <= #1 data          ^ crc_out[31];
1372
    crc_out[1]  <= #1 data          ^ crc_out[0]  ^ crc_out[31];
1373
    crc_out[2]  <= #1 data          ^ crc_out[1]  ^ crc_out[31];
1374
    crc_out[3]  <= #1 crc_out[2];
1375
    crc_out[4]  <= #1 data          ^ crc_out[3]  ^ crc_out[31];
1376
    crc_out[5]  <= #1 data          ^ crc_out[4]  ^ crc_out[31];
1377
    crc_out[6]  <= #1 crc_out[5];
1378
    crc_out[7]  <= #1 data          ^ crc_out[6]  ^ crc_out[31];
1379
    crc_out[8]  <= #1 data          ^ crc_out[7]  ^ crc_out[31];
1380
    crc_out[9]  <= #1 crc_out[8];
1381
    crc_out[10] <= #1 data         ^ crc_out[9]  ^ crc_out[31];
1382
    crc_out[11] <= #1 data         ^ crc_out[10] ^ crc_out[31];
1383
    crc_out[12] <= #1 data         ^ crc_out[11] ^ crc_out[31];
1384
    crc_out[13] <= #1 crc_out[12];
1385
    crc_out[14] <= #1 crc_out[13];
1386
    crc_out[15] <= #1 crc_out[14];
1387
    crc_out[16] <= #1 data         ^ crc_out[15] ^ crc_out[31];
1388
    crc_out[17] <= #1 crc_out[16];
1389
    crc_out[18] <= #1 crc_out[17];
1390
    crc_out[19] <= #1 crc_out[18];
1391
    crc_out[20] <= #1 crc_out[19];
1392
    crc_out[21] <= #1 crc_out[20];
1393
    crc_out[22] <= #1 data         ^ crc_out[21] ^ crc_out[31];
1394
    crc_out[23] <= #1 data         ^ crc_out[22] ^ crc_out[31];
1395
    crc_out[24] <= #1 crc_out[23];
1396
    crc_out[25] <= #1 crc_out[24];
1397
    crc_out[26] <= #1 data         ^ crc_out[25] ^ crc_out[31];
1398
    crc_out[27] <= #1 crc_out[26];
1399
    crc_out[28] <= #1 crc_out[27];
1400
    crc_out[29] <= #1 crc_out[28];
1401
    crc_out[30] <= #1 crc_out[29];
1402
    crc_out[31] <= #1 crc_out[30];
1403
  end
1404
endtask // calculate_crc
1405 93 mohor
 
1406
 
1407 114 mohor
// Calculating and checking input CRC
1408
always @(posedge tck_pad_i)
1409
begin
1410
  crc_in[0]  <= #1 tdo           ^ crc_in[31];
1411
  crc_in[1]  <= #1 tdo           ^ crc_in[0]  ^ crc_in[31];
1412
  crc_in[2]  <= #1 tdo           ^ crc_in[1]  ^ crc_in[31];
1413
  crc_in[3]  <= #1 crc_in[2];
1414
  crc_in[4]  <= #1 tdo           ^ crc_in[3]  ^ crc_in[31];
1415
  crc_in[5]  <= #1 tdo           ^ crc_in[4]  ^ crc_in[31];
1416
  crc_in[6]  <= #1 crc_in[5];
1417
  crc_in[7]  <= #1 tdo           ^ crc_in[6]  ^ crc_in[31];
1418
  crc_in[8]  <= #1 tdo           ^ crc_in[7]  ^ crc_in[31];
1419
  crc_in[9]  <= #1 crc_in[8];
1420
  crc_in[10] <= #1 tdo          ^ crc_in[9]  ^ crc_in[31];
1421
  crc_in[11] <= #1 tdo          ^ crc_in[10] ^ crc_in[31];
1422
  crc_in[12] <= #1 tdo          ^ crc_in[11] ^ crc_in[31];
1423
  crc_in[13] <= #1 crc_in[12];
1424
  crc_in[14] <= #1 crc_in[13];
1425
  crc_in[15] <= #1 crc_in[14];
1426
  crc_in[16] <= #1 tdo          ^ crc_in[15] ^ crc_in[31];
1427
  crc_in[17] <= #1 crc_in[16];
1428
  crc_in[18] <= #1 crc_in[17];
1429
  crc_in[19] <= #1 crc_in[18];
1430
  crc_in[20] <= #1 crc_in[19];
1431
  crc_in[21] <= #1 crc_in[20];
1432
  crc_in[22] <= #1 tdo          ^ crc_in[21] ^ crc_in[31];
1433
  crc_in[23] <= #1 tdo          ^ crc_in[22] ^ crc_in[31];
1434
  crc_in[24] <= #1 crc_in[23];
1435
  crc_in[25] <= #1 crc_in[24];
1436
  crc_in[26] <= #1 tdo          ^ crc_in[25] ^ crc_in[31];
1437
  crc_in[27] <= #1 crc_in[26];
1438
  crc_in[28] <= #1 crc_in[27];
1439
  crc_in[29] <= #1 crc_in[28];
1440
  crc_in[30] <= #1 crc_in[29];
1441
  crc_in[31] <= #1 crc_in[30];
1442
end
1443 93 mohor
 
1444 114 mohor
assign crc_match_in = crc_in == 32'h0;
1445
 
1446
 
1447
 
1448 2 mohor
/**********************************************************************************
1449
*                                                                                 *
1450
*   Printing the information to the screen                                        *
1451
*                                                                                 *
1452
**********************************************************************************/
1453
 
1454 80 mohor
always @ (posedge tck_pad_i)
1455 2 mohor
begin
1456 80 mohor
  if(dbg_tb.i_tap_top.update_ir)
1457
    case(dbg_tb.i_tap_top.jtag_ir[`IR_LENGTH-1:0])
1458
      `EXTEST         : $display("\tInstruction EXTEST entered");
1459
      `SAMPLE_PRELOAD : $display("\tInstruction SAMPLE_PRELOAD entered");
1460
      `IDCODE         : $display("\tInstruction IDCODE entered");
1461
      `MBIST          : $display("\tInstruction MBIST entered");
1462
      `DEBUG          : $display("\tInstruction DEBUG entered");
1463
      `BYPASS         : $display("\tInstruction BYPASS entered");
1464
                default           :     $display("\n\tInstruction not valid. Instruction BYPASS activated !!!");
1465 2 mohor
    endcase
1466
end
1467
 
1468
 
1469
 
1470 80 mohor
// We never use following states: exit2_ir,  exit2_dr,  pause_ir or pause_dr
1471
always @ (posedge tck_pad_i)
1472 2 mohor
begin
1473 80 mohor
  if(dbg_tb.i_tap_top.pause_ir | dbg_tb.i_tap_top.exit2_ir)
1474 2 mohor
    begin
1475 80 mohor
      $display("\n(%0t) ERROR: State pause_ir or exit2_ir detected.", $time);
1476
      $display("(%0t) Simulation stopped !!!", $time);
1477
      $stop;
1478 2 mohor
    end
1479
end
1480
 
1481
 
1482 80 mohor
 
1483 73 mohor
 
1484 88 mohor
// Detecting CRC error
1485 114 mohor
always @ (posedge dbg_tb.i_dbg_top.i_dbg_wb.crc_cnt_end or posedge dbg_tb.i_dbg_top.chain_latch_en or posedge dbg_tb.i_dbg_top.i_dbg_cpu.crc_cnt_end)
1486 88 mohor
begin
1487
  #2;
1488
  if (~dbg_tb.i_dbg_top.crc_match)
1489
    begin
1490
      $display("\t\tCRC ERROR !!!");
1491 90 mohor
      $stop;
1492 88 mohor
    end
1493
end
1494 80 mohor
 
1495 88 mohor
 
1496 90 mohor
 
1497
// Detecting errors in counters
1498
always @ (dbg_tb.i_dbg_top.i_dbg_wb.cmd_cnt or
1499
          dbg_tb.i_dbg_top.i_dbg_wb.cmd_cnt_end or
1500
          dbg_tb.i_dbg_top.i_dbg_wb.addr_len_cnt or
1501
          dbg_tb.i_dbg_top.i_dbg_wb.addr_len_cnt_end or
1502
          dbg_tb.i_dbg_top.i_dbg_wb.data_cnt or
1503
          dbg_tb.i_dbg_top.i_dbg_wb.data_cnt_end or
1504
          dbg_tb.i_dbg_top.i_dbg_wb.cmd_cnt_en or
1505
          dbg_tb.i_dbg_top.i_dbg_wb.addr_len_cnt_en or
1506
          dbg_tb.i_dbg_top.i_dbg_wb.data_cnt_en or
1507
          dbg_tb.i_dbg_top.i_dbg_wb.crc_cnt_en or
1508
          dbg_tb.i_dbg_top.i_dbg_wb.status_cnt1
1509
          //dbg_tb.i_dbg_top.i_dbg_wb.status_cnt2 or
1510
          //dbg_tb.i_dbg_top.i_dbg_wb.status_cnt3 or
1511
          //dbg_tb.i_dbg_top.i_dbg_wb.status_cnt4
1512
          // dbg_tb.i_dbg_top.i_dbg_wb. or
1513
         )
1514
begin
1515
  if ((~dbg_tb.i_dbg_top.i_dbg_wb.cmd_cnt_end) & (
1516
                                                  dbg_tb.i_dbg_top.i_dbg_wb.addr_len_cnt_en |
1517
                                                  dbg_tb.i_dbg_top.i_dbg_wb.data_cnt_en     |
1518
                                                  dbg_tb.i_dbg_top.i_dbg_wb.crc_cnt_en      |
1519
                                                  dbg_tb.i_dbg_top.i_dbg_wb.status_cnt1
1520
                                                 )
1521
     )
1522
    begin
1523
      $display("\n\n\t\t(%0t) ERROR in counters !!!", $time);
1524
      #10000;
1525
      $stop;
1526
    end
1527
 
1528
 
1529
 
1530
end
1531
 
1532
 
1533
 
1534
 
1535
 
1536 91 mohor
 
1537 80 mohor
endmodule // dbg_tb
1538
 
1539
 

powered by: WebSVN 2.1.0

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