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/] [custom1_noc_genvar.sv] - Blame information for rev 54

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/custom1_noc_genvar.sv
10
**
11 54 alirezamon
**      Copyright (C) 2014-2021  Alireza Monemi
12 48 alirezamon
**
13 54 alirezamon
**      This file is part of ProNoC 2.0.0
14 48 alirezamon
**
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 .
27
******************************************************************************/
28
 
29 54 alirezamon
`include "pronoc_def.v"
30
 
31 48 alirezamon
module   custom1_noc_genvar
32
   import pronoc_pkg::*;
33
        (
34
 
35
    reset,
36
    clk,
37
    chan_in_all,
38 54 alirezamon
    chan_out_all,
39
    router_event
40 48 alirezamon
);
41
 
42
         function integer log2;
43
      input integer number; begin
44
         log2=(number <=1) ? 1: 0;
45
         while(2**log2
46
            log2=log2+1;
47
         end
48
      end
49
    endfunction // log2
50
 
51
        localparam
52
                NE = 16,
53
                NR = 16,
54
                RAw=log2(NR),
55
                MAX_P=5;
56
 
57
 
58
 
59
        input  reset;
60
        input  clk;
61
        input  smartflit_chanel_t chan_in_all  [NE-1 : 0];
62
        output smartflit_chanel_t chan_out_all [NE-1 : 0];
63
 
64 54 alirezamon
//Events
65
        output  router_event_t  router_event [NR-1 : 0][MAX_P-1 : 0];
66
 
67 48 alirezamon
//all routers port
68
        smartflit_chanel_t    router_chan_in   [NR-1 :0][MAX_P-1 : 0];
69
        smartflit_chanel_t    router_chan_out  [NR-1 :0][MAX_P-1 : 0];
70
 
71 54 alirezamon
 
72 48 alirezamon
        wire [RAw-1 : 0] current_r_addr [NR-1 : 0];
73
 
74
 
75
 
76
 
77
 
78
 
79
 
80
 
81
 
82
        genvar i;
83
        generate
84
 
85
        for( i=0; i<4; i=i+1) begin : router_3_port_lp
86 54 alirezamon
        localparam RID = i;
87
        assign current_r_addr [RID] = RID[RAw-1: 0];
88 48 alirezamon
 
89
        router_top #(
90
                .P(3)
91
        )
92
        router_3_port
93
        (
94
                .clk(clk),
95
                .reset(reset),
96 54 alirezamon
                .current_r_id(RID),
97
                .current_r_addr(current_r_addr[RID]),
98
                .chan_in  (router_chan_in [RID] [2 : 0]),
99
                .chan_out (router_chan_out[RID] [2 : 0]),
100
                .router_event(router_event[RID] [2 : 0])
101 48 alirezamon
        );
102
 
103
 
104
 
105
        end
106
 
107
        for( i=0; i<8; i=i+1) begin : router_4_port_lp
108 54 alirezamon
        localparam RID = i+4;
109
        assign current_r_addr [RID] = RID[RAw-1: 0];
110 48 alirezamon
 
111
        router_top #(
112
                .P(4)
113
        )
114
        router_4_port
115
        (
116
                .clk(clk),
117
                .reset(reset),
118 54 alirezamon
                .current_r_id(RID),
119
                .current_r_addr(current_r_addr[RID]),
120
                .chan_in  (router_chan_in [RID] [3 : 0]),
121
                .chan_out (router_chan_out[RID] [3 : 0]),
122
                .router_event(router_event[RID] [3 : 0])
123 48 alirezamon
        );
124
 
125
 
126
 
127
        end
128
 
129
        for( i=0; i<4; i=i+1) begin : router_5_port_lp
130 54 alirezamon
        localparam RID = i+12;
131
        assign current_r_addr [RID] = RID[RAw-1: 0];
132 48 alirezamon
 
133
        router_top #(
134
                .P(5)
135
        )
136
        router_5_port
137
        (
138
                .clk(clk),
139
                .reset(reset),
140 54 alirezamon
                .current_r_id(RID),
141
                .current_r_addr(current_r_addr[RID]),
142
                .chan_in  (router_chan_in [RID] [4 : 0]),
143
                .chan_out (router_chan_out[RID] [4 : 0]),
144
                .router_event(router_event[RID] [4 : 0])
145 48 alirezamon
        );
146
 
147
 
148
 
149
        end
150
                        endgenerate
151
 
152
 
153
//Connect R0 input ports 0 to  T0 output ports 0
154
                assign  router_chan_in [0][0] = chan_in_all [0];
155
                assign  chan_out_all [0] = router_chan_out [0][0];
156
//Connect R0 input ports 1 to  R14 output ports 3
157
                assign  router_chan_in [0][1] = router_chan_out [10][3];
158
//Connect R0 input ports 2 to  R13 output ports 3
159
                assign  router_chan_in [0][2] = router_chan_out [9][3];
160
//Connect R1 input ports 0 to  T1 output ports 0
161
                assign  router_chan_in [1][0] = chan_in_all [1];
162
                assign  chan_out_all [1] = router_chan_out [1][0];
163
//Connect R1 input ports 1 to  R7 output ports 3
164
                assign  router_chan_in [1][1] = router_chan_out [7][3];
165
//Connect R1 input ports 2 to  R2 output ports 2
166
                assign  router_chan_in [1][2] = router_chan_out [2][2];
167
//Connect R2 input ports 0 to  T2 output ports 0
168
                assign  router_chan_in [2][0] = chan_in_all [2];
169
                assign  chan_out_all [2] = router_chan_out [2][0];
170
//Connect R2 input ports 1 to  R15 output ports 2
171
                assign  router_chan_in [2][1] = router_chan_out [11][2];
172
//Connect R2 input ports 2 to  R1 output ports 2
173
                assign  router_chan_in [2][2] = router_chan_out [1][2];
174
//Connect R3 input ports 0 to  T3 output ports 0
175
                assign  router_chan_in [3][0] = chan_in_all [3];
176
                assign  chan_out_all [3] = router_chan_out [3][0];
177
//Connect R3 input ports 1 to  R15 output ports 3
178
                assign  router_chan_in [3][1] = router_chan_out [11][3];
179
//Connect R3 input ports 2 to  R4 output ports 2
180
                assign  router_chan_in [3][2] = router_chan_out [4][2];
181
//Connect R4 input ports 0 to  T4 output ports 0
182
                assign  router_chan_in [4][0] = chan_in_all [4];
183
                assign  chan_out_all [4] = router_chan_out [4][0];
184
//Connect R4 input ports 1 to  R9 output ports 2
185
                assign  router_chan_in [4][1] = router_chan_out [13][2];
186
//Connect R4 input ports 2 to  R3 output ports 2
187
                assign  router_chan_in [4][2] = router_chan_out [3][2];
188
//Connect R4 input ports 3 to  R6 output ports 3
189
                assign  router_chan_in [4][3] = router_chan_out [6][3];
190
//Connect R5 input ports 0 to  T5 output ports 0
191
                assign  router_chan_in [5][0] = chan_in_all [5];
192
                assign  chan_out_all [5] = router_chan_out [5][0];
193
//Connect R5 input ports 1 to  R11 output ports 4
194
                assign  router_chan_in [5][1] = router_chan_out [15][4];
195
//Connect R5 input ports 2 to  R6 output ports 2
196
                assign  router_chan_in [5][2] = router_chan_out [6][2];
197
//Connect R5 input ports 3 to  R13 output ports 2
198
                assign  router_chan_in [5][3] = router_chan_out [9][2];
199
//Connect R6 input ports 0 to  T6 output ports 0
200
                assign  router_chan_in [6][0] = chan_in_all [6];
201
                assign  chan_out_all [6] = router_chan_out [6][0];
202
//Connect R6 input ports 1 to  R9 output ports 3
203
                assign  router_chan_in [6][1] = router_chan_out [13][3];
204
//Connect R6 input ports 2 to  R5 output ports 2
205
                assign  router_chan_in [6][2] = router_chan_out [5][2];
206
//Connect R6 input ports 3 to  R4 output ports 3
207
                assign  router_chan_in [6][3] = router_chan_out [4][3];
208
//Connect R7 input ports 0 to  T7 output ports 0
209
                assign  router_chan_in [7][0] = chan_in_all [7];
210
                assign  chan_out_all [7] = router_chan_out [7][0];
211
//Connect R7 input ports 1 to  R12 output ports 3
212
                assign  router_chan_in [7][1] = router_chan_out [8][3];
213
//Connect R7 input ports 2 to  R14 output ports 2
214
                assign  router_chan_in [7][2] = router_chan_out [10][2];
215
//Connect R7 input ports 3 to  R1 output ports 1
216
                assign  router_chan_in [7][3] = router_chan_out [1][1];
217
//Connect R12 input ports 0 to  T8 output ports 0
218
                assign  router_chan_in [8][0] = chan_in_all [8];
219
                assign  chan_out_all [8] = router_chan_out [8][0];
220
//Connect R12 input ports 1 to  R8 output ports 4
221
                assign  router_chan_in [8][1] = router_chan_out [12][4];
222
//Connect R12 input ports 2 to  R10 output ports 3
223
                assign  router_chan_in [8][2] = router_chan_out [14][3];
224
//Connect R12 input ports 3 to  R7 output ports 1
225
                assign  router_chan_in [8][3] = router_chan_out [7][1];
226
//Connect R13 input ports 0 to  T9 output ports 0
227
                assign  router_chan_in [9][0] = chan_in_all [9];
228
                assign  chan_out_all [9] = router_chan_out [9][0];
229
//Connect R13 input ports 1 to  R8 output ports 2
230
                assign  router_chan_in [9][1] = router_chan_out [12][2];
231
//Connect R13 input ports 2 to  R5 output ports 3
232
                assign  router_chan_in [9][2] = router_chan_out [5][3];
233
//Connect R13 input ports 3 to  R0 output ports 2
234
                assign  router_chan_in [9][3] = router_chan_out [0][2];
235
//Connect R14 input ports 0 to  T10 output ports 0
236
                assign  router_chan_in [10][0] = chan_in_all [10];
237
                assign  chan_out_all [10] = router_chan_out [10][0];
238
//Connect R14 input ports 1 to  R8 output ports 3
239
                assign  router_chan_in [10][1] = router_chan_out [12][3];
240
//Connect R14 input ports 2 to  R7 output ports 2
241
                assign  router_chan_in [10][2] = router_chan_out [7][2];
242
//Connect R14 input ports 3 to  R0 output ports 1
243
                assign  router_chan_in [10][3] = router_chan_out [0][1];
244
//Connect R15 input ports 0 to  T11 output ports 0
245
                assign  router_chan_in [11][0] = chan_in_all [11];
246
                assign  chan_out_all [11] = router_chan_out [11][0];
247
//Connect R15 input ports 1 to  R10 output ports 4
248
                assign  router_chan_in [11][1] = router_chan_out [14][4];
249
//Connect R15 input ports 2 to  R2 output ports 1
250
                assign  router_chan_in [11][2] = router_chan_out [2][1];
251
//Connect R15 input ports 3 to  R3 output ports 1
252
                assign  router_chan_in [11][3] = router_chan_out [3][1];
253
//Connect R8 input ports 0 to  T12 output ports 0
254
                assign  router_chan_in [12][0] = chan_in_all [12];
255
                assign  chan_out_all [12] = router_chan_out [12][0];
256
//Connect R8 input ports 1 to  R11 output ports 1
257
                assign  router_chan_in [12][1] = router_chan_out [15][1];
258
//Connect R8 input ports 2 to  R13 output ports 1
259
                assign  router_chan_in [12][2] = router_chan_out [9][1];
260
//Connect R8 input ports 3 to  R14 output ports 1
261
                assign  router_chan_in [12][3] = router_chan_out [10][1];
262
//Connect R8 input ports 4 to  R12 output ports 1
263
                assign  router_chan_in [12][4] = router_chan_out [8][1];
264
//Connect R9 input ports 0 to  T13 output ports 0
265
                assign  router_chan_in [13][0] = chan_in_all [13];
266
                assign  chan_out_all [13] = router_chan_out [13][0];
267
//Connect R9 input ports 1 to  R11 output ports 3
268
                assign  router_chan_in [13][1] = router_chan_out [15][3];
269
//Connect R9 input ports 2 to  R4 output ports 1
270
                assign  router_chan_in [13][2] = router_chan_out [4][1];
271
//Connect R9 input ports 3 to  R6 output ports 1
272
                assign  router_chan_in [13][3] = router_chan_out [6][1];
273
//Connect R9 input ports 4 to  R10 output ports 2
274
                assign  router_chan_in [13][4] = router_chan_out [14][2];
275
//Connect R10 input ports 0 to  T14 output ports 0
276
                assign  router_chan_in [14][0] = chan_in_all [14];
277
                assign  chan_out_all [14] = router_chan_out [14][0];
278
//Connect R10 input ports 1 to  R11 output ports 2
279
                assign  router_chan_in [14][1] = router_chan_out [15][2];
280
//Connect R10 input ports 2 to  R9 output ports 4
281
                assign  router_chan_in [14][2] = router_chan_out [13][4];
282
//Connect R10 input ports 3 to  R12 output ports 2
283
                assign  router_chan_in [14][3] = router_chan_out [8][2];
284
//Connect R10 input ports 4 to  R15 output ports 1
285
                assign  router_chan_in [14][4] = router_chan_out [11][1];
286
//Connect R11 input ports 0 to  T15 output ports 0
287
                assign  router_chan_in [15][0] = chan_in_all [15];
288
                assign  chan_out_all [15] = router_chan_out [15][0];
289
//Connect R11 input ports 1 to  R8 output ports 1
290
                assign  router_chan_in [15][1] = router_chan_out [12][1];
291
//Connect R11 input ports 2 to  R10 output ports 1
292
                assign  router_chan_in [15][2] = router_chan_out [14][1];
293
//Connect R11 input ports 3 to  R9 output ports 1
294
                assign  router_chan_in [15][3] = router_chan_out [13][1];
295
//Connect R11 input ports 4 to  R5 output ports 1
296
                assign  router_chan_in [15][4] = router_chan_out [5][1];
297
 
298
 
299
 
300
 
301
endmodule

powered by: WebSVN 2.1.0

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