OpenCores
URL https://opencores.org/ocsvn/async_sdm_noc/async_sdm_noc/trunk

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [branches/] [init/] [vc/] [tb/] [noc_top.v] - Blame information for rev 70

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

Line No. Rev Author Line
1 44 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
 04/03/2011  Support VC. <wsong83@gmail.com>
17
 05/06/2011  Clean up for opensource. <wsong83@gmail.com>
18
 
19
*/
20
 
21
// the router structure definitions
22
`include "define.v"
23
 
24
module noc_top(/*AUTOARG*/
25
   // Inputs
26
   rst_n
27
   );
28
   input rst_n;
29
 
30
 
31
   parameter DW = 32;
32
   parameter VCN = 1;
33
   parameter FT = 3;
34
   parameter DIMX = 8;
35
   parameter DIMY = 8;
36
   parameter SCN = DW/2;
37
 
38
   wire [DIMX-1:0][DIMY-1:0][3:0][SCN-1:0]     di0, di1, di2, di3;
39
   wire [DIMX-1:0][DIMY-1:0][3:0][SCN-1:0]     do0, do1, do2, do3;
40
   wire [DIMX-1:0][DIMY-1:0][3:0]         dia, doa;
41
   wire [DIMX-1:0][DIMY-1:0][3:0][FT-1:0]      dift, doft;
42
   wire [DIMX-1:0][DIMY-1:0][3:0][VCN-1:0]     divc, dovc;
43
   wire [DIMX-1:0][DIMY-1:0][3:0][VCN-1:0]     dic, doc;
44
   wire [DIMX-1:0][DIMY-1:0][3:0][VCN-1:0]     dica, doca;
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), .FT(FT), .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]), .sia (dia[x][y][0]), .sift(dift[x][y][0]), .sivc(divc[x][y][0]), .sic(dic[x][y][0]), .sica(dica[x][y][0]),
54
             .wi0 (di0[x][y][1]), .wi1 (di1[x][y][1]), .wi2 (di2[x][y][1]), .wi3 (di3[x][y][1]), .wia (dia[x][y][1]), .wift(dift[x][y][1]), .wivc(divc[x][y][1]), .wic(dic[x][y][1]), .wica(dica[x][y][1]),
55
             .ni0 (di0[x][y][2]), .ni1 (di1[x][y][2]), .ni2 (di2[x][y][2]), .ni3 (di3[x][y][2]), .nia (dia[x][y][2]), .nift(dift[x][y][2]), .nivc(divc[x][y][2]), .nic(dic[x][y][2]), .nica(dica[x][y][2]),
56
             .ei0 (di0[x][y][3]), .ei1 (di1[x][y][3]), .ei2 (di2[x][y][3]), .ei3 (di3[x][y][3]), .eia (dia[x][y][3]), .eift(dift[x][y][3]), .eivc(divc[x][y][3]), .eic(dic[x][y][3]), .eica(dica[x][y][3]),
57
             .so0 (do0[x][y][0]), .so1 (do1[x][y][0]), .so2 (do2[x][y][0]), .so3 (do3[x][y][0]), .soa (doa[x][y][0]), .soft(doft[x][y][0]), .sovc(dovc[x][y][0]), .soc(doc[x][y][0]), .soca(doca[x][y][0]),
58
             .wo0 (do0[x][y][1]), .wo1 (do1[x][y][1]), .wo2 (do2[x][y][1]), .wo3 (do3[x][y][1]), .woa (doa[x][y][1]), .woft(doft[x][y][1]), .wovc(dovc[x][y][1]), .woc(doc[x][y][1]), .woca(doca[x][y][1]),
59
             .no0 (do0[x][y][2]), .no1 (do1[x][y][2]), .no2 (do2[x][y][2]), .no3 (do3[x][y][2]), .noa (doa[x][y][2]), .noft(doft[x][y][2]), .novc(dovc[x][y][2]), .noc(doc[x][y][2]), .noca(doca[x][y][2]),
60
             .eo0 (do0[x][y][3]), .eo1 (do1[x][y][3]), .eo2 (do2[x][y][3]), .eo3 (do3[x][y][3]), .eoa (doa[x][y][3]), .eoft(doft[x][y][3]), .eovc(dovc[x][y][3]), .eoc(doc[x][y][3]), .eoca(doca[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 doa[x][y][2] = dia[x][y][2];
71
            assign dift[x][y][2] = doft[x][y][2];
72
            assign divc[x][y][2] = dovc[x][y][2];
73
            assign doc[x][y][2] = dic[x][y][2];
74
            assign dica[x][y][2] = doca[x][y][2];
75
         end else begin
76
            assign di0[x][y][2] = do0[x-1][y][0];
77
            assign di1[x][y][2] = do1[x-1][y][0];
78
            assign di2[x][y][2] = do2[x-1][y][0];
79
            assign di3[x][y][2] = do3[x-1][y][0];
80
            assign doa[x-1][y][0] = dia[x][y][2];
81
            assign dift[x][y][2] = doft[x-1][y][0];
82
            assign divc[x][y][2] = dovc[x-1][y][0];
83
            assign doc[x-1][y][0] = dic[x][y][2];
84
            assign dica[x][y][2] = doca[x-1][y][0];
85
         end
86
 
87
         // south link
88
         if(x==DIMX-1) begin
89
            assign di0[x][y][0] = do0[x][y][0];
90
            assign di1[x][y][0] = do1[x][y][0];
91
            assign di2[x][y][0] = do2[x][y][0];
92
            assign di3[x][y][0] = do3[x][y][0];
93
            assign doa[x][y][0] = dia[x][y][0];
94
            assign dift[x][y][0] = doft[x][y][0];
95
            assign divc[x][y][0] = dovc[x][y][0];
96
            assign doc[x][y][0] = dic[x][y][0];
97
            assign dica[x][y][0] = doca[x][y][0];
98
         end else begin
99
            assign di0[x][y][0] = do0[x+1][y][2];
100
            assign di1[x][y][0] = do1[x+1][y][2];
101
            assign di2[x][y][0] = do2[x+1][y][2];
102
            assign di3[x][y][0] = do3[x+1][y][2];
103
            assign doa[x+1][y][2] = dia[x][y][0];
104
            assign dift[x][y][0] = doft[x+1][y][2];
105
            assign divc[x][y][0] = dovc[x+1][y][2];
106
            assign doc[x+1][y][2] = dic[x][y][0];
107
            assign dica[x][y][0] = doca[x+1][y][2];
108
         end
109
 
110
         // west link
111
         if(y==0) begin
112
            assign di0[x][y][1] = do0[x][y][1];
113
            assign di1[x][y][1] = do1[x][y][1];
114
            assign di2[x][y][1] = do2[x][y][1];
115
            assign di3[x][y][1] = do3[x][y][1];
116
            assign doa[x][y][1] = dia[x][y][1];
117
            assign dift[x][y][1] = doft[x][y][1];
118
            assign divc[x][y][1] = dovc[x][y][1];
119
            assign doc[x][y][1] = dic[x][y][1];
120
            assign dica[x][y][1] = doca[x][y][1];
121
         end else begin
122
            assign di0[x][y][1] = do0[x][y-1][3];
123
            assign di1[x][y][1] = do1[x][y-1][3];
124
            assign di2[x][y][1] = do2[x][y-1][3];
125
            assign di3[x][y][1] = do3[x][y-1][3];
126
            assign doa[x][y-1][3] = dia[x][y][1];
127
            assign dift[x][y][1] = doft[x][y-1][3];
128
            assign divc[x][y][1] = dovc[x][y-1][3];
129
            assign doc[x][y-1][3] = dic[x][y][1];
130
            assign dica[x][y][1] = doca[x][y-1][3];
131
         end // else: !if(y==0)
132
 
133
         // east link
134
         if(y==DIMY-1) begin
135
            assign di0[x][y][3] = do0[x][y][3];
136
            assign di1[x][y][3] = do1[x][y][3];
137
            assign di2[x][y][3] = do2[x][y][3];
138
            assign di3[x][y][3] = do3[x][y][3];
139
            assign doa[x][y][3] = dia[x][y][3];
140
            assign dift[x][y][3] = doft[x][y][3];
141
            assign divc[x][y][3] = dovc[x][y][3];
142
            assign doc[x][y][3] = dic[x][y][3];
143
            assign dica[x][y][3] = doca[x][y][3];
144
         end else begin
145
            assign di0[x][y][3] = do0[x][y+1][1];
146
            assign di1[x][y][3] = do1[x][y+1][1];
147
            assign di2[x][y][3] = do2[x][y+1][1];
148
            assign di3[x][y][3] = do3[x][y+1][1];
149
            assign doa[x][y+1][1] = dia[x][y][3];
150
            assign dift[x][y][3] = doft[x][y+1][1];
151
            assign divc[x][y][3] = dovc[x][y+1][1];
152
            assign doc[x][y+1][1] = dic[x][y][3];
153
            assign dica[x][y][3] = doca[x][y+1][1];
154
         end // else: !if(y==DIMY-1)
155
 
156
      end // block: DY
157
   end // block: DX
158
   endgenerate
159
 
160
endmodule // noc_top

powered by: WebSVN 2.1.0

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