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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [branches/] [clos_opt/] [sdm/] [src/] [output_buf.v] - Blame information for rev 62

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 14 wsong0210
 
26
*/
27
 
28
// the router structure definitions
29
`include "define.v"
30
 
31
// the out buffer
32
module outp_buf (/*AUTOARG*/
33
   // Outputs
34
   o0, o1, o2, o3, o4, ia,
35
   // Inputs
36
   rst_n, i0, i1, i2, i3, i4, oa
37
   );
38
 
39
   parameter DW = 16;           // the datawidth of a single virtual circuit
40
   parameter PD = 2;            // buffer depth
41
   parameter SCN = DW/2;        // the number of 1-of-4 sub-channel in each virtual circuit
42
 
43
   input                  rst_n;          // global reset, active low
44
   input [SCN-1:0]         i0, i1, i2, i3; // data input
45
   output [SCN-1:0]        o0, o1, o2, o3; // data output
46
   wire [PD:0][SCN-1:0]   pd0, pd1, pd2, pd3;  // data wires for the internal pipeline satges
47
`ifdef ENABLE_CHANNEL_SLICING
48
   input [SCN-1:0]         i4, oa; // eof and ack
49
   output [SCN-1:0]        o4, ia;
50
   wire [SCN-1:0]          ian_dly;
51 62 wsong0210
   wire [PD:0][SCN-1:0]   pd4, pda, pdan, pd4an; // internal eof and ack
52 14 wsong0210
`else
53
   input                  i4, oa; // eof and ack
54
   output                 o4, ia;
55
   wire                   ian_dly;
56 62 wsong0210
   wire [PD:0]             pd4, pda, pdan, pd4an; // internal eof and ack
57 14 wsong0210
`endif
58
 
59
 
60
//-------------------------- pipeline ---------------------------------------//
61
    genvar       i,j;
62
   generate for(i=0; i<PD; i++) begin: DP
63
`ifdef ENABLE_CHANNEL_SLICING
64
      for(j=0; j<SCN; j++) begin: SC
65
         pipe4 #(.DW(2))
66
         P (
67
            .o0  ( pd0[i][j]   ),
68
            .o1  ( pd1[i][j]   ),
69
            .o2  ( pd2[i][j]   ),
70
            .o3  ( pd3[i][j]   ),
71 62 wsong0210
            //.o4  ( pd4[i][j]   ),
72 14 wsong0210
            .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 62 wsong0210
            //.i4  ( pd4[i+1][j] ),
78 14 wsong0210
            .oa  ( pdan[i][j]  )
79
            );
80 62 wsong0210
 
81
         pipen #(.DW(1))
82
         PEoF (
83
               .d_in_a  (             ),
84
               .d_out   ( pd4[i][j]   ),
85
               .d_in    ( pd4[i+1][j] ),
86
               .d_out_a ( pd4an[i][j] )
87
               );
88 14 wsong0210
      end // block: SC
89
 
90
`else // !`ifdef ENABLE_CHANNEL_SLICING
91
      pipe4 #(.DW(DW))
92
      P (
93
         .o0  ( pd0[i]   ),
94
         .o1  ( pd1[i]   ),
95
         .o2  ( pd2[i]   ),
96
         .o3  ( pd3[i]   ),
97 62 wsong0210
         //.o4  ( pd4[i]   ),
98 14 wsong0210
         .ia  ( pda[i+1] ),
99
         .i0  ( pd0[i+1] ),
100
         .i1  ( pd1[i+1] ),
101
         .i2  ( pd2[i+1] ),
102
         .i3  ( pd3[i+1] ),
103 62 wsong0210
         //.i4  ( pd4[i+1] ),
104 14 wsong0210
         .oa  ( pdan[i]  )
105
         );
106 62 wsong0210
 
107
      pipen #(.DW(1))
108
      PEoF (
109
            .d_in_a  (          ),
110
            .d_out   ( pd4[i]   ),
111
            .d_in    ( pd4[i+1] ),
112
            .d_out_a ( pd4an[i] )
113
            );
114
 
115 14 wsong0210
`endif // !`ifdef ENABLE_CHANNEL_SLICING
116
   end // block: DP
117
   endgenerate
118
 
119
   // generate the ack lines for data pipelines
120
   generate for(i=1; i<PD; i++) begin: DPA
121
      assign pdan[i] = rst_n ? ~(pda[i]|pd4[i-1]) : 0;
122
   end
123
   endgenerate
124
 
125
   // generate the input ack, add the AND gate if lookahead pipelines are used
126
   generate
127
`ifdef ENABLE_CHANNEL_SLICING
128
      for(j=0; j<SCN; j++) begin: SCA
129
 `ifdef ENABLE_LOOKAHEAD
130
         and ACKG (ia[j], pda[PD][j]|pd4[PD-1][j], ian_dly[j]);
131
         delay DLY ( .q(ian_dly[j]), .a(pdan[PD-1][j]));
132
 `else
133
         assign ia[j] = pda[PD][j]|pd4[PD-1][j];
134
 `endif
135
         assign pdan[0][j] = (~oa[j])&rst_n;
136 62 wsong0210
         assign pd4an[0][j] = pdan[0][j];
137 14 wsong0210
      end
138
`else
139
 `ifdef ENABLE_LOOKAHEAD
140
      and ACKG (ia, pda[PD]|pd4[PD-1], ian_dly);
141
      delay DLY ( .q(ian_dly), .a(pdan[PD-1]));
142
 `else
143
      assign ia = pda[PD]|pd4[PD-1];
144
 `endif
145
      assign pdan[0] = (~oa)&rst_n;
146 62 wsong0210
      assign pd4an[0] = pdan[0];
147 14 wsong0210
`endif // !`ifdef ENABLE_LOOKAHEAD
148
   endgenerate
149
 
150
   // name change
151
   assign pd0[PD] = i0;
152
   assign pd1[PD] = i1;
153
   assign pd2[PD] = i2;
154
   assign pd3[PD] = i3;
155
   assign pd4[PD] = i4;
156
   assign o0 = pd0[0];
157
   assign o1 = pd1[0];
158
   assign o2 = pd2[0];
159
   assign o3 = pd3[0];
160
   assign o4 = pd4[0];
161
 
162
endmodule // outp_buf
163
 

powered by: WebSVN 2.1.0

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