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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [branches/] [clos_opt/] [clos_opt/] [src/] [im.v] - Blame information for rev 68

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

Line No. Rev Author Line
1 68 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
 An IM of a buffered Clos for SDM-Clos routers
13
 *** SystemVerilog is used ***
14
 
15
 History:
16
 07/07/2011  Initial version. <wsong83@gmail.com>
17
 
18
*/
19
 
20
// the router structure definitions
21
`include "define.v"
22
 
23
module im (/*AUTOARG*/
24
   // Outputs
25
   do0, do1, do2, do3, deco, dia, do4,
26
   // Inputs
27
   di0, di1, di2, di3, deci, di4, doa, doa4, rst_n
28
   );
29
   parameter MN = 2;            // the number of CMs
30
   parameter NN = 2;            // the number of IPs in one IM
31
   parameter DW = 8;            // the data width of a single IP
32
   parameter SN = 2;            // the number of possible output directions
33
   parameter SCN = DW/2;        // the number of sub-channels in one IP
34
 
35
   input [NN-1:0][SCN-1:0]      di0, di1, di2, di3; // data input
36
   input [NN-1:0][SN-1:0]       deci;                 // decoded dir input
37
   output [MN-1:0][SCN-1:0]       do0, do1, do2, do3; // data output
38
   output [MN-1:0][SN-1:0]        deco;               // decoded dir output
39
 
40
   // eof bits and ack lines
41
`ifdef ENABLE_CHANNEL_SLICING
42
   input [NN-1:0][SCN-1:0]        di4; // data input
43
   output [NN-1:0][SCN-1:0]     dia; // input ack
44
   output [MN-1:0][SCN-1:0]       do4; // data output
45
   input [MN-1:0][SCN-1:0]        doa, doa4; // output ack
46
`else
47
   input [NN-1:0]                di4; // data input
48
   output [NN-1:0]               dia; // input ack
49
   output [MN-1:0]               do4; // data output
50
   input [MN-1:0]                doa, doa4; // output ack
51
`endif // !`ifdef ENABLE_CHANNEL_SLICING
52
 
53
`ifndef ENABLE_CRRD
54
   input [MN-1:0][SN-1:0]         cms; // the states from CMs
55
`endif
56
 
57
   input rst_n;                 // global active low reset
58
 
59
   wire cfg;                    // the configuration for the IM
60
   wire [MN-1:0][SCN-1:0]       imo0, imo1, imo2, imo3; // the IM output data
61
   wire [MN-1:0][SN-1:0]        imodec;                   // the IM output dec
62
`ifdef ENABLE_CHANNEL_SLICING
63
   wire [MN-1:0][SCN-1:0]         imo4;        // IM output data
64
   wire [MN-1:0][SCN-1:0]         imoa, imoa4; // IM output ack
65
   wire [MN-1:0][SCN-1:0]         eofan, eofan, doan, deca, decan; // stage control acks
66
`else
67
   wire [MN-1:0]                 imo4;        // IM data output
68
   wire [MN-1:0]                 imoa, imoa4; // IM output ack
69
   wire [MN-1:0]                eofan, eofan, doan, deca, decan; // stage control acks
70
`endif // !`ifdef ENABLE_CHANNEL_SLICING
71
 
72
   genvar                       i;
73
 
74
   // the data crossbar
75
   dcb #(.NN(NN), .MN(MN), .DW(DW))
76
   IMDCB (
77
        .o0  ( imo0    ),
78
        .o1  ( imo1    ),
79
        .o2  ( imo2    ),
80
        .o3  ( imo3    ),
81
        .o4  ( imo4    ),
82
        .ia  ( dia     ),
83
        .i0  ( di0     ),
84
        .i1  ( di1     ),
85
        .i2  ( di2     ),
86
        .i3  ( di3     ),
87
        .i4  ( di4     ),
88
        .oa  ( imoa    ),
89
        .oa4 ( imoa4   ),
90
        .cfg ( cfg     )
91
        );
92
 
93
   // the crossbar for decoded direction
94
   cb  #(.NN(NN), .MN(MN), .DW(SN))
95
   IMDECCB (
96
            .data_in   ( deci   ),
97
            .data_out  ( imodec ),
98
            .cfg       ( cfg    )
99
            );
100
 
101
   // the IM dispatcher
102
   im_alloc #(.VCN(NN), .CMN(MN), .SN(SN))
103
   IMD (
104
        .IMr   ( deci      ),
105
        .IMa   (           ),
106
`ifndef ENABLE_CRRD
107
        .CMs   ( cms       ),
108
`endif
109
        .cfg   ( cfg       ),
110
        .rst_n ( rst_n     )
111
        );
112
 
113
   // the buffer stage for data
114
   generate
115
      for(i=0; i<MN; i++) begin: OPD
116
`ifdef ENABLE_CHANNEL_SLICING
117
         for(j=0; j<SCN; j++) begin:SC
118
            pipe4 #(.DW(2))
119
            P (
120
               .o0 ( do0[i][j]  ),
121
               .o1 ( do1[i][j]  ),
122
               .o2 ( do2[i][j]  ),
123
               .o3 ( do3[i][j]  ),
124
               .ia ( imoa[i][j] ),
125
               .i0 ( imo0[i][j] ),
126
               .i1 ( imo1[i][j] ),
127
               .i2 ( imo2[i][j] ),
128
               .i3 ( imo3[i][j] ),
129
               .oa ( doan[i][j] )
130
               );
131
 
132
            pipen #(.DW(1))
133
            PEoF (
134
                  .d_in_a  (             ),
135
                  .d_out   ( do4[i][j]   ),
136
                  .d_in    ( imo4[i][j]  ),
137
                  .d_out_a ( eofa[i][j]  ),
138
                  );
139
 
140
            ppc PCTL (
141
                      .deca   ( deca[i][j] ),
142
                      .
143
 
144
              pipen #(.DW(SN))
145
            PDEC (
146
 
147
 
148
endmodule // im

powered by: WebSVN 2.1.0

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