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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [trunk/] [sdm/] [src/] [output_buf.v] - Blame information for rev 26

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

powered by: WebSVN 2.1.0

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