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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [trunk/] [vc/] [src/] [outpbuf.v] - Blame information for rev 47

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 40 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
 The output buffer for VC routers.
13
 
14
 History:
15
 04/04/2010  Initial version. <wsong83@gmail.com>
16
 12/05/2010  Use MPxP crossbars. <wsong83@gmail.com>
17
 08/05/2010  Remove unnecessary pipeline stages. <wsong83@gmail.com>
18
 02/06/2011  Clean up for opensource. <wsong83@gmail.com>
19
 
20
*/
21
 
22
module outpbuf (/*AUTOARG*/
23
   // Outputs
24
   dia, do0, do1, do2, do3, dot, dovc, afc, vca,
25
   // Inputs
26 45 wsong0210
   di0, di1, di2, di3, dit, doa, credit, vcr, rst_n
27 40 wsong0210
   );
28
   parameter DW = 32;           // data width
29
   parameter VCN = 4;           // VC number
30
   parameter FT = 3;            // flit type, now 3, HOF, BOF, EOF
31
   parameter FCPD = 3;          // the depth of the credit pipeline
32
   parameter SCN = DW/2;
33
 
34
   //data in
35
   input [SCN-1:0] di0, di1, di2, di3;
36
   input [FT-1:0]  dit;
37
   output          dia;
38
 
39
   // data out
40
   output [SCN-1:0] do0, do1, do2, do3;
41
   output [FT-1:0]  dot;
42
   output [VCN-1:0] dovc;
43
   input            doa;
44
 
45
   // credit
46
   input [VCN-1:0]  credit;
47
   output [VCN-1:0] afc;
48
 
49
   // vc requests in
50
   input [VCN-1:0]  vcr;
51
   output [VCN-1:0] vca;
52
 
53
   // active-low reset
54 45 wsong0210
   input            rst_n;
55 40 wsong0210
 
56
   //--------------------------------------------------------------
57
   wire [VCN-1:0]   vcro, vcg, vcgl, vcrm;
58
   wire [SCN-1:0]   doan, diad;
59
   wire             dian, diavc, diavcn, diat;
60
 
61
   genvar           i, gsub;
62
 
63
   // flow control controller
64
   fcctl #(.VCN(VCN), .PD(FCPD))
65
   FCU (
66
        .afc    ( afc    ),
67
        .ro     ( vcro   ),
68
        .credit ( credit ),
69
        .ri     ( vcr    ),
70 45 wsong0210
        .rst    ( ~rst_n  )
71 40 wsong0210
        );
72
 
73
   // VC arbiter
74
   mutex_arb #(.wd(VCN)) Sch (.req(vcro), .gnt(vcg));
75
 
76
   // the control logic for VC arbiter
77
   generate
78
      for(i=0; i<VCN; i++)begin:SCEN
79
         c2 C (.a0(vcg[i]), .a1(diavcn), .q(vcgl[i]));
80
      end
81
   endgenerate
82 45 wsong0210
   assign diavcn = (~diavc)&rst_n;
83 40 wsong0210
 
84
   // output data buffer
85
   generate
86
      for(gsub=0; gsub<SCN; gsub++) begin:SC
87
         pipe4 #(.DW(2))
88
         L0D (
89 42 wsong0210
              .ia ( diad[gsub]   ),
90
              .o0 ( do0[gsub]    ),
91
              .o1 ( do1[gsub]    ),
92
              .o2 ( do2[gsub]    ),
93
              .o3 ( do3[gsub]    ),
94
              .i0 ( di0[gsub]    ),
95
              .i1 ( di1[gsub]    ),
96
              .i2 ( di2[gsub]    ),
97
              .i3 ( di3[gsub]    ),
98
              .oa ( doan[gsub]   )
99 40 wsong0210
              );
100 45 wsong0210
         assign doan[gsub] = (~doa)&rst_n;
101 40 wsong0210
      end // block: SC
102
   endgenerate
103
 
104
   pipen #(.DW(FT))
105
   L0T (
106
        .d_in    ( dit     ),
107
        .d_in_a  ( diat    ),
108
        .d_out   ( dot     ),
109 45 wsong0210
        .d_out_a ( (~doa)&rst_n )
110 40 wsong0210
        );
111
 
112
   ctree #(.DW(SCN+2)) ACKT (.ci({diavc,diat, diad}), .co(dia));
113
 
114
   pipen #(.DW(VCN))
115
   LSV (
116
        .d_in    ( vcgl       ),
117
        .d_in_a  ( diavc      ),
118
        .d_out   ( dovc       ),
119 45 wsong0210
        .d_out_a ( (~doa)&rst_n )
120 40 wsong0210
        );
121
 
122
   assign vca = dovc;
123
 
124
endmodule // outpbuf
125
 
126
 
127
 

powered by: WebSVN 2.1.0

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