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