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/] [output_buf.v] - Blame information for rev 74

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 14 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
 Output buffer for Wormhole/SDM routers.
13
 *** SystemVerilog is used ***
14
 
15 16 wsong0210
 References
16
 * Lookahead pipelines
17
     Montek Singh and Steven M. Nowick}, The design of high-performance dynamic asynchronous pipelines: lookahead style, IEEE Transactions on Very Large Scale Integration (VLSI) Systems, 2007(15), 1256-1269. doi:10.1109/TVLSI.2007.902205
18
 
19 14 wsong0210
 History:
20
 26/05/2009  Initial version. <wsong83@gmail.com>
21
 20/09/2010  Supporting channel slicing and SDM using macro difinitions. <wsong83@gmail.com>
22
 22/10/2010  Parameterize the number of pipelines in output buffers. <wsong83@gmail.com>
23
 23/05/2011  Clean up for opensource. <wsong83@gmail.com>
24 62 wsong0210
 21/06/2011  Move the eof logic in every pipeline stage outside the pipe4 module. <wsong83@gmail.com>
25 74 wsong0210
 20/07/2011  Preparation for the buffered Clos switch. <wsong83@gmail.com>
26
 
27 14 wsong0210
*/
28
 
29
// the router structure definitions
30
`include "define.v"
31
 
32
// the out buffer
33
module outp_buf (/*AUTOARG*/
34
   // Outputs
35 74 wsong0210
   o0, o1, o2, o3, o4, ia, ia4,
36 14 wsong0210
   // Inputs
37
   rst_n, i0, i1, i2, i3, i4, oa
38
   );
39
 
40
   parameter DW = 16;           // the datawidth of a single virtual circuit
41
   parameter PD = 2;            // buffer depth
42
   parameter SCN = DW/2;        // the number of 1-of-4 sub-channel in each virtual circuit
43
 
44
   input                  rst_n;          // global reset, active low
45
   input [SCN-1:0]         i0, i1, i2, i3; // data input
46
   output [SCN-1:0]        o0, o1, o2, o3; // data output
47
   wire [PD:0][SCN-1:0]   pd0, pd1, pd2, pd3;  // data wires for the internal pipeline satges
48
`ifdef ENABLE_CHANNEL_SLICING
49
   input [SCN-1:0]         i4, oa; // eof and ack
50
   output [SCN-1:0]        o4, ia;
51
   wire [SCN-1:0]          ian_dly;
52 62 wsong0210
   wire [PD:0][SCN-1:0]   pd4, pda, pdan, pd4an; // internal eof and ack
53 14 wsong0210
`else
54
   input                  i4, oa; // eof and ack
55 74 wsong0210
   output                 o4, ia, ia4;
56 14 wsong0210
   wire                   ian_dly;
57 62 wsong0210
   wire [PD:0]             pd4, pda, pdan, pd4an; // internal eof and ack
58 14 wsong0210
`endif
59
 
60
 
61
//-------------------------- pipeline ---------------------------------------//
62
    genvar       i,j;
63
   generate for(i=0; i<PD; i++) begin: DP
64
`ifdef ENABLE_CHANNEL_SLICING
65
      for(j=0; j<SCN; j++) begin: SC
66
         pipe4 #(.DW(2))
67
         P (
68
            .o0  ( pd0[i][j]   ),
69
            .o1  ( pd1[i][j]   ),
70
            .o2  ( pd2[i][j]   ),
71
            .o3  ( pd3[i][j]   ),
72
            .ia  ( pda[i+1][j] ),
73
            .i0  ( pd0[i+1][j] ),
74
            .i1  ( pd1[i+1][j] ),
75
            .i2  ( pd2[i+1][j] ),
76
            .i3  ( pd3[i+1][j] ),
77
            .oa  ( pdan[i][j]  )
78
            );
79 62 wsong0210
 
80
         pipen #(.DW(1))
81
         PEoF (
82
               .d_in_a  (             ),
83
               .d_out   ( pd4[i][j]   ),
84
               .d_in    ( pd4[i+1][j] ),
85
               .d_out_a ( pd4an[i][j] )
86
               );
87 14 wsong0210
      end // block: SC
88
 
89
`else // !`ifdef ENABLE_CHANNEL_SLICING
90
      pipe4 #(.DW(DW))
91
      P (
92
         .o0  ( pd0[i]   ),
93
         .o1  ( pd1[i]   ),
94
         .o2  ( pd2[i]   ),
95
         .o3  ( pd3[i]   ),
96
         .ia  ( pda[i+1] ),
97
         .i0  ( pd0[i+1] ),
98
         .i1  ( pd1[i+1] ),
99
         .i2  ( pd2[i+1] ),
100
         .i3  ( pd3[i+1] ),
101
         .oa  ( pdan[i]  )
102
         );
103 62 wsong0210
 
104
      pipen #(.DW(1))
105
      PEoF (
106
            .d_in_a  (          ),
107
            .d_out   ( pd4[i]   ),
108
            .d_in    ( pd4[i+1] ),
109
            .d_out_a ( pd4an[i] )
110
            );
111
 
112 14 wsong0210
`endif // !`ifdef ENABLE_CHANNEL_SLICING
113
   end // block: DP
114
   endgenerate
115
 
116
   // generate the ack lines for data pipelines
117
   generate for(i=1; i<PD; i++) begin: DPA
118
      assign pdan[i] = rst_n ? ~(pda[i]|pd4[i-1]) : 0;
119
   end
120
   endgenerate
121
 
122
   // generate the input ack, add the AND gate if lookahead pipelines are used
123
   generate
124
`ifdef ENABLE_CHANNEL_SLICING
125
      for(j=0; j<SCN; j++) begin: SCA
126
 `ifdef ENABLE_LOOKAHEAD
127 74 wsong0210
         and ACKG (ia[j], pda[PD][j], ian_dly[j]);
128 14 wsong0210
         delay DLY ( .q(ian_dly[j]), .a(pdan[PD-1][j]));
129
 `else
130 74 wsong0210
         assign ia[j] = pda[PD][j];
131 14 wsong0210
 `endif
132 74 wsong0210
         assign ia4[j] = pd4[PD-1][j];
133 14 wsong0210
         assign pdan[0][j] = (~oa[j])&rst_n;
134 62 wsong0210
         assign pd4an[0][j] = pdan[0][j];
135 14 wsong0210
      end
136
`else
137
 `ifdef ENABLE_LOOKAHEAD
138 74 wsong0210
      and ACKG (ia, pda[PD], ian_dly);
139 14 wsong0210
      delay DLY ( .q(ian_dly), .a(pdan[PD-1]));
140
 `else
141 74 wsong0210
      assign ia = pda[PD];
142 14 wsong0210
 `endif
143 74 wsong0210
      assign ia4 = pd4[PD-1];
144 14 wsong0210
      assign pdan[0] = (~oa)&rst_n;
145 62 wsong0210
      assign pd4an[0] = pdan[0];
146 14 wsong0210
`endif // !`ifdef ENABLE_LOOKAHEAD
147
   endgenerate
148
 
149
   // name change
150
   assign pd0[PD] = i0;
151
   assign pd1[PD] = i1;
152
   assign pd2[PD] = i2;
153
   assign pd3[PD] = i3;
154
   assign pd4[PD] = i4;
155
   assign o0 = pd0[0];
156
   assign o1 = pd1[0];
157
   assign o2 = pd2[0];
158
   assign o3 = pd3[0];
159
   assign o4 = pd4[0];
160
 
161
endmodule // outp_buf
162
 

powered by: WebSVN 2.1.0

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