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

Subversion Repositories or1k

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

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

powered by: WebSVN 2.1.0

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