Merge branch 'vector_fix' of https://github.com/Kmanfi/yosys
[yosys.git] / tests / liberty / normal.lib
1 /********************************************/
2 /* */
3 /* Supergate cell library for Bench marking */
4 /* */
5 /* Symbiotic EDA GmbH / Moseley Instruments */
6 /* Niels A. Moseley */
7 /* */
8 /* Process: none */
9 /* */
10 /* Date : 02-11-2018 */
11 /* Version: 1.0 */
12 /* */
13 /********************************************/
14
15 library(supergate) {
16 technology (cmos);
17 revision : 1.0;
18
19 time_unit : "1ps";
20 pulling_resistance_unit : "1kohm";
21 voltage_unit : "1V";
22 current_unit : "1uA";
23
24 capacitive_load_unit(1,ff);
25
26 default_inout_pin_cap : 7.0;
27 default_input_pin_cap : 7.0;
28 default_output_pin_cap : 0.0;
29 default_fanout_load : 1.0;
30
31 default_wire_load_capacitance : 0.1;
32 default_wire_load_resistance : 1.0e-3;
33 default_wire_load_area : 0.0;
34
35 nom_process : 1.0;
36 nom_temperature : 25.0;
37 nom_voltage : 1.2;
38
39 delay_model : generic_cmos;
40
41 /* Inverter */
42 cell (inv) {
43 area : 1;
44 pin(A) {
45 direction : input;
46 }
47
48 pin(Y) {
49 direction : output;
50 function : "A'";
51 }
52 }
53
54 /* tri-state inverter */
55 cell (tri_inv) {
56 area : 4;
57 pin(A) {
58 direction : input;
59 }
60 pin(S) {
61 direction : input;
62 }
63 pin(Z) {
64 direction : output;
65 function : "A'";
66 three_State : "S'";
67 }
68 }
69
70 cell (buffer) {
71 area : 5;
72 pin(A) {
73 direction : input;
74 }
75 pin(Y) {
76 direction : output;
77 function : "A";
78 }
79 }
80
81 /* 2-input NAND gate */
82 cell (nand2) {
83 area : 3;
84 pin(A) {
85 direction : input;
86 }
87 pin(B) {
88 direction : input;
89 }
90 pin(Y) {
91 direction: output;
92 function : "(A * B)'";
93 }
94 }
95
96 /* 2-input NOR gate */
97 cell (nor2) {
98 area : 3;
99 pin(A) {
100 direction : input;
101 }
102 pin(B) {
103 direction : input;
104 }
105 pin(Y) {
106 direction: output;
107 function : "(A + B)'";
108 }
109 }
110
111 /* 2-input XOR */
112 cell (xor2) {
113 area : 6;
114 pin(A) {
115 direction : input;
116 }
117 pin(B) {
118 direction : input;
119 }
120 pin(Y) {
121 direction: output;
122 function : "(A *B') + (A' * B)";
123 }
124 }
125
126 /* 2-input inverting MUX */
127 cell (imux2) {
128 area : 5;
129 pin(A) {
130 direction : input;
131 }
132 pin(B) {
133 direction : input;
134 }
135 pin(S) {
136 direction : input;
137 }
138 pin(Y) {
139 direction: output;
140 function : "( (A * S) + (B * S') )'";
141 }
142 }
143
144 /* D-type flip-flop with asynchronous reset and preset */
145 cell (dff) {
146 area : 6;
147 ff("IQ", "IQN") {
148 next_state : "D";
149 clocked_on : "CLK";
150 clear : "RESET";
151 preset : "PRESET";
152 clear_preset_var1 : L;
153 clear_preset_var2 : L;
154 }
155 pin(D) {
156 direction : input;
157 }
158 pin(CLK) {
159 direction : input;
160 }
161 pin(RESET) {
162 direction : input;
163 }
164 pin(PRESET) {
165 direction : input;
166 }
167 pin(Q) {
168 direction: output;
169 function : "IQ";
170 timing() {
171 timing_type : rising_edge;
172 intrinsic_rise : 65;
173 intrinsic_fall : 65;
174 rise_resistance : 0;
175 fall_resistance : 0;
176 related_pin : "CLK";
177 }
178 timing () {
179 timing_type : clear;
180 timing_sense : positive_unate;
181 intrinsic_fall : 75;
182 related_pin : "RESET";
183 }
184 timing () {
185 timing_type : preset;
186 timing_sense : negative_unate;
187 intrinsic_rise : 75;
188 related_pin : "PRESET";
189 }
190 }
191 pin(QN) {
192 direction: output;
193 function : "IQN";
194 timing() {
195 timing_type : rising_edge;
196 intrinsic_rise : 65;
197 intrinsic_fall : 65;
198 rise_resistance : 0;
199 fall_resistance : 0;
200 related_pin : "CLK";
201 }
202 timing () {
203 timing_type : preset;
204 timing_sense : negative_unate;
205 intrinsic_rise : 75;
206 related_pin : "RESET";
207 }
208 timing () {
209 timing_type : clear;
210 timing_sense : positive_unate;
211 intrinsic_fall : 75;
212 related_pin : "PRESET";
213 }
214 }
215 }
216
217 /* Latch */
218 cell(latch) {
219 area : 5;
220 latch ("IQ","IQN") {
221 enable : "G";
222 data_in : "D";
223 }
224
225 pin(D) {
226 direction : input;
227 }
228 pin(G) {
229 direction : input;
230 }
231
232 pin(Q) {
233 direction : output;
234 function : "IQ";
235 internal_node : "Q";
236
237 timing() {
238 timing_type : rising_edge;
239 intrinsic_rise : 65;
240 intrinsic_fall : 65;
241 rise_resistance : 0;
242 fall_resistance : 0;
243 related_pin : "G";
244 }
245
246 timing() {
247 timing_sense : positive_unate;
248 intrinsic_rise : 65;
249 intrinsic_fall : 65;
250 rise_resistance : 0;
251 fall_resistance : 0;
252 related_pin : "D";
253 }
254 }
255
256 pin(QN) {
257 direction : output;
258 function : "IQN";
259 internal_node : "QN";
260
261 timing() {
262 timing_type : rising_edge;
263 intrinsic_rise : 65;
264 intrinsic_fall : 65;
265 rise_resistance : 0;
266 fall_resistance : 0;
267 related_pin : "G";
268 }
269
270 timing() {
271 timing_sense : negative_unate;
272 intrinsic_rise : 65;
273 intrinsic_fall : 65;
274 rise_resistance : 0;
275 fall_resistance : 0;
276 related_pin : "D";
277 }
278 }
279 }
280
281 /* 3 input AND-OR-INVERT gate */
282 cell (aoi211) {
283 area : 3;
284 pin(A) {
285 direction : input;
286 }
287 pin(B) {
288 direction : input;
289 }
290 pin(C) {
291 direction : input;
292 }
293 pin(Y) {
294 direction: output;
295 function : "((A * B) + C)'";
296 }
297 }
298
299
300 /* 3 input OR-AND-INVERT gate */
301 cell (oai211) {
302 area : 3;
303 pin(A) {
304 direction : input;
305 }
306 pin(B) {
307 direction : input;
308 }
309 pin(C) {
310 direction : input;
311 }
312 pin(Y) {
313 direction: output;
314 function : "((A + B) * C)'";
315 }
316 }
317
318 /* half adder */
319 cell (halfadder) {
320 area : 5;
321 pin(A) {
322 direction : input;
323 }
324 pin(B) {
325 direction : input;
326 }
327 pin(C) {
328 direction : output;
329 function : "(A * B)";
330 }
331 pin(Y) {
332 direction: output;
333 function : "(A *B') + (A' * B)";
334 }
335 }
336
337 /* full adder */
338 cell (fulladder) {
339 area : 8;
340 pin(A) {
341 direction : input;
342 }
343 pin(B) {
344 direction : input;
345 }
346 pin(CI) {
347 direction : input;
348 }
349 pin(CO) {
350 direction : output;
351 function : "(((A * B)+(B * CI))+(CI * A))";
352 }
353 pin(Y) {
354 direction: output;
355 function : "((A^B)^CI)";
356 }
357 }
358
359 } /* end */