1 /**CFile****************************************************************
2 
3   FileName    [acbTypes.h]
4 
5   SystemName  [ABC: Logic synthesis and verification system.]
6 
7   PackageName [Hierarchical word-level netlist.]
8 
9   Synopsis    [External declarations.]
10 
11   Author      [Alan Mishchenko]
12 
13   Affiliation [UC Berkeley]
14 
15   Date        [Ver. 1.0. Started - July 21, 2015.]
16 
17   Revision    [$Id: acbTypes.h,v 1.00 2014/11/29 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #ifndef ABC__base__acb__acb__types_h
22 #define ABC__base__acb__acb__types_h
23 
24 ////////////////////////////////////////////////////////////////////////
25 ///                          INCLUDES                                ///
26 ////////////////////////////////////////////////////////////////////////
27 
28 ////////////////////////////////////////////////////////////////////////
29 ///                         PARAMETERS                               ///
30 ////////////////////////////////////////////////////////////////////////
31 
32 ABC_NAMESPACE_HEADER_START
33 
34 ////////////////////////////////////////////////////////////////////////
35 ///                         BASIC TYPES                              ///
36 ////////////////////////////////////////////////////////////////////////
37 
38 // network objects
39 typedef enum {
40     ABC_OPER_NONE = 0,     // 00  unused
41     ABC_OPER_PI,           // 01  input
42     ABC_OPER_PO,           // 02  output
43     ABC_OPER_CI,           // 03  combinational input
44     ABC_OPER_CO,           // 04  combinational output
45     ABC_OPER_FON,          // 05  output placeholder
46     ABC_OPER_BOX,          // 06  box
47 
48     ABC_OPER_CONST_F,      // 07
49     ABC_OPER_CONST_T,      // 08
50     ABC_OPER_CONST_X,      // 09
51     ABC_OPER_CONST_Z,      // 10
52 
53     ABC_OPER_BIT_BUF,      // 11
54     ABC_OPER_BIT_INV,      // 12
55     ABC_OPER_BIT_AND,      // 13
56     ABC_OPER_BIT_NAND,     // 14
57     ABC_OPER_BIT_OR,       // 15
58     ABC_OPER_BIT_NOR,      // 16
59     ABC_OPER_BIT_XOR,      // 17
60     ABC_OPER_BIT_NXOR,     // 18
61     ABC_OPER_BIT_SHARP,    // 19
62     ABC_OPER_BIT_SHARPL,   // 20
63     ABC_OPER_BIT_MUX,      // 21  fanins are: {Ctrl, Data1, Data0}
64     ABC_OPER_BIT_MAJ,      // 22
65 
66     ABC_OPER_ABC,          // 23
67     ABC_OPER_BA,           // 24
68     ABC_OPER_BO,           // 25
69     ABC_OPER_BX,           // 26
70     ABC_OPER_BN,           // 27
71     ABC_OPER_BAO,          // 28
72     ABC_OPER_BOA,          // 29
73 
74     ABC_OPER_RED_AND,      // 30
75     ABC_OPER_RED_NAND,     // 31
76     ABC_OPER_RED_OR,       // 32
77     ABC_OPER_RED_NOR,      // 33
78     ABC_OPER_RED_XOR,      // 34
79     ABC_OPER_RED_NXOR,     // 35
80 
81     ABC_OPER_LOGIC_NOT,    // 36
82     ABC_OPER_LOGIC_AND,    // 37
83     ABC_OPER_LOGIC_NAND,   // 38
84     ABC_OPER_LOGIC_OR,     // 39
85     ABC_OPER_LOGIC_NOR,    // 40
86     ABC_OPER_LOGIC_XOR,    // 41
87     ABC_OPER_LOGIC_XNOR,   // 42
88 
89     ABC_OPER_SEL_NMUX,     // 43  fanins are: {Ctrl, Data0, Data1, Data2, ...}
90     ABC_OPER_SEL_SEL,      // 44
91     ABC_OPER_SEL_PSEL,     // 45
92     ABC_OPER_SEL_ENC,      // 46
93     ABC_OPER_SEL_PENC,     // 47
94     ABC_OPER_SEL_DEC,      // 48
95     ABC_OPER_SEL_EDEC,     // 49
96 
97     ABC_OPER_ARI_ADD,      // 50
98     ABC_OPER_ARI_SUB,      // 51
99     ABC_OPER_ARI_MUL,      // 52
100     ABC_OPER_ARI_SMUL,     // 53
101     ABC_OPER_ARI_DIV,      // 54
102     ABC_OPER_ARI_MOD,      // 55
103     ABC_OPER_ARI_REM,      // 56
104     ABC_OPER_ARI_POW,      // 57
105     ABC_OPER_ARI_MIN,      // 58
106     ABC_OPER_ARI_SQRT,     // 59
107     ABC_OPER_ARI_ABS,      // 60
108 
109     ABC_OPER_COMP_SLESS,   // 61
110     ABC_OPER_COMP_LESS,    // 62
111     ABC_OPER_COMP_LESSEQU, // 63
112     ABC_OPER_COMP_MOREEQU, // 64
113     ABC_OPER_COMP_MORE,    // 65
114     ABC_OPER_COMP_EQU,     // 66
115     ABC_OPER_COMP_NOTEQU,  // 67
116 
117     ABC_OPER_SHIFT_L,      // 68
118     ABC_OPER_SHIFT_R,      // 69
119     ABC_OPER_SHIFT_LA,     // 70
120     ABC_OPER_SHIFT_RA,     // 71
121     ABC_OPER_SHIFT_ROTL,   // 72
122     ABC_OPER_SHIFT_ROTR,   // 73
123 
124     ABC_OPER_NODE,         // 74
125     ABC_OPER_LUT,          // 75
126     ABC_OPER_GATE,         // 76
127     ABC_OPER_TABLE,        // 77
128 
129     ABC_OPER_TRI,          // 78
130     ABC_OPER_RAM,          // 79
131     ABC_OPER_RAMR,         // 80
132     ABC_OPER_RAMW,         // 81
133     ABC_OPER_RAMWC,        // 82
134     ABC_OPER_RAML,         // 83
135     ABC_OPER_RAMS,         // 84
136     ABC_OPER_RAMBOX,       // 85
137 
138     ABC_OPER_LATCH,        // 86
139     ABC_OPER_LATCHRS,      // 87
140     ABC_OPER_DFF,          // 88
141     ABC_OPER_DFFRSE,       // 89
142     ABC_OPER_DFFLAST,      // 90
143 
144     ABC_OPER_SLICE,        // 91
145     ABC_OPER_CONCAT,       // 92
146     ABC_OPER_ZEROPAD,      // 93
147     ABC_OPER_SIGNEXT,      // 94
148 
149     ABC_OPER_LOGIC_IMPL,   // 95
150     ABC_OPER_ARI_SQUARE,   // 96
151     ABC_OPER_CONST,        // 97
152 
153     ABC_OPER_ARI_ADDSUB,   // 98
154 
155     ABC_OPER_LAST          // 99
156 } Acb_ObjType_t;
157 
158 
159 // printing operator types
Abc_OperName(int Type)160 static inline const char * Abc_OperName( int Type )
161 {
162     if ( Type == ABC_OPER_NONE         )   return NULL;
163     if ( Type == ABC_OPER_PI           )   return "pi";
164     if ( Type == ABC_OPER_PO           )   return "po";
165     if ( Type == ABC_OPER_CI           )   return "ci";
166     if ( Type == ABC_OPER_CO           )   return "co";
167     if ( Type == ABC_OPER_FON          )   return "fon";
168     if ( Type == ABC_OPER_BOX          )   return "box";
169 
170     if ( Type == ABC_OPER_BIT_BUF      )   return "buf";
171     if ( Type == ABC_OPER_BIT_INV      )   return "~";
172     if ( Type == ABC_OPER_BIT_MUX      )   return "mux";
173     if ( Type == ABC_OPER_BIT_MAJ      )   return "maj";
174     if ( Type == ABC_OPER_BIT_AND      )   return "&";
175     if ( Type == ABC_OPER_BIT_OR       )   return "|";
176     if ( Type == ABC_OPER_BIT_XOR      )   return "^";
177     if ( Type == ABC_OPER_BIT_NAND     )   return "~&";
178     if ( Type == ABC_OPER_BIT_NOR      )   return "~|";
179     if ( Type == ABC_OPER_BIT_NXOR     )   return "~^";
180 
181     if ( Type == ABC_OPER_RED_AND      )   return "&";
182     if ( Type == ABC_OPER_RED_OR       )   return "|";
183     if ( Type == ABC_OPER_RED_XOR      )   return "^";
184     if ( Type == ABC_OPER_RED_NAND     )   return "~&";
185     if ( Type == ABC_OPER_RED_NOR      )   return "~|";
186     if ( Type == ABC_OPER_RED_NXOR     )   return "~^";
187 
188     if ( Type == ABC_OPER_LOGIC_NOT    )   return "!";
189     if ( Type == ABC_OPER_LOGIC_IMPL   )   return "=>";
190     if ( Type == ABC_OPER_LOGIC_AND    )   return "&&";
191     if ( Type == ABC_OPER_LOGIC_OR     )   return "||";
192     if ( Type == ABC_OPER_LOGIC_XOR    )   return "^^";
193 
194     if ( Type == ABC_OPER_ARI_ADD      )   return "+";
195     if ( Type == ABC_OPER_ARI_SUB      )   return "-";
196     if ( Type == ABC_OPER_ARI_MUL      )   return "*";
197     if ( Type == ABC_OPER_ARI_SMUL     )   return "*";
198     if ( Type == ABC_OPER_ARI_DIV      )   return "/";
199     if ( Type == ABC_OPER_ARI_REM      )   return "%";
200     if ( Type == ABC_OPER_ARI_MOD      )   return "mod";
201     if ( Type == ABC_OPER_ARI_POW      )   return "**";
202     if ( Type == ABC_OPER_ARI_MIN      )   return "-";
203     if ( Type == ABC_OPER_ARI_SQRT     )   return "sqrt";
204     if ( Type == ABC_OPER_ARI_SQUARE   )   return "squar";
205 
206     if ( Type == ABC_OPER_COMP_EQU     )   return "==";
207     if ( Type == ABC_OPER_COMP_NOTEQU  )   return "!=";
208     if ( Type == ABC_OPER_COMP_LESS    )   return "<";
209     if ( Type == ABC_OPER_COMP_MORE    )   return ">";
210     if ( Type == ABC_OPER_COMP_LESSEQU )   return "<=";
211     if ( Type == ABC_OPER_COMP_MOREEQU )   return ">=";
212 
213     if ( Type == ABC_OPER_SHIFT_L      )   return "<<";
214     if ( Type == ABC_OPER_SHIFT_R      )   return ">>";
215     if ( Type == ABC_OPER_SHIFT_LA     )   return "<<<";
216     if ( Type == ABC_OPER_SHIFT_RA     )   return ">>>";
217     if ( Type == ABC_OPER_SHIFT_ROTL   )   return "rotL";
218     if ( Type == ABC_OPER_SHIFT_ROTR   )   return "rotR";
219 
220     if ( Type == ABC_OPER_DFFRSE       )   return "DFFRSE";
221 
222     if ( Type == ABC_OPER_SLICE        )   return "[:]";
223     if ( Type == ABC_OPER_CONCAT       )   return "{}";
224     if ( Type == ABC_OPER_ZEROPAD      )   return "zPad";
225     if ( Type == ABC_OPER_SIGNEXT      )   return "sExt";
226 
227     if ( Type == ABC_OPER_CONST        )   return "const";
228     if ( Type == ABC_OPER_TABLE        )   return "table";
229     if ( Type == ABC_OPER_LUT          )   return "lut";
230     if ( Type == ABC_OPER_LAST         )   return NULL;
231     assert( 0 );
232     return NULL;
233 }
234 
235 ////////////////////////////////////////////////////////////////////////
236 ///                      MACRO DEFINITIONS                           ///
237 ////////////////////////////////////////////////////////////////////////
238 
239 ////////////////////////////////////////////////////////////////////////
240 ///                          ITERATORS                               ///
241 ////////////////////////////////////////////////////////////////////////
242 
243 ////////////////////////////////////////////////////////////////////////
244 ///                    FUNCTION DECLARATIONS                         ///
245 ////////////////////////////////////////////////////////////////////////
246 
247 
248 ABC_NAMESPACE_HEADER_END
249 
250 
251 #endif
252 
253 ////////////////////////////////////////////////////////////////////////
254 ///                       END OF FILE                                ///
255 ////////////////////////////////////////////////////////////////////////
256 
257