31 #define NUMBER1 3716960521u
32 #define NUMBER2 2174103536u
51 static unsigned int m_z =
NUMBER1;
52 static unsigned int m_w =
NUMBER2;
58 m_z = 36969 * (m_z & 65535) + (m_z >> 16);
59 m_w = 18000 * (m_w & 65535) + (m_w >> 16);
60 return (m_z << 16) + m_w;
85 for ( w = iWordStart; w < iWordStop; w++ )
103 static char Buffer[100];
108 TimeStamp = asctime( localtime( <ime ) );
109 TimeStamp[
strlen(TimeStamp) - 1 ] = 0;
110 strcpy( Buffer, TimeStamp );
127 static char Buffer[1000];
130 if ( (pDot =
strrchr( Buffer,
'.' )) )
132 strcat( Buffer, pSuffix );
133 if ( (pDot =
strrchr( Buffer,
'\\' )) || (pDot =
strrchr( Buffer,
'/' )) )
313 for ( i = 0; i < p->
nObjs; i++ )
331 for ( i = 0; i < p->
nObjs; i++ )
355 pObj->
fPhase = (fPhase2 && fPhase1) || (!fPhase2 && fPhase0);
358 pObj->
fPhase = fPhase0 ^ fPhase1;
360 pObj->
fPhase = fPhase0 & fPhase1;
562 if ( vCiLevels == NULL )
748 Gia_Obj_t * pObj, * pCtrl, * pFan0, * pFan1;
824 int i, nCutCur = 0, nCutMax = 0;
830 if ( nCutMax < nCutCur )
1134 int ConeSize1, ConeSize2;
1139 assert( ConeSize1 == ConeSize2 );
1140 assert( ConeSize1 >= 0 );
1177 Counter += !pObj->
fMark0;
1209 Counter += !pObj->
fMark0;
1262 printf(
"Object is NULL." );
1271 printf(
"Obj %4d : ",
Gia_ObjId(p, pObj) );
1273 printf(
"constant 0" );
1285 printf(
"XOR( %4d%s, %4d%s )",
1289 printf(
"MUX( %4d%s, %4d%s, %4d%s )",
1294 printf(
"AND( %4d%s, %4d%s )",
1333 printf(
"GIA manager has %d ANDs, %d XORs, %d MUXes.\n",
1352 printf(
"TFI cone of CO number %d:\n",
Gia_ObjCioId(pObj) );
1372 for ( i = 0; i < nLeaves; i++ )
1375 printf(
"GIA logic cone for node %d:\n",
Gia_ObjId(p, pObj) );
1398 printf(
"GIA logic cone for node %d:\n",
Gia_ObjId(p, pObj) );
1468 int nTruths = nBytesMax / (
sizeof(unsigned) * nTruthWords);
1469 int nTotalNodes = 0, nRounds = 0;
1474 printf(
"Var = %d. Words = %d. Truths = %d.\n", nVars, nTruthWords, nTruths );
1493 printf(
"Rounds = %d. Objects = %d. Total = %d. ", nRounds,
Gia_ManObjNum(p), nTotalNodes );
1517 printf(
"AIGs have different number of objects.\n" );
1527 printf(
"Objects %d are different.\n", i );
1534 printf(
"Representatives of objects %d are different.\n", i );
1674 int i, Counter1 = 0, Counter2 = 0;
1675 int nFailNoRepr = 0;
1676 int nFailHaveRepr = 0;
1677 int nChoiceNodes = 0;
1704 if ( Counter1 == 0 )
1706 printf(
"Warning: AIG has repr data-strucure but not reprs.\n" );
1709 printf(
"%d nodes have reprs.\n", Counter1 );
1710 printf(
"%d nodes have nexts.\n", Counter2 );
1735 if ( nChoices == 0 )
1739 printf(
"Gia_ManHasChoices_very_old(): Error: %d internal nodes have no fanout and no repr.\n", nFailNoRepr );
1742 if ( nFailHaveRepr )
1744 printf(
"Gia_ManHasChoices_very_old(): Error: %d internal nodes have both fanout and repr.\n", nFailHaveRepr );
1771 int i, k, nGroupCur, nGroups;
1775 assert( nGroupSize > 0 );
1776 assert( pCommLine != NULL );
1778 Abc_Print( 1,
"RUNNING MultiProve: Group size = %d. Command line = \"%s\".\n", nGroupSize, pCommLine );
1784 for ( i = 0; i < nGroups; i++ )
1789 Abc_Print( 1,
"GROUP %4d : %4d <= PoId < %4d : ", i, i * nGroupSize, i * nGroupSize + nGroupCur );
1797 if ( nGroupSize == 1 )
1806 assert( vStatusCur != NULL );
1808 for ( k = 0; k < nGroupCur; k++ )
1859 for ( f = 0; f < nFrames; f++ )
1884 printf(
"Simulation converged after %d frames.\n", f+1 );
1886 printf(
"Simulation terminated after %d frames.\n", nFrames );
static void Gia_ManPatchCoDriver(Gia_Man_t *p, int iCoIndex, int iLit0)
static void Gia_ObjRefFanin2Inc(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ObjLevelId(Gia_Man_t *p, int Id)
static int * Vec_IntArray(Vec_Int_t *p)
static void Gia_ObjTerSimCo(Gia_Obj_t *pObj)
static void Gia_ObjRefFanin0Inc(Gia_Man_t *p, Gia_Obj_t *pObj)
void Abc_FrameReplaceCexVec(Abc_Frame_t *pAbc, Vec_Ptr_t **pvCexVec)
static Gia_Obj_t * Gia_ObjChild0(Gia_Obj_t *pObj)
static int Gia_ManMuxNum(Gia_Man_t *p)
static int Gia_ObjFaninC2(Gia_Man_t *p, Gia_Obj_t *pObj)
int Gia_ManMarkDangling(Gia_Man_t *p)
Gia_Man_t * Gia_ManDupCones(Gia_Man_t *p, int *pPos, int nPos, int fTrimPis)
void Gia_ManCleanLevels(Gia_Man_t *p, int Size)
static void Gia_ObjTerSimRo(Gia_Man_t *p, Gia_Obj_t *pObj)
Vec_Int_t * Gia_ManCollectPoIds(Gia_Man_t *p)
void Gia_ManCreateRefs(Gia_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Gia_ObjPhase(Gia_Obj_t *pObj)
static void Gia_ObjTerSimSet0(Gia_Obj_t *pObj)
#define Vec_IntForEachEntryStop(vVec, Entry, i, Stop)
void Gia_ManSetPhasePattern(Gia_Man_t *p, Vec_Int_t *vCiValues)
ABC_DLL Vec_Int_t * Abc_FrameReadPoStatuses(Abc_Frame_t *p)
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
void Gia_ManStop(Gia_Man_t *p)
void Gia_ManInvertPos(Gia_Man_t *pAig)
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
#define Gia_ManForEachCo(p, pObj, i)
static int Gia_ManPoNum(Gia_Man_t *p)
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
void * Abc_FrameReadCex(void *pAbc)
word Gia_ManRandomW(int fReset)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Vec_IntCountEntry(Vec_Int_t *p, int Entry)
static void Gia_ObjRefFanin1Inc(Gia_Man_t *p, Gia_Obj_t *pObj)
int Cmd_CommandExecute(void *pAbc, char *pCommandLine)
static Gia_Obj_t * Gia_Regular(Gia_Obj_t *p)
static int Gia_ObjIsTravIdCurrent(Gia_Man_t *p, Gia_Obj_t *pObj)
int Gia_ObjIsMuxType(Gia_Obj_t *pNode)
static Gia_Obj_t * Gia_ManPo(Gia_Man_t *p, int v)
#define ABC_REALLOC(type, obj, num)
static int Gia_ObjFaninLit0p(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ObjIsCand(Gia_Obj_t *pObj)
Vec_Int_t * Gia_ManGetCiLevels(Gia_Man_t *p)
static int Gia_ManConstrNum(Gia_Man_t *p)
static void Gia_ObjSetGateLevel(Gia_Man_t *p, Gia_Obj_t *pObj)
int Gia_ObjRecognizeExor(Gia_Obj_t *pObj, Gia_Obj_t **ppFan0, Gia_Obj_t **ppFan1)
int Gia_ManPoMffcSize(Gia_Man_t *p)
static int Gia_ObjIsConst0(Gia_Obj_t *pObj)
ABC_DLL Vec_Ptr_t * Abc_FrameReadCexVec(Abc_Frame_t *p)
void Gia_ManSetPhase(Gia_Man_t *p)
static int Gia_ObjFaninId1p(Gia_Man_t *p, Gia_Obj_t *pObj)
void Gia_ManLoadValue(Gia_Man_t *p, Vec_Int_t *vValues)
static int Vec_IntFind(Vec_Int_t *p, int Entry)
void Gia_ManPrintCo(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ObjRefNum(Gia_Man_t *p, Gia_Obj_t *pObj)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Vec_Int_t * Gia_ManReverseLevel(Gia_Man_t *p)
static void Gia_ObjTerSimPrint(Gia_Obj_t *pObj)
static int Gia_ObjIsBuf(Gia_Obj_t *pObj)
int Gia_ManCompare(Gia_Man_t *p1, Gia_Man_t *p2)
int Gia_ManLevelNum(Gia_Man_t *p)
void Gia_ManCleanPhase(Gia_Man_t *p)
void Gia_ManPrintCo_rec(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Abc_TruthWordNum(int nVars)
int Gia_ManCheckCoPhase(Gia_Man_t *p)
static abctime Abc_Clock()
void Gia_ManSetPhase1(Gia_Man_t *p)
static int Abc_MaxInt(int a, int b)
static int Vec_PtrSize(Vec_Ptr_t *p)
static Vec_Int_t * Vec_IntStartNatural(int nSize)
int Gia_NodeMffcSize(Gia_Man_t *p, Gia_Obj_t *pNode)
static int Gia_ObjTerSimGetX(Gia_Obj_t *pObj)
int Gia_NodeRef_rec(Gia_Man_t *p, Gia_Obj_t *pNode)
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
int Abc_FrameReadProbStatus(void *pAbc)
static void Gia_ObjSetBufLevel(Gia_Man_t *p, Gia_Obj_t *pObj)
int Gia_ManSetLevels(Gia_Man_t *p, Vec_Int_t *vCiLevels)
int Gia_ManHasChoices_very_old(Gia_Man_t *p)
static Gia_Obj_t * Gia_ObjChild1(Gia_Obj_t *pObj)
#define Gia_ManForEachCi(p, pObj, i)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static Gia_Obj_t * Gia_Not(Gia_Obj_t *p)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static int Gia_ManAndNum(Gia_Man_t *p)
static int Gia_ObjLevel(Gia_Man_t *p, Gia_Obj_t *pObj)
static Vec_Int_t * Vec_IntStart(int nSize)
void Gia_ManCreateValueRefs(Gia_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
void Gia_ManCleanTruth(Gia_Man_t *p)
float Gia_ManLevelAve(Gia_Man_t *p)
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
void Gia_ManRandomInfo(Vec_Ptr_t *vInfo, int iInputStart, int iWordStart, int iWordStop)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Gia_ManCleanValue(Gia_Man_t *p)
unsigned Gia_ManRandom(int fReset)
FUNCTION DEFINITIONS ///.
void Gia_ManPrintCollect2_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vNodes)
void Gia_ManCheckMark1(Gia_Man_t *p)
static void Gia_ObjFlipFaninC0(Gia_Obj_t *pObj)
void Gia_ManSetMark1(Gia_Man_t *p)
#define Gia_ManForEachAndReverse(p, pObj, i)
static Gia_Obj_t * Gia_ObjRoToRi(Gia_Man_t *p, Gia_Obj_t *pObj)
void Gia_ObjPrint(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Vec_IntEntry(Vec_Int_t *p, int i)
unsigned __int64 word
DECLARATIONS ///.
static void Gia_ObjSetTravIdCurrent(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ObjRefInc(Gia_Man_t *p, Gia_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
static void Vec_IntUpdateEntry(Vec_Int_t *p, int i, int Value)
static int Gia_ObjIsXor(Gia_Obj_t *pObj)
#define Gia_ManForEachAnd(p, pObj, i)
Vec_Int_t * Gia_ManRequiredLevel(Gia_Man_t *p)
Vec_Int_t * Gia_ManGroupProve(Gia_Man_t *pInit, char *pCommLine, int nGroupSize, int fVerbose)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
void Gia_ManCleanMark1(Gia_Man_t *p)
static int Gia_ManXorNum(Gia_Man_t *p)
void Gia_ManSetMark0(Gia_Man_t *p)
int * Gia_ManCreateMuxRefs(Gia_Man_t *p)
Vec_Int_t * Gia_ManFirstFanouts(Gia_Man_t *p)
#define Gia_ManForEachPi(p, pObj, i)
static Gia_Obj_t * Gia_ObjNextObj(Gia_Man_t *p, int Id)
static void Abc_Print(int level, const char *format,...)
static int Vec_PtrCountZero(Vec_Ptr_t *p)
Vec_Int_t * Gia_ManDfsForCrossCut(Gia_Man_t *p, int fReverse)
static Gia_Obj_t * Gia_ObjFanin2(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ObjIsTravIdCurrentId(Gia_Man_t *p, int Id)
#define NUMBER1
DECLARATIONS ///.
int Gia_NodeDeref_rec(Gia_Man_t *p, Gia_Obj_t *pNode)
void Gia_ManPrint(Gia_Man_t *p)
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
static int Gia_ObjNext(Gia_Man_t *p, int Id)
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
#define ABC_NAMESPACE_IMPL_START
Vec_Int_t * Gia_ManSaveValue(Gia_Man_t *p)
static int Gia_ObjRefDec(Gia_Man_t *p, Gia_Obj_t *pObj)
void Gia_ManInvertConstraints(Gia_Man_t *pAig)
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static Gia_Obj_t * Gia_ObjReprObj(Gia_Man_t *p, int Id)
static int Gia_ManCiNum(Gia_Man_t *p)
Vec_Int_t * Gia_ManPoXSim(Gia_Man_t *p, int nFrames, int fVerbose)
void Gia_ObjSetPhase(Gia_Man_t *p, Gia_Obj_t *pObj)
void Gia_ManCleanMark01(Gia_Man_t *p)
static int Vec_IntSize(Vec_Int_t *p)
static int Gia_IsComplement(Gia_Obj_t *p)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Vec_Int_t * Gia_ManComputeSlacks(Gia_Man_t *p)
static void Gia_ObjSetCoLevel(Gia_Man_t *p, Gia_Obj_t *pObj)
void Gia_ManCleanMark0(Gia_Man_t *p)
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
void Gia_ManPrintCone2(Gia_Man_t *p, Gia_Obj_t *pObj)
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
void Gia_ManCheckMark0(Gia_Man_t *p)
int Gia_ObjRecognizeMuxLits(Gia_Man_t *p, Gia_Obj_t *pNode, int *iLitT, int *iLitE)
void Gia_ManMarkFanoutDrivers(Gia_Man_t *p)
void Gia_ManFillValue(Gia_Man_t *p)
#define ABC_CALLOC(type, num)
void Gia_ManPrintCone(Gia_Man_t *p, Gia_Obj_t *pObj, int *pLeaves, int nLeaves, Vec_Int_t *vNodes)
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
ABC_DLL Abc_Frame_t * Abc_FrameReadGlobalFrame()
static int Gia_ObjIsPo(Gia_Man_t *p, Gia_Obj_t *pObj)
unsigned * Gia_ManComputePoTruthTables(Gia_Man_t *p, int nBytesMax)
Gia_Obj_t * Gia_ObjRecognizeMux(Gia_Obj_t *pNode, Gia_Obj_t **ppNodeT, Gia_Obj_t **ppNodeE)
void Gia_ManCollectObjs_rec(Gia_Man_t *p, int iObjId, Vec_Int_t *vObjs, int Limit)
static int Gia_ObjFaninId2p(Gia_Man_t *p, Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
int Gia_ManCrossCut(Gia_Man_t *p, int fReverse)
void Gia_ManPrintCollect_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vNodes)
#define Gia_ManForEachRo(p, pObj, i)
void Gia_ManIncrementTravId(Gia_Man_t *p)
static int Gia_ObjFaninId2(Gia_Man_t *p, int ObjId)
#define Gia_ManForEachRi(p, pObj, i)
void Gia_ManSwapPos(Gia_Man_t *p, int i)
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
static void Vec_IntFree(Vec_Int_t *p)
static int Gia_ManPiNum(Gia_Man_t *p)
static void Vec_IntClear(Vec_Int_t *p)
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
static void Gia_ObjSetTravIdCurrentId(Gia_Man_t *p, int Id)
#define Gia_ManForEachPo(p, pObj, i)
static int Gia_ObjFaninId1(Gia_Obj_t *pObj, int ObjId)
static int Gia_ObjIsMux(Gia_Man_t *p, Gia_Obj_t *pObj)
static void Gia_ObjTerSimSetX(Gia_Obj_t *pObj)
#define Gia_ManForEachCoReverse(p, pObj, i)
void Gia_ManDfsForCrossCut_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vNodes)
static int Gia_ObjCioId(Gia_Obj_t *pObj)
static int Gia_Obj2Lit(Gia_Man_t *p, Gia_Obj_t *pObj)
Vec_Int_t * Gia_ManGetDangling(Gia_Man_t *p)
static int Gia_ManObjNum(Gia_Man_t *p)
static int Gia_ObjRepr(Gia_Man_t *p, int Id)
static void Gia_ObjTerSimAnd(Gia_Obj_t *pObj)
char * Gia_FileNameGenericAppend(char *pBase, char *pSuffix)
static void Vec_PtrFree(Vec_Ptr_t *p)
static int Gia_ObjFaninId0(Gia_Obj_t *pObj, int ObjId)
static int Gia_ObjIsPi(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Gia_ManCoNum(Gia_Man_t *p)
static void Gia_ObjSetLevel(Gia_Man_t *p, Gia_Obj_t *pObj, int l)
int Gia_ManHasDangling(Gia_Man_t *p)