ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
hop.h
Go to the documentation of this file.
1
20
21#ifndef ABC__aig__hop__hop_h
22#define ABC__aig__hop__hop_h
23
24
28
29#include <stdio.h>
30#include <stdlib.h>
31#include <string.h>
32#include <assert.h>
33
34#include "misc/vec/vec.h"
35
39
40
41
43
44
48
49typedef struct Hop_Man_t_ Hop_Man_t;
50typedef struct Hop_Obj_t_ Hop_Obj_t;
51typedef int Hop_Edge_t;
52
53// object types
54typedef enum {
55 AIG_NONE, // 0: non-existent object
56 AIG_CONST1, // 1: constant 1
57 AIG_PI, // 2: primary input
58 AIG_PO, // 3: primary output
59 AIG_AND, // 4: AND node
60 AIG_EXOR, // 5: EXOR node
61 AIG_VOID // 6: unused object
63
64// the AIG node
65struct Hop_Obj_t_ // 6 words
66{
67 union {
68 void * pData; // misc
69 int iData; }; // misc
70 union {
71 Hop_Obj_t * pNext; // strashing table
72 int PioNum; }; // the number of PI/PO
73 Hop_Obj_t * pFanin0; // fanin
74 Hop_Obj_t * pFanin1; // fanin
75 unsigned int Type : 3; // object type
76 unsigned int fPhase : 1; // value under 000...0 pattern
77 unsigned int fMarkA : 1; // multipurpose mask
78 unsigned int fMarkB : 1; // multipurpose mask
79 unsigned int nRefs : 26; // reference count (level)
80 int Id; // unique ID of the node
81};
82
83// the AIG manager
85{
86 // AIG nodes
87 Vec_Ptr_t * vPis; // the array of PIs
88 Vec_Ptr_t * vPos; // the array of POs
89 Vec_Ptr_t * vObjs; // the array of all nodes (optional)
90 Hop_Obj_t * pConst1; // the constant 1 node
91 Hop_Obj_t Ghost; // the ghost node
92 // AIG node counters
93 int nObjs[AIG_VOID];// the number of objects by type
94 int nCreated; // the number of created objects
95 int nDeleted; // the number of deleted objects
96 // stuctural hash table
97 Hop_Obj_t ** pTable; // structural hash table
98 int nTableSize; // structural hash table size
99 // various data members
100 void * pData; // the temporary data
101 int nTravIds; // the current traversal ID
102 int fRefCount; // enables reference counting
103 int fCatchExor; // enables EXOR nodes
104 // memory management
105 Vec_Ptr_t * vChunks; // allocated memory pieces
106 Vec_Ptr_t * vPages; // memory pages used by nodes
107 Hop_Obj_t * pListFree; // the list of free nodes
108 // timing statistics
111};
112
116extern void Hop_ManAddMemory( Hop_Man_t * p );
117
118static inline int Hop_BitWordNum( int nBits ) { return (nBits>>5) + ((nBits&31) > 0); }
119static inline int Hop_TruthWordNum( int nVars ) { return nVars <= 5 ? 1 : (1 << (nVars - 5)); }
120static inline int Hop_InfoHasBit( unsigned * p, int i ) { return (p[(i)>>5] & (1<<((i) & 31))) > 0; }
121static inline void Hop_InfoSetBit( unsigned * p, int i ) { p[(i)>>5] |= (1<<((i) & 31)); }
122static inline void Hop_InfoXorBit( unsigned * p, int i ) { p[(i)>>5] ^= (1<<((i) & 31)); }
123static inline int Hop_Base2Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n >>= 1, r++ ) {}; return r; }
124static inline int Hop_Base10Log( unsigned n ) { int r; if ( n < 2 ) return n; for ( r = 0, n--; n; n /= 10, r++ ) {}; return r; }
125
126static inline Hop_Obj_t * Hop_Regular( Hop_Obj_t * p ) { return (Hop_Obj_t *)((ABC_PTRUINT_T)(p) & ~01); }
127static inline Hop_Obj_t * Hop_Not( Hop_Obj_t * p ) { return (Hop_Obj_t *)((ABC_PTRUINT_T)(p) ^ 01); }
128static inline Hop_Obj_t * Hop_NotCond( Hop_Obj_t * p, int c ) { return (Hop_Obj_t *)((ABC_PTRUINT_T)(p) ^ (c)); }
129static inline int Hop_IsComplement( Hop_Obj_t * p ) { return (int)((ABC_PTRUINT_T)(p) & 01); }
130
131static inline Hop_Obj_t * Hop_ManConst0( Hop_Man_t * p ) { return Hop_Not(p->pConst1); }
132static inline Hop_Obj_t * Hop_ManConst1( Hop_Man_t * p ) { return p->pConst1; }
133static inline Hop_Obj_t * Hop_ManGhost( Hop_Man_t * p ) { return &p->Ghost; }
134static inline Hop_Obj_t * Hop_ManPi( Hop_Man_t * p, int i ) { return (Hop_Obj_t *)Vec_PtrEntry(p->vPis, i); }
135static inline Hop_Obj_t * Hop_ManPo( Hop_Man_t * p, int i ) { return (Hop_Obj_t *)Vec_PtrEntry(p->vPos, i); }
136static inline Hop_Obj_t * Hop_ManObj( Hop_Man_t * p, int i ) { return p->vObjs ? (Hop_Obj_t *)Vec_PtrEntry(p->vObjs, i) : NULL; }
137
138static inline Hop_Edge_t Hop_EdgeCreate( int Id, int fCompl ) { return (Id << 1) | fCompl; }
139static inline int Hop_EdgeId( Hop_Edge_t Edge ) { return Edge >> 1; }
140static inline int Hop_EdgeIsComplement( Hop_Edge_t Edge ) { return Edge & 1; }
141static inline Hop_Edge_t Hop_EdgeRegular( Hop_Edge_t Edge ) { return (Edge >> 1) << 1; }
142static inline Hop_Edge_t Hop_EdgeNot( Hop_Edge_t Edge ) { return Edge ^ 1; }
143static inline Hop_Edge_t Hop_EdgeNotCond( Hop_Edge_t Edge, int fCond ) { return Edge ^ fCond; }
144
145static inline int Hop_ManPiNum( Hop_Man_t * p ) { return p->nObjs[AIG_PI]; }
146static inline int Hop_ManPoNum( Hop_Man_t * p ) { return p->nObjs[AIG_PO]; }
147static inline int Hop_ManAndNum( Hop_Man_t * p ) { return p->nObjs[AIG_AND]; }
148static inline int Hop_ManExorNum( Hop_Man_t * p ) { return p->nObjs[AIG_EXOR]; }
149static inline int Hop_ManNodeNum( Hop_Man_t * p ) { return p->nObjs[AIG_AND]+p->nObjs[AIG_EXOR];}
150static inline int Hop_ManGetCost( Hop_Man_t * p ) { return p->nObjs[AIG_AND]+3*p->nObjs[AIG_EXOR]; }
151static inline int Hop_ManObjNum( Hop_Man_t * p ) { return p->nCreated - p->nDeleted; }
152
153static inline Hop_Type_t Hop_ObjType( Hop_Obj_t * pObj ) { return (Hop_Type_t)pObj->Type; }
154static inline int Hop_ObjIsNone( Hop_Obj_t * pObj ) { return pObj->Type == AIG_NONE; }
155static inline int Hop_ObjIsConst1( Hop_Obj_t * pObj ) { assert(!Hop_IsComplement(pObj)); return pObj->Type == AIG_CONST1; }
156static inline int Hop_ObjIsPi( Hop_Obj_t * pObj ) { return pObj->Type == AIG_PI; }
157static inline int Hop_ObjIsPo( Hop_Obj_t * pObj ) { return pObj->Type == AIG_PO; }
158static inline int Hop_ObjIsAnd( Hop_Obj_t * pObj ) { return pObj->Type == AIG_AND; }
159static inline int Hop_ObjIsExor( Hop_Obj_t * pObj ) { return pObj->Type == AIG_EXOR; }
160static inline int Hop_ObjIsNode( Hop_Obj_t * pObj ) { return pObj->Type == AIG_AND || pObj->Type == AIG_EXOR; }
161static inline int Hop_ObjIsTerm( Hop_Obj_t * pObj ) { return pObj->Type == AIG_PI || pObj->Type == AIG_PO || pObj->Type == AIG_CONST1; }
162static inline int Hop_ObjIsHash( Hop_Obj_t * pObj ) { return pObj->Type == AIG_AND || pObj->Type == AIG_EXOR; }
163
164static inline int Hop_ObjIsMarkA( Hop_Obj_t * pObj ) { return pObj->fMarkA; }
165static inline void Hop_ObjSetMarkA( Hop_Obj_t * pObj ) { pObj->fMarkA = 1; }
166static inline void Hop_ObjClearMarkA( Hop_Obj_t * pObj ) { pObj->fMarkA = 0; }
167
168static inline void Hop_ObjSetTravId( Hop_Obj_t * pObj, int TravId ) { pObj->pData = (void *)(ABC_PTRINT_T)TravId; }
169static inline void Hop_ObjSetTravIdCurrent( Hop_Man_t * p, Hop_Obj_t * pObj ) { pObj->pData = (void *)(ABC_PTRINT_T)p->nTravIds; }
170static inline void Hop_ObjSetTravIdPrevious( Hop_Man_t * p, Hop_Obj_t * pObj ) { pObj->pData = (void *)(ABC_PTRINT_T)(p->nTravIds - 1); }
171static inline int Hop_ObjIsTravIdCurrent( Hop_Man_t * p, Hop_Obj_t * pObj ) { return (int)((int)(ABC_PTRINT_T)pObj->pData == p->nTravIds); }
172static inline int Hop_ObjIsTravIdPrevious( Hop_Man_t * p, Hop_Obj_t * pObj ) { return (int)((int)(ABC_PTRINT_T)pObj->pData == p->nTravIds - 1); }
173
174static inline int Hop_ObjTravId( Hop_Obj_t * pObj ) { return (int)(ABC_PTRINT_T)pObj->pData; }
175static inline int Hop_ObjPhase( Hop_Obj_t * pObj ) { return pObj->fPhase; }
176static inline int Hop_ObjRefs( Hop_Obj_t * pObj ) { return pObj->nRefs; }
177static inline void Hop_ObjRef( Hop_Obj_t * pObj ) { pObj->nRefs++; }
178static inline void Hop_ObjDeref( Hop_Obj_t * pObj ) { assert( pObj->nRefs > 0 ); pObj->nRefs--; }
179static inline void Hop_ObjClearRef( Hop_Obj_t * pObj ) { pObj->nRefs = 0; }
180static inline int Hop_ObjFaninC0( Hop_Obj_t * pObj ) { return Hop_IsComplement(pObj->pFanin0); }
181static inline int Hop_ObjFaninC1( Hop_Obj_t * pObj ) { return Hop_IsComplement(pObj->pFanin1); }
182static inline Hop_Obj_t * Hop_ObjFanin0( Hop_Obj_t * pObj ) { return Hop_Regular(pObj->pFanin0); }
183static inline Hop_Obj_t * Hop_ObjFanin1( Hop_Obj_t * pObj ) { return Hop_Regular(pObj->pFanin1); }
184static inline Hop_Obj_t * Hop_ObjChild0( Hop_Obj_t * pObj ) { return pObj->pFanin0; }
185static inline Hop_Obj_t * Hop_ObjChild1( Hop_Obj_t * pObj ) { return pObj->pFanin1; }
186static inline Hop_Obj_t * Hop_ObjChild0Copy( Hop_Obj_t * pObj ) { assert( !Hop_IsComplement(pObj) ); return Hop_ObjFanin0(pObj)? Hop_NotCond((Hop_Obj_t *)Hop_ObjFanin0(pObj)->pData, Hop_ObjFaninC0(pObj)) : NULL; }
187static inline Hop_Obj_t * Hop_ObjChild1Copy( Hop_Obj_t * pObj ) { assert( !Hop_IsComplement(pObj) ); return Hop_ObjFanin1(pObj)? Hop_NotCond((Hop_Obj_t *)Hop_ObjFanin1(pObj)->pData, Hop_ObjFaninC1(pObj)) : NULL; }
188static inline int Hop_ObjChild0CopyI( Hop_Obj_t * pObj ) { assert( !Hop_IsComplement(pObj) ); return Hop_ObjFanin0(pObj)? Abc_LitNotCond(Hop_ObjFanin0(pObj)->iData, Hop_ObjFaninC0(pObj)) : -1; }
189static inline int Hop_ObjChild1CopyI( Hop_Obj_t * pObj ) { assert( !Hop_IsComplement(pObj) ); return Hop_ObjFanin1(pObj)? Abc_LitNotCond(Hop_ObjFanin1(pObj)->iData, Hop_ObjFaninC1(pObj)) : -1; }
190static inline int Hop_ObjLevel( Hop_Obj_t * pObj ) { return pObj->nRefs; }
191static inline int Hop_ObjLevelNew( Hop_Obj_t * pObj ) { return 1 + Hop_ObjIsExor(pObj) + Abc_MaxInt(Hop_ObjFanin0(pObj)->nRefs, Hop_ObjFanin1(pObj)->nRefs); }
192static inline int Hop_ObjPhaseCompl( Hop_Obj_t * pObj ) { return Hop_IsComplement(pObj)? !Hop_Regular(pObj)->fPhase : pObj->fPhase; }
193static inline void Hop_ObjClean( Hop_Obj_t * pObj ) { memset( pObj, 0, sizeof(Hop_Obj_t) ); }
194static inline int Hop_ObjWhatFanin( Hop_Obj_t * pObj, Hop_Obj_t * pFanin )
195{
196 if ( Hop_ObjFanin0(pObj) == pFanin ) return 0;
197 if ( Hop_ObjFanin1(pObj) == pFanin ) return 1;
198 assert(0); return -1;
199}
200static inline int Hop_ObjFanoutC( Hop_Obj_t * pObj, Hop_Obj_t * pFanout )
201{
202 if ( Hop_ObjFanin0(pFanout) == pObj ) return Hop_ObjFaninC0(pObj);
203 if ( Hop_ObjFanin1(pFanout) == pObj ) return Hop_ObjFaninC1(pObj);
204 assert(0); return -1;
205}
206
207// create the ghost of the new node
208static inline Hop_Obj_t * Hop_ObjCreateGhost( Hop_Man_t * p, Hop_Obj_t * p0, Hop_Obj_t * p1, Hop_Type_t Type )
209{
210 Hop_Obj_t * pGhost;
211 assert( Type != AIG_AND || !Hop_ObjIsConst1(Hop_Regular(p0)) );
212 assert( p1 == NULL || !Hop_ObjIsConst1(Hop_Regular(p1)) );
213 assert( Type == AIG_PI || Hop_Regular(p0) != Hop_Regular(p1) );
214 pGhost = Hop_ManGhost(p);
215 pGhost->Type = Type;
216 if ( Hop_Regular(p0)->Id < Hop_Regular(p1)->Id )
217 {
218 pGhost->pFanin0 = p0;
219 pGhost->pFanin1 = p1;
220 }
221 else
222 {
223 pGhost->pFanin0 = p1;
224 pGhost->pFanin1 = p0;
225 }
226 return pGhost;
227}
228
229// internal memory manager
230static inline Hop_Obj_t * Hop_ManFetchMemory( Hop_Man_t * p )
231{
232 Hop_Obj_t * pTemp;
233 if ( p->pListFree == NULL )
235 pTemp = p->pListFree;
236 p->pListFree = *((Hop_Obj_t **)pTemp);
237 memset( pTemp, 0, sizeof(Hop_Obj_t) );
238 if ( p->vObjs )
239 {
240 assert( p->nCreated == Vec_PtrSize(p->vObjs) );
241 Vec_PtrPush( p->vObjs, pTemp );
242 }
243 pTemp->Id = p->nCreated++;
244 return pTemp;
245}
246static inline void Hop_ManRecycleMemory( Hop_Man_t * p, Hop_Obj_t * pEntry )
247{
248 pEntry->Type = AIG_NONE; // distinquishes dead node from live node
249 *((Hop_Obj_t **)pEntry) = p->pListFree;
250 p->pListFree = pEntry;
251}
252
253
257
258// iterator over the primary inputs
259#define Hop_ManForEachPi( p, pObj, i ) \
260 Vec_PtrForEachEntry( Hop_Obj_t *, p->vPis, pObj, i )
261// iterator over the primary outputs
262#define Hop_ManForEachPo( p, pObj, i ) \
263 Vec_PtrForEachEntry( Hop_Obj_t *, p->vPos, pObj, i )
264// iterator over all objects, including those currently not used
265#define Hop_ManForEachNode( p, pObj, i ) \
266 for ( i = 0; i < p->nTableSize; i++ ) \
267 if ( ((pObj) = p->pTable[i]) == NULL ) {} else
268
272
273/*=== hopBalance.c ========================================================*/
274extern Hop_Man_t * Hop_ManBalance( Hop_Man_t * p, int fUpdateLevel );
275extern Hop_Obj_t * Hop_NodeBalanceBuildSuper( Hop_Man_t * p, Vec_Ptr_t * vSuper, Hop_Type_t Type, int fUpdateLevel );
276/*=== hopCheck.c ========================================================*/
277extern int Hop_ManCheck( Hop_Man_t * p );
278/*=== hopDfs.c ==========================================================*/
279extern Vec_Ptr_t * Hop_ManDfs( Hop_Man_t * p );
280extern Vec_Ptr_t * Hop_ManDfsNode( Hop_Man_t * p, Hop_Obj_t * pNode );
281extern int Hop_ManCountLevels( Hop_Man_t * p );
282extern void Hop_ManCreateRefs( Hop_Man_t * p );
283extern int Hop_DagSize( Hop_Obj_t * pObj );
284extern int Hop_ObjFanoutCount( Hop_Obj_t * pObj, Hop_Obj_t * pPivot );
285extern void Hop_ConeUnmark_rec( Hop_Obj_t * pObj );
286extern Hop_Obj_t * Hop_Transfer( Hop_Man_t * pSour, Hop_Man_t * pDest, Hop_Obj_t * pObj, int nVars );
287extern Hop_Obj_t * Hop_Compose( Hop_Man_t * p, Hop_Obj_t * pRoot, Hop_Obj_t * pFunc, int iVar );
288extern Hop_Obj_t * Hop_Complement( Hop_Man_t * p, Hop_Obj_t * pRoot, int iVar );
289extern Hop_Obj_t * Hop_Remap( Hop_Man_t * p, Hop_Obj_t * pRoot, unsigned uSupp, int nVars );
290extern Hop_Obj_t * Hop_Permute( Hop_Man_t * p, Hop_Obj_t * pRoot, int nRootVars, int * pPermute );
291/*=== hopMan.c ==========================================================*/
292extern Hop_Man_t * Hop_ManStart();
294extern void Hop_ManStop( Hop_Man_t * p );
295extern int Hop_ManCleanup( Hop_Man_t * p );
296extern void Hop_ManPrintStats( Hop_Man_t * p );
297/*=== hopMem.c ==========================================================*/
298extern void Hop_ManStartMemory( Hop_Man_t * p );
299extern void Hop_ManStopMemory( Hop_Man_t * p );
300/*=== hopObj.c ==========================================================*/
302extern Hop_Obj_t * Hop_ObjCreatePo( Hop_Man_t * p, Hop_Obj_t * pDriver );
303extern Hop_Obj_t * Hop_ObjCreate( Hop_Man_t * p, Hop_Obj_t * pGhost );
304extern void Hop_ObjConnect( Hop_Man_t * p, Hop_Obj_t * pObj, Hop_Obj_t * pFan0, Hop_Obj_t * pFan1 );
305extern void Hop_ObjDisconnect( Hop_Man_t * p, Hop_Obj_t * pObj );
306extern void Hop_ObjDelete( Hop_Man_t * p, Hop_Obj_t * pObj );
307extern void Hop_ObjDelete_rec( Hop_Man_t * p, Hop_Obj_t * pObj );
308extern Hop_Obj_t * Hop_ObjRepr( Hop_Obj_t * pObj );
309extern void Hop_ObjCreateChoice( Hop_Obj_t * pOld, Hop_Obj_t * pNew );
310/*=== hopOper.c =========================================================*/
311extern Hop_Obj_t * Hop_IthVar( Hop_Man_t * p, int i );
312extern Hop_Obj_t * Hop_Oper( Hop_Man_t * p, Hop_Obj_t * p0, Hop_Obj_t * p1, Hop_Type_t Type );
313extern Hop_Obj_t * Hop_And( Hop_Man_t * p, Hop_Obj_t * p0, Hop_Obj_t * p1 );
314extern Hop_Obj_t * Hop_Or( Hop_Man_t * p, Hop_Obj_t * p0, Hop_Obj_t * p1 );
315extern Hop_Obj_t * Hop_Exor( Hop_Man_t * p, Hop_Obj_t * p0, Hop_Obj_t * p1 );
316extern Hop_Obj_t * Hop_Mux( Hop_Man_t * p, Hop_Obj_t * pC, Hop_Obj_t * p1, Hop_Obj_t * p0 );
317extern Hop_Obj_t * Hop_Maj( Hop_Man_t * p, Hop_Obj_t * pA, Hop_Obj_t * pB, Hop_Obj_t * pC );
318extern Hop_Obj_t * Hop_Miter( Hop_Man_t * p, Vec_Ptr_t * vPairs );
319extern Hop_Obj_t * Hop_CreateAnd( Hop_Man_t * p, int nVars );
320extern Hop_Obj_t * Hop_CreateOr( Hop_Man_t * p, int nVars );
321extern Hop_Obj_t * Hop_CreateExor( Hop_Man_t * p, int nVars );
322/*=== hopTable.c ========================================================*/
323extern Hop_Obj_t * Hop_TableLookup( Hop_Man_t * p, Hop_Obj_t * pGhost );
324extern void Hop_TableInsert( Hop_Man_t * p, Hop_Obj_t * pObj );
325extern void Hop_TableDelete( Hop_Man_t * p, Hop_Obj_t * pObj );
326extern int Hop_TableCountEntries( Hop_Man_t * p );
327extern void Hop_TableProfile( Hop_Man_t * p );
328/*=== hopTruth.c ========================================================*/
329extern unsigned * Hop_ManConvertAigToTruth( Hop_Man_t * p, Hop_Obj_t * pRoot, int nVars, Vec_Int_t * vTruth, int fMsbFirst );
330extern word Hop_ManComputeTruth6( Hop_Man_t * p, Hop_Obj_t * pObj, int nVars );
331/*=== hopUtil.c =========================================================*/
332extern void Hop_ManIncrementTravId( Hop_Man_t * p );
333extern void Hop_ManCleanData( Hop_Man_t * p );
334extern void Hop_ObjCleanData_rec( Hop_Obj_t * pObj );
335extern void Hop_ObjCollectMulti( Hop_Obj_t * pFunc, Vec_Ptr_t * vSuper );
336extern int Hop_ObjIsMuxType( Hop_Obj_t * pObj );
337extern int Hop_ObjRecognizeExor( Hop_Obj_t * pObj, Hop_Obj_t ** ppFan0, Hop_Obj_t ** ppFan1 );
338extern Hop_Obj_t * Hop_ObjRecognizeMux( Hop_Obj_t * pObj, Hop_Obj_t ** ppObjT, Hop_Obj_t ** ppObjE );
339extern void Hop_ObjPrintEqn( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, int Level );
340extern void Hop_ObjPrintVerilog( FILE * pFile, Hop_Obj_t * pObj, Vec_Vec_t * vLevels, int Level, int fOnlyAnds );
341extern void Hop_ObjPrintVerbose( Hop_Obj_t * pObj, int fHaig );
342extern void Hop_ManPrintVerbose( Hop_Man_t * p, int fHaig );
343extern void Hop_ManDumpBlif( Hop_Man_t * p, char * pFileName );
344
345
346
348
349
350
351#endif
352
356
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_NAMESPACE_HEADER_END
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
Cube * p
Definition exorList.c:222
void Hop_ConeUnmark_rec(Hop_Obj_t *pObj)
Definition hopDfs.c:257
void Hop_TableDelete(Hop_Man_t *p, Hop_Obj_t *pObj)
Definition hopTable.c:123
Hop_Man_t * Hop_ManDup(Hop_Man_t *p)
int Hop_TableCountEntries(Hop_Man_t *p)
Definition hopTable.c:145
void Hop_ObjConnect(Hop_Man_t *p, Hop_Obj_t *pObj, Hop_Obj_t *pFan0, Hop_Obj_t *pFan1)
Definition hopObj.c:125
Hop_Obj_t * Hop_ObjCreatePo(Hop_Man_t *p, Hop_Obj_t *pDriver)
Definition hopObj.c:67
Hop_Obj_t * Hop_Transfer(Hop_Man_t *pSour, Hop_Man_t *pDest, Hop_Obj_t *pObj, int nVars)
Definition hopDfs.c:353
Hop_Obj_t * Hop_CreateOr(Hop_Man_t *p, int nVars)
Definition hopOper.c:341
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition hop.h:49
Hop_Obj_t * Hop_Complement(Hop_Man_t *p, Hop_Obj_t *pRoot, int iVar)
Definition hopDfs.c:469
void Hop_TableInsert(Hop_Man_t *p, Hop_Obj_t *pObj)
Definition hopTable.c:100
Hop_Obj_t * Hop_Compose(Hop_Man_t *p, Hop_Obj_t *pRoot, Hop_Obj_t *pFunc, int iVar)
Definition hopDfs.c:415
Hop_Obj_t * Hop_ObjRecognizeMux(Hop_Obj_t *pObj, Hop_Obj_t **ppObjT, Hop_Obj_t **ppObjE)
Definition hopUtil.c:231
int Hop_ManCheck(Hop_Man_t *p)
DECLARATIONS ///.
Definition hopCheck.c:45
void Hop_ManStartMemory(Hop_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition hopMem.c:49
Hop_Obj_t * Hop_CreateAnd(Hop_Man_t *p, int nVars)
Definition hopOper.c:320
void Hop_ManPrintStats(Hop_Man_t *p)
Definition hopMan.c:150
Hop_Obj_t * Hop_Permute(Hop_Man_t *p, Hop_Obj_t *pRoot, int nRootVars, int *pPermute)
Definition hopDfs.c:563
int Hop_ManCleanup(Hop_Man_t *p)
Definition hopMan.c:120
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
Definition hopOper.c:63
Hop_Obj_t * Hop_Remap(Hop_Man_t *p, Hop_Obj_t *pRoot, unsigned uSupp, int nVars)
Definition hopDfs.c:518
Hop_Obj_t * Hop_Maj(Hop_Man_t *p, Hop_Obj_t *pA, Hop_Obj_t *pB, Hop_Obj_t *pC)
Definition hopOper.c:242
void Hop_ObjCleanData_rec(Hop_Obj_t *pObj)
Definition hopUtil.c:88
Vec_Ptr_t * Hop_ManDfs(Hop_Man_t *p)
Definition hopDfs.c:68
void Hop_ObjPrintVerbose(Hop_Obj_t *pObj, int fHaig)
Definition hopUtil.c:456
Vec_Ptr_t * Hop_ManDfsNode(Hop_Man_t *p, Hop_Obj_t *pNode)
Definition hopDfs.c:92
Hop_Obj_t * Hop_ObjCreate(Hop_Man_t *p, Hop_Obj_t *pGhost)
Definition hopObj.c:97
Hop_Obj_t * Hop_NodeBalanceBuildSuper(Hop_Man_t *p, Vec_Ptr_t *vSuper, Hop_Type_t Type, int fUpdateLevel)
Definition hopBalance.c:243
Hop_Man_t * Hop_ManBalance(Hop_Man_t *p, int fUpdateLevel)
FUNCTION DECLARATIONS ///.
Definition hopBalance.c:51
int Hop_ManCountLevels(Hop_Man_t *p)
Definition hopDfs.c:116
void Hop_ObjDelete_rec(Hop_Man_t *p, Hop_Obj_t *pObj)
Definition hopObj.c:214
void Hop_ObjPrintEqn(FILE *pFile, Hop_Obj_t *pObj, Vec_Vec_t *vLevels, int Level)
Definition hopUtil.c:322
void Hop_ManIncrementTravId(Hop_Man_t *p)
DECLARATIONS ///.
Definition hopUtil.c:45
Hop_Type_t
Definition hop.h:54
@ AIG_VOID
Definition hop.h:61
@ AIG_CONST1
Definition hop.h:56
@ AIG_EXOR
Definition hop.h:60
@ AIG_NONE
Definition hop.h:55
@ AIG_PI
Definition hop.h:57
@ AIG_PO
Definition hop.h:58
@ AIG_AND
Definition hop.h:59
void Hop_TableProfile(Hop_Man_t *p)
Definition hopTable.c:212
void Hop_ManDumpBlif(Hop_Man_t *p, char *pFileName)
Definition hopUtil.c:509
int Hop_ObjRecognizeExor(Hop_Obj_t *pObj, Hop_Obj_t **ppFan0, Hop_Obj_t **ppFan1)
Definition hopUtil.c:187
Hop_Obj_t * Hop_Exor(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
Definition hopOper.c:138
void Hop_ObjCollectMulti(Hop_Obj_t *pFunc, Vec_Ptr_t *vSuper)
Definition hopUtil.c:133
int Hop_ObjFanoutCount(Hop_Obj_t *pObj, Hop_Obj_t *pPivot)
Definition hopDfs.c:310
Hop_Obj_t * Hop_TableLookup(Hop_Man_t *p, Hop_Obj_t *pGhost)
FUNCTION DEFINITIONS ///.
Definition hopTable.c:71
int Hop_ObjIsMuxType(Hop_Obj_t *pObj)
Definition hopUtil.c:151
void Hop_ManPrintVerbose(Hop_Man_t *p, int fHaig)
Definition hopUtil.c:482
Hop_Obj_t * Hop_CreateExor(Hop_Man_t *p, int nVars)
Definition hopOper.c:362
Hop_Obj_t * Hop_Miter(Hop_Man_t *p, Vec_Ptr_t *vPairs)
Definition hopOper.c:297
Hop_Obj_t * Hop_Oper(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1, Hop_Type_t Type)
Definition hopOper.c:83
int Hop_DagSize(Hop_Obj_t *pObj)
Definition hopDfs.c:279
Hop_Obj_t * Hop_And(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
Definition hopOper.c:104
word Hop_ManComputeTruth6(Hop_Man_t *p, Hop_Obj_t *pObj, int nVars)
Definition hopTruth.c:256
void Hop_ManStop(Hop_Man_t *p)
Definition hopMan.c:84
unsigned * Hop_ManConvertAigToTruth(Hop_Man_t *p, Hop_Obj_t *pRoot, int nVars, Vec_Int_t *vTruth, int fMsbFirst)
Definition hopTruth.c:143
void Hop_ManStopMemory(Hop_Man_t *p)
Definition hopMem.c:66
void Hop_ObjPrintVerilog(FILE *pFile, Hop_Obj_t *pObj, Vec_Vec_t *vLevels, int Level, int fOnlyAnds)
Definition hopUtil.c:369
void Hop_ObjCreateChoice(Hop_Obj_t *pOld, Hop_Obj_t *pNew)
Definition hopObj.c:260
void Hop_ObjDelete(Hop_Man_t *p, Hop_Obj_t *pObj)
Definition hopObj.c:186
void Hop_ObjDisconnect(Hop_Man_t *p, Hop_Obj_t *pObj)
Definition hopObj.c:159
void Hop_ManAddMemory(Hop_Man_t *p)
MACRO DEFINITIONS ///.
Definition hopMem.c:89
Hop_Obj_t * Hop_ObjCreatePi(Hop_Man_t *p)
DECLARATIONS ///.
Definition hopObj.c:45
int Hop_Edge_t
Definition hop.h:51
void Hop_ManCreateRefs(Hop_Man_t *p)
Definition hopDfs.c:152
Hop_Obj_t * Hop_Or(Hop_Man_t *p, Hop_Obj_t *p0, Hop_Obj_t *p1)
Definition hopOper.c:171
Hop_Obj_t * Hop_Mux(Hop_Man_t *p, Hop_Obj_t *pC, Hop_Obj_t *p1, Hop_Obj_t *p0)
Definition hopOper.c:187
Hop_Man_t * Hop_ManStart()
DECLARATIONS ///.
Definition hopMan.c:45
Hop_Obj_t * Hop_ObjRepr(Hop_Obj_t *pObj)
Definition hopObj.c:241
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
void Hop_ManCleanData(Hop_Man_t *p)
Definition hopUtil.c:63
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
Vec_Ptr_t * vPages
Definition hop.h:106
int fRefCount
Definition hop.h:102
abctime time2
Definition hop.h:110
int fCatchExor
Definition hop.h:103
Hop_Obj_t * pConst1
Definition hop.h:90
Vec_Ptr_t * vChunks
Definition hop.h:105
Hop_Obj_t Ghost
Definition hop.h:91
Hop_Obj_t * pListFree
Definition hop.h:107
Hop_Obj_t ** pTable
Definition hop.h:97
void * pData
Definition hop.h:100
int nCreated
Definition hop.h:94
int nDeleted
Definition hop.h:95
abctime time1
Definition hop.h:109
Vec_Ptr_t * vPos
Definition hop.h:88
int nObjs[AIG_VOID]
Definition hop.h:93
int nTableSize
Definition hop.h:98
int nTravIds
Definition hop.h:101
Vec_Ptr_t * vObjs
Definition hop.h:89
Vec_Ptr_t * vPis
Definition hop.h:87
unsigned int Type
Definition hop.h:75
int iData
Definition hop.h:69
unsigned int nRefs
Definition hop.h:79
unsigned int fPhase
Definition hop.h:76
Hop_Obj_t * pNext
Definition hop.h:71
unsigned int fMarkA
Definition hop.h:77
Hop_Obj_t * pFanin1
Definition hop.h:74
Hop_Obj_t * pFanin0
Definition hop.h:73
int Id
Definition hop.h:80
unsigned int fMarkB
Definition hop.h:78
int PioNum
Definition hop.h:72
void * pData
Definition hop.h:68
#define assert(ex)
Definition util_old.h:213
char * memset()
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
Definition vecVec.h:42