61 for( i = 0; i < nSize; i++)
67 int Fill = fSigned ? pFanins[nFanins-1] : 0;
69 assert( nFanins <= nTotal );
70 for( i = 0; i <
nTotal; i++)
71 Vec_IntPush( vOut, i < nFanins ? pFanins[i] : Fill );
77 for ( i = 0; i < nNum; i++ )
80 else if ( pNum[i] != 0 )
108 int Fill = fSticky ? pNum[nNum-1] : 0;
109 int i, j, fShort = 0;
111 for( i = 0; i < nShift; i++ )
112 for( j = 0; j < nNum - fSticky; j++ )
114 if( fShort || j + (1<<i) >= nNum )
121 pRes[j] =
Gia_ManHashMux( pNew, pShift[i], pRes[j+(1<<i)], pRes[j] );
127 int Fill = fSticky ? pNum[0] : 0;
128 int i, j, fShort = 0;
130 for( i = 0; i < nShift; i++ )
131 for( j = nNum-1; j >= fSticky; j-- )
133 if( fShort || (1<<i) > j )
140 pRes[j] =
Gia_ManHashMux( pNew, pShift[i], pRes[j-(1<<i)], pRes[j] );
146 int i, j, * pTemp =
ABC_ALLOC(
int, nNum );
148 for( i = 0; i < nShift; i++, pRes =
Wlc_VecCopy(vRes, pTemp, nNum) )
149 for( j = 0; j < nNum; j++ )
150 pTemp[j] =
Gia_ManHashMux( pNew, pShift[i], pRes[(j+(1<<i))%nNum], pRes[j] );
156 int i, j, * pTemp =
ABC_ALLOC(
int, nNum );
158 for( i = 0; i < nShift; i++, pRes =
Wlc_VecCopy(vRes, pTemp, nNum) )
159 for( j = 0; j < nNum; j++ )
161 int move = (j >= (1<<i)) ? (j-(1<<i))%nNum : (nNum - (((1<<i)-j)%nNum)) % nNum;
162 pTemp[j] =
Gia_ManHashMux( pNew, pShift[i], pRes[move], pRes[j] );
172 for ( k = 0; k < nFans; k++ )
179 for ( k = 0; k < nFans; k++ )
186 for ( k = 0; k < nFans; k++ )
195 int k, iKnown = 0, iRes = 0;
196 for ( k = nBits - 1; k >= 0; k-- )
207 int iDiffSign =
Gia_ManHashXor( pNew, pArg0[nBits-1], pArg1[nBits-1] );
212 int iCarry = 0, iTerm1, iTerm2, iTerm3, iSum, b;
213 for ( b = 0; b < nBits; b++ )
225 int borrow = 0, top_bit, b;
226 for ( b = 0; b < nBits; b++ )
237 for ( i = 0; i < nNum; i++ )
247 for ( i = 0; i < nBits; i++ )
261 int i, j, known, borrow, y_bit, top_bit;
263 for ( j = nNum - 1; j >= 0; j-- )
266 for ( i = nNum - 1; i > nNum - 1 - j; i-- )
273 for ( i = nNum - 1; i >= 0; i-- )
277 y_bit = (i >= j) ? pDiv[i-j] : 0;
285 for ( i = 0; i < nNum; i++ )
288 y_bit = (i >= j) ? pDiv[i-j] : 0;
295 for( i = 0; i < nNum; i++ )
312 int k, iDiffSign =
Gia_ManHashXor( pNew, pNum[nNum-1], pDiv[nDiv-1] );
320 for ( k = 0; k < nNum; k++ )
327 for ( k = 0; k < nNum; k++ )
348 Vec_Int_t vLeaves = { nFans, nFans, pFans };
350 int o, i, m, iLit, nMints = (1 << nFans);
352 for ( o = 0; o < nOuts; o++ )
356 for ( m = 0; m < nMints; m++ )
357 for ( i = 0; i < nFans; i++ )
363 iLit =
Kit_TruthToGia( pNew, (
unsigned *)pTruth, nFans, vMemory, &vLeaves, 1 );
377 for ( i = 0; i < nExp; i++ )
384 pDegrees =
Wlc_VecCopy( vDegrees, pResTemp, nNum );
387 for ( k = 0; k < nNum; k++ )
409 Gia_Man_t * pTemp, * pNew, * pExtra = NULL;
411 Vec_Int_t * vBits, * vTemp0, * vTemp1, * vTemp2, * vRes;
413 int nRange, nRange0, nRange1, nRange2;
414 int i, k, b, iFanin, iLit, nAndPrev, * pFans0, * pFans1, * pFans2;
415 int nFFins = 0, nFFouts = 0, curPi = 0, curPo = 0;
416 int nBitCis = 0, nBitCos = 0;
431 int nNewCis = 0, nNewCos = 0;
451 pManTime =
Tim_ManStart( nBitCis + nNewCis, nBitCos + nNewCos );
472 if ( vBoxIds && pObj->
Mark )
479 curPo += nRange0 + nRange1;
482 for ( k = 0; k < nRange0; k++ )
484 for ( k = 0; k < nRange1; k++ )
488 for ( k =
Gia_ManPiNum(pExtra); k < nRange0 + nRange1; k++ )
492 for ( k = 0; k < nRange0; k++ )
495 for ( k = 0; k < nRange1; k++ )
509 for ( k = 0; k < nRange; k++ )
514 for ( k = 0; k < nRange; k++ )
519 for ( k = 0; k < nRange; k++ )
526 int nRangeMax =
Abc_MaxInt( nRange0, nRange );
528 for ( k = 0; k < nRange; k++ )
534 for ( k = 0; k < nRange; k++ )
540 for ( b = 0; b < nRange; b++ )
556 int nRangeMax =
Abc_MaxInt( nRange, nRange0 );
566 assert( nRange0 == nRange );
571 assert( nRange0 == nRange );
576 int nRangeMax =
Abc_MaxInt( nRange, nRange0 );
578 for ( k = 0; k < nRange; k++ )
586 for ( k = 0; k < nRange; k++ )
594 for ( k = 0; k < nRange; k++ )
602 for ( k = 0; k < nRange; k++ )
610 assert( nRange == End - Beg + 1 );
611 assert( (
int)pFanin->
Beg <= Beg && End <= (
int)pFanin->
End );
612 for ( k = Beg; k <= End; k++ )
620 assert( nRange == nTotal );
625 for ( b = 0; b < nRange0; b++ )
632 assert( nRange0 < nRange );
633 for ( k = 0; k < nRange0; k++ )
635 for ( ; k < nRange; k++ )
642 for ( k = 1; k < nRange; k++ )
650 for ( k = 1; k < nRange; k++ )
658 for ( k = 1; k < nRange; k++ )
663 int iLit = 0, nRangeMax =
Abc_MaxInt( nRange0, nRange1 );
666 for ( k = 0; k < nRangeMax; k++ )
669 for ( k = 1; k < nRange; k++ )
675 int nRangeMax =
Abc_MaxInt( nRange0, nRange1 );
681 if ( fSwap )
ABC_SWAP(
int *, pArg0, pArg1 );
688 for ( k = 1; k < nRange; k++ )
694 for ( k = 1; k < nRange; k++ )
731 int nRangeMax =
Abc_MaxInt( nRange0, nRange );
741 Wlc_BlastPower( pNew, pArg0, nRangeMax, pArg1, nRange1, vTemp2, vRes );
765 for ( k = 0; k < nRange; k++ )
775 assert( nFFins == nFFouts );
static int * Vec_IntArray(Vec_Int_t *p)
int Tim_ManCoNum(Tim_Man_t *p)
void Wlc_BlastPower(Gia_Man_t *pNew, int *pNum, int nNum, int *pExp, int nExp, Vec_Int_t *vTemp, Vec_Int_t *vRes)
#define Wlc_NtkForEachCo(p, pCo, i)
void Wlc_BlastDividerSigned(Gia_Man_t *pNew, int *pNum, int nNum, int *pDiv, int nDiv, int fQuo, Vec_Int_t *vRes)
void Wlc_BlastAdder(Gia_Man_t *pNew, int *pAdd0, int *pAdd1, int nBits)
static int Wlc_ObjId(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
char * Wlc_ObjName(Wlc_Ntk_t *p, int iObj)
static Wlc_Obj_t * Wlc_ObjFanin2(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
void Gia_ManStop(Gia_Man_t *p)
void Wlc_BlastTable(Gia_Man_t *pNew, word *pTable, int *pFans, int nFans, int nOuts, Vec_Int_t *vRes)
static int Wlc_ObjFaninId1(Wlc_Obj_t *p)
static int Gia_ManPoNum(Gia_Man_t *p)
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
#define Wlc_ObjForEachFanin(pObj, iFanin, i)
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Wlc_NtkObjNum(Wlc_Ntk_t *p)
ABC_NAMESPACE_IMPL_START int Wlc_NtkPrepareBits(Wlc_Ntk_t *p)
DECLARATIONS ///.
static Wlc_Obj_t * Wlc_NtkObj(Wlc_Ntk_t *p, int Id)
#define Wlc_NtkForEachObjVec(vVec, p, pObj, i)
static int Gia_ManAppendCi(Gia_Man_t *p)
void Wlc_BlastDivider(Gia_Man_t *pNew, int *pNum, int nNum, int *pDiv, int nDiv, int fQuo, Vec_Int_t *vRes)
static int Wlc_ObjRangeEnd(Wlc_Obj_t *p)
static Wlc_Obj_t * Wlc_ObjFanin0(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
#define ABC_ALLOC(type, num)
static void Vec_IntErase(Vec_Int_t *p)
void Wlc_BlastRotateLeft(Gia_Man_t *pNew, int *pNum, int nNum, int *pShift, int nShift, Vec_Int_t *vRes)
static void Abc_TtSetBit(word *p, int i)
void Gia_ManSetRegNum(Gia_Man_t *p, int nRegs)
void Wlc_BlastShiftRight(Gia_Man_t *pNew, int *pNum, int nNum, int *pShift, int nShift, int fSticky, Vec_Int_t *vRes)
void Wlc_BlastZeroCondition(Gia_Man_t *pNew, int *pDiv, int nDiv, Vec_Int_t *vRes)
int Wlc_BlastReduction(Gia_Man_t *pNew, int *pFans, int nFans, int Type)
int Wlc_BlastLessSigned(Gia_Man_t *pNew, int *pArg0, int *pArg1, int nBits)
static int Abc_TtGetBit(word *p, int i)
MACRO DEFINITIONS ///.
static int Abc_MaxInt(int a, int b)
static int Wlc_ObjRange(Wlc_Obj_t *p)
int * Wlc_VecLoadFanins(Vec_Int_t *vOut, int *pFanins, int nFanins, int nTotal, int fSigned)
static int Abc_LitNotCond(int Lit, int c)
static void Wlc_NtkCleanCopy(Wlc_Ntk_t *p)
int Wlc_BlastLess(Gia_Man_t *pNew, int *pArg0, int *pArg1, int nBits)
#define ABC_SWAP(Type, a, b)
static word * Wlc_ObjTable(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
int Wlc_BlastGetConst(int *pNum, int nNum)
void Tim_ManCreateBox(Tim_Man_t *p, int firstIn, int nIns, int firstOut, int nOuts, int iDelayTable)
ITERATORS ///.
static int Wlc_ObjFaninId0(Wlc_Obj_t *p)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
#define Wlc_ObjForEachFaninReverse(pObj, iFanin, i)
static int Gia_ManAndNum(Gia_Man_t *p)
void Wlc_BlastMultiplier(Gia_Man_t *pNew, int *pArg0, int *pArg1, int nBits, Vec_Int_t *vTemp, Vec_Int_t *vRes)
static void Wlc_ObjSetCopy(Wlc_Ntk_t *p, int iObj, int i)
void Wlc_BlastRotateRight(Gia_Man_t *pNew, int *pNum, int nNum, int *pShift, int nShift, Vec_Int_t *vRes)
static Gia_Obj_t * Gia_ManPi(Gia_Man_t *p, int v)
#define Wlc_NtkForEachCi(p, pCi, i)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Wlc_ObjFaninNum(Wlc_Obj_t *p)
Gia_Man_t * Gia_ManDupNormalize(Gia_Man_t *p)
static int Vec_IntEntry(Vec_Int_t *p, int i)
unsigned __int64 word
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_END
int Tim_ManCiNum(Tim_Man_t *p)
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)
static word Abc_Tt6Stretch(word t, int nVars)
static int Wlc_ObjIsCi(Wlc_Obj_t *p)
void Wlc_BlastSubtract(Gia_Man_t *pNew, int *pAdd0, int *pAdd1, int nBits)
Gia_Man_t * Gia_ManStart(int nObjsMax)
DECLARATIONS ///.
int Wlc_NtkMuxTree_rec(Gia_Man_t *pNew, int *pCtrl, int nCtrl, Vec_Int_t *vData, int Shift)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Tim_Man_t * Tim_ManStart(int nCis, int nCos)
DECLARATIONS ///.
int nAnds[WLC_OBJ_NUMBER]
void Gia_ManTransferTiming(Gia_Man_t *p, Gia_Man_t *pGia)
#define Wlc_NtkForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
void Wlc_BlastMinus(Gia_Man_t *pNew, int *pNum, int nNum, Vec_Int_t *vRes)
static int Wlc_ObjRangeBeg(Wlc_Obj_t *p)
ABC_NAMESPACE_IMPL_START int Kit_TruthToGia(Gia_Man_t *pMan, unsigned *pTruth, int nVars, Vec_Int_t *vMemory, Vec_Int_t *vLeaves, int fHash)
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_START
Gia_Man_t * Wlc_NtkBitBlast(Wlc_Ntk_t *p, Vec_Int_t *vBoxIds)
static int Gia_ManCiNum(Gia_Man_t *p)
static int Wlc_ObjCopy(Wlc_Ntk_t *p, int iObj)
static int Abc_LitNot(int Lit)
static int Vec_IntSize(Vec_Int_t *p)
static int Abc_TtWordNum(int nVars)
void Wlc_BlastShiftLeft(Gia_Man_t *pNew, int *pNum, int nNum, int *pShift, int nShift, int fSticky, Vec_Int_t *vRes)
static void Vec_IntShrink(Vec_Int_t *p, int nSizeNew)
static int * Wlc_ObjFanins(Wlc_Obj_t *p)
static Wlc_Obj_t * Wlc_ObjFanin1(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
static int * Vec_IntEntryP(Vec_Int_t *p, int i)
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
void Gia_ManHashAlloc(Gia_Man_t *p)
static void Vec_IntFree(Vec_Int_t *p)
static int Gia_ManPiNum(Gia_Man_t *p)
static int Wlc_ObjFaninId2(Wlc_Obj_t *p)
static int Wlc_ObjIsSignedFanin01(Wlc_Ntk_t *p, Wlc_Obj_t *pObj)
static void Vec_IntClear(Vec_Int_t *p)
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
char * Abc_UtilStrsav(char *s)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
int Gia_ManHashOr(Gia_Man_t *p, int iLit0, int iLit1)
int * Wlc_VecCopy(Vec_Int_t *vOut, int *pArray, int nSize)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
static int Gia_Obj2Lit(Gia_Man_t *p, Gia_Obj_t *pObj)
int nTotal
DECLARATIONS ///.
static int Gia_ManCoNum(Gia_Man_t *p)