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

Subversion Repositories or1k

[/] [or1k/] [tags/] [rel_16/] [or1200/] [rtl/] [verilog/] [or1200_du.v] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 504 lampret
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  OR1200's Debug Unit                                         ////
4
////                                                              ////
5
////  This file is part of the OpenRISC 1200 project              ////
6
////  http://www.opencores.org/cores/or1k/                        ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  Basic OR1200 debug unit.                                    ////
10
////                                                              ////
11
////  To Do:                                                      ////
12
////   - make it smaller and faster                               ////
13
////                                                              ////
14
////  Author(s):                                                  ////
15
////      - Damjan Lampret, lampret@opencores.org                 ////
16
////                                                              ////
17
//////////////////////////////////////////////////////////////////////
18
////                                                              ////
19
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
20
////                                                              ////
21
//// This source file may be used and distributed without         ////
22
//// restriction provided that this copyright statement is not    ////
23
//// removed from the file and that any derivative work contains  ////
24
//// the original copyright notice and the associated disclaimer. ////
25
////                                                              ////
26
//// This source file is free software; you can redistribute it   ////
27
//// and/or modify it under the terms of the GNU Lesser General   ////
28
//// Public License as published by the Free Software Foundation; ////
29
//// either version 2.1 of the License, or (at your option) any   ////
30
//// later version.                                               ////
31
////                                                              ////
32
//// This source is distributed in the hope that it will be       ////
33
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
34
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
35
//// PURPOSE.  See the GNU Lesser General Public License for more ////
36
//// details.                                                     ////
37
////                                                              ////
38
//// You should have received a copy of the GNU Lesser General    ////
39
//// Public License along with this source; if not, download it   ////
40
//// from http://www.opencores.org/lgpl.shtml                     ////
41
////                                                              ////
42
//////////////////////////////////////////////////////////////////////
43
//
44
// CVS Revision History
45
//
46
// $Log: not supported by cvs2svn $
47 1112 lampret
// Revision 1.8  2002/09/08 19:31:52  lampret
48
// Fixed a typo, reported by Taylor Su.
49
//
50 1038 lampret
// Revision 1.7  2002/07/14 22:17:17  lampret
51
// Added simple trace buffer [only for Xilinx Virtex target]. Fixed instruction fetch abort when new exception is recognized.
52
//
53 895 lampret
// Revision 1.6  2002/03/14 00:30:24  lampret
54
// Added alternative for critical path in DU.
55
//
56 737 lampret
// Revision 1.5  2002/02/11 04:33:17  lampret
57
// Speed optimizations (removed duplicate _cyc_ and _stb_). Fixed D/IMMU cache-inhibit attr.
58
//
59 660 lampret
// Revision 1.4  2002/01/28 01:16:00  lampret
60
// Changed 'void' nop-ops instead of insn[0] to use insn[16]. Debug unit stalls the tick timer. Prepared new flag generation for add and and insns. Blocked DC/IC while they are turned off. Fixed I/D MMU SPRs layout except WAYs. TODO: smart IC invalidate, l.j 2 and TLB ways.
61
//
62 617 lampret
// Revision 1.3  2002/01/18 07:56:00  lampret
63
// No more low/high priority interrupts (PICPR removed). Added tick timer exception. Added exception prefix (SR[EPH]). Fixed single-step bug whenreading NPC.
64
//
65 589 lampret
// Revision 1.2  2002/01/14 06:18:22  lampret
66
// Fixed mem2reg bug in FAST implementation. Updated debug unit to work with new genpc/if.
67
//
68 562 lampret
// Revision 1.1  2002/01/03 08:16:15  lampret
69
// New prefixes for RTL files, prefixed module names. Updated cache controllers and MMUs.
70
//
71 504 lampret
// Revision 1.12  2001/11/30 18:58:00  simons
72
// Trap insn couses break after exits ex_insn.
73
//
74
// Revision 1.11  2001/11/23 08:38:51  lampret
75
// Changed DSR/DRR behavior and exception detection.
76
//
77
// Revision 1.10  2001/11/20 21:25:44  lampret
78
// Fixed dbg_is_o assignment width.
79
//
80
// Revision 1.9  2001/11/20 18:46:14  simons
81
// Break point bug fixed
82
//
83
// Revision 1.8  2001/11/18 08:36:28  lampret
84
// For GDB changed single stepping and disabled trap exception.
85
//
86
// Revision 1.7  2001/10/21 18:09:53  lampret
87
// Fixed sensitivity list.
88
//
89
// Revision 1.6  2001/10/14 13:12:09  lampret
90
// MP3 version.
91
//
92
//
93
 
94
// synopsys translate_off
95
`include "timescale.v"
96
// synopsys translate_on
97
`include "or1200_defines.v"
98
 
99
//
100
// Debug unit
101
//
102
 
103
module or1200_du(
104
        // RISC Internal Interface
105
        clk, rst,
106 895 lampret
        dcpu_cycstb_i, dcpu_we_i, icpu_cycstb_i,
107
        ex_freeze, branch_op, ex_insn,
108
        spr_dat_npc, rf_dataw,
109
        du_dsr, du_stall, du_addr, du_dat_i, du_dat_o,
110
        du_read, du_write, du_except,
111 504 lampret
        spr_cs, spr_write, spr_addr, spr_dat_i, spr_dat_o,
112
 
113
        // External Debug Interface
114
        dbg_stall_i, dbg_dat_i, dbg_adr_i, dbg_op_i, dbg_ewt_i,
115
        dbg_lss_o, dbg_is_o, dbg_wp_o, dbg_bp_o, dbg_dat_o
116
);
117
 
118
parameter dw = `OR1200_OPERAND_WIDTH;
119
parameter aw = `OR1200_OPERAND_WIDTH;
120
 
121
//
122
// I/O
123
//
124
 
125
//
126
// RISC Internal Interface
127
//
128
input                           clk;            // Clock
129
input                           rst;            // Reset
130 660 lampret
input                           dcpu_cycstb_i;  // LSU status
131 504 lampret
input                           dcpu_we_i;      // LSU status
132 660 lampret
input   [`OR1200_FETCHOP_WIDTH-1:0]      icpu_cycstb_i;  // IFETCH unit status
133 504 lampret
input                           ex_freeze;      // EX stage freeze
134
input   [`OR1200_BRANCHOP_WIDTH-1:0]     branch_op;      // Branch op
135
input   [dw-1:0]         ex_insn;        // EX insn
136 895 lampret
input   [31:0]                   spr_dat_npc;    // Next PC (for trace)
137
input   [31:0]                   rf_dataw;       // ALU result (for trace)
138 504 lampret
output  [`OR1200_DU_DSR_WIDTH-1:0]     du_dsr;           // DSR
139
output                          du_stall;       // Debug Unit Stall
140
output  [aw-1:0]         du_addr;        // Debug Unit Address
141
input   [dw-1:0]         du_dat_i;       // Debug Unit Data In
142
output  [dw-1:0]         du_dat_o;       // Debug Unit Data Out
143
output                          du_read;        // Debug Unit Read Enable
144
output                          du_write;       // Debug Unit Write Enable
145
input   [12:0]                   du_except;      // Exception masked by DSR
146
input                           spr_cs;         // SPR Chip Select
147
input                           spr_write;      // SPR Read/Write
148
input   [aw-1:0]         spr_addr;       // SPR Address
149
input   [dw-1:0]         spr_dat_i;      // SPR Data Input
150
output  [dw-1:0]         spr_dat_o;      // SPR Data Output
151
 
152
//
153
// External Debug Interface
154
//
155
input                           dbg_stall_i;    // External Stall Input
156
input   [dw-1:0]         dbg_dat_i;      // External Data Input
157
input   [aw-1:0]         dbg_adr_i;      // External Address Input
158
input   [2:0]                    dbg_op_i;       // External Operation Select Input
159
input                           dbg_ewt_i;      // External Watchpoint Trigger Input
160
output  [3:0]                    dbg_lss_o;      // External Load/Store Unit Status
161
output  [1:0]                    dbg_is_o;       // External Insn Fetch Status
162
output  [10:0]                   dbg_wp_o;       // Watchpoints Outputs
163
output                          dbg_bp_o;       // Breakpoint Output
164
output  [dw-1:0]         dbg_dat_o;      // External Data Output
165
 
166
 
167
//
168
// Some connections go directly from the CPU through DU to Debug I/F
169
//
170 737 lampret
`ifdef OR1200_DU_STATUS_UNIMPLEMENTED
171
assign dbg_lss_o = 4'b0000;
172 895 lampret
 
173
reg     [1:0]                    dbg_is_o;
174
//
175
// Show insn activity (temp, must be removed)
176
//
177
always @(posedge clk or posedge rst)
178
        if (rst)
179
                dbg_is_o <= #1 2'b00;
180
        else if (!ex_freeze &
181
                ~((ex_insn[31:26] == `OR1200_OR32_NOP) & ex_insn[16]))
182
                dbg_is_o <= #1 ~dbg_is_o;
183
`ifdef UNUSED
184 737 lampret
assign dbg_is_o = 2'b00;
185 895 lampret
`endif
186 737 lampret
`else
187 660 lampret
assign dbg_lss_o = dcpu_cycstb_i ? {dcpu_we_i, 3'b000} : 4'b0000;
188
assign dbg_is_o = {1'b0, icpu_cycstb_i};
189 737 lampret
`endif
190 504 lampret
assign dbg_wp_o = 11'b000_0000_0000;
191
assign dbg_dat_o = du_dat_i;
192
 
193
//
194
// Some connections go directly from Debug I/F through DU to the CPU
195
//
196
assign du_stall = dbg_stall_i;
197
assign du_addr = dbg_adr_i;
198
assign du_dat_o = dbg_dat_i;
199
assign du_read = (dbg_op_i == `OR1200_DU_OP_READSPR);
200
assign du_write = (dbg_op_i == `OR1200_DU_OP_WRITESPR);
201
 
202
`ifdef OR1200_DU_IMPLEMENTED
203
 
204
//
205
// Debug Mode Register 1 (only ST and BT implemented)
206
//
207
`ifdef OR1200_DU_DMR1
208
reg     [23:22]                 dmr1;           // DMR1 implemented (ST & BT)
209
`else
210
wire    [23:22]                 dmr1;           // DMR1 not implemented
211
`endif
212
 
213
//
214
// Debug Mode Register 2 (not implemented)
215
//
216
`ifdef OR1200_DU_DMR2
217
wire    [31:0]                   dmr2;           // DMR not implemented
218
`endif
219
 
220
//
221
// Debug Stop Register
222
//
223
`ifdef OR1200_DU_DSR
224
reg     [`OR1200_DU_DSR_WIDTH-1:0]       dsr;            // DSR implemented
225
`else
226
wire    [`OR1200_DU_DSR_WIDTH-1:0]       dsr;            // DSR not implemented
227
`endif
228
 
229
//
230
// Debug Reason Register
231
//
232
`ifdef OR1200_DU_DRR
233
reg     [13:0]                   drr;            // DRR implemented
234
`else
235
wire    [13:0]                   drr;            // DRR not implemented
236
`endif
237
 
238
//
239
// Internal wires
240
//
241
wire                            dmr1_sel;       // DMR1 select
242
wire                            dsr_sel;        // DSR select
243
wire                            drr_sel;        // DRR select
244
reg                             dbg_bp_r;
245
`ifdef OR1200_DU_READREGS
246
reg     [31:0]                   spr_dat_o;
247
`endif
248
reg     [13:0]                   except_stop;    // Exceptions that stop because of DSR
249 895 lampret
`ifdef OR1200_DU_TB_IMPLEMENTED
250
wire                            tb_enw;
251
reg     [7:0]                    tb_wadr;
252
reg [31:0]                       tb_timstmp;
253
`endif
254
wire    [31:0]                   tbia_dat_o;
255
wire    [31:0]                   tbim_dat_o;
256
wire    [31:0]                   tbar_dat_o;
257
wire    [31:0]                   tbts_dat_o;
258 504 lampret
 
259
//
260
// DU registers address decoder
261
//
262
`ifdef OR1200_DU_DMR1
263 895 lampret
assign dmr1_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_OFS_DMR1));
264 504 lampret
`endif
265
`ifdef OR1200_DU_DSR
266 895 lampret
assign dsr_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_OFS_DSR));
267 504 lampret
`endif
268
`ifdef OR1200_DU_DRR
269 895 lampret
assign drr_sel = (spr_cs && (spr_addr[`OR1200_DUOFS_BITS] == `OR1200_DU_OFS_DRR));
270 504 lampret
`endif
271
 
272
//
273
// Decode started exception
274
//
275
always @(du_except) begin
276
        except_stop = 14'b0000_0000_0000;
277
        casex (du_except)
278 617 lampret
                13'b1_xxxx_xxxx_xxxx:
279
                        except_stop[`OR1200_DU_DRR_TTE] = 1'b1;
280
                13'b0_1xxx_xxxx_xxxx: begin
281 589 lampret
                        except_stop[`OR1200_DU_DRR_IE] = 1'b1;
282 504 lampret
                end
283 617 lampret
                13'b0_01xx_xxxx_xxxx: begin
284 504 lampret
                        except_stop[`OR1200_DU_DRR_IME] = 1'b1;
285
                end
286 617 lampret
                13'b0_001x_xxxx_xxxx:
287 504 lampret
                        except_stop[`OR1200_DU_DRR_IPFE] = 1'b1;
288 617 lampret
                13'b0_0001_xxxx_xxxx: begin
289 504 lampret
                        except_stop[`OR1200_DU_DRR_BUSEE] = 1'b1;
290
                end
291 617 lampret
                13'b0_0000_1xxx_xxxx:
292 504 lampret
                        except_stop[`OR1200_DU_DRR_IIE] = 1'b1;
293 617 lampret
                13'b0_0000_01xx_xxxx: begin
294 504 lampret
                        except_stop[`OR1200_DU_DRR_AE] = 1'b1;
295
                end
296 617 lampret
                13'b0_0000_001x_xxxx: begin
297 504 lampret
                        except_stop[`OR1200_DU_DRR_DME] = 1'b1;
298
                end
299 617 lampret
                13'b0_0000_0001_xxxx:
300 504 lampret
                        except_stop[`OR1200_DU_DRR_DPFE] = 1'b1;
301 617 lampret
                13'b0_0000_0000_1xxx:
302 504 lampret
                        except_stop[`OR1200_DU_DRR_BUSEE] = 1'b1;
303
                13'b0_0000_0000_01xx: begin
304
                        except_stop[`OR1200_DU_DRR_RE] = 1'b1;
305
                end
306
                13'b0_0000_0000_001x: begin
307
                        except_stop[`OR1200_DU_DRR_TE] = 1'b1;
308
                end
309
                13'b0_0000_0000_0001:
310
                        except_stop[`OR1200_DU_DRR_SCE] = 1'b1;
311
                default:
312
                        except_stop = 14'b0000_0000_0000;
313
        endcase
314
end
315
 
316
//
317
// dbg_bp_o is registered
318
//
319
assign dbg_bp_o = dbg_bp_r;
320
 
321
//
322
// Breakpoint activation register
323
//
324
always @(posedge clk or posedge rst)
325
        if (rst)
326
                dbg_bp_r <= #1 1'b0;
327
        else if (!ex_freeze)
328
                dbg_bp_r <= #1 |except_stop
329
`ifdef OR1200_DU_DMR1_ST
330 617 lampret
                        | ~((ex_insn[31:26] == `OR1200_OR32_NOP) & ex_insn[16]) & dmr1[`OR1200_DU_DMR1_ST]
331 504 lampret
`endif
332
`ifdef OR1200_DU_DMR1_BT
333
                        | (branch_op != `OR1200_BRANCHOP_NOP) & dmr1[`OR1200_DU_DMR1_BT]
334
`endif
335
                        ;
336
        else
337 562 lampret
                dbg_bp_r <= #1 |except_stop;
338 504 lampret
 
339
//
340
// Write to DMR1
341
//
342
`ifdef OR1200_DU_DMR1
343
always @(posedge clk or posedge rst)
344
        if (rst)
345
                dmr1 <= 2'b00;
346
        else if (dmr1_sel && spr_write)
347
                dmr1 <= #1 spr_dat_i[23:22];
348
`else
349
assign dmr1 = 2'b00;
350
`endif
351
 
352
//
353
// DMR2 bits tied to zero
354
//
355
`ifdef OR1200_DU_DMR2
356
assign dmr2 = 32'h0000_0000;
357
`endif
358
 
359
//
360
// Write to DSR
361
//
362
`ifdef OR1200_DU_DSR
363
always @(posedge clk or posedge rst)
364
        if (rst)
365
                dsr <= {`OR1200_DU_DSR_WIDTH{1'b0}};
366
        else if (dsr_sel && spr_write)
367
                dsr <= #1 spr_dat_i[`OR1200_DU_DSR_WIDTH-1:0];
368
`else
369
assign dsr = {`OR1200_DU_DSR_WIDTH{1'b0}};
370
`endif
371
 
372
//
373
// Write to DRR
374
//
375
`ifdef OR1200_DU_DRR
376
always @(posedge clk or posedge rst)
377
        if (rst)
378
                drr <= 14'b0;
379
        else if (drr_sel && spr_write)
380
                drr <= #1 spr_dat_i[13:0];
381
        else
382
                drr <= #1 drr | except_stop;
383
`else
384
assign drr = 14'b0;
385
`endif
386
 
387
//
388
// Read DU registers
389
//
390
`ifdef OR1200_DU_READREGS
391 1112 lampret
always @(spr_addr or dsr or drr or dmr1 or dmr2
392 1038 lampret
`ifdef OR1200_DU_TB_IMPLEMENTED
393 1112 lampret
        or tb_wadr or tbia_dat_o or tbim_dat_o
394
        or tbar_dat_o or tbts_dat_o
395 1038 lampret
`endif
396
        )
397 895 lampret
        casex (spr_addr[`OR1200_DUOFS_BITS]) // synopsys parallel_case
398 504 lampret
`ifdef OR1200_DU_DMR1
399
                `OR1200_DU_OFS_DMR1:
400
                        spr_dat_o = {8'b0, dmr1, 22'b0};
401
`endif
402
`ifdef OR1200_DU_DMR2
403
                `OR1200_DU_OFS_DMR2:
404
                        spr_dat_o = dmr2;
405
`endif
406
`ifdef OR1200_DU_DSR
407
                `OR1200_DU_OFS_DSR:
408
                        spr_dat_o = {18'b0, dsr};
409
`endif
410
`ifdef OR1200_DU_DRR
411
                `OR1200_DU_OFS_DRR:
412
                        spr_dat_o = {18'b0, drr};
413
`endif
414 895 lampret
`ifdef OR1200_DU_TB_IMPLEMENTED
415
                `OR1200_DU_OFS_TBADR:
416
                        spr_dat_o = {24'h000000, tb_wadr};
417
                `OR1200_DU_OFS_TBIA:
418
                        spr_dat_o = tbia_dat_o;
419
                `OR1200_DU_OFS_TBIM:
420
                        spr_dat_o = tbim_dat_o;
421
                `OR1200_DU_OFS_TBAR:
422
                        spr_dat_o = tbar_dat_o;
423
                `OR1200_DU_OFS_TBTS:
424
                        spr_dat_o = tbts_dat_o;
425
`endif
426 504 lampret
                default:
427
                        spr_dat_o = 32'h0000_0000;
428
        endcase
429
`endif
430
 
431
//
432
// DSR alias
433
//
434
assign du_dsr = dsr;
435
 
436 895 lampret
`ifdef OR1200_DU_TB_IMPLEMENTED
437
//
438
// Simple trace buffer
439
// (right now hardcoded for Xilinx Virtex FPGAs)
440
//
441
// Stores last 256 instruction addresses, instruction
442
// machine words and ALU results
443
//
444
 
445
//
446
// Trace buffer write enable
447
//
448
assign tb_enw = ~ex_freeze & ~((ex_insn[31:26] == `OR1200_OR32_NOP) & ex_insn[16]);
449
 
450
//
451
// Trace buffer write address pointer
452
//
453
always @(posedge clk or posedge rst)
454
        if (rst)
455
                tb_wadr <= #1 8'h00;
456
        else if (tb_enw)
457
                tb_wadr <= #1 tb_wadr + 8'd1;
458
 
459
//
460
// Free running counter (time stamp)
461
//
462
always @(posedge clk or posedge rst)
463
        if (rst)
464
                tb_timstmp <= #1 32'h00000000;
465
        else if (!dbg_bp_r)
466
                tb_timstmp <= #1 tb_timstmp + 32'd1;
467
 
468
//
469
// Trace buffer RAMs
470
//
471
RAMB4_S16_S16 tbia_ramb4_s16_0(
472
        .CLKA(clk),
473
        .RSTA(rst),
474
        .ADDRA(tb_wadr),
475
        .DIA(spr_dat_npc[15:0]),
476
        .ENA(1'b1),
477
        .WEA(tb_enw),
478
        .DOA(),
479
 
480
        .CLKB(clk),
481
        .RSTB(rst),
482
        .ADDRB(spr_addr[7:0]),
483
        .DIB(16'h0000),
484
        .ENB(1'b1),
485
        .WEB(1'b0),
486
        .DOB(tbia_dat_o[15:0])
487
);
488
 
489
RAMB4_S16_S16 tbia_ramb4_s16_1(
490
        .CLKA(clk),
491
        .RSTA(rst),
492
        .ADDRA(tb_wadr),
493
        .DIA(spr_dat_npc[31:16]),
494
        .ENA(1'b1),
495
        .WEA(tb_enw),
496
        .DOA(),
497
 
498
        .CLKB(clk),
499
        .RSTB(rst),
500
        .ADDRB(spr_addr[7:0]),
501
        .DIB(16'h0000),
502
        .ENB(1'b1),
503
        .WEB(1'b0),
504
        .DOB(tbia_dat_o[31:16])
505
);
506
 
507
RAMB4_S16_S16 tbim_ramb4_s16_0(
508
        .CLKA(clk),
509
        .RSTA(rst),
510
        .ADDRA(tb_wadr),
511
        .DIA(ex_insn[15:0]),
512
        .ENA(1'b1),
513
        .WEA(tb_enw),
514
        .DOA(),
515
 
516
        .CLKB(clk),
517
        .RSTB(rst),
518
        .ADDRB(spr_addr[7:0]),
519
        .DIB(16'h0000),
520
        .ENB(1'b1),
521
        .WEB(1'b0),
522
        .DOB(tbim_dat_o[15:0])
523
);
524
 
525
RAMB4_S16_S16 tbim_ramb4_s16_1(
526
        .CLKA(clk),
527
        .RSTA(rst),
528
        .ADDRA(tb_wadr),
529
        .DIA(ex_insn[31:16]),
530
        .ENA(1'b1),
531
        .WEA(tb_enw),
532
        .DOA(),
533
 
534
        .CLKB(clk),
535
        .RSTB(rst),
536
        .ADDRB(spr_addr[7:0]),
537
        .DIB(16'h0000),
538
        .ENB(1'b1),
539
        .WEB(1'b0),
540
        .DOB(tbim_dat_o[31:16])
541
);
542
 
543
RAMB4_S16_S16 tbar_ramb4_s16_0(
544
        .CLKA(clk),
545
        .RSTA(rst),
546
        .ADDRA(tb_wadr),
547
        .DIA(rf_dataw[15:0]),
548
        .ENA(1'b1),
549
        .WEA(tb_enw),
550
        .DOA(),
551
 
552
        .CLKB(clk),
553
        .RSTB(rst),
554
        .ADDRB(spr_addr[7:0]),
555
        .DIB(16'h0000),
556
        .ENB(1'b1),
557
        .WEB(1'b0),
558
        .DOB(tbar_dat_o[15:0])
559
);
560
 
561
RAMB4_S16_S16 tbar_ramb4_s16_1(
562
        .CLKA(clk),
563
        .RSTA(rst),
564
        .ADDRA(tb_wadr),
565
        .DIA(rf_dataw[31:16]),
566
        .ENA(1'b1),
567
        .WEA(tb_enw),
568
        .DOA(),
569
 
570
        .CLKB(clk),
571
        .RSTB(rst),
572
        .ADDRB(spr_addr[7:0]),
573
        .DIB(16'h0000),
574
        .ENB(1'b1),
575
        .WEB(1'b0),
576
        .DOB(tbar_dat_o[31:16])
577
);
578
 
579
RAMB4_S16_S16 tbts_ramb4_s16_0(
580
        .CLKA(clk),
581
        .RSTA(rst),
582
        .ADDRA(tb_wadr),
583
        .DIA(tb_timstmp[15:0]),
584
        .ENA(1'b1),
585
        .WEA(tb_enw),
586
        .DOA(),
587
 
588
        .CLKB(clk),
589
        .RSTB(rst),
590
        .ADDRB(spr_addr[7:0]),
591
        .DIB(16'h0000),
592
        .ENB(1'b1),
593
        .WEB(1'b0),
594
        .DOB(tbts_dat_o[15:0])
595
);
596
 
597
RAMB4_S16_S16 tbts_ramb4_s16_1(
598
        .CLKA(clk),
599
        .RSTA(rst),
600
        .ADDRA(tb_wadr),
601
        .DIA(tb_timstmp[31:16]),
602
        .ENA(1'b1),
603
        .WEA(tb_enw),
604
        .DOA(),
605
 
606
        .CLKB(clk),
607
        .RSTB(rst),
608
        .ADDRB(spr_addr[7:0]),
609
        .DIB(16'h0000),
610
        .ENB(1'b1),
611
        .WEB(1'b0),
612
        .DOB(tbts_dat_o[31:16])
613
);
614
 
615 504 lampret
`else
616 895 lampret
assign tbia_dat_o = 32'h0000_0000;
617
assign tbim_dat_o = 32'h0000_0000;
618
assign tbar_dat_o = 32'h0000_0000;
619
assign tbts_dat_o = 32'h0000_0000;
620 504 lampret
 
621 895 lampret
`endif  // OR1200_DU_TB_IMPLEMENTED
622
 
623
`else   // OR1200_DU_IMPLEMENTED
624
 
625 504 lampret
//
626
// When DU is not implemented, drive all outputs as would when DU is disabled
627
//
628
assign dbg_bp_o = 1'b0;
629
assign du_dsr = {`OR1200_DU_DSR_WIDTH{1'b0}};
630
 
631
//
632
// Read DU registers
633
//
634
`ifdef OR1200_DU_READREGS
635
assign spr_dat_o = 32'h0000_0000;
636
`ifdef OR1200_DU_UNUSED_ZERO
637
`endif
638
`endif
639
 
640
`endif
641
 
642
endmodule

powered by: WebSVN 2.1.0

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