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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [branches/] [init/] [common/] [src/] [dcb.v] - Blame information for rev 41

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

Line No. Rev Author Line
1 12 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
 Data crossbar for wormhole and SDM routers.
13
 *** SystemVerilog is used ***
14
 
15
 History:
16
 17/07/2010  Initial version. <wsong83@gmail.com>
17
 23/05/2011  Clean up for opensource. <wsong83@gmail.com>
18
 
19
*/
20
 
21
// the router structure definitions
22
`include "define.v"
23
 
24
module dcb (/*AUTOARG*/
25
   // Outputs
26
   o0, o1, o2, o3, ia, o4,
27
   // Inputs
28
   i0, i1, i2, i3, oa, i4, cfg
29
   );
30
 
31
   parameter NN = 2;            // number of input ports
32
   parameter MN = 3;            // number of output ports
33
   parameter DW = 8;            // data-width of a port
34
   parameter SCN = DW/2;        // number of 1-of-4 sub-channels for one port
35
 
36
   input [NN-1:0][SCN-1:0]       i0, i1, i2, i3; // input ports
37
   output [MN-1:0][SCN-1:0]        o0, o1, o2, o3; // output ports
38
 
39
`ifdef ENABLE_CHANNEL_SLICING
40
   output [NN-1:0][SCN-1:0]        ia, o4; // eof and ack
41
   input [MN-1:0][SCN-1:0]         oa, i4;
42
`else
43
   output [NN-1:0]                ia, o4; // eof and ack
44
   input [MN-1:0]                 oa, i4;
45
`endif
46
 
47
   input [MN-1:0][NN-1:0]          cfg; // crossbar configuration
48
 
49
   wire [MN-1:0][SCN-1:0][NN-1:0] dm0, dm1, dm2, dm3;
50
 
51
`ifdef ENABLE_CHANNEL_SLICING
52
   wire [NN-1:0][SCN-1:0][MN-1:0] am, dm4;
53
`else
54
   wire [NN-1:0][MN-1:0]    am, dm4;
55
`endif
56
 
57
   genvar                        i, j, k;
58
 
59
   generate
60
      for(i=0; i<MN; i++) begin: EN
61
         for(j=0; j<NN; j++) begin: IP
62
            for(k=0; k<SCN; k++) begin: SC
63
               and A0 (dm0[i][k][j], i0[j][k], cfg[i][j]);
64
               and A1 (dm1[i][k][j], i1[j][k], cfg[i][j]);
65
               and A2 (dm2[i][k][j], i2[j][k], cfg[i][j]);
66
               and A3 (dm3[i][k][j], i3[j][k], cfg[i][j]);
67
`ifdef ENABLE_CHANNEL_SLICING
68
               and A4 (dm4[i][k][j], i4[j][k], cfg[i][j]);
69
               and Aa (am[j][k][i], oa[i][k], cfg[i][j]);
70
`endif
71
            end
72
 
73
`ifndef ENABLE_CHANNEL_SLICING
74
            and A4 (dm4[i][j], i4[j], cfg[i][j]);
75
            and Aa (am[j][i], oa[i], cfg[i][j]);
76
`endif
77
         end // block: IP
78
      end // block: EN
79
   endgenerate
80
 
81
   generate
82
      for(i=0; i<MN; i++) begin: ORTD
83
         for(j=0; j<SCN; j++) begin: OP
84
            assign o0[i][j] = |dm0[i][j];
85
            assign o1[i][j] = |dm1[i][j];
86
            assign o2[i][j] = |dm2[i][j];
87
            assign o3[i][j] = |dm3[i][j];
88
`ifdef ENABLE_CHANNEL_SLICING
89
            assign o4[i][j] = |dm4[i][j];
90
`endif
91
         end
92
 
93
`ifndef ENABLE_CHANNEL_SLICING
94
         assign o4[i] = |dm4[i];
95
`endif
96
 
97
      end // block: ORTD
98
   endgenerate
99
 
100
   generate
101
      for(i=0; i<NN; i++) begin: ORTA
102
`ifdef ENABLE_CHANNEL_SLICING
103
         for(j=0; j<SCN; j++) begin: IP
104
           assign ia[i][j] = |am[i][j];
105
         end
106
`else
107
         assign ia[i] = |am[i];
108
`endif
109
      end
110
   endgenerate
111
 
112
endmodule // dcb
113
 

powered by: WebSVN 2.1.0

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