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

powered by: WebSVN 2.1.0

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