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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [rtl/] [verilog/] [tc_top.v] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1327 jcastillo
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  Xess Traffic Cop                                            ////
4
////                                                              ////
5
////  This file is part of the OR1K test application              ////
6
////  http://www.opencores.org/cores/or1k/                        ////
7
////                                                              ////
8
////  Description                                                 ////
9
////  This block connectes the RISC and peripheral controller     ////
10
////  cores together.                                             ////
11
////                                                              ////
12
////  To Do:                                                      ////
13
////   - nothing really                                           ////
14
////                                                              ////
15
////  Author(s):                                                  ////
16
////      - Damjan Lampret, lampret@opencores.org                 ////
17
////                                                              ////
18
//////////////////////////////////////////////////////////////////////
19
////                                                              ////
20
//// Copyright (C) 2002 OpenCores                                 ////
21
////                                                              ////
22
//// This source file may be used and distributed without         ////
23
//// restriction provided that this copyright statement is not    ////
24
//// removed from the file and that any derivative work contains  ////
25
//// the original copyright notice and the associated disclaimer. ////
26
////                                                              ////
27
//// This source file is free software; you can redistribute it   ////
28
//// and/or modify it under the terms of the GNU Lesser General   ////
29
//// Public License as published by the Free Software Foundation; ////
30
//// either version 2.1 of the License, or (at your option) any   ////
31
//// later version.                                               ////
32
////                                                              ////
33
//// This source is distributed in the hope that it will be       ////
34
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
35
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
36
//// PURPOSE.  See the GNU Lesser General Public License for more ////
37
//// details.                                                     ////
38
////                                                              ////
39
//// You should have received a copy of the GNU Lesser General    ////
40
//// Public License along with this source; if not, download it   ////
41
//// from http://www.opencores.org/lgpl.shtml                     ////
42
////                                                              ////
43
//////////////////////////////////////////////////////////////////////
44
//
45
// CVS Revision History
46
//
47
// $Log: not supported by cvs2svn $
48
 
49
 
50
// synopsys translate_off
51
`include "timescale.v"
52
// synopsys translate_on
53
 
54
//
55
// Width of address bus
56
//
57
`define TC_AW           32
58
 
59
//
60
// Width of data bus
61
//
62
`define TC_DW           32
63
 
64
//
65
// Width of byte select bus
66
//
67
`define TC_BSW          4
68
 
69
//
70
// Width of WB target inputs (coming from WB slave)
71
//
72
// data bus width + ack + err
73
//
74
`define TC_TIN_W        `TC_DW+1+1
75
 
76
//
77
// Width of WB initiator inputs (coming from WB masters)
78
//
79
// cyc + stb + cab + address bus width +
80
// byte select bus width + we + data bus width
81
//
82
`define TC_IIN_W        1+1+1+`TC_AW+`TC_BSW+1+`TC_DW
83
 
84
//
85
// Traffic Cop Top
86
//
87
module tc_top (
88
        wb_clk_i,
89
        wb_rst_i,
90
 
91
        i0_wb_cyc_i,
92
        i0_wb_stb_i,
93
        i0_wb_cab_i,
94
        i0_wb_adr_i,
95
        i0_wb_sel_i,
96
        i0_wb_we_i,
97
        i0_wb_dat_i,
98
        i0_wb_dat_o,
99
        i0_wb_ack_o,
100
        i0_wb_err_o,
101
 
102
        i1_wb_cyc_i,
103
        i1_wb_stb_i,
104
        i1_wb_cab_i,
105
        i1_wb_adr_i,
106
        i1_wb_sel_i,
107
        i1_wb_we_i,
108
        i1_wb_dat_i,
109
        i1_wb_dat_o,
110
        i1_wb_ack_o,
111
        i1_wb_err_o,
112
 
113
        i2_wb_cyc_i,
114
        i2_wb_stb_i,
115
        i2_wb_cab_i,
116
        i2_wb_adr_i,
117
        i2_wb_sel_i,
118
        i2_wb_we_i,
119
        i2_wb_dat_i,
120
        i2_wb_dat_o,
121
        i2_wb_ack_o,
122
        i2_wb_err_o,
123
 
124
        i3_wb_cyc_i,
125
        i3_wb_stb_i,
126
        i3_wb_cab_i,
127
        i3_wb_adr_i,
128
        i3_wb_sel_i,
129
        i3_wb_we_i,
130
        i3_wb_dat_i,
131
        i3_wb_dat_o,
132
        i3_wb_ack_o,
133
        i3_wb_err_o,
134
 
135
        i4_wb_cyc_i,
136
        i4_wb_stb_i,
137
        i4_wb_cab_i,
138
        i4_wb_adr_i,
139
        i4_wb_sel_i,
140
        i4_wb_we_i,
141
        i4_wb_dat_i,
142
        i4_wb_dat_o,
143
        i4_wb_ack_o,
144
        i4_wb_err_o,
145
 
146
        i5_wb_cyc_i,
147
        i5_wb_stb_i,
148
        i5_wb_cab_i,
149
        i5_wb_adr_i,
150
        i5_wb_sel_i,
151
        i5_wb_we_i,
152
        i5_wb_dat_i,
153
        i5_wb_dat_o,
154
        i5_wb_ack_o,
155
        i5_wb_err_o,
156
 
157
        i6_wb_cyc_i,
158
        i6_wb_stb_i,
159
        i6_wb_cab_i,
160
        i6_wb_adr_i,
161
        i6_wb_sel_i,
162
        i6_wb_we_i,
163
        i6_wb_dat_i,
164
        i6_wb_dat_o,
165
        i6_wb_ack_o,
166
        i6_wb_err_o,
167
 
168
        i7_wb_cyc_i,
169
        i7_wb_stb_i,
170
        i7_wb_cab_i,
171
        i7_wb_adr_i,
172
        i7_wb_sel_i,
173
        i7_wb_we_i,
174
        i7_wb_dat_i,
175
        i7_wb_dat_o,
176
        i7_wb_ack_o,
177
        i7_wb_err_o,
178
 
179
        t0_wb_cyc_o,
180
        t0_wb_stb_o,
181
        t0_wb_cab_o,
182
        t0_wb_adr_o,
183
        t0_wb_sel_o,
184
        t0_wb_we_o,
185
        t0_wb_dat_o,
186
        t0_wb_dat_i,
187
        t0_wb_ack_i,
188
        t0_wb_err_i,
189
 
190
        t1_wb_cyc_o,
191
        t1_wb_stb_o,
192
        t1_wb_cab_o,
193
        t1_wb_adr_o,
194
        t1_wb_sel_o,
195
        t1_wb_we_o,
196
        t1_wb_dat_o,
197
        t1_wb_dat_i,
198
        t1_wb_ack_i,
199
        t1_wb_err_i,
200
 
201
        t2_wb_cyc_o,
202
        t2_wb_stb_o,
203
        t2_wb_cab_o,
204
        t2_wb_adr_o,
205
        t2_wb_sel_o,
206
        t2_wb_we_o,
207
        t2_wb_dat_o,
208
        t2_wb_dat_i,
209
        t2_wb_ack_i,
210
        t2_wb_err_i,
211
 
212
        t3_wb_cyc_o,
213
        t3_wb_stb_o,
214
        t3_wb_cab_o,
215
        t3_wb_adr_o,
216
        t3_wb_sel_o,
217
        t3_wb_we_o,
218
        t3_wb_dat_o,
219
        t3_wb_dat_i,
220
        t3_wb_ack_i,
221
        t3_wb_err_i,
222
 
223
        t4_wb_cyc_o,
224
        t4_wb_stb_o,
225
        t4_wb_cab_o,
226
        t4_wb_adr_o,
227
        t4_wb_sel_o,
228
        t4_wb_we_o,
229
        t4_wb_dat_o,
230
        t4_wb_dat_i,
231
        t4_wb_ack_i,
232
        t4_wb_err_i,
233
 
234
        t5_wb_cyc_o,
235
        t5_wb_stb_o,
236
        t5_wb_cab_o,
237
        t5_wb_adr_o,
238
        t5_wb_sel_o,
239
        t5_wb_we_o,
240
        t5_wb_dat_o,
241
        t5_wb_dat_i,
242
        t5_wb_ack_i,
243
        t5_wb_err_i,
244
 
245
        t6_wb_cyc_o,
246
        t6_wb_stb_o,
247
        t6_wb_cab_o,
248
        t6_wb_adr_o,
249
        t6_wb_sel_o,
250
        t6_wb_we_o,
251
        t6_wb_dat_o,
252
        t6_wb_dat_i,
253
        t6_wb_ack_i,
254
        t6_wb_err_i,
255
 
256
        t7_wb_cyc_o,
257
        t7_wb_stb_o,
258
        t7_wb_cab_o,
259
        t7_wb_adr_o,
260
        t7_wb_sel_o,
261
        t7_wb_we_o,
262
        t7_wb_dat_o,
263
        t7_wb_dat_i,
264
        t7_wb_ack_i,
265
        t7_wb_err_i,
266
 
267
        t8_wb_cyc_o,
268
        t8_wb_stb_o,
269
        t8_wb_cab_o,
270
        t8_wb_adr_o,
271
        t8_wb_sel_o,
272
        t8_wb_we_o,
273
        t8_wb_dat_o,
274
        t8_wb_dat_i,
275
        t8_wb_ack_i,
276
        t8_wb_err_i
277
 
278
);
279
 
280
//
281
// Parameters
282
//
283
parameter               t0_addr_w = 4;
284
parameter               t0_addr = 4'd8;
285
parameter               t1_addr_w = 4;
286
parameter               t1_addr = 4'd0;
287
parameter               t28c_addr_w = 4;
288
parameter               t28_addr = 4'd0;
289
parameter               t28i_addr_w = 4;
290
parameter               t2_addr = 4'd1;
291
parameter               t3_addr = 4'd2;
292
parameter               t4_addr = 4'd3;
293
parameter               t5_addr = 4'd4;
294
parameter               t6_addr = 4'd5;
295
parameter               t7_addr = 4'd6;
296
parameter               t8_addr = 4'd7;
297
 
298
//
299
// I/O Ports
300
//
301
input                   wb_clk_i;
302
input                   wb_rst_i;
303
 
304
//
305
// WB slave i/f connecting initiator 0
306
//
307
input                   i0_wb_cyc_i;
308
input                   i0_wb_stb_i;
309
input                   i0_wb_cab_i;
310
input   [`TC_AW-1:0]     i0_wb_adr_i;
311
input   [`TC_BSW-1:0]    i0_wb_sel_i;
312
input                   i0_wb_we_i;
313
input   [`TC_DW-1:0]     i0_wb_dat_i;
314
output  [`TC_DW-1:0]     i0_wb_dat_o;
315
output                  i0_wb_ack_o;
316
output                  i0_wb_err_o;
317
 
318
//
319
// WB slave i/f connecting initiator 1
320
//
321
input                   i1_wb_cyc_i;
322
input                   i1_wb_stb_i;
323
input                   i1_wb_cab_i;
324
input   [`TC_AW-1:0]     i1_wb_adr_i;
325
input   [`TC_BSW-1:0]    i1_wb_sel_i;
326
input                   i1_wb_we_i;
327
input   [`TC_DW-1:0]     i1_wb_dat_i;
328
output  [`TC_DW-1:0]     i1_wb_dat_o;
329
output                  i1_wb_ack_o;
330
output                  i1_wb_err_o;
331
 
332
//
333
// WB slave i/f connecting initiator 2
334
//
335
input                   i2_wb_cyc_i;
336
input                   i2_wb_stb_i;
337
input                   i2_wb_cab_i;
338
input   [`TC_AW-1:0]     i2_wb_adr_i;
339
input   [`TC_BSW-1:0]    i2_wb_sel_i;
340
input                   i2_wb_we_i;
341
input   [`TC_DW-1:0]     i2_wb_dat_i;
342
output  [`TC_DW-1:0]     i2_wb_dat_o;
343
output                  i2_wb_ack_o;
344
output                  i2_wb_err_o;
345
 
346
//
347
// WB slave i/f connecting initiator 3
348
//
349
input                   i3_wb_cyc_i;
350
input                   i3_wb_stb_i;
351
input                   i3_wb_cab_i;
352
input   [`TC_AW-1:0]     i3_wb_adr_i;
353
input   [`TC_BSW-1:0]    i3_wb_sel_i;
354
input                   i3_wb_we_i;
355
input   [`TC_DW-1:0]     i3_wb_dat_i;
356
output  [`TC_DW-1:0]     i3_wb_dat_o;
357
output                  i3_wb_ack_o;
358
output                  i3_wb_err_o;
359
 
360
//
361
// WB slave i/f connecting initiator 4
362
//
363
input                   i4_wb_cyc_i;
364
input                   i4_wb_stb_i;
365
input                   i4_wb_cab_i;
366
input   [`TC_AW-1:0]     i4_wb_adr_i;
367
input   [`TC_BSW-1:0]    i4_wb_sel_i;
368
input                   i4_wb_we_i;
369
input   [`TC_DW-1:0]     i4_wb_dat_i;
370
output  [`TC_DW-1:0]     i4_wb_dat_o;
371
output                  i4_wb_ack_o;
372
output                  i4_wb_err_o;
373
 
374
//
375
// WB slave i/f connecting initiator 5
376
//
377
input                   i5_wb_cyc_i;
378
input                   i5_wb_stb_i;
379
input                   i5_wb_cab_i;
380
input   [`TC_AW-1:0]     i5_wb_adr_i;
381
input   [`TC_BSW-1:0]    i5_wb_sel_i;
382
input                   i5_wb_we_i;
383
input   [`TC_DW-1:0]     i5_wb_dat_i;
384
output  [`TC_DW-1:0]     i5_wb_dat_o;
385
output                  i5_wb_ack_o;
386
output                  i5_wb_err_o;
387
 
388
//
389
// WB slave i/f connecting initiator 6
390
//
391
input                   i6_wb_cyc_i;
392
input                   i6_wb_stb_i;
393
input                   i6_wb_cab_i;
394
input   [`TC_AW-1:0]     i6_wb_adr_i;
395
input   [`TC_BSW-1:0]    i6_wb_sel_i;
396
input                   i6_wb_we_i;
397
input   [`TC_DW-1:0]     i6_wb_dat_i;
398
output  [`TC_DW-1:0]     i6_wb_dat_o;
399
output                  i6_wb_ack_o;
400
output                  i6_wb_err_o;
401
 
402
//
403
// WB slave i/f connecting initiator 7
404
//
405
input                   i7_wb_cyc_i;
406
input                   i7_wb_stb_i;
407
input                   i7_wb_cab_i;
408
input   [`TC_AW-1:0]     i7_wb_adr_i;
409
input   [`TC_BSW-1:0]    i7_wb_sel_i;
410
input                   i7_wb_we_i;
411
input   [`TC_DW-1:0]     i7_wb_dat_i;
412
output  [`TC_DW-1:0]     i7_wb_dat_o;
413
output                  i7_wb_ack_o;
414
output                  i7_wb_err_o;
415
 
416
//
417
// WB master i/f connecting target 0
418
//
419
output                  t0_wb_cyc_o;
420
output                  t0_wb_stb_o;
421
output                  t0_wb_cab_o;
422
output  [`TC_AW-1:0]     t0_wb_adr_o;
423
output  [`TC_BSW-1:0]    t0_wb_sel_o;
424
output                  t0_wb_we_o;
425
output  [`TC_DW-1:0]     t0_wb_dat_o;
426
input   [`TC_DW-1:0]     t0_wb_dat_i;
427
input                   t0_wb_ack_i;
428
input                   t0_wb_err_i;
429
 
430
//
431
// WB master i/f connecting target 1
432
//
433
output                  t1_wb_cyc_o;
434
output                  t1_wb_stb_o;
435
output                  t1_wb_cab_o;
436
output  [`TC_AW-1:0]     t1_wb_adr_o;
437
output  [`TC_BSW-1:0]    t1_wb_sel_o;
438
output                  t1_wb_we_o;
439
output  [`TC_DW-1:0]     t1_wb_dat_o;
440
input   [`TC_DW-1:0]     t1_wb_dat_i;
441
input                   t1_wb_ack_i;
442
input                   t1_wb_err_i;
443
 
444
//
445
// WB master i/f connecting target 2
446
//
447
output                  t2_wb_cyc_o;
448
output                  t2_wb_stb_o;
449
output                  t2_wb_cab_o;
450
output  [`TC_AW-1:0]     t2_wb_adr_o;
451
output  [`TC_BSW-1:0]    t2_wb_sel_o;
452
output                  t2_wb_we_o;
453
output  [`TC_DW-1:0]     t2_wb_dat_o;
454
input   [`TC_DW-1:0]     t2_wb_dat_i;
455
input                   t2_wb_ack_i;
456
input                   t2_wb_err_i;
457
 
458
//
459
// WB master i/f connecting target 3
460
//
461
output                  t3_wb_cyc_o;
462
output                  t3_wb_stb_o;
463
output                  t3_wb_cab_o;
464
output  [`TC_AW-1:0]     t3_wb_adr_o;
465
output  [`TC_BSW-1:0]    t3_wb_sel_o;
466
output                  t3_wb_we_o;
467
output  [`TC_DW-1:0]     t3_wb_dat_o;
468
input   [`TC_DW-1:0]     t3_wb_dat_i;
469
input                   t3_wb_ack_i;
470
input                   t3_wb_err_i;
471
 
472
//
473
// WB master i/f connecting target 4
474
//
475
output                  t4_wb_cyc_o;
476
output                  t4_wb_stb_o;
477
output                  t4_wb_cab_o;
478
output  [`TC_AW-1:0]     t4_wb_adr_o;
479
output  [`TC_BSW-1:0]    t4_wb_sel_o;
480
output                  t4_wb_we_o;
481
output  [`TC_DW-1:0]     t4_wb_dat_o;
482
input   [`TC_DW-1:0]     t4_wb_dat_i;
483
input                   t4_wb_ack_i;
484
input                   t4_wb_err_i;
485
 
486
//
487
// WB master i/f connecting target 5
488
//
489
output                  t5_wb_cyc_o;
490
output                  t5_wb_stb_o;
491
output                  t5_wb_cab_o;
492
output  [`TC_AW-1:0]     t5_wb_adr_o;
493
output  [`TC_BSW-1:0]    t5_wb_sel_o;
494
output                  t5_wb_we_o;
495
output  [`TC_DW-1:0]     t5_wb_dat_o;
496
input   [`TC_DW-1:0]     t5_wb_dat_i;
497
input                   t5_wb_ack_i;
498
input                   t5_wb_err_i;
499
 
500
//
501
// WB master i/f connecting target 6
502
//
503
output                  t6_wb_cyc_o;
504
output                  t6_wb_stb_o;
505
output                  t6_wb_cab_o;
506
output  [`TC_AW-1:0]     t6_wb_adr_o;
507
output  [`TC_BSW-1:0]    t6_wb_sel_o;
508
output                  t6_wb_we_o;
509
output  [`TC_DW-1:0]     t6_wb_dat_o;
510
input   [`TC_DW-1:0]     t6_wb_dat_i;
511
input                   t6_wb_ack_i;
512
input                   t6_wb_err_i;
513
 
514
//
515
// WB master i/f connecting target 7
516
//
517
output                  t7_wb_cyc_o;
518
output                  t7_wb_stb_o;
519
output                  t7_wb_cab_o;
520
output  [`TC_AW-1:0]     t7_wb_adr_o;
521
output  [`TC_BSW-1:0]    t7_wb_sel_o;
522
output                  t7_wb_we_o;
523
output  [`TC_DW-1:0]     t7_wb_dat_o;
524
input   [`TC_DW-1:0]     t7_wb_dat_i;
525
input                   t7_wb_ack_i;
526
input                   t7_wb_err_i;
527
 
528
//
529
// WB master i/f connecting target 8
530
//
531
output                  t8_wb_cyc_o;
532
output                  t8_wb_stb_o;
533
output                  t8_wb_cab_o;
534
output  [`TC_AW-1:0]     t8_wb_adr_o;
535
output  [`TC_BSW-1:0]    t8_wb_sel_o;
536
output                  t8_wb_we_o;
537
output  [`TC_DW-1:0]     t8_wb_dat_o;
538
input   [`TC_DW-1:0]     t8_wb_dat_i;
539
input                   t8_wb_ack_i;
540
input                   t8_wb_err_i;
541
 
542
//
543
// Internal wires & registers
544
//
545
 
546
//
547
// Outputs for initiators from both mi_to_st blocks
548
//
549
wire    [`TC_DW-1:0]     xi0_wb_dat_o;
550
wire                    xi0_wb_ack_o;
551
wire                    xi0_wb_err_o;
552
wire    [`TC_DW-1:0]     xi1_wb_dat_o;
553
wire                    xi1_wb_ack_o;
554
wire                    xi1_wb_err_o;
555
wire    [`TC_DW-1:0]     xi2_wb_dat_o;
556
wire                    xi2_wb_ack_o;
557
wire                    xi2_wb_err_o;
558
wire    [`TC_DW-1:0]     xi3_wb_dat_o;
559
wire                    xi3_wb_ack_o;
560
wire                    xi3_wb_err_o;
561
wire    [`TC_DW-1:0]     xi4_wb_dat_o;
562
wire                    xi4_wb_ack_o;
563
wire                    xi4_wb_err_o;
564
wire    [`TC_DW-1:0]     xi5_wb_dat_o;
565
wire                    xi5_wb_ack_o;
566
wire                    xi5_wb_err_o;
567
wire    [`TC_DW-1:0]     xi6_wb_dat_o;
568
wire                    xi6_wb_ack_o;
569
wire                    xi6_wb_err_o;
570
wire    [`TC_DW-1:0]     xi7_wb_dat_o;
571
wire                    xi7_wb_ack_o;
572
wire                    xi7_wb_err_o;
573
wire    [`TC_DW-1:0]     yi0_wb_dat_o;
574
wire                    yi0_wb_ack_o;
575
wire                    yi0_wb_err_o;
576
wire    [`TC_DW-1:0]     yi1_wb_dat_o;
577
wire                    yi1_wb_ack_o;
578
wire                    yi1_wb_err_o;
579
wire    [`TC_DW-1:0]     yi2_wb_dat_o;
580
wire                    yi2_wb_ack_o;
581
wire                    yi2_wb_err_o;
582
wire    [`TC_DW-1:0]     yi3_wb_dat_o;
583
wire                    yi3_wb_ack_o;
584
wire                    yi3_wb_err_o;
585
wire    [`TC_DW-1:0]     yi4_wb_dat_o;
586
wire                    yi4_wb_ack_o;
587
wire                    yi4_wb_err_o;
588
wire    [`TC_DW-1:0]     yi5_wb_dat_o;
589
wire                    yi5_wb_ack_o;
590
wire                    yi5_wb_err_o;
591
wire    [`TC_DW-1:0]     yi6_wb_dat_o;
592
wire                    yi6_wb_ack_o;
593
wire                    yi6_wb_err_o;
594
wire    [`TC_DW-1:0]     yi7_wb_dat_o;
595
wire                    yi7_wb_ack_o;
596
wire                    yi7_wb_err_o;
597
 
598
//
599
// Intermediate signals connecting peripheral channel's
600
// mi_to_st and si_to_mt blocks.
601
//
602
wire                    z_wb_cyc_i;
603
wire                    z_wb_stb_i;
604
wire                    z_wb_cab_i;
605
wire    [`TC_AW-1:0]     z_wb_adr_i;
606
wire    [`TC_BSW-1:0]    z_wb_sel_i;
607
wire                    z_wb_we_i;
608
wire    [`TC_DW-1:0]     z_wb_dat_i;
609
wire    [`TC_DW-1:0]     z_wb_dat_t;
610
wire                    z_wb_ack_t;
611
wire                    z_wb_err_t;
612
 
613
//
614
// Outputs for initiators are ORed from both mi_to_st blocks
615
//
616
assign i0_wb_dat_o = xi0_wb_dat_o | yi0_wb_dat_o;
617
assign i0_wb_ack_o = xi0_wb_ack_o | yi0_wb_ack_o;
618
assign i0_wb_err_o = xi0_wb_err_o | yi0_wb_err_o;
619
assign i1_wb_dat_o = xi1_wb_dat_o | yi1_wb_dat_o;
620
assign i1_wb_ack_o = xi1_wb_ack_o | yi1_wb_ack_o;
621
assign i1_wb_err_o = xi1_wb_err_o | yi1_wb_err_o;
622
assign i2_wb_dat_o = xi2_wb_dat_o | yi2_wb_dat_o;
623
assign i2_wb_ack_o = xi2_wb_ack_o | yi2_wb_ack_o;
624
assign i2_wb_err_o = xi2_wb_err_o | yi2_wb_err_o;
625
assign i3_wb_dat_o = xi3_wb_dat_o | yi3_wb_dat_o;
626
assign i3_wb_ack_o = xi3_wb_ack_o | yi3_wb_ack_o;
627
assign i3_wb_err_o = xi3_wb_err_o | yi3_wb_err_o;
628
assign i4_wb_dat_o = xi4_wb_dat_o | yi4_wb_dat_o;
629
assign i4_wb_ack_o = xi4_wb_ack_o | yi4_wb_ack_o;
630
assign i4_wb_err_o = xi4_wb_err_o | yi4_wb_err_o;
631
assign i5_wb_dat_o = xi5_wb_dat_o | yi5_wb_dat_o;
632
assign i5_wb_ack_o = xi5_wb_ack_o | yi5_wb_ack_o;
633
assign i5_wb_err_o = xi5_wb_err_o | yi5_wb_err_o;
634
assign i6_wb_dat_o = xi6_wb_dat_o | yi6_wb_dat_o;
635
assign i6_wb_ack_o = xi6_wb_ack_o | yi6_wb_ack_o;
636
assign i6_wb_err_o = xi6_wb_err_o | yi6_wb_err_o;
637
assign i7_wb_dat_o = xi7_wb_dat_o | yi7_wb_dat_o;
638
assign i7_wb_ack_o = xi7_wb_ack_o | yi7_wb_ack_o;
639
assign i7_wb_err_o = xi7_wb_err_o | yi7_wb_err_o;
640
 
641
//
642
// From initiators to target 0
643
//
644
tc_mi_to_st #(t0_addr_w, t0_addr,
645
        0, t0_addr_w, t0_addr) t0_ch(
646
        .wb_clk_i(wb_clk_i),
647
        .wb_rst_i(wb_rst_i),
648
 
649
        .i0_wb_cyc_i(i0_wb_cyc_i),
650
        .i0_wb_stb_i(i0_wb_stb_i),
651
        .i0_wb_cab_i(i0_wb_cab_i),
652
        .i0_wb_adr_i(i0_wb_adr_i),
653
        .i0_wb_sel_i(i0_wb_sel_i),
654
        .i0_wb_we_i(i0_wb_we_i),
655
        .i0_wb_dat_i(i0_wb_dat_i),
656
        .i0_wb_dat_o(xi0_wb_dat_o),
657
        .i0_wb_ack_o(xi0_wb_ack_o),
658
        .i0_wb_err_o(xi0_wb_err_o),
659
 
660
        .i1_wb_cyc_i(i1_wb_cyc_i),
661
        .i1_wb_stb_i(i1_wb_stb_i),
662
        .i1_wb_cab_i(i1_wb_cab_i),
663
        .i1_wb_adr_i(i1_wb_adr_i),
664
        .i1_wb_sel_i(i1_wb_sel_i),
665
        .i1_wb_we_i(i1_wb_we_i),
666
        .i1_wb_dat_i(i1_wb_dat_i),
667
        .i1_wb_dat_o(xi1_wb_dat_o),
668
        .i1_wb_ack_o(xi1_wb_ack_o),
669
        .i1_wb_err_o(xi1_wb_err_o),
670
 
671
        .i2_wb_cyc_i(i2_wb_cyc_i),
672
        .i2_wb_stb_i(i2_wb_stb_i),
673
        .i2_wb_cab_i(i2_wb_cab_i),
674
        .i2_wb_adr_i(i2_wb_adr_i),
675
        .i2_wb_sel_i(i2_wb_sel_i),
676
        .i2_wb_we_i(i2_wb_we_i),
677
        .i2_wb_dat_i(i2_wb_dat_i),
678
        .i2_wb_dat_o(xi2_wb_dat_o),
679
        .i2_wb_ack_o(xi2_wb_ack_o),
680
        .i2_wb_err_o(xi2_wb_err_o),
681
 
682
        .i3_wb_cyc_i(i3_wb_cyc_i),
683
        .i3_wb_stb_i(i3_wb_stb_i),
684
        .i3_wb_cab_i(i3_wb_cab_i),
685
        .i3_wb_adr_i(i3_wb_adr_i),
686
        .i3_wb_sel_i(i3_wb_sel_i),
687
        .i3_wb_we_i(i3_wb_we_i),
688
        .i3_wb_dat_i(i3_wb_dat_i),
689
        .i3_wb_dat_o(xi3_wb_dat_o),
690
        .i3_wb_ack_o(xi3_wb_ack_o),
691
        .i3_wb_err_o(xi3_wb_err_o),
692
 
693
        .i4_wb_cyc_i(i4_wb_cyc_i),
694
        .i4_wb_stb_i(i4_wb_stb_i),
695
        .i4_wb_cab_i(i4_wb_cab_i),
696
        .i4_wb_adr_i(i4_wb_adr_i),
697
        .i4_wb_sel_i(i4_wb_sel_i),
698
        .i4_wb_we_i(i4_wb_we_i),
699
        .i4_wb_dat_i(i4_wb_dat_i),
700
        .i4_wb_dat_o(xi4_wb_dat_o),
701
        .i4_wb_ack_o(xi4_wb_ack_o),
702
        .i4_wb_err_o(xi4_wb_err_o),
703
 
704
        .i5_wb_cyc_i(i5_wb_cyc_i),
705
        .i5_wb_stb_i(i5_wb_stb_i),
706
        .i5_wb_cab_i(i5_wb_cab_i),
707
        .i5_wb_adr_i(i5_wb_adr_i),
708
        .i5_wb_sel_i(i5_wb_sel_i),
709
        .i5_wb_we_i(i5_wb_we_i),
710
        .i5_wb_dat_i(i5_wb_dat_i),
711
        .i5_wb_dat_o(xi5_wb_dat_o),
712
        .i5_wb_ack_o(xi5_wb_ack_o),
713
        .i5_wb_err_o(xi5_wb_err_o),
714
 
715
        .i6_wb_cyc_i(i6_wb_cyc_i),
716
        .i6_wb_stb_i(i6_wb_stb_i),
717
        .i6_wb_cab_i(i6_wb_cab_i),
718
        .i6_wb_adr_i(i6_wb_adr_i),
719
        .i6_wb_sel_i(i6_wb_sel_i),
720
        .i6_wb_we_i(i6_wb_we_i),
721
        .i6_wb_dat_i(i6_wb_dat_i),
722
        .i6_wb_dat_o(xi6_wb_dat_o),
723
        .i6_wb_ack_o(xi6_wb_ack_o),
724
        .i6_wb_err_o(xi6_wb_err_o),
725
 
726
        .i7_wb_cyc_i(i7_wb_cyc_i),
727
        .i7_wb_stb_i(i7_wb_stb_i),
728
        .i7_wb_cab_i(i7_wb_cab_i),
729
        .i7_wb_adr_i(i7_wb_adr_i),
730
        .i7_wb_sel_i(i7_wb_sel_i),
731
        .i7_wb_we_i(i7_wb_we_i),
732
        .i7_wb_dat_i(i7_wb_dat_i),
733
        .i7_wb_dat_o(xi7_wb_dat_o),
734
        .i7_wb_ack_o(xi7_wb_ack_o),
735
        .i7_wb_err_o(xi7_wb_err_o),
736
 
737
        .t0_wb_cyc_o(t0_wb_cyc_o),
738
        .t0_wb_stb_o(t0_wb_stb_o),
739
        .t0_wb_cab_o(t0_wb_cab_o),
740
        .t0_wb_adr_o(t0_wb_adr_o),
741
        .t0_wb_sel_o(t0_wb_sel_o),
742
        .t0_wb_we_o(t0_wb_we_o),
743
        .t0_wb_dat_o(t0_wb_dat_o),
744
        .t0_wb_dat_i(t0_wb_dat_i),
745
        .t0_wb_ack_i(t0_wb_ack_i),
746
        .t0_wb_err_i(t0_wb_err_i)
747
 
748
);
749
 
750
//
751
// From initiators to targets 1-8 (upper part)
752
//
753
tc_mi_to_st #(t1_addr_w, t1_addr,
754
        1, t28c_addr_w, t28_addr) t18_ch_upper(
755
        .wb_clk_i(wb_clk_i),
756
        .wb_rst_i(wb_rst_i),
757
 
758
        .i0_wb_cyc_i(i0_wb_cyc_i),
759
        .i0_wb_stb_i(i0_wb_stb_i),
760
        .i0_wb_cab_i(i0_wb_cab_i),
761
        .i0_wb_adr_i(i0_wb_adr_i),
762
        .i0_wb_sel_i(i0_wb_sel_i),
763
        .i0_wb_we_i(i0_wb_we_i),
764
        .i0_wb_dat_i(i0_wb_dat_i),
765
        .i0_wb_dat_o(yi0_wb_dat_o),
766
        .i0_wb_ack_o(yi0_wb_ack_o),
767
        .i0_wb_err_o(yi0_wb_err_o),
768
 
769
        .i1_wb_cyc_i(i1_wb_cyc_i),
770
        .i1_wb_stb_i(i1_wb_stb_i),
771
        .i1_wb_cab_i(i1_wb_cab_i),
772
        .i1_wb_adr_i(i1_wb_adr_i),
773
        .i1_wb_sel_i(i1_wb_sel_i),
774
        .i1_wb_we_i(i1_wb_we_i),
775
        .i1_wb_dat_i(i1_wb_dat_i),
776
        .i1_wb_dat_o(yi1_wb_dat_o),
777
        .i1_wb_ack_o(yi1_wb_ack_o),
778
        .i1_wb_err_o(yi1_wb_err_o),
779
 
780
        .i2_wb_cyc_i(i2_wb_cyc_i),
781
        .i2_wb_stb_i(i2_wb_stb_i),
782
        .i2_wb_cab_i(i2_wb_cab_i),
783
        .i2_wb_adr_i(i2_wb_adr_i),
784
        .i2_wb_sel_i(i2_wb_sel_i),
785
        .i2_wb_we_i(i2_wb_we_i),
786
        .i2_wb_dat_i(i2_wb_dat_i),
787
        .i2_wb_dat_o(yi2_wb_dat_o),
788
        .i2_wb_ack_o(yi2_wb_ack_o),
789
        .i2_wb_err_o(yi2_wb_err_o),
790
 
791
        .i3_wb_cyc_i(i3_wb_cyc_i),
792
        .i3_wb_stb_i(i3_wb_stb_i),
793
        .i3_wb_cab_i(i3_wb_cab_i),
794
        .i3_wb_adr_i(i3_wb_adr_i),
795
        .i3_wb_sel_i(i3_wb_sel_i),
796
        .i3_wb_we_i(i3_wb_we_i),
797
        .i3_wb_dat_i(i3_wb_dat_i),
798
        .i3_wb_dat_o(yi3_wb_dat_o),
799
        .i3_wb_ack_o(yi3_wb_ack_o),
800
        .i3_wb_err_o(yi3_wb_err_o),
801
 
802
        .i4_wb_cyc_i(i4_wb_cyc_i),
803
        .i4_wb_stb_i(i4_wb_stb_i),
804
        .i4_wb_cab_i(i4_wb_cab_i),
805
        .i4_wb_adr_i(i4_wb_adr_i),
806
        .i4_wb_sel_i(i4_wb_sel_i),
807
        .i4_wb_we_i(i4_wb_we_i),
808
        .i4_wb_dat_i(i4_wb_dat_i),
809
        .i4_wb_dat_o(yi4_wb_dat_o),
810
        .i4_wb_ack_o(yi4_wb_ack_o),
811
        .i4_wb_err_o(yi4_wb_err_o),
812
 
813
        .i5_wb_cyc_i(i5_wb_cyc_i),
814
        .i5_wb_stb_i(i5_wb_stb_i),
815
        .i5_wb_cab_i(i5_wb_cab_i),
816
        .i5_wb_adr_i(i5_wb_adr_i),
817
        .i5_wb_sel_i(i5_wb_sel_i),
818
        .i5_wb_we_i(i5_wb_we_i),
819
        .i5_wb_dat_i(i5_wb_dat_i),
820
        .i5_wb_dat_o(yi5_wb_dat_o),
821
        .i5_wb_ack_o(yi5_wb_ack_o),
822
        .i5_wb_err_o(yi5_wb_err_o),
823
 
824
        .i6_wb_cyc_i(i6_wb_cyc_i),
825
        .i6_wb_stb_i(i6_wb_stb_i),
826
        .i6_wb_cab_i(i6_wb_cab_i),
827
        .i6_wb_adr_i(i6_wb_adr_i),
828
        .i6_wb_sel_i(i6_wb_sel_i),
829
        .i6_wb_we_i(i6_wb_we_i),
830
        .i6_wb_dat_i(i6_wb_dat_i),
831
        .i6_wb_dat_o(yi6_wb_dat_o),
832
        .i6_wb_ack_o(yi6_wb_ack_o),
833
        .i6_wb_err_o(yi6_wb_err_o),
834
 
835
        .i7_wb_cyc_i(i7_wb_cyc_i),
836
        .i7_wb_stb_i(i7_wb_stb_i),
837
        .i7_wb_cab_i(i7_wb_cab_i),
838
        .i7_wb_adr_i(i7_wb_adr_i),
839
        .i7_wb_sel_i(i7_wb_sel_i),
840
        .i7_wb_we_i(i7_wb_we_i),
841
        .i7_wb_dat_i(i7_wb_dat_i),
842
        .i7_wb_dat_o(yi7_wb_dat_o),
843
        .i7_wb_ack_o(yi7_wb_ack_o),
844
        .i7_wb_err_o(yi7_wb_err_o),
845
 
846
        .t0_wb_cyc_o(z_wb_cyc_i),
847
        .t0_wb_stb_o(z_wb_stb_i),
848
        .t0_wb_cab_o(z_wb_cab_i),
849
        .t0_wb_adr_o(z_wb_adr_i),
850
        .t0_wb_sel_o(z_wb_sel_i),
851
        .t0_wb_we_o(z_wb_we_i),
852
        .t0_wb_dat_o(z_wb_dat_i),
853
        .t0_wb_dat_i(z_wb_dat_t),
854
        .t0_wb_ack_i(z_wb_ack_t),
855
        .t0_wb_err_i(z_wb_err_t)
856
 
857
);
858
 
859
//
860
// From initiators to targets 1-8 (lower part)
861
//
862
tc_si_to_mt #(t1_addr_w, t1_addr, t28i_addr_w, t2_addr, t3_addr,
863
        t4_addr, t5_addr, t6_addr, t7_addr, t8_addr) t18_ch_lower(
864
 
865
        .i0_wb_cyc_i(z_wb_cyc_i),
866
        .i0_wb_stb_i(z_wb_stb_i),
867
        .i0_wb_cab_i(z_wb_cab_i),
868
        .i0_wb_adr_i(z_wb_adr_i),
869
        .i0_wb_sel_i(z_wb_sel_i),
870
        .i0_wb_we_i(z_wb_we_i),
871
        .i0_wb_dat_i(z_wb_dat_i),
872
        .i0_wb_dat_o(z_wb_dat_t),
873
        .i0_wb_ack_o(z_wb_ack_t),
874
        .i0_wb_err_o(z_wb_err_t),
875
 
876
        .t0_wb_cyc_o(t1_wb_cyc_o),
877
        .t0_wb_stb_o(t1_wb_stb_o),
878
        .t0_wb_cab_o(t1_wb_cab_o),
879
        .t0_wb_adr_o(t1_wb_adr_o),
880
        .t0_wb_sel_o(t1_wb_sel_o),
881
        .t0_wb_we_o(t1_wb_we_o),
882
        .t0_wb_dat_o(t1_wb_dat_o),
883
        .t0_wb_dat_i(t1_wb_dat_i),
884
        .t0_wb_ack_i(t1_wb_ack_i),
885
        .t0_wb_err_i(t1_wb_err_i),
886
 
887
        .t1_wb_cyc_o(t2_wb_cyc_o),
888
        .t1_wb_stb_o(t2_wb_stb_o),
889
        .t1_wb_cab_o(t2_wb_cab_o),
890
        .t1_wb_adr_o(t2_wb_adr_o),
891
        .t1_wb_sel_o(t2_wb_sel_o),
892
        .t1_wb_we_o(t2_wb_we_o),
893
        .t1_wb_dat_o(t2_wb_dat_o),
894
        .t1_wb_dat_i(t2_wb_dat_i),
895
        .t1_wb_ack_i(t2_wb_ack_i),
896
        .t1_wb_err_i(t2_wb_err_i),
897
 
898
        .t2_wb_cyc_o(t3_wb_cyc_o),
899
        .t2_wb_stb_o(t3_wb_stb_o),
900
        .t2_wb_cab_o(t3_wb_cab_o),
901
        .t2_wb_adr_o(t3_wb_adr_o),
902
        .t2_wb_sel_o(t3_wb_sel_o),
903
        .t2_wb_we_o(t3_wb_we_o),
904
        .t2_wb_dat_o(t3_wb_dat_o),
905
        .t2_wb_dat_i(t3_wb_dat_i),
906
        .t2_wb_ack_i(t3_wb_ack_i),
907
        .t2_wb_err_i(t3_wb_err_i),
908
 
909
        .t3_wb_cyc_o(t4_wb_cyc_o),
910
        .t3_wb_stb_o(t4_wb_stb_o),
911
        .t3_wb_cab_o(t4_wb_cab_o),
912
        .t3_wb_adr_o(t4_wb_adr_o),
913
        .t3_wb_sel_o(t4_wb_sel_o),
914
        .t3_wb_we_o(t4_wb_we_o),
915
        .t3_wb_dat_o(t4_wb_dat_o),
916
        .t3_wb_dat_i(t4_wb_dat_i),
917
        .t3_wb_ack_i(t4_wb_ack_i),
918
        .t3_wb_err_i(t4_wb_err_i),
919
 
920
        .t4_wb_cyc_o(t5_wb_cyc_o),
921
        .t4_wb_stb_o(t5_wb_stb_o),
922
        .t4_wb_cab_o(t5_wb_cab_o),
923
        .t4_wb_adr_o(t5_wb_adr_o),
924
        .t4_wb_sel_o(t5_wb_sel_o),
925
        .t4_wb_we_o(t5_wb_we_o),
926
        .t4_wb_dat_o(t5_wb_dat_o),
927
        .t4_wb_dat_i(t5_wb_dat_i),
928
        .t4_wb_ack_i(t5_wb_ack_i),
929
        .t4_wb_err_i(t5_wb_err_i),
930
 
931
        .t5_wb_cyc_o(t6_wb_cyc_o),
932
        .t5_wb_stb_o(t6_wb_stb_o),
933
        .t5_wb_cab_o(t6_wb_cab_o),
934
        .t5_wb_adr_o(t6_wb_adr_o),
935
        .t5_wb_sel_o(t6_wb_sel_o),
936
        .t5_wb_we_o(t6_wb_we_o),
937
        .t5_wb_dat_o(t6_wb_dat_o),
938
        .t5_wb_dat_i(t6_wb_dat_i),
939
        .t5_wb_ack_i(t6_wb_ack_i),
940
        .t5_wb_err_i(t6_wb_err_i),
941
 
942
        .t6_wb_cyc_o(t7_wb_cyc_o),
943
        .t6_wb_stb_o(t7_wb_stb_o),
944
        .t6_wb_cab_o(t7_wb_cab_o),
945
        .t6_wb_adr_o(t7_wb_adr_o),
946
        .t6_wb_sel_o(t7_wb_sel_o),
947
        .t6_wb_we_o(t7_wb_we_o),
948
        .t6_wb_dat_o(t7_wb_dat_o),
949
        .t6_wb_dat_i(t7_wb_dat_i),
950
        .t6_wb_ack_i(t7_wb_ack_i),
951
        .t6_wb_err_i(t7_wb_err_i),
952
 
953
        .t7_wb_cyc_o(t8_wb_cyc_o),
954
        .t7_wb_stb_o(t8_wb_stb_o),
955
        .t7_wb_cab_o(t8_wb_cab_o),
956
        .t7_wb_adr_o(t8_wb_adr_o),
957
        .t7_wb_sel_o(t8_wb_sel_o),
958
        .t7_wb_we_o(t8_wb_we_o),
959
        .t7_wb_dat_o(t8_wb_dat_o),
960
        .t7_wb_dat_i(t8_wb_dat_i),
961
        .t7_wb_ack_i(t8_wb_ack_i),
962
        .t7_wb_err_i(t8_wb_err_i)
963
 
964
);
965
 
966
endmodule
967
 
968
//
969
// Multiple initiator to single target
970
//
971
module tc_mi_to_st (
972
        wb_clk_i,
973
        wb_rst_i,
974
 
975
        i0_wb_cyc_i,
976
        i0_wb_stb_i,
977
        i0_wb_cab_i,
978
        i0_wb_adr_i,
979
        i0_wb_sel_i,
980
        i0_wb_we_i,
981
        i0_wb_dat_i,
982
        i0_wb_dat_o,
983
        i0_wb_ack_o,
984
        i0_wb_err_o,
985
 
986
        i1_wb_cyc_i,
987
        i1_wb_stb_i,
988
        i1_wb_cab_i,
989
        i1_wb_adr_i,
990
        i1_wb_sel_i,
991
        i1_wb_we_i,
992
        i1_wb_dat_i,
993
        i1_wb_dat_o,
994
        i1_wb_ack_o,
995
        i1_wb_err_o,
996
 
997
        i2_wb_cyc_i,
998
        i2_wb_stb_i,
999
        i2_wb_cab_i,
1000
        i2_wb_adr_i,
1001
        i2_wb_sel_i,
1002
        i2_wb_we_i,
1003
        i2_wb_dat_i,
1004
        i2_wb_dat_o,
1005
        i2_wb_ack_o,
1006
        i2_wb_err_o,
1007
 
1008
        i3_wb_cyc_i,
1009
        i3_wb_stb_i,
1010
        i3_wb_cab_i,
1011
        i3_wb_adr_i,
1012
        i3_wb_sel_i,
1013
        i3_wb_we_i,
1014
        i3_wb_dat_i,
1015
        i3_wb_dat_o,
1016
        i3_wb_ack_o,
1017
        i3_wb_err_o,
1018
 
1019
        i4_wb_cyc_i,
1020
        i4_wb_stb_i,
1021
        i4_wb_cab_i,
1022
        i4_wb_adr_i,
1023
        i4_wb_sel_i,
1024
        i4_wb_we_i,
1025
        i4_wb_dat_i,
1026
        i4_wb_dat_o,
1027
        i4_wb_ack_o,
1028
        i4_wb_err_o,
1029
 
1030
        i5_wb_cyc_i,
1031
        i5_wb_stb_i,
1032
        i5_wb_cab_i,
1033
        i5_wb_adr_i,
1034
        i5_wb_sel_i,
1035
        i5_wb_we_i,
1036
        i5_wb_dat_i,
1037
        i5_wb_dat_o,
1038
        i5_wb_ack_o,
1039
        i5_wb_err_o,
1040
 
1041
        i6_wb_cyc_i,
1042
        i6_wb_stb_i,
1043
        i6_wb_cab_i,
1044
        i6_wb_adr_i,
1045
        i6_wb_sel_i,
1046
        i6_wb_we_i,
1047
        i6_wb_dat_i,
1048
        i6_wb_dat_o,
1049
        i6_wb_ack_o,
1050
        i6_wb_err_o,
1051
 
1052
        i7_wb_cyc_i,
1053
        i7_wb_stb_i,
1054
        i7_wb_cab_i,
1055
        i7_wb_adr_i,
1056
        i7_wb_sel_i,
1057
        i7_wb_we_i,
1058
        i7_wb_dat_i,
1059
        i7_wb_dat_o,
1060
        i7_wb_ack_o,
1061
        i7_wb_err_o,
1062
 
1063
        t0_wb_cyc_o,
1064
        t0_wb_stb_o,
1065
        t0_wb_cab_o,
1066
        t0_wb_adr_o,
1067
        t0_wb_sel_o,
1068
        t0_wb_we_o,
1069
        t0_wb_dat_o,
1070
        t0_wb_dat_i,
1071
        t0_wb_ack_i,
1072
        t0_wb_err_i
1073
 
1074
);
1075
 
1076
//
1077
// Parameters
1078
//
1079
parameter               t0_addr_w = 2;
1080
parameter               t0_addr = 2'b00;
1081
parameter               multitarg = 1'b0;
1082
parameter               t17_addr_w = 2;
1083
parameter               t17_addr = 2'b00;
1084
 
1085
//
1086
// I/O Ports
1087
//
1088
input                   wb_clk_i;
1089
input                   wb_rst_i;
1090
 
1091
//
1092
// WB slave i/f connecting initiator 0
1093
//
1094
input                   i0_wb_cyc_i;
1095
input                   i0_wb_stb_i;
1096
input                   i0_wb_cab_i;
1097
input   [`TC_AW-1:0]     i0_wb_adr_i;
1098
input   [`TC_BSW-1:0]    i0_wb_sel_i;
1099
input                   i0_wb_we_i;
1100
input   [`TC_DW-1:0]     i0_wb_dat_i;
1101
output  [`TC_DW-1:0]     i0_wb_dat_o;
1102
output                  i0_wb_ack_o;
1103
output                  i0_wb_err_o;
1104
 
1105
//
1106
// WB slave i/f connecting initiator 1
1107
//
1108
input                   i1_wb_cyc_i;
1109
input                   i1_wb_stb_i;
1110
input                   i1_wb_cab_i;
1111
input   [`TC_AW-1:0]     i1_wb_adr_i;
1112
input   [`TC_BSW-1:0]    i1_wb_sel_i;
1113
input                   i1_wb_we_i;
1114
input   [`TC_DW-1:0]     i1_wb_dat_i;
1115
output  [`TC_DW-1:0]     i1_wb_dat_o;
1116
output                  i1_wb_ack_o;
1117
output                  i1_wb_err_o;
1118
 
1119
//
1120
// WB slave i/f connecting initiator 2
1121
//
1122
input                   i2_wb_cyc_i;
1123
input                   i2_wb_stb_i;
1124
input                   i2_wb_cab_i;
1125
input   [`TC_AW-1:0]     i2_wb_adr_i;
1126
input   [`TC_BSW-1:0]    i2_wb_sel_i;
1127
input                   i2_wb_we_i;
1128
input   [`TC_DW-1:0]     i2_wb_dat_i;
1129
output  [`TC_DW-1:0]     i2_wb_dat_o;
1130
output                  i2_wb_ack_o;
1131
output                  i2_wb_err_o;
1132
 
1133
//
1134
// WB slave i/f connecting initiator 3
1135
//
1136
input                   i3_wb_cyc_i;
1137
input                   i3_wb_stb_i;
1138
input                   i3_wb_cab_i;
1139
input   [`TC_AW-1:0]     i3_wb_adr_i;
1140
input   [`TC_BSW-1:0]    i3_wb_sel_i;
1141
input                   i3_wb_we_i;
1142
input   [`TC_DW-1:0]     i3_wb_dat_i;
1143
output  [`TC_DW-1:0]     i3_wb_dat_o;
1144
output                  i3_wb_ack_o;
1145
output                  i3_wb_err_o;
1146
 
1147
//
1148
// WB slave i/f connecting initiator 4
1149
//
1150
input                   i4_wb_cyc_i;
1151
input                   i4_wb_stb_i;
1152
input                   i4_wb_cab_i;
1153
input   [`TC_AW-1:0]     i4_wb_adr_i;
1154
input   [`TC_BSW-1:0]    i4_wb_sel_i;
1155
input                   i4_wb_we_i;
1156
input   [`TC_DW-1:0]     i4_wb_dat_i;
1157
output  [`TC_DW-1:0]     i4_wb_dat_o;
1158
output                  i4_wb_ack_o;
1159
output                  i4_wb_err_o;
1160
 
1161
//
1162
// WB slave i/f connecting initiator 5
1163
//
1164
input                   i5_wb_cyc_i;
1165
input                   i5_wb_stb_i;
1166
input                   i5_wb_cab_i;
1167
input   [`TC_AW-1:0]     i5_wb_adr_i;
1168
input   [`TC_BSW-1:0]    i5_wb_sel_i;
1169
input                   i5_wb_we_i;
1170
input   [`TC_DW-1:0]     i5_wb_dat_i;
1171
output  [`TC_DW-1:0]     i5_wb_dat_o;
1172
output                  i5_wb_ack_o;
1173
output                  i5_wb_err_o;
1174
 
1175
//
1176
// WB slave i/f connecting initiator 6
1177
//
1178
input                   i6_wb_cyc_i;
1179
input                   i6_wb_stb_i;
1180
input                   i6_wb_cab_i;
1181
input   [`TC_AW-1:0]     i6_wb_adr_i;
1182
input   [`TC_BSW-1:0]    i6_wb_sel_i;
1183
input                   i6_wb_we_i;
1184
input   [`TC_DW-1:0]     i6_wb_dat_i;
1185
output  [`TC_DW-1:0]     i6_wb_dat_o;
1186
output                  i6_wb_ack_o;
1187
output                  i6_wb_err_o;
1188
 
1189
//
1190
// WB slave i/f connecting initiator 7
1191
//
1192
input                   i7_wb_cyc_i;
1193
input                   i7_wb_stb_i;
1194
input                   i7_wb_cab_i;
1195
input   [`TC_AW-1:0]     i7_wb_adr_i;
1196
input   [`TC_BSW-1:0]    i7_wb_sel_i;
1197
input                   i7_wb_we_i;
1198
input   [`TC_DW-1:0]     i7_wb_dat_i;
1199
output  [`TC_DW-1:0]     i7_wb_dat_o;
1200
output                  i7_wb_ack_o;
1201
output                  i7_wb_err_o;
1202
 
1203
//
1204
// WB master i/f connecting target
1205
//
1206
output                  t0_wb_cyc_o;
1207
output                  t0_wb_stb_o;
1208
output                  t0_wb_cab_o;
1209
output  [`TC_AW-1:0]     t0_wb_adr_o;
1210
output  [`TC_BSW-1:0]    t0_wb_sel_o;
1211
output                  t0_wb_we_o;
1212
output  [`TC_DW-1:0]     t0_wb_dat_o;
1213
input   [`TC_DW-1:0]     t0_wb_dat_i;
1214
input                   t0_wb_ack_i;
1215
input                   t0_wb_err_i;
1216
 
1217
//
1218
// Internal wires & registers
1219
//
1220
wire    [`TC_IIN_W-1:0]  i0_in, i1_in,
1221
                        i2_in, i3_in,
1222
                        i4_in, i5_in,
1223
                        i6_in, i7_in;
1224
wire    [`TC_TIN_W-1:0]  i0_out, i1_out,
1225
                        i2_out, i3_out,
1226
                        i4_out, i5_out,
1227
                        i6_out, i7_out;
1228
wire    [`TC_IIN_W-1:0]  t0_out;
1229
wire    [`TC_TIN_W-1:0]  t0_in;
1230
wire    [7:0]            req_i;
1231
wire    [2:0]            req_won;
1232
reg                     req_cont;
1233
reg     [2:0]            req_r;
1234
 
1235
//
1236
// Group WB initiator 0 i/f inputs and outputs
1237
//
1238
assign i0_in = {i0_wb_cyc_i, i0_wb_stb_i, i0_wb_cab_i, i0_wb_adr_i,
1239
                i0_wb_sel_i, i0_wb_we_i, i0_wb_dat_i};
1240
assign {i0_wb_dat_o, i0_wb_ack_o, i0_wb_err_o} = i0_out;
1241
 
1242
//
1243
// Group WB initiator 1 i/f inputs and outputs
1244
//
1245
assign i1_in = {i1_wb_cyc_i, i1_wb_stb_i, i1_wb_cab_i, i1_wb_adr_i,
1246
                i1_wb_sel_i, i1_wb_we_i, i1_wb_dat_i};
1247
assign {i1_wb_dat_o, i1_wb_ack_o, i1_wb_err_o} = i1_out;
1248
 
1249
//
1250
// Group WB initiator 2 i/f inputs and outputs
1251
//
1252
assign i2_in = {i2_wb_cyc_i, i2_wb_stb_i, i2_wb_cab_i, i2_wb_adr_i,
1253
                i2_wb_sel_i, i2_wb_we_i, i2_wb_dat_i};
1254
assign {i2_wb_dat_o, i2_wb_ack_o, i2_wb_err_o} = i2_out;
1255
 
1256
//
1257
// Group WB initiator 3 i/f inputs and outputs
1258
//
1259
assign i3_in = {i3_wb_cyc_i, i3_wb_stb_i, i3_wb_cab_i, i3_wb_adr_i,
1260
                i3_wb_sel_i, i3_wb_we_i, i3_wb_dat_i};
1261
assign {i3_wb_dat_o, i3_wb_ack_o, i3_wb_err_o} = i3_out;
1262
 
1263
//
1264
// Group WB initiator 4 i/f inputs and outputs
1265
//
1266
assign i4_in = {i4_wb_cyc_i, i4_wb_stb_i, i4_wb_cab_i, i4_wb_adr_i,
1267
                i4_wb_sel_i, i4_wb_we_i, i4_wb_dat_i};
1268
assign {i4_wb_dat_o, i4_wb_ack_o, i4_wb_err_o} = i4_out;
1269
 
1270
//
1271
// Group WB initiator 5 i/f inputs and outputs
1272
//
1273
assign i5_in = {i5_wb_cyc_i, i5_wb_stb_i, i5_wb_cab_i, i5_wb_adr_i,
1274
                i5_wb_sel_i, i5_wb_we_i, i5_wb_dat_i};
1275
assign {i5_wb_dat_o, i5_wb_ack_o, i5_wb_err_o} = i5_out;
1276
 
1277
//
1278
// Group WB initiator 6 i/f inputs and outputs
1279
//
1280
assign i6_in = {i6_wb_cyc_i, i6_wb_stb_i, i6_wb_cab_i, i6_wb_adr_i,
1281
                i6_wb_sel_i, i6_wb_we_i, i6_wb_dat_i};
1282
assign {i6_wb_dat_o, i6_wb_ack_o, i6_wb_err_o} = i6_out;
1283
 
1284
//
1285
// Group WB initiator 7 i/f inputs and outputs
1286
//
1287
assign i7_in = {i7_wb_cyc_i, i7_wb_stb_i, i7_wb_cab_i, i7_wb_adr_i,
1288
                i7_wb_sel_i, i7_wb_we_i, i7_wb_dat_i};
1289
assign {i7_wb_dat_o, i7_wb_ack_o, i7_wb_err_o} = i7_out;
1290
 
1291
//
1292
// Group WB target 0 i/f inputs and outputs
1293
//
1294
assign {t0_wb_cyc_o, t0_wb_stb_o, t0_wb_cab_o, t0_wb_adr_o,
1295
                t0_wb_sel_o, t0_wb_we_o, t0_wb_dat_o} = t0_out;
1296
assign t0_in = {t0_wb_dat_i, t0_wb_ack_i, t0_wb_err_i};
1297
 
1298
//
1299
// Assign to WB initiator i/f outputs
1300
//
1301
// Either inputs from the target are assigned or zeros.
1302
//
1303
assign i0_out = (req_won == 3'd0) ? t0_in : {`TC_TIN_W{1'b0}};
1304
assign i1_out = (req_won == 3'd1) ? t0_in : {`TC_TIN_W{1'b0}};
1305
assign i2_out = (req_won == 3'd2) ? t0_in : {`TC_TIN_W{1'b0}};
1306
assign i3_out = (req_won == 3'd3) ? t0_in : {`TC_TIN_W{1'b0}};
1307
assign i4_out = (req_won == 3'd4) ? t0_in : {`TC_TIN_W{1'b0}};
1308
assign i5_out = (req_won == 3'd5) ? t0_in : {`TC_TIN_W{1'b0}};
1309
assign i6_out = (req_won == 3'd6) ? t0_in : {`TC_TIN_W{1'b0}};
1310
assign i7_out = (req_won == 3'd7) ? t0_in : {`TC_TIN_W{1'b0}};
1311
 
1312
//
1313
// Assign to WB target i/f outputs
1314
//
1315
// Assign inputs from initiator to target outputs according to
1316
// which initiator has won. If there is no request for the target,
1317
// assign zeros.
1318
//
1319
assign t0_out = (req_won == 3'd0) ? i0_in :
1320
                (req_won == 3'd1) ? i1_in :
1321
                (req_won == 3'd2) ? i2_in :
1322
                (req_won == 3'd3) ? i3_in :
1323
                (req_won == 3'd4) ? i4_in :
1324
                (req_won == 3'd5) ? i5_in :
1325
                (req_won == 3'd6) ? i6_in :
1326
                (req_won == 3'd7) ? i7_in : {`TC_IIN_W{1'b0}};
1327
 
1328
//
1329
// Determine if an initiator has address of the target.
1330
//
1331
assign req_i[0] = i0_wb_cyc_i &
1332
        ((i0_wb_adr_i[`TC_AW-1:`TC_AW-t0_addr_w] == t0_addr) |
1333
         multitarg & (i0_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t17_addr));
1334
assign req_i[1] = i1_wb_cyc_i &
1335
        ((i1_wb_adr_i[`TC_AW-1:`TC_AW-t0_addr_w] == t0_addr) |
1336
         multitarg & (i1_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t17_addr));
1337
assign req_i[2] = i2_wb_cyc_i &
1338
        ((i2_wb_adr_i[`TC_AW-1:`TC_AW-t0_addr_w] == t0_addr) |
1339
         multitarg & (i2_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t17_addr));
1340
assign req_i[3] = i3_wb_cyc_i &
1341
        ((i3_wb_adr_i[`TC_AW-1:`TC_AW-t0_addr_w] == t0_addr) |
1342
         multitarg & (i3_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t17_addr));
1343
assign req_i[4] = i4_wb_cyc_i &
1344
        ((i4_wb_adr_i[`TC_AW-1:`TC_AW-t0_addr_w] == t0_addr) |
1345
         multitarg & (i4_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t17_addr));
1346
assign req_i[5] = i5_wb_cyc_i &
1347
        ((i5_wb_adr_i[`TC_AW-1:`TC_AW-t0_addr_w] == t0_addr) |
1348
         multitarg & (i5_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t17_addr));
1349
assign req_i[6] = i6_wb_cyc_i &
1350
        ((i6_wb_adr_i[`TC_AW-1:`TC_AW-t0_addr_w] == t0_addr) |
1351
         multitarg & (i6_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t17_addr));
1352
assign req_i[7] = i7_wb_cyc_i &
1353
        ((i7_wb_adr_i[`TC_AW-1:`TC_AW-t0_addr_w] == t0_addr) |
1354
         multitarg & (i7_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t17_addr));
1355
 
1356
//
1357
// Determine who gets current access to the target.
1358
//
1359
// If current initiator still asserts request, do nothing
1360
// (keep current initiator).
1361
// Otherwise check each initiator's request, starting from initiator 0
1362
// (highest priority).
1363
// If there is no requests from initiators, park initiator 0.
1364
//
1365
assign req_won = req_cont ? req_r :
1366
                 req_i[0] ? 3'd0 :
1367
                 req_i[1] ? 3'd1 :
1368
                 req_i[2] ? 3'd2 :
1369
                 req_i[3] ? 3'd3 :
1370
                 req_i[4] ? 3'd4 :
1371
                 req_i[5] ? 3'd5 :
1372
                 req_i[6] ? 3'd6 :
1373
                 req_i[7] ? 3'd7 : 3'd0;
1374
 
1375
//
1376
// Check if current initiator still wants access to the target and if
1377
// it does, assert req_cont.
1378
//
1379
always @(req_r or req_i)
1380
        case (req_r)    // synopsys parallel_case
1381
                3'd0: req_cont = req_i[0];
1382
                3'd1: req_cont = req_i[1];
1383
                3'd2: req_cont = req_i[2];
1384
                3'd3: req_cont = req_i[3];
1385
                3'd4: req_cont = req_i[4];
1386
                3'd5: req_cont = req_i[5];
1387
                3'd6: req_cont = req_i[6];
1388
                3'd7: req_cont = req_i[7];
1389
        endcase
1390
 
1391
//
1392
// Register who has current access to the target.
1393
//
1394
always @(posedge wb_clk_i or posedge wb_rst_i)
1395
        if (wb_rst_i)
1396
                req_r <= #1 3'd0;
1397
        else
1398
                req_r <= #1 req_won;
1399
 
1400
endmodule
1401
 
1402
//
1403
// Single initiator to multiple targets
1404
//
1405
module tc_si_to_mt (
1406
 
1407
        i0_wb_cyc_i,
1408
        i0_wb_stb_i,
1409
        i0_wb_cab_i,
1410
        i0_wb_adr_i,
1411
        i0_wb_sel_i,
1412
        i0_wb_we_i,
1413
        i0_wb_dat_i,
1414
        i0_wb_dat_o,
1415
        i0_wb_ack_o,
1416
        i0_wb_err_o,
1417
 
1418
        t0_wb_cyc_o,
1419
        t0_wb_stb_o,
1420
        t0_wb_cab_o,
1421
        t0_wb_adr_o,
1422
        t0_wb_sel_o,
1423
        t0_wb_we_o,
1424
        t0_wb_dat_o,
1425
        t0_wb_dat_i,
1426
        t0_wb_ack_i,
1427
        t0_wb_err_i,
1428
 
1429
        t1_wb_cyc_o,
1430
        t1_wb_stb_o,
1431
        t1_wb_cab_o,
1432
        t1_wb_adr_o,
1433
        t1_wb_sel_o,
1434
        t1_wb_we_o,
1435
        t1_wb_dat_o,
1436
        t1_wb_dat_i,
1437
        t1_wb_ack_i,
1438
        t1_wb_err_i,
1439
 
1440
        t2_wb_cyc_o,
1441
        t2_wb_stb_o,
1442
        t2_wb_cab_o,
1443
        t2_wb_adr_o,
1444
        t2_wb_sel_o,
1445
        t2_wb_we_o,
1446
        t2_wb_dat_o,
1447
        t2_wb_dat_i,
1448
        t2_wb_ack_i,
1449
        t2_wb_err_i,
1450
 
1451
        t3_wb_cyc_o,
1452
        t3_wb_stb_o,
1453
        t3_wb_cab_o,
1454
        t3_wb_adr_o,
1455
        t3_wb_sel_o,
1456
        t3_wb_we_o,
1457
        t3_wb_dat_o,
1458
        t3_wb_dat_i,
1459
        t3_wb_ack_i,
1460
        t3_wb_err_i,
1461
 
1462
        t4_wb_cyc_o,
1463
        t4_wb_stb_o,
1464
        t4_wb_cab_o,
1465
        t4_wb_adr_o,
1466
        t4_wb_sel_o,
1467
        t4_wb_we_o,
1468
        t4_wb_dat_o,
1469
        t4_wb_dat_i,
1470
        t4_wb_ack_i,
1471
        t4_wb_err_i,
1472
 
1473
        t5_wb_cyc_o,
1474
        t5_wb_stb_o,
1475
        t5_wb_cab_o,
1476
        t5_wb_adr_o,
1477
        t5_wb_sel_o,
1478
        t5_wb_we_o,
1479
        t5_wb_dat_o,
1480
        t5_wb_dat_i,
1481
        t5_wb_ack_i,
1482
        t5_wb_err_i,
1483
 
1484
        t6_wb_cyc_o,
1485
        t6_wb_stb_o,
1486
        t6_wb_cab_o,
1487
        t6_wb_adr_o,
1488
        t6_wb_sel_o,
1489
        t6_wb_we_o,
1490
        t6_wb_dat_o,
1491
        t6_wb_dat_i,
1492
        t6_wb_ack_i,
1493
        t6_wb_err_i,
1494
 
1495
        t7_wb_cyc_o,
1496
        t7_wb_stb_o,
1497
        t7_wb_cab_o,
1498
        t7_wb_adr_o,
1499
        t7_wb_sel_o,
1500
        t7_wb_we_o,
1501
        t7_wb_dat_o,
1502
        t7_wb_dat_i,
1503
        t7_wb_ack_i,
1504
        t7_wb_err_i
1505
 
1506
);
1507
 
1508
//
1509
// Parameters
1510
//
1511
parameter               t0_addr_w = 3;
1512
parameter               t0_addr = 3'd0;
1513
parameter               t17_addr_w = 3;
1514
parameter               t1_addr = 3'd1;
1515
parameter               t2_addr = 3'd2;
1516
parameter               t3_addr = 3'd3;
1517
parameter               t4_addr = 3'd4;
1518
parameter               t5_addr = 3'd5;
1519
parameter               t6_addr = 3'd6;
1520
parameter               t7_addr = 3'd7;
1521
 
1522
//
1523
// I/O Ports
1524
//
1525
 
1526
//
1527
// WB slave i/f connecting initiator 0
1528
//
1529
input                   i0_wb_cyc_i;
1530
input                   i0_wb_stb_i;
1531
input                   i0_wb_cab_i;
1532
input   [`TC_AW-1:0]     i0_wb_adr_i;
1533
input   [`TC_BSW-1:0]    i0_wb_sel_i;
1534
input                   i0_wb_we_i;
1535
input   [`TC_DW-1:0]     i0_wb_dat_i;
1536
output  [`TC_DW-1:0]     i0_wb_dat_o;
1537
output                  i0_wb_ack_o;
1538
output                  i0_wb_err_o;
1539
 
1540
//
1541
// WB master i/f connecting target 0
1542
//
1543
output                  t0_wb_cyc_o;
1544
output                  t0_wb_stb_o;
1545
output                  t0_wb_cab_o;
1546
output  [`TC_AW-1:0]     t0_wb_adr_o;
1547
output  [`TC_BSW-1:0]    t0_wb_sel_o;
1548
output                  t0_wb_we_o;
1549
output  [`TC_DW-1:0]     t0_wb_dat_o;
1550
input   [`TC_DW-1:0]     t0_wb_dat_i;
1551
input                   t0_wb_ack_i;
1552
input                   t0_wb_err_i;
1553
 
1554
//
1555
// WB master i/f connecting target 1
1556
//
1557
output                  t1_wb_cyc_o;
1558
output                  t1_wb_stb_o;
1559
output                  t1_wb_cab_o;
1560
output  [`TC_AW-1:0]     t1_wb_adr_o;
1561
output  [`TC_BSW-1:0]    t1_wb_sel_o;
1562
output                  t1_wb_we_o;
1563
output  [`TC_DW-1:0]     t1_wb_dat_o;
1564
input   [`TC_DW-1:0]     t1_wb_dat_i;
1565
input                   t1_wb_ack_i;
1566
input                   t1_wb_err_i;
1567
 
1568
//
1569
// WB master i/f connecting target 2
1570
//
1571
output                  t2_wb_cyc_o;
1572
output                  t2_wb_stb_o;
1573
output                  t2_wb_cab_o;
1574
output  [`TC_AW-1:0]     t2_wb_adr_o;
1575
output  [`TC_BSW-1:0]    t2_wb_sel_o;
1576
output                  t2_wb_we_o;
1577
output  [`TC_DW-1:0]     t2_wb_dat_o;
1578
input   [`TC_DW-1:0]     t2_wb_dat_i;
1579
input                   t2_wb_ack_i;
1580
input                   t2_wb_err_i;
1581
 
1582
//
1583
// WB master i/f connecting target 3
1584
//
1585
output                  t3_wb_cyc_o;
1586
output                  t3_wb_stb_o;
1587
output                  t3_wb_cab_o;
1588
output  [`TC_AW-1:0]     t3_wb_adr_o;
1589
output  [`TC_BSW-1:0]    t3_wb_sel_o;
1590
output                  t3_wb_we_o;
1591
output  [`TC_DW-1:0]     t3_wb_dat_o;
1592
input   [`TC_DW-1:0]     t3_wb_dat_i;
1593
input                   t3_wb_ack_i;
1594
input                   t3_wb_err_i;
1595
 
1596
//
1597
// WB master i/f connecting target 4
1598
//
1599
output                  t4_wb_cyc_o;
1600
output                  t4_wb_stb_o;
1601
output                  t4_wb_cab_o;
1602
output  [`TC_AW-1:0]     t4_wb_adr_o;
1603
output  [`TC_BSW-1:0]    t4_wb_sel_o;
1604
output                  t4_wb_we_o;
1605
output  [`TC_DW-1:0]     t4_wb_dat_o;
1606
input   [`TC_DW-1:0]     t4_wb_dat_i;
1607
input                   t4_wb_ack_i;
1608
input                   t4_wb_err_i;
1609
 
1610
//
1611
// WB master i/f connecting target 5
1612
//
1613
output                  t5_wb_cyc_o;
1614
output                  t5_wb_stb_o;
1615
output                  t5_wb_cab_o;
1616
output  [`TC_AW-1:0]     t5_wb_adr_o;
1617
output  [`TC_BSW-1:0]    t5_wb_sel_o;
1618
output                  t5_wb_we_o;
1619
output  [`TC_DW-1:0]     t5_wb_dat_o;
1620
input   [`TC_DW-1:0]     t5_wb_dat_i;
1621
input                   t5_wb_ack_i;
1622
input                   t5_wb_err_i;
1623
 
1624
//
1625
// WB master i/f connecting target 6
1626
//
1627
output                  t6_wb_cyc_o;
1628
output                  t6_wb_stb_o;
1629
output                  t6_wb_cab_o;
1630
output  [`TC_AW-1:0]     t6_wb_adr_o;
1631
output  [`TC_BSW-1:0]    t6_wb_sel_o;
1632
output                  t6_wb_we_o;
1633
output  [`TC_DW-1:0]     t6_wb_dat_o;
1634
input   [`TC_DW-1:0]     t6_wb_dat_i;
1635
input                   t6_wb_ack_i;
1636
input                   t6_wb_err_i;
1637
 
1638
//
1639
// WB master i/f connecting target 7
1640
//
1641
output                  t7_wb_cyc_o;
1642
output                  t7_wb_stb_o;
1643
output                  t7_wb_cab_o;
1644
output  [`TC_AW-1:0]     t7_wb_adr_o;
1645
output  [`TC_BSW-1:0]    t7_wb_sel_o;
1646
output                  t7_wb_we_o;
1647
output  [`TC_DW-1:0]     t7_wb_dat_o;
1648
input   [`TC_DW-1:0]     t7_wb_dat_i;
1649
input                   t7_wb_ack_i;
1650
input                   t7_wb_err_i;
1651
 
1652
//
1653
// Internal wires & registers
1654
//
1655
wire    [`TC_IIN_W-1:0]  i0_in;
1656
wire    [`TC_TIN_W-1:0]  i0_out;
1657
wire    [`TC_IIN_W-1:0]  t0_out, t1_out,
1658
                        t2_out, t3_out,
1659
                        t4_out, t5_out,
1660
                        t6_out, t7_out;
1661
wire    [`TC_TIN_W-1:0]  t0_in, t1_in,
1662
                        t2_in, t3_in,
1663
                        t4_in, t5_in,
1664
                        t6_in, t7_in;
1665
wire    [7:0]            req_t;
1666
 
1667
//
1668
// Group WB initiator 0 i/f inputs and outputs
1669
//
1670
assign i0_in = {i0_wb_cyc_i, i0_wb_stb_i, i0_wb_cab_i, i0_wb_adr_i,
1671
                i0_wb_sel_i, i0_wb_we_i, i0_wb_dat_i};
1672
assign {i0_wb_dat_o, i0_wb_ack_o, i0_wb_err_o} = i0_out;
1673
 
1674
//
1675
// Group WB target 0 i/f inputs and outputs
1676
//
1677
assign {t0_wb_cyc_o, t0_wb_stb_o, t0_wb_cab_o, t0_wb_adr_o,
1678
                t0_wb_sel_o, t0_wb_we_o, t0_wb_dat_o} = t0_out;
1679
assign t0_in = {t0_wb_dat_i, t0_wb_ack_i, t0_wb_err_i};
1680
 
1681
//
1682
// Group WB target 1 i/f inputs and outputs
1683
//
1684
assign {t1_wb_cyc_o, t1_wb_stb_o, t1_wb_cab_o, t1_wb_adr_o,
1685
                t1_wb_sel_o, t1_wb_we_o, t1_wb_dat_o} = t1_out;
1686
assign t1_in = {t1_wb_dat_i, t1_wb_ack_i, t1_wb_err_i};
1687
 
1688
//
1689
// Group WB target 2 i/f inputs and outputs
1690
//
1691
assign {t2_wb_cyc_o, t2_wb_stb_o, t2_wb_cab_o, t2_wb_adr_o,
1692
                t2_wb_sel_o, t2_wb_we_o, t2_wb_dat_o} = t2_out;
1693
assign t2_in = {t2_wb_dat_i, t2_wb_ack_i, t2_wb_err_i};
1694
 
1695
//
1696
// Group WB target 3 i/f inputs and outputs
1697
//
1698
assign {t3_wb_cyc_o, t3_wb_stb_o, t3_wb_cab_o, t3_wb_adr_o,
1699
                t3_wb_sel_o, t3_wb_we_o, t3_wb_dat_o} = t3_out;
1700
assign t3_in = {t3_wb_dat_i, t3_wb_ack_i, t3_wb_err_i};
1701
 
1702
//
1703
// Group WB target 4 i/f inputs and outputs
1704
//
1705
assign {t4_wb_cyc_o, t4_wb_stb_o, t4_wb_cab_o, t4_wb_adr_o,
1706
                t4_wb_sel_o, t4_wb_we_o, t4_wb_dat_o} = t4_out;
1707
assign t4_in = {t4_wb_dat_i, t4_wb_ack_i, t4_wb_err_i};
1708
 
1709
//
1710
// Group WB target 5 i/f inputs and outputs
1711
//
1712
assign {t5_wb_cyc_o, t5_wb_stb_o, t5_wb_cab_o, t5_wb_adr_o,
1713
                t5_wb_sel_o, t5_wb_we_o, t5_wb_dat_o} = t5_out;
1714
assign t5_in = {t5_wb_dat_i, t5_wb_ack_i, t5_wb_err_i};
1715
 
1716
//
1717
// Group WB target 6 i/f inputs and outputs
1718
//
1719
assign {t6_wb_cyc_o, t6_wb_stb_o, t6_wb_cab_o, t6_wb_adr_o,
1720
                t6_wb_sel_o, t6_wb_we_o, t6_wb_dat_o} = t6_out;
1721
assign t6_in = {t6_wb_dat_i, t6_wb_ack_i, t6_wb_err_i};
1722
 
1723
//
1724
// Group WB target 7 i/f inputs and outputs
1725
//
1726
assign {t7_wb_cyc_o, t7_wb_stb_o, t7_wb_cab_o, t7_wb_adr_o,
1727
                t7_wb_sel_o, t7_wb_we_o, t7_wb_dat_o} = t7_out;
1728
assign t7_in = {t7_wb_dat_i, t7_wb_ack_i, t7_wb_err_i};
1729
 
1730
//
1731
// Assign to WB target i/f outputs
1732
//
1733
// Either inputs from the initiator are assigned or zeros.
1734
//
1735
assign t0_out = req_t[0] ? i0_in : {`TC_IIN_W{1'b0}};
1736
assign t1_out = req_t[1] ? i0_in : {`TC_IIN_W{1'b0}};
1737
assign t2_out = req_t[2] ? i0_in : {`TC_IIN_W{1'b0}};
1738
assign t3_out = req_t[3] ? i0_in : {`TC_IIN_W{1'b0}};
1739
assign t4_out = req_t[4] ? i0_in : {`TC_IIN_W{1'b0}};
1740
assign t5_out = req_t[5] ? i0_in : {`TC_IIN_W{1'b0}};
1741
assign t6_out = req_t[6] ? i0_in : {`TC_IIN_W{1'b0}};
1742
assign t7_out = req_t[7] ? i0_in : {`TC_IIN_W{1'b0}};
1743
 
1744
//
1745
// Assign to WB initiator i/f outputs
1746
//
1747
// Assign inputs from target to initiator outputs according to
1748
// which target is accessed. If there is no request for a target,
1749
// assign zeros.
1750
//
1751
assign i0_out = req_t[0] ? t0_in :
1752
                req_t[1] ? t1_in :
1753
                req_t[2] ? t2_in :
1754
                req_t[3] ? t3_in :
1755
                req_t[4] ? t4_in :
1756
                req_t[5] ? t5_in :
1757
                req_t[6] ? t6_in :
1758
                req_t[7] ? t7_in : {`TC_TIN_W{1'b0}};
1759
 
1760
//
1761
// Determine which target is being accessed.
1762
//
1763
assign req_t[0] = i0_wb_cyc_i & (i0_wb_adr_i[`TC_AW-1:`TC_AW-t0_addr_w] == t0_addr);
1764
assign req_t[1] = i0_wb_cyc_i & (i0_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t1_addr);
1765
assign req_t[2] = i0_wb_cyc_i & (i0_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t2_addr);
1766
assign req_t[3] = i0_wb_cyc_i & (i0_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t3_addr);
1767
assign req_t[4] = i0_wb_cyc_i & (i0_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t4_addr);
1768
assign req_t[5] = i0_wb_cyc_i & (i0_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t5_addr);
1769
assign req_t[6] = i0_wb_cyc_i & (i0_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t6_addr);
1770
assign req_t[7] = i0_wb_cyc_i & (i0_wb_adr_i[`TC_AW-1:`TC_AW-t17_addr_w] == t7_addr);
1771
 
1772
endmodule

powered by: WebSVN 2.1.0

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