OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [rtl/] [src_topolgy/] [custom1/] [Tcustom1Rcustom_look_ahead_routing.v] - Blame information for rev 48

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

Line No. Rev Author Line
1 48 alirezamon
 
2
/**************************************************************************
3
**      WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
4
**      OVERWRITTEN AND LOST. Rename this file if you wish to do any modification.
5
****************************************************************************/
6
 
7
 
8
/**********************************************************************
9
**      File: /home/alireza/work/git/hca_git/ProNoC/mpsoc/rtl/src_topolgy/custom1/Tcustom1Rcustom_look_ahead_routing.v
10
**
11
**      Copyright (C) 2014-2019  Alireza Monemi
12
**
13
**      This file is part of ProNoC 1.9.1
14
**
15
**      ProNoC ( stands for Prototype Network-on-chip)  is free software:
16
**      you can redistribute it and/or modify it under the terms of the GNU
17
**      Lesser General Public License as published by the Free Software Foundation,
18
**      either version 2 of the License, or (at your option) any later version.
19
**
20
**      ProNoC is distributed in the hope that it will be useful, but WITHOUT
21
**      ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22
**      or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
23
**      Public License for more details.
24
**
25
**      You should have received a copy of the GNU Lesser General Public
26
**      License along with ProNoC. If not, see <http:**www.gnu.org/licenses/>.
27
******************************************************************************/
28
 
29
/*******************
30
*  Tcustom1Rcustom_look_ahead_routing
31
*******************/
32
module Tcustom1Rcustom_look_ahead_routing  #(
33
        parameter RAw = 3,
34
        parameter EAw = 3,
35
        parameter DSTPw=4
36
)
37
(
38
        reset,
39
        clk,
40
        current_r_addr,
41
        dest_e_addr,
42
        src_e_addr,
43
        destport
44
);
45
 
46
        input   [RAw-1   :0] current_r_addr;
47
        input   [EAw-1   :0] dest_e_addr;
48
        input   [EAw-1   :0] src_e_addr;
49
        output  [DSTPw-1 :0] destport;
50
        input reset,clk;
51
 
52
        reg [EAw-1   :0] dest_e_addr_delay;
53
        reg [EAw-1   :0] src_e_addr_delay;
54
 
55
        always @(posedge clk)begin
56
                if(reset)begin
57
                        dest_e_addr_delay<={EAw{1'b0}};
58
                        src_e_addr_delay<={EAw{1'b0}};
59
                end else begin
60
                        dest_e_addr_delay<=dest_e_addr;
61
                        src_e_addr_delay<=src_e_addr;
62
                end
63
        end
64
 
65
        Tcustom1Rcustom_look_ahead_routing_comb  #(
66
                .RAw(RAw),
67
                .EAw(EAw),
68
                .DSTPw(DSTPw)
69
        )
70
        lkp_cmb
71
        (
72
                .current_r_addr(current_r_addr),
73
                .dest_e_addr(dest_e_addr_delay),
74
                .src_e_addr(src_e_addr_delay),
75
                .destport(destport)
76
        );
77
 
78
 
79
 
80
endmodule
81
 
82
/*******************
83
*  Tcustom1Rcustom_look_ahead_routing_comb
84
*******************/
85
 
86
 module Tcustom1Rcustom_look_ahead_routing_comb  #(
87
        parameter RAw = 3,
88
        parameter EAw = 3,
89
        parameter DSTPw=4
90
)
91
(
92
        current_r_addr,
93
        dest_e_addr,
94
        src_e_addr,
95
        destport
96
);
97
 
98
        input   [RAw-1   :0] current_r_addr;
99
        input   [EAw-1   :0] dest_e_addr;
100
        input   [EAw-1   :0] src_e_addr;
101
        output reg [DSTPw-1 :0] destport;
102
 
103
localparam [EAw-1 : 0]   E0=0;
104
localparam [EAw-1 : 0]   E1=1;
105
localparam [EAw-1 : 0]   E2=2;
106
localparam [EAw-1 : 0]   E3=3;
107
localparam [EAw-1 : 0]   E4=4;
108
localparam [EAw-1 : 0]   E5=5;
109
localparam [EAw-1 : 0]   E6=6;
110
localparam [EAw-1 : 0]   E7=7;
111
localparam [EAw-1 : 0]   E8=8;
112
localparam [EAw-1 : 0]   E9=9;
113
localparam [EAw-1 : 0]   E10=10;
114
localparam [EAw-1 : 0]   E11=11;
115
localparam [EAw-1 : 0]   E12=12;
116
localparam [EAw-1 : 0]   E13=13;
117
localparam [EAw-1 : 0]   E14=14;
118
localparam [EAw-1 : 0]   E15=15;
119
 
120
 
121
        always@(*)begin
122
                destport=0;
123
                case(current_r_addr) //current_r_addr of each individual router is fixed. So this CASE will be optimized by the synthesizer for each router. 
124
                0: begin
125
                        case({src_e_addr,dest_e_addr})
126
                        {E0,E9},{E0,E10}: begin
127
                                destport= 0;
128
                        end
129
                        {E0,E2},{E0,E3},{E0,E8},{E0,E11},{E0,E12}: begin
130
                                destport= 1;
131
                        end
132
                        {E0,E1},{E0,E4},{E0,E5},{E0,E6},{E0,E7},{E0,E13},{E0,E14},{E0,E15}: begin
133
                                destport= 2;
134
                        end
135
                        default: begin
136
                                destport= {DSTPw{1'bX}};
137
                        end
138
                        endcase
139
                end//0
140
                1: begin
141
                        case({src_e_addr,dest_e_addr})
142
                        {E1,E2},{E1,E7},{E2,E7}: begin
143
                                destport= 0;
144
                        end
145
                        {E1,E3},{E1,E4},{E1,E5},{E1,E6},{E1,E8},{E1,E9},{E1,E11},{E1,E12},{E1,E13},{E1,E14},{E1,E15},{E2,E9},{E2,E12}: begin
146
                                destport= 1;
147
                        end
148
                        {E1,E0},{E1,E10},{E2,E0},{E2,E10}: begin
149
                                destport= 2;
150
                        end
151
                        default: begin
152
                                destport= {DSTPw{1'bX}};
153
                        end
154
                        endcase
155
                end//1
156
                2: begin
157
                        case({src_e_addr,dest_e_addr})
158
                        {E1,E11},{E2,E1},{E2,E11}: begin
159
                                destport= 0;
160
                        end
161
                        {E1,E5},{E1,E6},{E1,E13},{E1,E14},{E2,E0},{E2,E4},{E2,E5},{E2,E6},{E2,E7},{E2,E8},{E2,E9},{E2,E10},{E2,E12},{E2,E13},{E2,E14},{E2,E15}: begin
162
                                destport= 1;
163
                        end
164
                        {E1,E3},{E2,E3}: begin
165
                                destport= 3;
166
                        end
167
                        default: begin
168
                                destport= {DSTPw{1'bX}};
169
                        end
170
                        endcase
171
                end//2
172
                3: begin
173
                        case({src_e_addr,dest_e_addr})
174
                        {E3,E4},{E3,E11}: begin
175
                                destport= 0;
176
                        end
177
                        {E3,E1},{E3,E6},{E3,E7},{E3,E8},{E3,E10},{E3,E12},{E3,E13},{E3,E14}: begin
178
                                destport= 1;
179
                        end
180
                        {E3,E2}: begin
181
                                destport= 2;
182
                        end
183
                        {E3,E0},{E3,E5},{E3,E9},{E3,E15}: begin
184
                                destport= 3;
185
                        end
186
                        default: begin
187
                                destport= {DSTPw{1'bX}};
188
                        end
189
                        endcase
190
                end//3
191
                4: begin
192
                        case({src_e_addr,dest_e_addr})
193
                        {E3,E13},{E4,E3},{E4,E13},{E5,E3},{E6,E3},{E7,E3},{E8,E3},{E9,E3},{E10,E3},{E12,E3},{E13,E3},{E14,E3},{E15,E3}: begin
194
                                destport= 0;
195
                        end
196
                        {E4,E2},{E4,E11},{E4,E14}: begin
197
                                destport= 1;
198
                        end
199
                        {E3,E0},{E3,E5},{E3,E9},{E3,E15},{E4,E0},{E4,E5},{E4,E9},{E4,E12},{E4,E15}: begin
200
                                destport= 2;
201
                        end
202
                        {E3,E6},{E4,E6}: begin
203
                                destport= 3;
204
                        end
205
                        {E3,E1},{E3,E7},{E3,E8},{E3,E14},{E4,E1},{E4,E7},{E4,E8},{E4,E10}: begin
206
                                destport= 4;
207
                        end
208
                        default: begin
209
                                destport= {DSTPw{1'bX}};
210
                        end
211
                        endcase
212
                end//4
213
                5: begin
214
                        case({src_e_addr,dest_e_addr})
215
                        {E0,E6},{E0,E15},{E3,E9},{E3,E15},{E4,E9},{E4,E15},{E5,E6},{E5,E9},{E5,E15},{E6,E9},{E6,E15},{E9,E6},{E9,E15},{E13,E9},{E14,E9},{E15,E9}: begin
216
                                destport= 0;
217
                        end
218
                        {E0,E4},{E0,E13},{E4,E12},{E5,E1},{E5,E2},{E5,E3},{E5,E4},{E5,E7},{E5,E8},{E5,E10},{E5,E12},{E5,E13},{E5,E14},{E6,E1},{E6,E7},{E6,E8},{E6,E10},{E6,E12},{E9,E3},{E9,E4},{E9,E13},{E9,E14}: begin
219
                                destport= 1;
220
                        end
221
                        {E0,E14},{E5,E11},{E6,E2},{E6,E11},{E6,E14},{E9,E2},{E9,E11}: begin
222
                                destport= 2;
223
                        end
224
                        {E3,E0},{E4,E0},{E5,E0},{E6,E0},{E11,E0},{E13,E0},{E15,E0}: begin
225
                                destport= 3;
226
                        end
227
                        default: begin
228
                                destport= {DSTPw{1'bX}};
229
                        end
230
                        endcase
231
                end//5
232
                6: begin
233
                        case({src_e_addr,dest_e_addr})
234
                        {E0,E13},{E3,E5},{E4,E5},{E5,E13},{E6,E5},{E6,E13},{E9,E13}: begin
235
                                destport= 0;
236
                        end
237
                        {E3,E15},{E4,E12},{E4,E15},{E6,E1},{E6,E2},{E6,E7},{E6,E8},{E6,E10},{E6,E11},{E6,E12},{E6,E14},{E6,E15}: begin
238
                                destport= 1;
239
                        end
240
                        {E0,E4},{E5,E3},{E5,E4},{E6,E3},{E6,E4},{E9,E3},{E9,E4}: begin
241
                                destport= 2;
242
                        end
243
                        {E3,E0},{E3,E9},{E4,E0},{E4,E9},{E6,E0},{E6,E9}: begin
244
                                destport= 3;
245
                        end
246
                        {E4,E2},{E4,E11},{E4,E14},{E5,E2},{E5,E14},{E9,E14}: begin
247
                                destport= 4;
248
                        end
249
                        default: begin
250
                                destport= {DSTPw{1'bX}};
251
                        end
252
                        endcase
253
                end//6
254
                7: begin
255
                        case({src_e_addr,dest_e_addr})
256
                        {E0,E1},{E1,E8},{E1,E10},{E2,E10},{E3,E1},{E3,E10},{E4,E1},{E4,E10},{E5,E1},{E6,E1},{E7,E1},{E7,E8},{E7,E10},{E8,E1},{E9,E1},{E10,E1},{E11,E1},{E11,E10},{E12,E1},{E13,E1},{E13,E10},{E14,E1},{E14,E10},{E15,E1}: begin
257
                                destport= 0;
258
                        end
259
                        {E1,E9},{E1,E12},{E1,E15},{E2,E9},{E2,E12},{E7,E9},{E7,E12}: begin
260
                                destport= 1;
261
                        end
262
                        {E1,E4},{E7,E2},{E7,E3},{E7,E4},{E7,E5},{E7,E6},{E7,E11},{E7,E13},{E7,E14},{E7,E15}: begin
263
                                destport= 2;
264
                        end
265
                        {E1,E0},{E2,E0},{E7,E0},{E14,E0}: begin
266
                                destport= 3;
267
                        end
268
                        default: begin
269
                                destport= {DSTPw{1'bX}};
270
                        end
271
                        endcase
272
                end//7
273
                8: begin
274
                        case({src_e_addr,dest_e_addr})
275
                        {E1,E12},{E2,E12},{E3,E7},{E4,E7},{E7,E12},{E7,E14},{E8,E7},{E8,E12},{E8,E14},{E9,E7},{E11,E7},{E13,E7},{E14,E7}: begin
276
                                destport= 0;
277
                        end
278
                        {E1,E15},{E7,E5},{E7,E15},{E8,E4},{E8,E5},{E8,E15}: begin
279
                                destport= 1;
280
                        end
281
                        {E1,E4},{E1,E9},{E2,E9},{E3,E10},{E4,E10},{E7,E3},{E7,E4},{E7,E6},{E7,E9},{E7,E13},{E8,E0},{E8,E3},{E8,E6},{E8,E9},{E8,E13},{E11,E10},{E13,E10},{E14,E0},{E14,E10}: begin
282
                                destport= 2;
283
                        end
284
                        {E3,E1},{E4,E1},{E8,E1},{E8,E10},{E9,E1},{E11,E1},{E13,E1},{E14,E1}: begin
285
                                destport= 3;
286
                        end
287
                        {E7,E2},{E7,E11},{E8,E2},{E8,E11}: begin
288
                                destport= 4;
289
                        end
290
                        default: begin
291
                                destport= {DSTPw{1'bX}};
292
                        end
293
                        endcase
294
                end//8
295
                9: begin
296
                        case({src_e_addr,dest_e_addr})
297
                        {E0,E5},{E0,E12},{E3,E0},{E4,E0},{E5,E0},{E6,E0},{E8,E0},{E9,E0},{E9,E5},{E9,E12},{E11,E0},{E12,E0},{E13,E0},{E15,E0}: begin
298
                                destport= 0;
299
                        end
300
                        {E0,E11},{E0,E14},{E0,E15},{E9,E2},{E9,E11},{E9,E15}: begin
301
                                destport= 1;
302
                        end
303
                        {E0,E4},{E0,E6},{E0,E13},{E9,E3},{E9,E4},{E9,E6},{E9,E13},{E9,E14}: begin
304
                                destport= 2;
305
                        end
306
                        {E9,E10}: begin
307
                                destport= 3;
308
                        end
309
                        {E0,E8},{E9,E1},{E9,E7},{E9,E8}: begin
310
                                destport= 4;
311
                        end
312
                        default: begin
313
                                destport= {DSTPw{1'bX}};
314
                        end
315
                        endcase
316
                end//9
317
                10: begin
318
                        case({src_e_addr,dest_e_addr})
319
                        {E0,E7},{E1,E0},{E2,E0},{E5,E7},{E6,E7},{E7,E0},{E10,E0},{E10,E7},{E10,E12},{E12,E7},{E14,E0},{E15,E7}: begin
320
                                destport= 0;
321
                        end
322
                        {E0,E2},{E0,E3},{E10,E2},{E10,E3},{E10,E4},{E10,E5},{E10,E6},{E10,E11},{E10,E13},{E10,E14},{E10,E15}: begin
323
                                destport= 1;
324
                        end
325
                        {E10,E9}: begin
326
                                destport= 2;
327
                        end
328
                        {E0,E1},{E5,E1},{E6,E1},{E10,E1},{E12,E1},{E15,E1}: begin
329
                                destport= 3;
330
                        end
331
                        {E10,E8}: begin
332
                                destport= 4;
333
                        end
334
                        default: begin
335
                                destport= {DSTPw{1'bX}};
336
                        end
337
                        endcase
338
                end//10
339
                11: begin
340
                        case({src_e_addr,dest_e_addr})
341
                        {E0,E2},{E0,E3},{E1,E3},{E1,E14},{E2,E3},{E2,E14},{E3,E2},{E4,E2},{E5,E2},{E6,E2},{E7,E2},{E8,E2},{E9,E2},{E10,E2},{E11,E2},{E11,E3},{E11,E14},{E12,E2},{E13,E2},{E14,E2},{E15,E2}: begin
342
                                destport= 0;
343
                        end
344
                        {E1,E5},{E1,E13},{E2,E5},{E2,E15},{E3,E12},{E11,E0},{E11,E5},{E11,E9},{E11,E12},{E11,E15}: begin
345
                                destport= 1;
346
                        end
347
                        {E1,E6},{E2,E4},{E2,E6},{E2,E13},{E11,E4},{E11,E6},{E11,E13}: begin
348
                                destport= 2;
349
                        end
350
                        {E2,E8},{E3,E10},{E11,E1},{E11,E7},{E11,E8},{E11,E10}: begin
351
                                destport= 3;
352
                        end
353
                        default: begin
354
                                destport= {DSTPw{1'bX}};
355
                        end
356
                        endcase
357
                end//11
358
                12: begin
359
                        case({src_e_addr,dest_e_addr})
360
                        {E0,E8},{E1,E9},{E1,E15},{E2,E9},{E5,E8},{E5,E10},{E6,E8},{E6,E10},{E7,E9},{E8,E9},{E8,E10},{E9,E8},{E9,E10},{E10,E8},{E10,E9},{E10,E15},{E11,E9},{E12,E8},{E12,E9},{E12,E10},{E12,E15},{E15,E8},{E15,E10}: begin
361
                                destport= 0;
362
                        end
363
                        {E0,E2},{E0,E3},{E0,E11},{E5,E1},{E5,E7},{E6,E1},{E6,E7},{E10,E2},{E10,E11},{E10,E14},{E12,E1},{E12,E2},{E12,E7},{E12,E11},{E12,E14},{E15,E1},{E15,E7}: begin
364
                                destport= 2;
365
                        end
366
                        {E8,E0},{E8,E4},{E9,E1},{E9,E7},{E10,E3},{E10,E4},{E10,E6},{E10,E13},{E12,E0},{E12,E3},{E12,E4},{E12,E6},{E12,E13}: begin
367
                                destport= 3;
368
                        end
369
                        {E8,E5},{E10,E5},{E12,E5}: begin
370
                                destport= 4;
371
                        end
372
                        default: begin
373
                                destport= {DSTPw{1'bX}};
374
                        end
375
                        endcase
376
                end//12
377
                13: begin
378
                        case({src_e_addr,dest_e_addr})
379
                        {E0,E4},{E1,E4},{E1,E6},{E2,E4},{E2,E6},{E3,E6},{E3,E14},{E4,E6},{E4,E14},{E5,E4},{E5,E14},{E6,E4},{E7,E4},{E7,E6},{E8,E4},{E8,E6},{E9,E4},{E9,E14},{E10,E4},{E10,E6},{E11,E4},{E11,E6},{E12,E4},{E12,E6},{E13,E4},{E13,E6},{E13,E14},{E14,E4},{E14,E6},{E15,E4},{E15,E6}: begin
380
                                destport= 0;
381
                        end
382
                        {E13,E0},{E13,E5},{E13,E9},{E13,E12},{E13,E15}: begin
383
                                destport= 1;
384
                        end
385
                        {E5,E3},{E6,E3},{E7,E3},{E8,E3},{E9,E3},{E10,E3},{E12,E3},{E13,E3},{E14,E3},{E15,E3}: begin
386
                                destport= 2;
387
                        end
388
                        {E3,E1},{E3,E7},{E3,E8},{E4,E1},{E4,E7},{E4,E8},{E4,E10},{E13,E1},{E13,E7},{E13,E8},{E13,E10}: begin
389
                                destport= 3;
390
                        end
391
                        {E4,E2},{E4,E11},{E5,E2},{E13,E2},{E13,E11}: begin
392
                                destport= 4;
393
                        end
394
                        default: begin
395
                                destport= {DSTPw{1'bX}};
396
                        end
397
                        endcase
398
                end//13
399
                14: begin
400
                        case({src_e_addr,dest_e_addr})
401
                        {E0,E11},{E2,E8},{E2,E13},{E2,E15},{E3,E8},{E4,E8},{E4,E11},{E5,E11},{E6,E11},{E7,E11},{E7,E13},{E7,E15},{E8,E11},{E8,E13},{E8,E15},{E9,E11},{E10,E11},{E11,E8},{E11,E13},{E11,E15},{E12,E11},{E13,E8},{E13,E11},{E13,E15},{E14,E8},{E14,E11},{E14,E13},{E14,E15},{E15,E11}: begin
402
                                destport= 0;
403
                        end
404
                        {E3,E12},{E11,E9},{E11,E12},{E13,E12},{E14,E12}: begin
405
                                destport= 1;
406
                        end
407
                        {E0,E2},{E1,E4},{E2,E4},{E4,E2},{E5,E2},{E6,E2},{E7,E2},{E7,E3},{E7,E4},{E8,E2},{E8,E3},{E9,E2},{E10,E2},{E11,E4},{E12,E2},{E13,E2},{E14,E2},{E14,E3},{E14,E4},{E15,E2}: begin
408
                                destport= 2;
409
                        end
410
                        {E0,E3},{E1,E6},{E1,E13},{E2,E6},{E3,E1},{E3,E7},{E3,E10},{E4,E1},{E4,E7},{E4,E10},{E7,E6},{E8,E6},{E11,E1},{E11,E6},{E11,E7},{E11,E10},{E13,E1},{E13,E7},{E13,E10},{E14,E0},{E14,E1},{E14,E6},{E14,E7},{E14,E10}: begin
411
                                destport= 3;
412
                        end
413
                        {E1,E5},{E2,E5},{E7,E5},{E11,E0},{E11,E5},{E13,E0},{E13,E5},{E13,E9},{E14,E5},{E14,E9}: begin
414
                                destport= 4;
415
                        end
416
                        default: begin
417
                                destport= {DSTPw{1'bX}};
418
                        end
419
                        endcase
420
                end//14
421
                15: begin
422
                        case({src_e_addr,dest_e_addr})
423
                        {E0,E14},{E1,E5},{E1,E13},{E2,E5},{E3,E12},{E4,E12},{E5,E12},{E6,E12},{E6,E14},{E7,E5},{E8,E5},{E10,E5},{E10,E13},{E10,E14},{E11,E5},{E11,E12},{E12,E5},{E12,E13},{E12,E14},{E13,E5},{E13,E12},{E14,E5},{E14,E12},{E15,E5},{E15,E12},{E15,E13},{E15,E14}: begin
424
                                destport= 0;
425
                        end
426
                        {E8,E4},{E10,E3},{E10,E4},{E11,E9},{E12,E3},{E12,E4},{E15,E3},{E15,E4}: begin
427
                                destport= 2;
428
                        end
429
                        {E5,E1},{E5,E7},{E5,E10},{E6,E1},{E6,E7},{E6,E10},{E10,E6},{E11,E0},{E12,E6},{E13,E0},{E13,E9},{E14,E9},{E15,E0},{E15,E1},{E15,E6},{E15,E7},{E15,E9},{E15,E10}: begin
430
                                destport= 3;
431
                        end
432
                        {E0,E2},{E0,E3},{E0,E11},{E5,E8},{E5,E11},{E6,E2},{E6,E8},{E6,E11},{E9,E2},{E9,E11},{E10,E2},{E10,E11},{E12,E2},{E12,E11},{E15,E2},{E15,E8},{E15,E11}: begin
433
                                destport= 4;
434
                        end
435
                        default: begin
436
                                destport= {DSTPw{1'bX}};
437
                        end
438
                        endcase
439
                end//15
440
                default: begin
441
                        destport= {DSTPw{1'bX}};
442
                end
443
                endcase
444
        end
445
 
446
 
447
 
448
endmodule
449
 
450
 

powered by: WebSVN 2.1.0

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