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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [trunk/] [common/] [src/] [cell_lib.v] - Blame information for rev 28

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

Line No. Rev Author Line
1 8 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
 A synthesizable cell library for asynchronous circuis.
13
 Some cell are directly initialized to one of the Nangate 45nm cell lib.
14
 
15
 History:
16
 05/05/2009  Initial version. <wsong83@gmail.com>
17
 20/05/2011  Change to general verilog description for opensource.
18
             The Nangate cell library is used. <wsong83@gmail.com>
19
 
20
*/
21 6 wsong0210
 
22 8 wsong0210
// General 2-input C-element
23
module c2 (a0, a1, q);
24 6 wsong0210
 
25 8 wsong0210
   input a0, a1;                // two inputs
26
   output q;                    // output
27 6 wsong0210
 
28 8 wsong0210
   wire [2:0] m;         // internal wires
29 6 wsong0210
 
30 8 wsong0210
   nand U1 (m[0], a0, a1);
31
   nand U2 (m[1], a0, q);
32
   nand U3 (m[2], a1, q);
33
   assign q = &m;
34
 
35 6 wsong0210
endmodule
36
 
37 8 wsong0210
// the 2-input C-element on data paths, different name for easy synthesis scription
38
module dc2 (d, a, q);
39 6 wsong0210
 
40 8 wsong0210
   input d;                     // data input
41
   input a;                     // ack input
42
   output q;                    // data output
43 6 wsong0210
 
44 8 wsong0210
   wire [2:0] m;         // internal wires
45 6 wsong0210
 
46 8 wsong0210
   nand U1 (m[0], a, d);
47
   nand U2 (m[1], d, q);
48
   nand U3 (m[2], a, q);
49
   assign q = &m;
50 6 wsong0210
 
51 8 wsong0210
endmodule
52 6 wsong0210
 
53 8 wsong0210
// 2-input C-element with a minus input
54
module c2n (a, b, q);
55 6 wsong0210
 
56 8 wsong0210
   input a;                     // the normal input
57
   input b;                     // the minus input
58
   output q;                    // output
59 6 wsong0210
 
60 8 wsong0210
   wire m;                      // internal wire
61
 
62
   and U1 (m, b, q);
63
   or  U2 (q, m, a);
64
 
65 6 wsong0210
endmodule
66
 
67 8 wsong0210
// 2-input C-element with a plus input
68
module c2p (a, b, q);
69 6 wsong0210
 
70 8 wsong0210
   input a;                     // the normal input
71
   input b;                     // the plus input
72
   output q;                    // output
73 6 wsong0210
 
74 8 wsong0210
   wire m;                      // internal wire
75 6 wsong0210
 
76 8 wsong0210
   or  U1 (m, b, q);
77
   and U2 (q, m, a);
78
 
79
endmodule
80 6 wsong0210
 
81 8 wsong0210
// 2-input MUTEX cell, Nangate
82 28 wsong0210
module mutex2 ( a, b, qa, qb ); // !!! dont touch !!!
83 6 wsong0210
 
84 8 wsong0210
   input a, b;                  // request inputs
85
   output qa, qb;               // grant outputs
86 6 wsong0210
 
87 8 wsong0210
   wire   qan, qbn;             // internal wires
88 6 wsong0210
 
89 8 wsong0210
   NAND2_X2 U1 ( .A1(a), .A2(qbn), .ZN(qan) ); // different driving strength for fast convergence
90
   NOR3_X2  U2 ( .A1(qbn), .A2(qbn), .A3(qbn), .ZN(qb) ); // pulse filter
91
   NOR3_X2  U3 ( .A1(qan), .A2(qan), .A3(qan), .ZN(qa) ); // pulse filter
92
   NAND2_X1 U4 ( .A1(b), .A2(qan), .ZN(qbn) );
93
 
94 6 wsong0210
endmodule
95
 
96 8 wsong0210
// 3-input C-element with a plus input
97
module c2p1 (a0, a1, b, q);
98
 
99
   input a0, a1;                // normal inputs
100
   input b;                     // plus input
101
   output q;                    // output
102 6 wsong0210
 
103 8 wsong0210
   wire [2:0] m;         // internal wires
104 6 wsong0210
 
105 8 wsong0210
   nand U1 (m[0], a0, a1, b);
106
   nand U2 (m[1], a0, q);
107
   nand U3 (m[2], a1, q);
108
   assign q = &m;
109 6 wsong0210
 
110 8 wsong0210
endmodule
111
 
112
// the basic element of a tree arbiter
113 6 wsong0210
module tarb ( ngnt, ntgnt, req, treq );
114
 
115 8 wsong0210
   input [1:0] req;              // request input
116
   output [1:0] ngnt;            // the negative grant output
117
   output treq;                 // combined request output
118
   input ntgnt;                 // the negative combined grant input
119
 
120
   wire  n1, n2;                // internal wires
121
   wire [1:0] mgnt;              // outputs of the MUTEX
122
 
123 28 wsong0210
   mutex2 ME ( .a(req[0]), .b(req[1]), .qa(mgnt[0]), .qb(mgnt[1]) );
124 8 wsong0210
   c2n C0 ( .a(ntgnt), .b(n2), .q(ngnt[0]) );
125
   c2n C1 ( .a(ntgnt), .b(n1), .q(ngnt[1]) );
126
   nand U1 (treq, n1, n2);
127
   nand U2 (n1, ngnt[0], mgnt[1]);
128
   nand U3 (n2, ngnt[1], mgnt[0]);
129 6 wsong0210
endmodule
130
 
131 8 wsong0210
// the tile in a multi-resource arbiter
132 6 wsong0210
module cr_blk ( bo, hs, cbi, rbi, rg, cg );
133
 
134 8 wsong0210
   input rg, cg;                // input requests
135
   input cbi, rbi;              // input blockage
136
   output bo;                   // output blockage
137
   output hs;                   // match result
138
 
139
   wire   blk;                  // internal wire
140 6 wsong0210
 
141 8 wsong0210
   c2p1 XG ( .a0(rg), .a1(cg), .b(blk), .q(bo) );
142
   c2p1 HG ( .a0(cbi), .a1(rbi), .b(bo), .q(hs) );
143
   nor U1 (blk, rbi, cbi);
144
 
145 6 wsong0210
endmodule
146
 
147 8 wsong0210
// a data latch template, Nangate
148 6 wsong0210
module dlatch ( q, qb, d, g);
149
   output q, qb;
150
   input  d, g;
151
 
152 8 wsong0210
   DLH_X1 U1 (.Q(q), .D(d), .G(g));
153
endmodule
154 6 wsong0210
 
155 8 wsong0210
// a delay line, Nangate
156 6 wsong0210
module delay (q, a);
157
   input a;
158
   output q;
159 8 wsong0210
 
160
   BUF_X2 U (.Z(q), .A(a));
161
endmodule
162 6 wsong0210
 
163
 

powered by: WebSVN 2.1.0

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