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

Subversion Repositories or1k

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

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

powered by: WebSVN 2.1.0

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