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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [trunk/] [sdm/] [src/] [clos_sch.v] - Blame information for rev 46

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

Line No. Rev Author Line
1 19 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
 Clos scheduler
13
 *** SystemVerilog is used ***
14
 
15
 References
16
 For the detail structure, please refer to Section 6.3.1 of the thesis:
17
   Wei Song, Spatial parallelism in the routers of asynchronous on-chip networks, PhD thesis, the University of Manchester, 2011.
18
 
19
 History:
20
 11/12/2009  Initial version. <wsong83@gmail.com>
21
 10/06/2010  Change to use PIM structure <wsong83@gmail.com>
22
 23/08/2010  Fix the non-QDI request withdraw process <wsong83@gmail.com>
23
 23/09/2010  Modified for Clos SDM router <wsong83@gmail.com>
24 28 wsong0210
 27/05/2011  Clean up for opensource. <wsong83@gmail.com>
25 19 wsong0210
 
26
*/
27
 
28
// the router structure definitions
29
`include "define.v"
30
 
31
module clos_sch (/*AUTOARG*/
32
   // Outputs
33
   sack, wack, nack, eack, lack, imc, scfg, ncfg, wcfg, ecfg, lcfg,
34
   // Inputs
35
   sreq, nreq, lreq, wreq, ereq, rst_n
36
   );
37
 
38
   parameter M = 2;             // the number of CMs
39
   parameter N = 2;             // the number of ports in IMs/OMs
40
 
41
   // reuests from all input buffers
42
   input [N-1:0][3:0]             sreq, nreq, lreq;
43
   input [N-1:0][1:0]               wreq, ereq;
44
 
45
   // ack to input buffers
46
   output [N-1:0]                  sack, wack, nack, eack, lack;
47
 
48
   // IM acks
49
   wire [4:0][N-1:0]                imra;
50
   wire [4:0][N-1:0]                cmra;
51
 
52
   // IM cfgs and CM cfgs
53
   output [4:0][M-1:0][N-1:0]        imc;
54
   output [M-1:0][1:0]              scfg, ncfg;
55
   output [M-1:0][3:0]              wcfg, ecfg, lcfg;
56
 
57
   input                          rst_n;        // reset, active low
58
 
59
   // the requests from IMs to CMs
60
   wire [M-1:0][1:0]                wr, er;
61
   wire [M-1:0][3:0]                sr, nr, lr;
62
   wire [M-1:0]            sra, wra, nra, era, lra;
63
 
64
`ifndef ENABLE_CRRD
65
   wire [M-1:0][4:0]                cms;          // the states from CMs
66
 
67
   wire [M-1:0][3:0]                scms, ncms, lcms;
68
   wire [M-1:0][1:0]                wcms, ecms;
69
`endif
70
 
71
   genvar                         i;
72
 
73
   // IM schedulers
74
   im_alloc #(.VCN(N), .CMN(M), .SN(4))
75
   SIM (
76
        .IMr   ( sreq      ),
77
        .IMa   ( imra[0]   ),
78
`ifndef ENABLE_CRRD
79
        .CMs   ( scms      ),
80
`endif
81
        .cfg   ( imc[0]    ),
82
        .rst_n ( rst_n     )
83
        );
84
 
85
   rcb #(.NN(N), .MN(M), .DW(4))
86
   SRIM (
87
         .ireq ( sreq      ),
88
         .ira  ( cmra[0]   ),
89
         .oreq ( sr        ),
90
         .ora  ( sra       ),
91 28 wsong0210
         .cfg  ( imc[0]    )
92 19 wsong0210
         );
93
 
94
   // the C-element to force the request withdrawal sequence
95
   generate for(i=0; i<N; i++) begin: SA
96
      c2 UA (.q(sack[i]), .a0(imra[0][i]), .a1(cmra[0][i]));
97
   end endgenerate
98
 
99
   im_alloc #(.VCN(N), .CMN(M), .SN(2))
100
   WIM (
101
        .IMr   ( wreq      ),
102
        .IMa   ( imra[1]   ),
103
`ifndef ENABLE_CRRD
104
        .CMs   ( wcms      ),
105
`endif
106
        .cfg   ( imc[1]    ),
107
        .rst_n ( rst_n     )
108
        );
109
 
110
   rcb #(.NN(N), .MN(M), .DW(2))
111
   WRIM (
112
         .ireq ( wreq      ),
113
         .ira  ( cmra[1]   ),
114
         .oreq ( wr        ),
115
         .ora  ( wra       ),
116 28 wsong0210
         .cfg  ( imc[1]    )
117 19 wsong0210
         );
118
 
119
   generate for(i=0; i<N; i++) begin: WA
120
      c2 UA (.q(wack[i]), .a0(imra[1][i]), .a1(cmra[1][i]));
121
   end endgenerate
122
 
123
   im_alloc #(.VCN(N), .CMN(M), .SN(4))
124
   NIM (
125
        .IMr   ( nreq      ),
126
        .IMa   ( imra[2]   ),
127
`ifndef ENABLE_CRRD
128
        .CMs   ( ncms      ),
129
`endif
130
        .cfg   ( imc[2]    ),
131
        .rst_n ( rst_n     )
132
        );
133
 
134
   rcb #(.NN(N), .MN(M), .DW(4))
135
   NRIM (
136
         .ireq ( nreq      ),
137
         .ira  ( cmra[2]   ),
138
         .oreq ( nr        ),
139
         .ora  ( nra       ),
140 28 wsong0210
         .cfg  ( imc[2]    )
141 19 wsong0210
         );
142
 
143
   generate for(i=0; i<N; i++) begin: NA
144
      c2 UA (.q(nack[i]), .a0(imra[2][i]), .a1(cmra[2][i]));
145
   end endgenerate
146
 
147
   im_alloc #(.VCN(N), .CMN(M), .SN(2))
148
   EIM (
149
        .IMr   ( ereq      ),
150
        .IMa   ( imra[3]   ),
151
`ifndef ENABLE_CRRD
152
        .CMs   ( ecms      ),
153
`endif
154
        .cfg   ( imc[3]    ),
155
        .rst_n ( rst_n     )
156
        );
157
 
158
   rcb #(.NN(N), .MN(M), .DW(2))
159
   ERIM (
160
         .ireq ( ereq      ),
161
         .ira  ( cmra[3]   ),
162
         .oreq ( er        ),
163
         .ora  ( era       ),
164 28 wsong0210
         .cfg  ( imc[3]    )
165 19 wsong0210
         );
166
 
167
   generate for(i=0; i<N; i++) begin: EA
168
      c2 UA (.q(eack[i]), .a0(imra[3][i]), .a1(cmra[3][i]));
169
   end endgenerate
170
 
171
   im_alloc #(.VCN(N), .CMN(M), .SN(4))
172
   LIM (
173
        .IMr   ( lreq      ),
174
        .IMa   ( imra[4]   ),
175
`ifndef ENABLE_CRRD
176
        .CMs   ( lcms      ),
177
`endif
178
        .cfg   ( imc[4]    ),
179
        .rst_n ( rst_n     )
180
        );
181
 
182
   rcb #(.NN(N), .MN(M), .DW(4))
183
   LRIM (
184
         .ireq ( lreq      ),
185
         .ira  ( cmra[4]   ),
186
         .oreq ( lr        ),
187
         .ora  ( lra       ),
188 28 wsong0210
         .cfg  ( imc[4]    )
189 19 wsong0210
         );
190
 
191
   generate for(i=0; i<N; i++) begin: LA
192
      c2 UA (.q(lack[i]), .a0(imra[4][i]), .a1(cmra[4][i]));
193
   end endgenerate
194
 
195
   // CM schedulers
196
   generate
197
      for(i=0; i<M; i=i+1) begin: CMSch
198
         cm_alloc S (
199
                   .sra   ( sra[i]  ),
200
                   .wra   ( wra[i]  ),
201
                   .nra   ( nra[i]  ),
202
                   .era   ( era[i]  ),
203
                   .lra   ( lra[i]  ),
204
                   .scfg  ( scfg[i] ),
205
                   .ncfg  ( ncfg[i] ),
206
                   .wcfg  ( wcfg[i] ),
207
                   .ecfg  ( ecfg[i] ),
208
                   .lcfg  ( lcfg[i] ),
209
`ifndef ENABLE_CRRD
210
                   .s     ( cms[i]  ),
211
`endif
212
                   .wr    ( wr[i]   ),
213
                   .er    ( er[i]   ),
214
                   .sr    ( sr[i]   ),
215
                   .nr    ( nr[i]   ),
216
                   .lr    ( lr[i]   )
217
                   );
218
 
219
`ifndef ENABLE_CRRD
220
         assign scms[i] = {cms[i][4], cms[i][3], cms[i][2], cms[i][1]};
221
         assign wcms[i] = {cms[i][4], cms[i][3]};
222
         assign ncms[i] = {cms[i][4], cms[i][3], cms[i][1], cms[i][0]};
223
         assign ecms[i] = {cms[i][4], cms[i][1]};
224
         assign lcms[i] = {cms[i][3], cms[i][2], cms[i][1], cms[i][0]};
225
`endif
226
 
227
      end
228
   endgenerate
229
 
230
endmodule // clos_sch
231
 
232
 

powered by: WebSVN 2.1.0

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