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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [branches/] [clos_opt/] [common/] [src/] [dcb.v] - Blame information for rev 71

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 wsong0210
/*
2
 Asynchronous SDM NoC
3
 (C)2011 Wei Song
4
 Advanced Processor Technologies Group
5
 Computer Science, the Univ. of Manchester, UK
6
 
7
 Authors:
8
 Wei Song     wsong83@gmail.com
9
 
10
 License: LGPL 3.0 or later
11
 
12
 Data crossbar for wormhole and SDM routers.
13
 *** SystemVerilog is used ***
14
 
15
 History:
16
 17/07/2010  Initial version. <wsong83@gmail.com>
17
 23/05/2011  Clean up for opensource. <wsong83@gmail.com>
18 62 wsong0210
 21/06/2011  Prepare to support buffered Clos. <wsong83@gmail.com>
19 12 wsong0210
 
20
*/
21
 
22
// the router structure definitions
23
`include "define.v"
24
 
25 62 wsong0210
module dcb (
26 12 wsong0210
   // Outputs
27
   o0, o1, o2, o3, ia, o4,
28
   // Inputs
29
   i0, i1, i2, i3, oa, i4, cfg
30 62 wsong0210
`ifdef ENABLE_BUFFERED_CLOS
31 63 wsong0210
   , oa4
32 62 wsong0210
`endif
33 12 wsong0210
   );
34
 
35
   parameter NN = 2;            // number of input ports
36
   parameter MN = 3;            // number of output ports
37
   parameter DW = 8;            // data-width of a port
38
   parameter SCN = DW/2;        // number of 1-of-4 sub-channels for one port
39
 
40
   input [NN-1:0][SCN-1:0]       i0, i1, i2, i3; // input ports
41
   output [MN-1:0][SCN-1:0]        o0, o1, o2, o3; // output ports
42
 
43
`ifdef ENABLE_CHANNEL_SLICING
44
   output [NN-1:0][SCN-1:0]        ia, o4; // eof and ack
45
   input [MN-1:0][SCN-1:0]         oa, i4;
46 62 wsong0210
 `ifdef ENABLE_BUFFERED_CLOS
47
   input [MN-1:0][SCN-1:0]         oa4; // the eof ack from output buffer
48
 `endif
49 12 wsong0210
`else
50
   output [NN-1:0]                ia, o4; // eof and ack
51
   input [MN-1:0]                 oa, i4;
52
`endif
53
 
54
   input [MN-1:0][NN-1:0]          cfg; // crossbar configuration
55
 
56
   wire [MN-1:0][SCN-1:0][NN-1:0] dm0, dm1, dm2, dm3;
57
 
58
`ifdef ENABLE_CHANNEL_SLICING
59
   wire [NN-1:0][SCN-1:0][MN-1:0] am, dm4;
60 62 wsong0210
 `ifdef ENABLE_BUFFERED_CLOS
61
   wire [NN-1:0][SCN-1:0][MN-1:0] amd, am4;
62
 `endif
63 12 wsong0210
`else
64
   wire [NN-1:0][MN-1:0]    am, dm4;
65 62 wsong0210
 `ifdef ENABLE_BUFFERED_CLOS
66
   wire [NN-1:0][MN-1:0]    amd, am4;
67
 `endif
68 12 wsong0210
`endif
69
 
70
   genvar                        i, j, k;
71
 
72
   generate
73
      for(i=0; i<MN; i++) begin: EN
74
         for(j=0; j<NN; j++) begin: IP
75
            for(k=0; k<SCN; k++) begin: SC
76
               and A0 (dm0[i][k][j], i0[j][k], cfg[i][j]);
77
               and A1 (dm1[i][k][j], i1[j][k], cfg[i][j]);
78
               and A2 (dm2[i][k][j], i2[j][k], cfg[i][j]);
79
               and A3 (dm3[i][k][j], i3[j][k], cfg[i][j]);
80
`ifdef ENABLE_CHANNEL_SLICING
81
               and A4 (dm4[i][k][j], i4[j][k], cfg[i][j]);
82 62 wsong0210
 `ifdef ENABLE_BUFFERED_CLOS
83
               and Aad (amd[j][k][i], oa[i][k], cfg[i][j]);
84
               c2  Aa4 (.q(am4[j][k][i]), .a0(oa4[i][k]), .a1(cfg[i][j]));
85
               assign am[j][k][i] = amd[j][k][i] | am4[j][k][i];
86
 `else
87 12 wsong0210
               and Aa (am[j][k][i], oa[i][k], cfg[i][j]);
88 62 wsong0210
 `endif
89 12 wsong0210
`endif
90
            end
91
 
92
`ifndef ENABLE_CHANNEL_SLICING
93
            and A4 (dm4[i][j], i4[j], cfg[i][j]);
94 62 wsong0210
 `ifdef ENABLE_BUFFERED_CLOS
95
            and Aa (amd[j][i], oa[i], cfg[i][j]);
96
            c2  Aa4 (.q(am4[j][i]), .a0(oa4[i]), .a1(cfg[i][j]));
97
            assign am[j][i] = amd[j][i] | am4[j][i];
98
 `else
99 12 wsong0210
            and Aa (am[j][i], oa[i], cfg[i][j]);
100 62 wsong0210
 `endif
101 12 wsong0210
`endif
102
         end // block: IP
103
      end // block: EN
104
   endgenerate
105
 
106
   generate
107
      for(i=0; i<MN; i++) begin: ORTD
108
         for(j=0; j<SCN; j++) begin: OP
109
            assign o0[i][j] = |dm0[i][j];
110
            assign o1[i][j] = |dm1[i][j];
111
            assign o2[i][j] = |dm2[i][j];
112
            assign o3[i][j] = |dm3[i][j];
113
`ifdef ENABLE_CHANNEL_SLICING
114
            assign o4[i][j] = |dm4[i][j];
115
`endif
116
         end
117
 
118
`ifndef ENABLE_CHANNEL_SLICING
119
         assign o4[i] = |dm4[i];
120
`endif
121
 
122
      end // block: ORTD
123
   endgenerate
124
 
125
   generate
126
      for(i=0; i<NN; i++) begin: ORTA
127
`ifdef ENABLE_CHANNEL_SLICING
128
         for(j=0; j<SCN; j++) begin: IP
129
           assign ia[i][j] = |am[i][j];
130
         end
131
`else
132
         assign ia[i] = |am[i];
133
`endif
134
      end
135
   endgenerate
136
 
137
endmodule // dcb
138
 

powered by: WebSVN 2.1.0

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