88 #define Str_NtkManForEachObj( p, pObj ) \
89 for ( pObj = p->pObjs; Str_ObjId(p, pObj) < p->nObjs; pObj++ )
90 #define Str_NtkManForEachObjVec( vVec, p, pObj, i ) \
91 for ( i = 0; (i < Vec_IntSize(vVec)) && ((pObj) = Str_NtkObj(p, Vec_IntEntry(vVec,i))); i++ )
116 for ( i = 0; i < nFanins; i++ )
119 assert( pFanins[i] >= 0 );
143 printf(
"Network contains %d ands, %d xors, %d muxes (%d trees in %d groups). ",
150 *pnGroups = *pnMuxes = 0;
151 if ( pObj->
iTop == 0 )
155 *pnMuxes = pObj1 - pObj + 1;
156 *pnGroups = (pObj2 - pObj + 1) / *pnMuxes;
166 pObj += nGroups * nMuxes - 1;
167 printf(
"%d x %d ", nGroups, nMuxes );
187 for ( k = 0; k < (int)pObj->
nFanins; k++ )
193 for ( k = 0; k < (int)pObj->
nFanins; k++ )
227 Gia_Obj_t * pObj, * pFan0, * pFan1, * pFanC;
228 int i, iLit0, iLit1, fCompl;
267 if ( iLit0 == iLit1 )
358 Count += (*p ==
'[');
363 int fPrintStructs = 0;
368 int i, iStructId, fFound;
409 printf(
"%5d : ", i );
412 printf(
"%s\n", pTemp );
448 int i, k, n, iObj, iObj2;
523 int i, k = 0, Prev = -1, This, fCompl = 0;
530 else if ( Prev != This )
543 int i, k = 0, Prev = -1, This;
552 else if ( Prev != This )
640 int i, k, iVar, iLit, iBeg, iEnd;
661 ABC_SWAP(
int, pFanins[0], pFanins[1] );
690 ABC_SWAP(
int, pFanins[0], pFanins[1] );
784 n = (d == (d0 >> 4)) ? (d0 & 15) : 1;
785 n += (d == (d1 >> 4)) ? (d1 & 15) : 1;
786 return (d << 4) + (n > nLutSize ? 18 : n);
788 static inline int Str_Delay3(
int d0,
int d1,
int d2,
int nLutSize )
791 n = (d == (d0 >> 4)) ? (d0 & 15) : 1;
792 n += (d == (d1 >> 4)) ? (d1 & 15) : 1;
793 n += (d == (d2 >> 4)) ? (d2 & 15) : 1;
794 return (d << 4) + (n > nLutSize ? 19 : n);
835 word t, m = 0x00000000FFFFFFFF;
836 for ( j = 32; j != 0; j = j >> 1, m = m ^ (m << j) )
838 for ( k = 0; k < 64; k = (k + j + 1) & ~j )
840 t = (A[k] ^ (A[k+j] >> j)) & m;
842 A[k+j] = A[k+j] ^ (t << j);
866 int Prev = nSize, nLevels = 1;
867 int i, k, iLit, iFanin, nSizeNew;
872 for ( i = 0; i < 64; i++ )
882 Matrix[i] = ((
word)1) << (63-i);
891 for ( k = 0; k < 2; k++ )
929 Mask = (~(
word)0) << (64 - nSize);
933 if ( (Matrix[i] & (Matrix[i] - 1)) == 0 )
935 if ( Matrix[i] == Mask )
937 Matrix[k] = Matrix[i];
938 Levels[k] = Levels[i];
944 for ( i = k; i < 64; i++ )
964 if ( fVerbose && nSize > 10 )
966 printf(
"Gate inputs = %d. Collected fanins = %d. All = %d. Good = %d. Levels = %d\n",
969 for ( i = 0; i < nSizeNew; i++ )
970 printf(
"%d", Levels[i] );
972 for ( i = 0; i < nSize; i++ )
1006 i = i - ((i >> 1) & 0x5555555555555555);
1007 i = (i & 0x3333333333333333) + ((i >> 2) & 0x3333333333333333);
1008 i = ((i + (i >> 4)) & 0x0F0F0F0F0F0F0F0F);
1009 return (i*(0x0101010101010101))>>56;
1015 for ( i = 0; i < nSize; i++ )
1017 printf(
"%6d : ", i );
1019 printf(
"%3d ", pCost[i] >> 4 );
1020 printf(
"%3d ", pCost[i] & 15 );
1042 for ( k = 0; k < (int)pObj->
nFanins; k++ )
1052 int Str_NtkBalanceTwo(
Gia_Man_t * pNew,
Str_Ntk_t *
p,
Str_Obj_t * pObj,
int i,
int j,
Vec_Int_t * vDelay,
int * pCost,
int * pSuper,
word * pMatrix,
int nSize,
int nLutSize,
int CostBest )
1054 int k, iLitRes, Delay;
1064 pSuper[i] = iLitRes;
1065 pMatrix[i] |= pMatrix[j];
1069 for ( k = j; k < nSize; k++ )
1071 pCost[k] = pCost[k+1];
1072 pSuper[k] = pSuper[k+1];
1073 pMatrix[k] = pMatrix[k+1];
1077 for ( k = 0; k < nSize; k++ )
1079 if ( pCost[k] <= pCost[k+1] )
1081 ABC_SWAP(
int, pCost[k], pCost[k+1] );
1082 ABC_SWAP(
int, pSuper[k], pSuper[k+1] );
1096 int k, iLit, MatrixSize = 0;
1102 for ( k = 0; k < (int)pObj->
nFanins; k++ )
1117 pObj->
iCopy =
Str_NtkBalanceTwo( pNew, p, pObj, 0, 1, vDelay, pCost, pSuper, pMatrix, 2, nLutSize, -1 );
1135 int i, iStop, iBest,iBest2;
1136 int CostNew, CostBest, CostBest2;
1137 int OccurNew, OccurBest, OccurBest2;
1141 Str_NtkBalanceTwo( pNew, p, pObj, 0, 1, vDelay, pCost, pSuper, pMatrix,
Vec_IntSize(vSuper), nLutSize, -1 );
1154 if ( pCost[0] == 17 && pCost[1] == 17 )
1156 Str_NtkBalanceTwo( pNew, p, pObj, 0, 1, vDelay, pCost, pSuper, pMatrix,
Vec_IntSize(vSuper), nLutSize, 2 );
1163 for ( iStop = 0; iStop <
Vec_IntSize(vSuper); iStop++ )
1164 if ( (pCost[iStop] >> 4) != (pCost[0] >> 4) )
1169 iBest = iStop, OccurBest =
Str_CountBits(pMatrix[0] & pMatrix[iStop]);
1170 for ( i = iStop + 1; i <
Vec_IntSize(vSuper); i++ )
1172 if ( (pCost[i] >> 4) != (pCost[iStop] >> 4) )
1175 if ( OccurBest < OccurNew )
1176 iBest = i, OccurBest = OccurNew;
1179 Str_NtkBalanceTwo( pNew, p, pObj, 0, iBest, vDelay, pCost, pSuper, pMatrix,
Vec_IntSize(vSuper), nLutSize, -1 );
1185 iBest = -1; CostBest = -1; OccurBest2 = -1; OccurBest = -1;
1186 for ( i = 1; i < iStop; i++ )
1188 CostNew = (pCost[0] & 15) + (pCost[i] & 15);
1189 if ( CostNew > nLutSize )
1192 if ( CostBest < CostNew || (CostBest == CostNew && OccurBest < OccurNew) )
1193 CostBest = CostNew, iBest = i, OccurBest = OccurNew;
1196 if ( CostBest == nLutSize )
1199 Str_NtkBalanceTwo( pNew, p, pObj, 0, iBest, vDelay, pCost, pSuper, pMatrix,
Vec_IntSize(vSuper), nLutSize, CostBest );
1205 iBest = iBest2 = -1; CostBest = CostBest2 = -1, OccurBest = OccurBest2 = -1;
1206 for ( i = 0; i < iStop; i++ )
1207 for ( k = i+1; k < iStop; k++ )
1209 CostNew = (pCost[i] & 15) + (pCost[k] & 15);
1211 if ( CostNew <= nLutSize )
1213 if ( OccurBest < OccurNew || (OccurBest == OccurNew && CostBest < CostNew ))
1214 CostBest = CostNew, iBest = (i << 16) | k, OccurBest = OccurNew;
1218 if ( OccurBest2 < OccurNew || (OccurBest2 == OccurNew && CostBest2 < CostNew) )
1219 CostBest2 = CostNew, iBest2 = (i << 16) | k, OccurBest2 = OccurNew;
1225 Str_NtkBalanceTwo( pNew, p, pObj, iBest>>16, iBest&0xFFFF, vDelay, pCost, pSuper, pMatrix,
Vec_IntSize(vSuper), nLutSize, CostBest );
1232 Str_NtkBalanceTwo( pNew, p, pObj, iBest2>>16, iBest2&0xFFFF, vDelay, pCost, pSuper, pMatrix,
Vec_IntSize(vSuper), nLutSize, -1 );
1237 pObj->
iCopy =
Str_NtkBalanceTwo( pNew, p, pObj, 0, 1, vDelay, pCost, pSuper, pMatrix, 2, nLutSize, -1 );
1255 int n, m, iRes, fUseRestruct = 1;
1258 for ( n = 0; n < nGroups; n++ )
1263 for ( m = 0; m <
nMuxes; m++, pObj++ )
1279 for ( n = 0; n < nGroups *
nMuxes; n++, pObj++ )
1291 int nGroups,
nMuxes, CioId;
1292 int arrTime, Delay = 0;
1300 if ( pNew->
vSuper == NULL )
1302 if ( pNew->
vStore == NULL )
1329 assert( nGroups * nMuxes >= 2 );
1330 Str_NtkBalanceMux( pNew, p, pObj, vDelay, nLutSize, nGroups, nMuxes, fRecursive, fOptArea, fVerbose );
1331 pObj += nGroups * nMuxes - 1;
1393 pNew =
Str_NtkBalance( p, pNtk, nLutSize, fUseMuxes, fRecursive, fOptArea, fVerbose );
1409 pNew =
Str_NtkBalance( p, pNtk, nLutSize, fUseMuxes, fRecursive, fOptArea, fVerbose );
1461 printf(
"%d", -pMux->
Edge[i].
Fan );
1502 for ( i = 1; i <=
nMuxes; i++ )
1509 pObj =
Str_NtkObj( pNtk, iMux + nMuxes - i );
1511 for ( k = 0; k < 3; k++ )
1542 int pInds[3], MidFan, MidCom, MidDel, MidCop, c;
1543 int iRes, iCond, fCompl;
1560 assert( pSpots[0]->Edge[pInds[0]].Fan > 0 );
1561 assert( pSpots[1]->Edge[pInds[1]].Fan > 0 );
1564 for ( c = i+1; c < k; c++ )
1567 MidFan = pSpots[2]->
Edge[!pInds[2]].
Fan;
1570 MidCop = pSpots[2]->
Edge[!pInds[2]].
Copy;
1575 pSpots[0]->
Edge[pInds[0]].
Fan = pSpots[2]->
Id;
1577 pSpots[1]->
Edge[pInds[1]].
Fan = MidFan;
1580 pSpots[1]->
Edge[pInds[1]].
Copy = MidCop;
1582 for ( c = i + 1; c < k; c++ )
1588 for ( c = i; c < k; c++ )
1610 if ( pMux->
Edge[i].
Fan > 0 && !Str_MuxFindPath_rec(
Str_MuxFanin(pMux, i), pPath, pnLength) )
1618 for ( i = 0; i < 2; i++ )
1630 if ( pRoot->
Edge[i].
Fan <= 0 )
1652 int i, k, nLength = 0, ForkBest = -1, nChecks = 0;
1654 if ( RetValue == 0 )
1657 printf(
"Trying node %d with path of length %d.\n", pRoot->
Id, nLength );
1658 for ( i = 0; i < nLength; i++ )
1659 for ( k = i+2; k < nLength; k++ )
1664 if ( DelayBest > Delay || (ForkBest > 0 && DelayBest == Delay) )
1665 DelayBest = Delay, ForkBest = (i << 16) | k;
1667 printf(
"%2d %2d -> %3d (%3d)\n", i, k, Delay, DelayBest );
1670 if ( ForkBest == -1 )
1673 printf(
"Did not find!\n" );
1677 Str_MuxChangeOnce( pTree, pPath, ForkBest >> 16, ForkBest & 0xFFFF, NULL, pNew, vDelay );
1680 printf(
"Node %6d (%3d %3d) : Checks = %d. Delay: %d -> %d.\n",
1681 pRoot->
Id, ForkBest >> 16, ForkBest & 0xFFFF, nChecks, DelayInit, DelayBest );
1694 fChanges |=
Str_MuxTryOnce( pNew, pNtk, pTree, pRoot, Edge, vDelay, fVerbose );
1701 int Delay, Delay2, fChanges = 0;
1702 if ( nMuxes >= Limit )
1704 assert( nMuxes < Limit );
1705 Str_MuxCreate( pTree, pNtk, iMux, nMuxes, vDelay, nLutSize );
1724 int Delay, Delay2, fChanges = 0;
1725 if ( nMuxes >= Limit )
1727 assert( nMuxes < Limit );
1728 Str_MuxCreate( pTree, pNtk, iMux, nMuxes, vDelay, nLutSize );
1732 if ( !
Str_MuxTryOnce(pNew, pNtk, pTree, pTree, 0, vDelay, fVerbose) )
1786 int fSkipMoving = 1;
1788 int nMuxes0, nMuxes1;
1789 if ( pRoot->
Edge[i].
Fan <= 0 )
1794 if ( nMuxes0 + nMuxes1 < 2 )
1795 return 1 + nMuxes0 + nMuxes1;
1796 if ( nMuxes0 + nMuxes1 == 2 )
1798 if ( nMuxes0 == 2 || nMuxes1 == 2 )
1810 assert( nMuxes0 + nMuxes1 == 3 || nMuxes0 + nMuxes1 == 4 );
1811 assert( nMuxes0 == 2 || nMuxes1 == 2 );
1842 return nMuxes0 + nMuxes1 - 2;
1849 if ( nMuxes >= Limit )
1851 assert( nMuxes < Limit );
1852 Str_MuxCreate( pTree, pNtk, iMux, nMuxes, vDelay, nLutSize );
1854 assert( Result >= 0 && Result <= 2 );
int Str_NtkBalanceTwo(Gia_Man_t *pNew, Str_Ntk_t *p, Str_Obj_t *pObj, int i, int j, Vec_Int_t *vDelay, int *pCost, int *pSuper, word *pMatrix, int nSize, int nLutSize, int CostBest)
static int Gia_ObjFanin2Copy(Gia_Man_t *p, Gia_Obj_t *pObj)
void Str_NtkBalanceMulti2(Gia_Man_t *pNew, Str_Ntk_t *p, Str_Obj_t *pObj, Vec_Int_t *vDelay, int nLutSize)
static int Gia_ObjToLit(Gia_Man_t *p, Gia_Obj_t *pObj)
static int * Vec_IntArray(Vec_Int_t *p)
static int Gia_ManAppendAnd(Gia_Man_t *p, int iLit0, int iLit1)
static void Gia_ManSimplifyAnd(Vec_Int_t *vSuper)
void Gia_ManCreateRefs(Gia_Man_t *p)
void Str_MuxStructDump_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Str_t *vStr)
int Str_MuxRestructure2(Gia_Man_t *pNew, Str_Ntk_t *pNtk, int iMux, int nMuxes, Vec_Int_t *vDelay, int nLutSize, int fVerbose)
static Gia_Obj_t * Gia_ObjChild0(Gia_Obj_t *pObj)
static int Gia_ManMuxNum(Gia_Man_t *p)
int Gia_ObjRecognizeExor(Gia_Obj_t *pObj, Gia_Obj_t **ppFan0, Gia_Obj_t **ppFan1)
static int Gia_ObjFaninC2(Gia_Man_t *p, Gia_Obj_t *pObj)
static Vec_Wec_t * Vec_WecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Abc_NamStop(Abc_Nam_t *p)
static int Gia_ManAppendMuxReal(Gia_Man_t *p, int iLitC, int iLit1, int iLit0)
Gia_Man_t * Gia_ManDupUnnormalize(Gia_Man_t *p)
static int Gia_ObjIsAndReal(Gia_Man_t *p, Gia_Obj_t *pObj)
int Str_MuxRestructure1(Gia_Man_t *pNew, Str_Ntk_t *pNtk, int iMux, int nMuxes, Vec_Int_t *vDelay, int nLutSize, int fVerbose)
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
void Str_ManNormalize_rec(Str_Ntk_t *pNtk, Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Wec_t *vGroups, Vec_Int_t *vRoots)
int Str_ManVectorAffinity(Gia_Man_t *p, Vec_Int_t *vSuper, Vec_Int_t *vDelay, word Matrix[256], int nLimit)
int Str_MuxRestruct_rec(Gia_Man_t *pNew, Str_Ntk_t *pNtk, Str_Mux_t *pTree, Str_Mux_t *pRoot, int Edge, Vec_Int_t *vDelay, int fVerbose)
void Gia_ManStop(Gia_Man_t *p)
int Str_MuxFindPath_rec(Str_Mux_t *pMux, int *pPath, int *pnLength)
static int Str_Delay2(int d0, int d1, int nLutSize)
void Tim_ManIncrementTravId(Tim_Man_t *p)
DECLARATIONS ///.
#define Gia_ManForEachCo(p, pObj, i)
static int Gia_ObjFaninC1(Gia_Obj_t *pObj)
void Str_MuxChangeOnce(Str_Mux_t *pTree, int *pPath, int i, int k, Str_Mux_t *pBackup, Gia_Man_t *pNew, Vec_Int_t *vDelay)
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
static void Str_ObjReadGroup(Str_Ntk_t *p, Str_Obj_t *pObj, int *pnGroups, int *pnMuxes)
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static void Gia_ManSuperCollect(Gia_Man_t *p, Gia_Obj_t *pObj)
static char * Vec_StrArray(Vec_Str_t *p)
static int Str_Delay3(int d0, int d1, int d2, int nLutSize)
#define Gia_ManForEachMuxId(p, i)
int Str_MuxRestructureArea(Gia_Man_t *pNew, Str_Ntk_t *pNtk, int iMux, int nMuxes, Vec_Int_t *vDelay, int nLutSize, int fVerbose)
static void Gia_ManSimplifyXor(Vec_Int_t *vSuper)
void Str_MuxInputsCollect_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vNodes)
static void Vec_WecFree(Vec_Wec_t *p)
static void Vec_StrPrintNum(Vec_Str_t *p, int Num)
static int Gia_ManAppendCi(Gia_Man_t *p)
int Abc_NamObjNumMax(Abc_Nam_t *p)
Gia_Man_t * Str_NtkToGia(Gia_Man_t *pGia, Str_Ntk_t *p)
void Gia_ManCleanMark0(Gia_Man_t *p)
static Vec_Int_t * Vec_WecPushLevel(Vec_Wec_t *p)
void Tim_ManSetCoArrival(Tim_Man_t *p, int iCo, float Delay)
static int Abc_Var2Lit(int Var, int fCompl)
Gia_Man_t * Gia_ManLutBalance(Gia_Man_t *p, int nLutSize, int fUseMuxes, int fRecursive, int fOptArea, int fVerbose)
static int Gia_ObjRefNumId(Gia_Man_t *p, int Id)
static void Str_PrintState(int *pCost, int *pSuper, word *pMatrix, int nSize)
#define Abc_NamManForEachObj(p, pStr, i)
MACRO DEFINITIONS ///.
static int Str_ObjDelay(Gia_Man_t *pNew, int iObj, int nLutSize, Vec_Int_t *vDelay)
static int Gia_ObjFaninId1p(Gia_Man_t *p, Gia_Obj_t *pObj)
static void Vec_StrClear(Vec_Str_t *p)
static int Gia_ObjRefNum(Gia_Man_t *p, Gia_Obj_t *pObj)
#define ABC_ALLOC(type, num)
Vec_Wec_t * Str_ManDeriveTrees(Gia_Man_t *p)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
int Abc_NamStrFindOrAdd(Abc_Nam_t *p, char *pStr, int *pfFound)
static Vec_Str_t * Vec_StrAlloc(int nCap)
static abctime Abc_Clock()
static int Abc_MaxInt(int a, int b)
static void Vec_StrPush(Vec_Str_t *p, char Entry)
static void Vec_IntSort(Vec_Int_t *p, int fReverse)
static Vec_Int_t * Vec_IntStartFull(int nSize)
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
static int Abc_LitNotCond(int Lit, int c)
static int Vec_WecSize(Vec_Wec_t *p)
Abc_Nam_t * Abc_NamStart(int nObjs, int nAveSize)
FUNCTION DEFINITIONS ///.
#define ABC_SWAP(Type, a, b)
Gia_Man_t * Gia_ManDupNoMuxes(Gia_Man_t *p)
int Str_MuxRestructure(Gia_Man_t *pNew, Str_Ntk_t *pNtk, int iMux, int nMuxes, Vec_Int_t *vDelay, int nLutSize, int fRecursive, int fOptArea, int fVerbose)
int Gia_ManHasDangling(Gia_Man_t *p)
int Str_MuxDelayEdge_rec(Str_Mux_t *pMux, int i)
#define Str_NtkManForEachObj(p, pObj)
int Str_MuxFindPathEdge_rec(Str_Mux_t *pMux, int i, int *pPath, int *pnLength)
Str_Ntk_t * Str_ManNormalize(Gia_Man_t *p)
static Gia_Obj_t * Gia_ObjChild1(Gia_Obj_t *pObj)
int nObjCount[STR_UNUSED]
static void Vec_IntGrow(Vec_Int_t *p, int nCapMin)
#define Gia_ManForEachCi(p, pObj, i)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static void Str_NtkDelete(Str_Ntk_t *p)
static Str_Ntk_t * Str_NtkCreate(int nObjsAlloc, int nFaninsAlloc)
static int Gia_ManAndNum(Gia_Man_t *p)
Str_Mux_t * Str_MuxFindBranching(Str_Mux_t *pRoot, int i)
static Vec_Int_t * Vec_IntStart(int nSize)
static int Abc_LitIsCompl(int Lit)
void Str_MuxStructCollect_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vNodes)
static int Gia_ObjIsMuxId(Gia_Man_t *p, int iObj)
static int Str_ObjFaninC(Str_Ntk_t *p, Str_Obj_t *pObj, int i)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
void Str_MuxStructDump(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Str_t *vStr)
static int Str_ObjCreate(Str_Ntk_t *p, int Type, int nFanins, int *pFanins)
FUNCTION DEFINITIONS ///.
static int Str_ManNum(Gia_Man_t *p, int iObj)
static int Str_MuxHasFanin(Str_Mux_t *pMux, int i)
void Str_MuxCreate(Str_Mux_t *pTree, Str_Ntk_t *pNtk, int iMux, int nMuxes, Vec_Int_t *vDelay, int nLutSize)
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
static void Vec_StrFree(Vec_Str_t *p)
void Str_MuxChangeUndo(Str_Mux_t *pTree, int *pPath, int i, int k, Str_Mux_t *pBackup)
Gia_Man_t * Gia_ManDupNormalize(Gia_Man_t *p)
int Str_MuxToGia_rec(Gia_Man_t *pNew, Str_Mux_t *pMux, int i, Vec_Int_t *vDelay)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static Str_Obj_t * Str_ObjFanin(Str_Ntk_t *p, Str_Obj_t *pObj, int i)
unsigned __int64 word
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_END
int Gia_ManHashMux(Gia_Man_t *p, int iCtrl, int iData1, int iData0)
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
void Gia_ManHashStart(Gia_Man_t *p)
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
Gia_Man_t * Gia_ManDupMuxes(Gia_Man_t *p, int Limit)
static int Str_ObjId(Str_Ntk_t *p, Str_Obj_t *pObj)
static int Gia_ObjIsXor(Gia_Obj_t *pObj)
#define Gia_ManForEachAnd(p, pObj, i)
static void Vec_IntSelectSortCost2(int *pArray, int nSize, int *pCosts)
int Gia_ManHashXorReal(Gia_Man_t *p, int iLit0, int iLit1)
Tim_Man_t * Tim_ManDup(Tim_Man_t *p, int fUnitDelay)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
static Str_Mux_t * Str_MuxFanin(Str_Mux_t *pMux, int i)
void Tim_ManStop(Tim_Man_t *p)
void Gia_ManFillValue(Gia_Man_t *p)
int Tim_ManBoxNum(Tim_Man_t *p)
void Gia_ManTransferTiming(Gia_Man_t *p, Gia_Man_t *pGia)
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
static int Vec_IntCap(Vec_Int_t *p)
static int Gia_ObjLitCopy(Gia_Man_t *p, int iLit)
Gia_Man_t * Gia_ManDupMuxesNoHash(Gia_Man_t *p)
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
int Str_ManMuxCountOne(char *p)
void Str_ManCheckOverlap(Gia_Man_t *p, Vec_Wec_t *vGroups)
static Gia_Obj_t * Gia_ObjFanin2(Gia_Man_t *p, Gia_Obj_t *pObj)
void Str_NtkBalanceMux(Gia_Man_t *pNew, Str_Ntk_t *p, Str_Obj_t *pObj, Vec_Int_t *vDelay, int nLutSize, int nGroups, int nMuxes, int fRecursive, int fOptArea, int fVerbose)
static int Gia_ObjIsTravIdCurrentId(Gia_Man_t *p, int Id)
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
#define STR_SUPER
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_START
static int Gia_ObjRefDec(Gia_Man_t *p, Gia_Obj_t *pObj)
static Vec_Int_t * Vec_WecEntry(Vec_Wec_t *p, int i)
void Str_MuxDelayPrint_rec(Str_Mux_t *pMux, int i)
static int Str_ObjFaninId(Str_Ntk_t *p, Str_Obj_t *pObj, int i)
int Gia_ObjIsMuxType(Gia_Obj_t *pNode)
void Tim_ManInitPiArrivalAll(Tim_Man_t *p, float Delay)
static int Vec_IntEntryLast(Vec_Int_t *p)
static int Abc_LitNot(int Lit)
Gia_Man_t * Str_NtkBalance(Gia_Man_t *pGia, Str_Ntk_t *p, int nLutSize, int fUseMuxes, int fRecursive, int fOptArea, int fVerbose)
static int Vec_IntSize(Vec_Int_t *p)
void Str_NtkBalanceMulti(Gia_Man_t *pNew, Str_Ntk_t *p, Str_Obj_t *pObj, Vec_Int_t *vDelay, int nLutSize)
static void Str_NtkPrintGroups(Str_Ntk_t *p)
static int Gia_IsComplement(Gia_Obj_t *p)
void Str_MuxInputsCollect(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vNodes)
static void Gia_ManSuperCollectAnd_rec(Gia_Man_t *p, Gia_Obj_t *pObj)
int Str_MuxTryOnce(Gia_Man_t *pNew, Str_Ntk_t *pNtk, Str_Mux_t *pTree, Str_Mux_t *pRoot, int Edge, Vec_Int_t *vDelay, int fVerbose)
static void Vec_IntShrink(Vec_Int_t *p, int nSizeNew)
Gia_Obj_t * Gia_ObjRecognizeMux(Gia_Obj_t *pNode, Gia_Obj_t **ppNodeT, Gia_Obj_t **ppNodeE)
int Gia_ManIsNormalized(Gia_Man_t *p)
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
static void Gia_ManSuperCollectXor_rec(Gia_Man_t *p, Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
static int Str_CountBits(word i)
#define ABC_CALLOC(type, num)
static int Abc_Lit2Var(int Lit)
Vec_Int_t * Str_ManCreateRoots(Vec_Wec_t *vGroups, int nObjs)
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
int Str_MuxRestructAreaThree(Gia_Man_t *pNew, Str_Mux_t *pMux, Vec_Int_t *vDelay, int fVerbose)
static int Gia_ObjFaninId2p(Gia_Man_t *p, Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Abc_Nam_t_ Abc_Nam_t
INCLUDES ///.
static Str_Obj_t * Str_NtkObj(Str_Ntk_t *p, int i)
static void Str_ManSetNum(Gia_Man_t *p, int iObj, int Num)
static void transpose64(word A[64])
static int Abc_LitRegular(int Lit)
static int * Vec_IntEntryP(Vec_Int_t *p, int i)
#define Vec_IntForEachEntryStartStop(vVec, Entry, i, Start, Stop)
static int Gia_ObjFaninId2(Gia_Man_t *p, int ObjId)
int Gia_ManHashMuxReal(Gia_Man_t *p, int iLitC, int iLit1, int iLit0)
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
void Str_MuxStructCollect(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vNodes)
static int Str_ObjFaninCopy(Str_Ntk_t *p, Str_Obj_t *pObj, int i)
#define Gia_ManForEachObj1(p, pObj, i)
void Gia_ManIncrementTravId(Gia_Man_t *p)
static int Gia_ObjFaninC0(Gia_Obj_t *pObj)
static void Vec_IntFree(Vec_Int_t *p)
static void Vec_IntClear(Vec_Int_t *p)
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
static void Gia_ObjSetTravIdCurrentId(Gia_Man_t *p, int Id)
Str_Ntk_t * Str_ManNormalizeInt(Gia_Man_t *p, Vec_Wec_t *vGroups, Vec_Int_t *vRoots)
char * Abc_UtilStrsav(char *s)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static int Gia_ObjFaninId1(Gia_Obj_t *pObj, int ObjId)
static int Gia_ObjIsMux(Gia_Man_t *p, Gia_Obj_t *pObj)
float Tim_ManGetCiArrival(Tim_Man_t *p, int iCi)
static int Gia_ManAppendXorReal(Gia_Man_t *p, int iLit0, int iLit1)
void Str_MuxTraverse_rec(Gia_Man_t *p, int i)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
int Str_MuxRestructArea_rec(Gia_Man_t *pNew, Str_Mux_t *pTree, Str_Mux_t *pRoot, int i, Vec_Int_t *vDelay, int fVerbose)
static int Gia_ObjCioId(Gia_Obj_t *pObj)
static int Gia_ManObjNum(Gia_Man_t *p)
static int Gia_ObjFaninId0(Gia_Obj_t *pObj, int ObjId)
void Gia_ManHashStop(Gia_Man_t *p)
static int Gia_ManCoNum(Gia_Man_t *p)
static int Gia_ManRegNum(Gia_Man_t *p)
static void Str_NtkPs(Str_Ntk_t *p, abctime clk)