1 |
32 |
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 |
|
|
The mesh network for simulation.
|
13 |
|
|
|
14 |
|
|
History:
|
15 |
|
|
03/03/2011 Initial version. <wsong83@gmail.com>
|
16 |
|
|
30/05/2011 Clean up for opensource. <wsong83@gmail.com>
|
17 |
|
|
|
18 |
|
|
*/
|
19 |
|
|
|
20 |
|
|
// the router structure definitions
|
21 |
|
|
`include "define.v"
|
22 |
|
|
|
23 |
|
|
module noc_top(/*AUTOARG*/
|
24 |
|
|
// Inputs
|
25 |
|
|
rst_n
|
26 |
|
|
);
|
27 |
|
|
input rst_n;
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
parameter DW = 32;
|
31 |
|
|
parameter VCN = 1;
|
32 |
|
|
parameter DIMX = 8;
|
33 |
|
|
parameter DIMY = 8;
|
34 |
|
|
parameter SCN = DW/2;
|
35 |
|
|
|
36 |
|
|
wire [DIMX-1:0][DIMY-1:0][3:0][VCN*SCN-1:0] di0, di1, di2, di3;
|
37 |
|
|
wire [DIMX-1:0][DIMY-1:0][3:0][VCN*SCN-1:0] do0, do1, do2, do3;
|
38 |
|
|
`ifdef ENABLE_CHANNEL_SLICING
|
39 |
|
|
wire [DIMX-1:0][DIMY-1:0][3:0][VCN*SCN-1:0] di4, dia;
|
40 |
|
|
wire [DIMX-1:0][DIMY-1:0][3:0][VCN*SCN-1:0] do4, doa;
|
41 |
|
|
`else
|
42 |
|
|
wire [DIMX-1:0][DIMY-1:0][3:0][VCN-1:0] di4, dia;
|
43 |
|
|
wire [DIMX-1:0][DIMY-1:0][3:0][VCN-1:0] do4, doa;
|
44 |
|
|
`endif
|
45 |
|
|
|
46 |
|
|
genvar x, y;
|
47 |
|
|
|
48 |
|
|
generate for(x=0; x<DIMX; x++) begin: DX
|
49 |
|
|
for(y=0; y<DIMY; y++) begin: DY
|
50 |
|
|
|
51 |
|
|
node_top #(.DW(DW), .VCN(VCN), .x(x), .y(y))
|
52 |
|
|
NN (
|
53 |
|
|
.si0 (di0[x][y][0]), .si1 (di1[x][y][0]), .si2 (di2[x][y][0]), .si3 (di3[x][y][0]), .si4 (di4[x][y][0]), .sia (dia[x][y][0]),
|
54 |
|
|
.wi0 (di0[x][y][1]), .wi1 (di1[x][y][1]), .wi2 (di2[x][y][1]), .wi3 (di3[x][y][1]), .wi4 (di4[x][y][1]), .wia (dia[x][y][1]),
|
55 |
|
|
.ni0 (di0[x][y][2]), .ni1 (di1[x][y][2]), .ni2 (di2[x][y][2]), .ni3 (di3[x][y][2]), .ni4 (di4[x][y][2]), .nia (dia[x][y][2]),
|
56 |
|
|
.ei0 (di0[x][y][3]), .ei1 (di1[x][y][3]), .ei2 (di2[x][y][3]), .ei3 (di3[x][y][3]), .ei4 (di4[x][y][3]), .eia (dia[x][y][3]),
|
57 |
|
|
.so0 (do0[x][y][0]), .so1 (do1[x][y][0]), .so2 (do2[x][y][0]), .so3 (do3[x][y][0]), .so4 (do4[x][y][0]), .soa (doa[x][y][0]),
|
58 |
|
|
.wo0 (do0[x][y][1]), .wo1 (do1[x][y][1]), .wo2 (do2[x][y][1]), .wo3 (do3[x][y][1]), .wo4 (do4[x][y][1]), .woa (doa[x][y][1]),
|
59 |
|
|
.no0 (do0[x][y][2]), .no1 (do1[x][y][2]), .no2 (do2[x][y][2]), .no3 (do3[x][y][2]), .no4 (do4[x][y][2]), .noa (doa[x][y][2]),
|
60 |
|
|
.eo0 (do0[x][y][3]), .eo1 (do1[x][y][3]), .eo2 (do2[x][y][3]), .eo3 (do3[x][y][3]), .eo4 (do4[x][y][3]), .eoa (doa[x][y][3]),
|
61 |
|
|
.rst_n(rst_n)
|
62 |
|
|
);
|
63 |
|
|
|
64 |
|
|
// north link
|
65 |
|
|
if(x==0) begin
|
66 |
|
|
assign di0[x][y][2] = do0[x][y][2];
|
67 |
|
|
assign di1[x][y][2] = do1[x][y][2];
|
68 |
|
|
assign di2[x][y][2] = do2[x][y][2];
|
69 |
|
|
assign di3[x][y][2] = do3[x][y][2];
|
70 |
|
|
assign di4[x][y][2] = do4[x][y][2];
|
71 |
|
|
assign doa[x][y][2] = dia[x][y][2];
|
72 |
|
|
end else begin
|
73 |
|
|
assign di0[x][y][2] = do0[x-1][y][0];
|
74 |
|
|
assign di1[x][y][2] = do1[x-1][y][0];
|
75 |
|
|
assign di2[x][y][2] = do2[x-1][y][0];
|
76 |
|
|
assign di3[x][y][2] = do3[x-1][y][0];
|
77 |
|
|
assign di4[x][y][2] = do4[x-1][y][0];
|
78 |
|
|
assign doa[x-1][y][0] = dia[x][y][2];
|
79 |
|
|
end
|
80 |
|
|
|
81 |
|
|
// south link
|
82 |
|
|
if(x==DIMX-1) begin
|
83 |
|
|
assign di0[x][y][0] = do0[x][y][0];
|
84 |
|
|
assign di1[x][y][0] = do1[x][y][0];
|
85 |
|
|
assign di2[x][y][0] = do2[x][y][0];
|
86 |
|
|
assign di3[x][y][0] = do3[x][y][0];
|
87 |
|
|
assign di4[x][y][0] = do4[x][y][0];
|
88 |
|
|
assign doa[x][y][0] = dia[x][y][0];
|
89 |
|
|
end else begin
|
90 |
|
|
assign di0[x][y][0] = do0[x+1][y][2];
|
91 |
|
|
assign di1[x][y][0] = do1[x+1][y][2];
|
92 |
|
|
assign di2[x][y][0] = do2[x+1][y][2];
|
93 |
|
|
assign di3[x][y][0] = do3[x+1][y][2];
|
94 |
|
|
assign di4[x][y][0] = do4[x+1][y][2];
|
95 |
|
|
assign doa[x+1][y][2] = dia[x][y][0];
|
96 |
|
|
end
|
97 |
|
|
|
98 |
|
|
// west link
|
99 |
|
|
if(y==0) begin
|
100 |
|
|
assign di0[x][y][1] = do0[x][y][1];
|
101 |
|
|
assign di1[x][y][1] = do1[x][y][1];
|
102 |
|
|
assign di2[x][y][1] = do2[x][y][1];
|
103 |
|
|
assign di3[x][y][1] = do3[x][y][1];
|
104 |
|
|
assign di4[x][y][1] = do4[x][y][1];
|
105 |
|
|
assign doa[x][y][1] = dia[x][y][1];
|
106 |
|
|
end else begin
|
107 |
|
|
assign di0[x][y][1] = do0[x][y-1][3];
|
108 |
|
|
assign di1[x][y][1] = do1[x][y-1][3];
|
109 |
|
|
assign di2[x][y][1] = do2[x][y-1][3];
|
110 |
|
|
assign di3[x][y][1] = do3[x][y-1][3];
|
111 |
|
|
assign di4[x][y][1] = do4[x][y-1][3];
|
112 |
|
|
assign doa[x][y-1][3] = dia[x][y][1];
|
113 |
|
|
end // else: !if(y==0)
|
114 |
|
|
|
115 |
|
|
// east link
|
116 |
|
|
if(y==DIMY-1) begin
|
117 |
|
|
assign di0[x][y][3] = do0[x][y][3];
|
118 |
|
|
assign di1[x][y][3] = do1[x][y][3];
|
119 |
|
|
assign di2[x][y][3] = do2[x][y][3];
|
120 |
|
|
assign di3[x][y][3] = do3[x][y][3];
|
121 |
|
|
assign di4[x][y][3] = do4[x][y][3];
|
122 |
|
|
assign doa[x][y][3] = dia[x][y][3];
|
123 |
|
|
end else begin
|
124 |
|
|
assign di0[x][y][3] = do0[x][y+1][1];
|
125 |
|
|
assign di1[x][y][3] = do1[x][y+1][1];
|
126 |
|
|
assign di2[x][y][3] = do2[x][y+1][1];
|
127 |
|
|
assign di3[x][y][3] = do3[x][y+1][1];
|
128 |
|
|
assign di4[x][y][3] = do4[x][y+1][1];
|
129 |
|
|
assign doa[x][y+1][1] = dia[x][y][3];
|
130 |
|
|
end // else: !if(y==DIMY-1)
|
131 |
|
|
|
132 |
|
|
end // block: DY
|
133 |
|
|
end // block: DX
|
134 |
|
|
endgenerate
|
135 |
|
|
|
136 |
|
|
endmodule // noc_top
|