#include "aig.h"
#include "misc/tim/tim.h"
Go to the source code of this file.
◆ Aig_ManAntiCleanup()
Function*************************************************************
Synopsis [Adds POs for the nodes that otherwise would be dangling.]
Description [Returns the number of POs added.]
SideEffects []
SeeAlso []
Definition at line 293 of file aigMan.c.
294{
296 int i, nNodesOld = Aig_ManCoNum(
p);
298 if ( Aig_ObjIsNode(pNode) && Aig_ObjRefs(pNode) == 0 )
300 return nNodesOld - Aig_ManCoNum(
p);
301}
#define Aig_ManForEachObj(p, pObj, i)
Aig_Obj_t * Aig_ObjCreateCo(Aig_Man_t *p, Aig_Obj_t *pDriver)
struct Aig_Obj_t_ Aig_Obj_t
◆ Aig_ManCiCleanup()
Function*************************************************************
Synopsis [Removes PIs without fanouts.]
Description [Returns the number of PIs removed.]
SideEffects []
SeeAlso []
Definition at line 314 of file aigMan.c.
315{
317 int i, k = 0, nPisOld = Aig_ManCiNum(
p);
319 {
320 if ( i >= Aig_ManCiNum(
p) - Aig_ManRegNum(
p) )
321 Vec_PtrWriteEntry(
p->vCis, k++, pObj );
322 else if ( Aig_ObjRefs(pObj) > 0 )
323 Vec_PtrWriteEntry(
p->vCis, k++, pObj );
324 else
325 Vec_PtrWriteEntry(
p->vObjs, pObj->
Id, NULL );
326 }
327 Vec_PtrShrink(
p->vCis, k );
329 if ( Aig_ManRegNum(
p) )
330 p->nTruePis = Aig_ManCiNum(
p) - Aig_ManRegNum(
p);
331 return nPisOld - Aig_ManCiNum(
p);
332}
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
◆ Aig_ManCleanup()
Function*************************************************************
Synopsis [Removes combinational logic that does not feed into POs.]
Description [Returns the number of dangling nodes removed.]
SideEffects []
SeeAlso []
Definition at line 265 of file aigMan.c.
266{
269 int i, nNodesOld = Aig_ManNodeNum(
p);
270
271 vObjs = Vec_PtrAlloc( 100 );
273 if ( Aig_ObjIsNode(pNode) && Aig_ObjRefs(pNode) == 0 )
274 Vec_PtrPush( vObjs, pNode );
275
278 Vec_PtrFree( vObjs );
279 return nNodesOld - Aig_ManNodeNum(
p);
280}
void Aig_ObjDelete_rec(Aig_Man_t *p, Aig_Obj_t *pObj, int fFreeTop)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
◆ Aig_ManCoCleanup()
Function*************************************************************
Synopsis [Removes POs with constant input.]
Description [Returns the number of POs removed.]
SideEffects []
SeeAlso []
Definition at line 345 of file aigMan.c.
346{
348 int i, k = 0, nPosOld = Aig_ManCoNum(
p);
350 {
351 if ( i >= Aig_ManCoNum(
p) - Aig_ManRegNum(
p) )
352 Vec_PtrWriteEntry(
p->vCos, k++, pObj );
353 else if ( !Aig_ObjIsConst1(Aig_ObjFanin0(pObj)) || !Aig_ObjFaninC0(pObj) )
354 Vec_PtrWriteEntry(
p->vCos, k++, pObj );
355 else
356 {
358 Vec_PtrWriteEntry(
p->vObjs, pObj->
Id, NULL );
359 }
360 }
361 Vec_PtrShrink(
p->vCos, k );
363 if ( Aig_ManRegNum(
p) )
364 p->nTruePos = Aig_ManCoNum(
p) - Aig_ManRegNum(
p);
365 return nPosOld - Aig_ManCoNum(
p);
366}
void Aig_ObjDisconnect(Aig_Man_t *p, Aig_Obj_t *pObj)
◆ Aig_ManDup_rec()
Function*************************************************************
Synopsis [Duplicates the AIG manager recursively.]
Description []
SideEffects []
SeeAlso []
Definition at line 123 of file aigMan.c.
124{
129 if ( Aig_ObjIsBuf(pObj) )
132 pObjNew =
Aig_Oper( pNew, Aig_ObjChild0Copy(pObj), Aig_ObjChild1Copy(pObj), Aig_ObjType(pObj) );
134}
Aig_Obj_t * Aig_ManDup_rec(Aig_Man_t *pNew, Aig_Man_t *p, Aig_Obj_t *pObj)
Aig_Obj_t * Aig_Oper(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1, Aig_Type_t Type)
◆ Aig_ManExtractMiter()
Function*************************************************************
Synopsis [Extracts the miter composed of XOR of the two nodes.]
Description []
SideEffects []
SeeAlso []
Definition at line 147 of file aigMan.c.
148{
151 int i;
152
154 pNew->pName = Abc_UtilStrsav(
p->pName );
155 pNew->pSpec = Abc_UtilStrsav(
p->pSpec );
156
158 Aig_ManConst1(
p)->pData = Aig_ManConst1(pNew);
161
164
166 pObj = Aig_NotCond( pObj, Aig_Regular(pObj)->fPhase ^ Aig_IsComplement(pObj) );
167
169
171 printf( "Aig_ManExtractMiter(): The check has failed.\n" );
172 return pNew;
173}
ABC_NAMESPACE_IMPL_START Aig_Man_t * Aig_ManStart(int nNodesMax)
DECLARATIONS ///.
#define Aig_ManForEachCi(p, pObj, i)
ITERATORS ///.
Aig_Obj_t * Aig_Exor(Aig_Man_t *p, Aig_Obj_t *p0, Aig_Obj_t *p1)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
Aig_Obj_t * Aig_ObjCreateCi(Aig_Man_t *p)
DECLARATIONS ///.
void Aig_ManCleanData(Aig_Man_t *p)
ABC_DLL int Aig_ManCheck(Aig_Man_t *p)
FUNCTION DECLARATIONS ///.
◆ Aig_ManFlipFirstPo()
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 457 of file aigMan.c.
458{
459 Aig_ObjChild0Flip( Aig_ManCo(
p, 0) );
460}
◆ Aig_ManPrintStats()
Function*************************************************************
Synopsis [Stops the AIG manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 379 of file aigMan.c.
380{
382 printf(
"%-15s : ",
p->pName );
383 printf(
"pi = %5d ", Aig_ManCiNum(
p)-Aig_ManRegNum(
p) );
384 printf(
"po = %5d ", Aig_ManCoNum(
p)-Aig_ManRegNum(
p) );
385 if ( Aig_ManRegNum(
p) )
386 printf(
"lat = %5d ", Aig_ManRegNum(
p) );
387 printf(
"and = %7d ", Aig_ManAndNum(
p) );
388
389 if ( Aig_ManExorNum(
p) )
390 printf(
"xor = %5d ", Aig_ManExorNum(
p) );
391 if ( nChoices )
392 printf( "ch = %5d ", nChoices );
393 if ( Aig_ManBufNum(
p) )
394 printf(
"buf = %5d ", Aig_ManBufNum(
p) );
395
396
397
398
400 printf( "\n" );
401 fflush( stdout );
402}
int Aig_ManChoiceNum(Aig_Man_t *p)
int Aig_ManLevels(Aig_Man_t *p)
◆ Aig_ManReleaseData()
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 473 of file aigMan.c.
474{
475 void * pD =
p->pData;
477 return pD;
478}
◆ Aig_ManReportImprovement()
Function*************************************************************
Synopsis [Reports the reduction of the AIG.]
Description []
SideEffects []
SeeAlso []
Definition at line 415 of file aigMan.c.
416{
417 printf( "REG: Beg = %5d. End = %5d. (R =%5.1f %%) ",
418 Aig_ManRegNum(
p), Aig_ManRegNum(pNew),
419 Aig_ManRegNum(
p)? 100.0*(Aig_ManRegNum(
p)-Aig_ManRegNum(pNew))/Aig_ManRegNum(
p) : 0.0 );
420 printf( "AND: Beg = %6d. End = %6d. (R =%5.1f %%)",
421 Aig_ManNodeNum(
p), Aig_ManNodeNum(pNew),
422 Aig_ManNodeNum(
p)? 100.0*(Aig_ManNodeNum(
p)-Aig_ManNodeNum(pNew))/Aig_ManNodeNum(
p) : 0.0 );
423 printf( "\n" );
424}
◆ Aig_ManSetRegNum()
| void Aig_ManSetRegNum |
( |
Aig_Man_t * | p, |
|
|
int | nRegs ) |
Function*************************************************************
Synopsis [Sets the number of registers in the AIG manager.]
Description [This procedure should be called after the manager is fully constructed.]
SideEffects []
SeeAlso []
Definition at line 438 of file aigMan.c.
439{
441 p->nTruePis = Aig_ManCiNum(
p) - nRegs;
442 p->nTruePos = Aig_ManCoNum(
p) - nRegs;
444}
void Aig_ManSetCioIds(Aig_Man_t *p)
◆ Aig_ManStart()
DECLARATIONS ///.
CFile****************************************************************
FileName [aigMan.c]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [AIG package.]
Synopsis [AIG manager.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - April 28, 2007.]
Revision [
- Id
- aigMan.c,v 1.00 2007/04/28 00:00:00 alanmi Exp
] FUNCTION DEFINITIONS /// Function*************************************************************
Synopsis [Starts the AIG manager.]
Description [The argument of this procedure is a soft limit on the the number of nodes, or 0 if the limit is unknown.]
SideEffects []
SeeAlso []
Definition at line 47 of file aigMan.c.
48{
50 if ( nNodesMax <= 0 )
51 nNodesMax = 10007;
52
55
58
59 p->vCis = Vec_PtrAlloc( 100 );
60 p->vCos = Vec_PtrAlloc( 100 );
61 p->vObjs = Vec_PtrAlloc( 1000 );
62 p->vBufs = Vec_PtrAlloc( 100 );
63
64 p->unfold2_type_I = Vec_PtrAlloc( 4);
65 p->unfold2_type_II = Vec_PtrAlloc( 4);
66
67
69
70 p->pConst1 = Aig_ManFetchMemory(
p );
72 p->pConst1->fPhase = 1;
74
75 p->nTableSize = Abc_PrimeCudd( nNodesMax );
79}
#define ABC_ALLOC(type, num)
Aig_MmFixed_t * Aig_MmFixedStart(int nEntrySize, int nEntriesMax)
FUNCTION DEFINITIONS ///.
◆ Aig_ManStartFrom()
Function*************************************************************
Synopsis [Duplicates the AIG manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 92 of file aigMan.c.
93{
96 int i;
97
99 pNew->pName = Abc_UtilStrsav(
p->pName );
100 pNew->pSpec = Abc_UtilStrsav(
p->pSpec );
101
102 Aig_ManConst1(
p)->pData = Aig_ManConst1(pNew);
104 {
107 pObj->
pData = pObjNew;
108 }
109 return pNew;
110}
◆ Aig_ManStop()
Function*************************************************************
Synopsis [Stops the AIG manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 187 of file aigMan.c.
188{
190 int i;
191 if (
p->time1 ) {
ABC_PRT(
"time1",
p->time1 ); }
192 if (
p->time2 ) {
ABC_PRT(
"time2",
p->time2 ); }
193
201
203 Vec_PtrFreeP( &
p->vCis );
204 Vec_PtrFreeP( &
p->vCos );
205 Vec_PtrFreeP( &
p->vObjs );
206 Vec_PtrFreeP( &
p->vBufs );
207
208 Vec_PtrFreeP( &
p->unfold2_type_I );
209 Vec_PtrFreeP( &
p->unfold2_type_II );
210
211 Vec_IntFreeP( &
p->vLevelR );
212 Vec_VecFreeP( &
p->vLevels );
213 Vec_IntFreeP( &
p->vFlopNums );
214 Vec_IntFreeP( &
p->vFlopReprs );
216 Vec_VecFreeP( &
p->vClockDoms );
217 Vec_IntFreeP( &
p->vProbs );
218 Vec_IntFreeP( &
p->vCiNumsOrig );
219 Vec_PtrFreeP( &
p->vMapped );
220 if (
p->vSeqModelVec )
221 Vec_PtrFreeFree(
p->vSeqModelVec );
233}
void Aig_ManStop(Aig_Man_t *p)
void Aig_ManFanoutStop(Aig_Man_t *p)
void Aig_MmFixedStop(Aig_MmFixed_t *p, int fVerbose)
void Tim_ManStopP(Tim_Man_t **p)
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
◆ Aig_ManStopP()
Function*************************************************************
Synopsis [Stops the AIG manager.]
Description []
SideEffects []
SeeAlso []
Definition at line 246 of file aigMan.c.