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 1235

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

powered by: WebSVN 2.1.0

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