29 #ifdef ABC_USE_PTHREADS
32 #include "../lib/pthread.h"
131 #define If_DsdVecForEachObj( vVec, pObj, i ) \
132 Vec_PtrForEachEntry( If_DsdObj_t *, vVec, pObj, i )
133 #define If_DsdVecForEachObjStart( vVec, pObj, i, Start ) \
134 Vec_PtrForEachEntryStart( If_DsdObj_t *, vVec, pObj, i, Start )
135 #define If_DsdVecForEachObjVec( vNodes, vVec, pObj, i ) \
136 for ( i = 0; (i < Vec_IntSize(vNodes)) && ((pObj) = If_DsdVecObj(vVec, Vec_IntEntry(vNodes,i))); i++ )
137 #define If_DsdVecForEachNode( vVec, pObj, i ) \
138 Vec_PtrForEachEntryStart( If_DsdObj_t *, vVec, pObj, i, 2 )
139 #define If_DsdObjForEachFanin( vVec, pObj, pFanin, i ) \
140 for ( i = 0; (i < If_DsdObjFaninNum(pObj)) && ((pFanin) = If_DsdObjFanin(vVec, pObj, i)); i++ )
141 #define If_DsdObjForEachFaninLit( vVec, pObj, iLit, i ) \
142 for ( i = 0; (i < If_DsdObjFaninNum(pObj)) && ((iLit) = If_DsdObjFaninLit(pObj, i)); i++ )
222 if ( pTtElems[0] == NULL )
226 pTtElems[v] = TtElems[v];
253 sprintf( pFileName,
"%02d.dsd", nVars );
270 for ( v = 3; v <= nVars; v++ )
282 for ( v = 2; v < nVars; v++ )
294 if ( p->
vIsops[3] != NULL )
297 printf(
"Warning: DSD manager is already started without ISOPs.\n" );
298 for ( v = 3; v <= nLutSize; v++ )
310 vLevel->nCap ^= (1<<16);
325 for ( v = 3; v <= p->
nVars; v++ )
327 sprintf( FileName,
"dumpdsd%02d", v );
331 for ( v = 2; v < p->
nVars; v++ )
333 for ( v = 3; v <= p->
nVars; v++ )
358 char * pFileName =
"tts_nondsd.txt";
361 FILE * pFile = fopen( pFileName,
"wb" );
365 printf(
"Cannot open file \"%s\".\n", pFileName );
368 for ( v = 3; v <= p->
nVars; v++ )
380 fprintf( pFile,
"0x" );
382 fprintf( pFile,
"\n" );
393 char * pFileName =
"tts_all.txt";
396 FILE * pFile = fopen( pFileName,
"wb" );
399 printf(
"Cannot open file \"%s\".\n", pFileName );
407 fprintf( pFile,
"0x" );
409 fprintf( pFile,
"\n" );
441 for ( i = 0; i < p->
nBins; i++ )
471 char OpenType[7] = {0, 0, 0,
'(',
'[',
'<',
'{'};
472 char CloseType[7] = {0, 0, 0,
')',
']',
'>',
'}'};
478 { fprintf( pFile,
"0" );
return; }
481 int iPermLit = pPermLits ? (int)pPermLits[(*pnSupp)++] :
Abc_Var2Lit((*pnSupp)++, 0);
495 fprintf( pFile,
"%6d : ", iObjId );
501 fprintf( pFile,
"\n" );
504 #define DSD_ARRAY_LIMIT 16
508 int i, k, v, nSuppSize, nDecMax = 0;
514 for ( v = 3; v <= p->
nVars; v++ )
530 pCountsAll[nSuppSize]++;
545 fprintf( pFile,
" N : " );
546 fprintf( pFile,
" Total " );
548 fprintf( pFile,
"%6d", k );
549 fprintf( pFile,
" " );
550 fprintf( pFile,
" More" );
551 fprintf( pFile,
" Ave" );
552 fprintf( pFile,
" Max" );
553 fprintf( pFile,
"\n" );
555 for ( i = 0; i <= p->
nVars; i++ )
557 fprintf( pFile,
"%2d : ", i );
558 fprintf( pFile,
"%6d ", pCountsAll[i] );
561 fprintf( pFile,
"%6.1f", 100.0*pCounts[i][k]/
Abc_MaxInt(1,pCountsAll[i]) );
562 fprintf( pFile,
" " );
564 fprintf( pFile,
"%6.1f", 100.0*pCounts[i][k]/
Abc_MaxInt(1,pCountsAll[i]) );
565 fprintf( pFile,
" " );
566 fprintf( pFile,
"%6.1f", 1.0*pCountsSSizes[i]/
Abc_MaxInt(1,pCountsAll[i]) );
567 fprintf( pFile,
" " );
568 fprintf( pFile,
"%6d", pDecMax[i] );
569 fprintf( pFile,
"\n" );
577 int nOccurs, nOccursMax, nOccursAll;
578 int i, k, nSizeMax,
Counter = 0;
580 nOccursMax = nOccursAll = 0;
583 nOccurs = pObj->
Count;
584 nOccursAll += nOccurs;
585 nOccursMax =
Abc_MaxInt( nOccursMax, nOccurs );
593 nOccurs = pObj->
Count;
596 else if ( nOccurs < 100 )
598 else if ( nOccurs < 1000 )
600 else if ( nOccurs < 10000 )
602 else if ( nOccurs < 100000 )
604 else if ( nOccurs < 1000000 )
606 else if ( nOccurs < 10000000 )
609 fprintf( pFile,
"The distribution of object occurrences:\n" );
610 for ( k = 0; k < nSizeMax; k++ )
615 fprintf( pFile,
"%15d : ", k );
618 sprintf( Buffer,
"%d - %d", (
int)pow((
double)10, k/10) * (k%10), (
int)pow((
double)10, k/10) * (k%10+1) - 1 );
619 fprintf( pFile,
"%15s : ", Buffer );
624 fprintf( pFile,
"\n" );
627 fprintf( pFile,
"Fanins: Max = %d. Ave = %.2f.\n", nOccursMax, 1.0*nOccursAll/
Vec_PtrSize(&p->
vObjs) );
639 for ( i = 3; i <= p->
nVars; i++ )
655 printf(
"***** DSD MANAGER STATISTICS *****\n" );
656 printf(
"Support " );
658 printf(
"ObjNDSD " );
659 printf(
"NPNNDSD " );
661 printf(
"StrNDSD " );
664 for ( i = 0; i <= p->
nVars + 1; i++ )
666 if ( i == p->
nVars + 1 )
669 printf(
"%3d : ", i );
670 printf(
"%9d ", CountObj[i] );
671 printf(
"%9d ", CountObjNon[i] );
672 printf(
"%6.2f %% ", 100.0 * CountObjNon[i] /
Abc_MaxInt(1, CountObj[i]) );
673 printf(
"%9d ", CountObjNpn[i] );
674 printf(
"%6.2f %% ", 100.0 * CountObjNpn[i] /
Abc_MaxInt(1, CountObj[i]) );
676 printf(
"%9d ", CountStr[i] );
677 printf(
"%9d ", CountStrNon[i] );
678 printf(
"%6.2f %% ", 100.0 * CountStrNon[i] /
Abc_MaxInt(1, CountStr[i]) );
679 printf(
"%9d ", CountMarked[i] );
680 printf(
"%6.2f %%", 100.0 * CountMarked[i] /
Abc_MaxInt(1, CountStr[i]) );
688 int CountUsed = 0, CountNonDsd = 0, CountNonDsdStr = 0, CountMarked = 0, CountPrime = 0;
689 int i, v, *
pPerm, DsdMax = 0, MemSizeTTs = 0, MemSizeDecs = 0;
691 pFile = pFileName ? fopen( pFileName,
"wb" ) : stdout;
692 if ( pFileName && pFile == NULL )
694 printf(
"cannot open output file\n" );
699 fprintf( pFile,
"***** NOTATIONS USED BELOW *****\n" );
700 fprintf( pFile,
"Support -- the support size\n" );
701 fprintf( pFile,
"Obj -- the number of nodes in the DSD manager for each support size\n" );
702 fprintf( pFile,
" (the constant node and the primary input node have no support)\n" );
703 fprintf( pFile,
"ObjNDSD -- the number of prime nodes (that is, nodes whose function has no DSD)\n" );
704 fprintf( pFile,
" (percentage is relative to the number of all nodes of that size)\n" );
705 fprintf( pFile,
"NPNNDSD -- the number of different NPN classes of prime nodes\n" );
706 fprintf( pFile,
" (Each NPN class may appear more than once. For example: F1 = 17(ab(cd))\n" );
707 fprintf( pFile,
" and F2 = 17(ab[cd]) both have prime majority node (hex TT is 17),\n" );
708 fprintf( pFile,
" but in one case the majority node is fed by AND, and in another by XOR.\n" );
709 fprintf( pFile,
" These two majority nodes are different nodes in the DSD manager\n" );
710 fprintf( pFile,
"Str -- the number of structures for each support size\n" );
711 fprintf( pFile,
" (each structure is composed of one or more nodes)\n" );
712 fprintf( pFile,
"StrNDSD -- the number of DSD structures containing at least one prime node\n" );
713 fprintf( pFile,
"Marked -- the number of DSD structures matchable with the LUT structure (say, \"44\")\n" );
724 for ( v = 3; v <= p->
nVars; v++ )
731 printf(
"Number of inputs = %d. LUT size = %d. Marks = %s. NewAsUseless = %s. Bookmark = %d.\n",
734 printf(
"Symbolic cell description: %s\n", p->
pCellStr );
737 fprintf( pFile,
"Unique table misses = %8d\n", p->
nUniqueMisses );
738 fprintf( pFile,
"Unique table hits = %8d\n", p->
nUniqueHits );
740 fprintf( pFile,
"Memory used for functions = %8.2f MB.\n", 8.0*(MemSizeTTs+
sizeof(
int)*
Vec_IntCap(&p->
vTruths))/(1<<20) );
741 fprintf( pFile,
"Memory used for hash table = %8.2f MB.\n", 1.0*
sizeof(
int)*(p->
nBins+
Vec_IntCap(&p->
vNexts))/(1<<20) );
742 fprintf( pFile,
"Memory used for bound sets = %8.2f MB.\n", 1.0*MemSizeDecs/(1<<20) );
743 fprintf( pFile,
"Memory used for array = %8.2f MB.\n", 1.0*
sizeof(
void *)*
Vec_PtrCap(&p->
vObjs)/(1<<20) );
745 fprintf( pFile,
"Memory used for AIG = %8.2f MB.\n", 8.0*
Gia_ManAndNum(p->
pTtGia)/(1<<20) );
768 if ( Number && i % Number )
780 printf(
"%2d : ", i+1 );
865 for ( i = 0; i < nLits-1; i++ )
868 for ( j = i+1; j < nLits; j++ )
873 ABC_SWAP(
int, pLits[i], pLits[best_i] );
875 ABC_SWAP(
int, pPerm[i], pPerm[best_i] );
892 static int s_Primes[24] = { 1049, 1297, 1559, 1823, 2089, 2371, 2663, 2909,
893 3221, 3517, 3779, 4073, 4363, 4663, 4973, 5281,
894 5573, 5861, 6199, 6481, 6803, 7109, 7477, 7727 };
896 unsigned uHash = Type * 7873 + nLits * 8147;
897 for ( i = 0; i < nLits; i++ )
898 uHash += pLits[i] * s_Primes[i & 0xF];
900 uHash += truthId * s_Primes[i & 0xF];
901 return uHash % p->
nBins;
952 for ( i = 0; i < nLits; i++ )
966 for ( i = 0; i < nLits; i++ )
968 pObj->
pFans[i] = pLits[i];
1001 vLevel->nCap ^= (1<<16);
1036 char * pBuffer =
"dsd0";
1039 FILE * pFile = fopen( pFileName ? pFileName : p->
pStore,
"wb" );
1040 if ( pFile == NULL )
1042 printf(
"Writing DSD manager file \"%s\" has failed.\n", pFileName ? pFileName : p->
pStore );
1045 fwrite( pBuffer, 4, 1, pFile );
1047 fwrite( &Num, 4, 1, pFile );
1049 fwrite( &Num, 4, 1, pFile );
1051 fwrite( &Num, 4, 1, pFile );
1055 fwrite( &Num, 4, 1, pFile );
1056 fwrite( pObj,
sizeof(
word)*Num, 1, pFile );
1060 for ( v = 3; v <= p->
nVars; v++ )
1064 fwrite( &Num, 4, 1, pFile );
1066 fwrite( pTruth, nBytes, 1, pFile );
1068 fwrite( &Num, 4, 1, pFile );
1072 fwrite( &Num, 4, 1, pFile );
1073 fwrite(
Vec_IntArray(vSets),
sizeof(
int)*Num, 1, pFile );
1077 fwrite( &Num, 4, 1, pFile );
1081 fwrite( &Num, 4, 1, pFile );
1083 fwrite( p->
pCellStr,
sizeof(
char)*Num, 1, pFile );
1094 int i, v, Num, Num2, RetValue;
1095 FILE * pFile = fopen( pFileName,
"rb" );
1096 if ( pFile == NULL )
1098 printf(
"Reading DSD manager file \"%s\" has failed.\n", pFileName );
1101 RetValue = fread( pBuffer, 4, 1, pFile );
1102 if ( pBuffer[0] !=
'd' && pBuffer[1] !=
's' && pBuffer[2] !=
'd' && pBuffer[3] !=
'0' )
1104 printf(
"Unrecognized format of file \"%s\".\n", pFileName );
1107 RetValue = fread( &Num, 4, 1, pFile );
1111 RetValue = fread( &Num, 4, 1, pFile );
1114 RetValue = fread( &Num, 4, 1, pFile );
1124 RetValue = fread( &Num, 4, 1, pFile );
1126 RetValue = fread( pObj,
sizeof(
word)*Num, 1, pFile );
1130 RetValue = fread( &Num, 4, 1, pFile );
1140 for ( v = 3; v <= p->
nVars; v++ )
1143 RetValue = fread( &Num, 4, 1, pFile );
1144 for ( i = 0; i < Num; i++ )
1146 RetValue = fread( pTruth, nBytes, 1, pFile );
1150 RetValue = fread( &Num2, 4, 1, pFile );
1151 for ( i = 0; i < Num2; i++ )
1153 RetValue = fread( &Num, 4, 1, pFile );
1155 RetValue = fread(
Vec_IntArray(vSets),
sizeof(
int)*Num, 1, pFile );
1162 RetValue = fread( &Num, 4, 1, pFile );
1163 if ( RetValue && Num )
1168 RetValue = fread( &Num, 4, 1, pFile );
1169 if ( RetValue && Num )
1172 RetValue = fread( p->
pCellStr,
sizeof(
char)*Num, 1, pFile );
1182 int i, k, iFanin, Id;
1185 printf(
"The number of variables should be the same or smaller.\n" );
1190 printf(
"LUT size should be the same.\n" );
1194 printf(
"Warning! Old manager has %smarks while new manager has %smarks.\n",
1273 if ( (
int)pObj->
Count >= Limit )
1292 int i, iFanin, iFirst;
1332 int iPermLit = pPermLits ? (int)pPermLits[*pnSupp] :
Abc_Var2Lit(*pnSupp, 0);
1384 else if ( iDsd == 1 )
1388 int iPermLit = pPermLits ? (int)pPermLits[nSupp] :
Abc_Var2Lit(nSupp, 0);
1441 pPerm[0] = (
unsigned char)
Abc_LitNot((
int)pPerm[0]);
1486 for ( i = 0; i < nLits; i++ )
1488 pFirsts[i] = nSSize;
1502 int i, k, j, Id, iFanin, fCompl = 0, nSSize = 0;
1505 for ( k = 0; k < nLits; k++ )
1518 pChildren[nChildren] = iFanin;
1533 for ( j = i = 0; i < nChildren; i++ )
1534 for ( k = (pBegEnd[i] >> 16); k < (pBegEnd[i] & 0xFF); k++ )
1535 pPermNew[j++] = pPerm[k];
1537 for ( j = 0; j < nSSize; j++ )
1538 pPerm[j] = pPermNew[j];
1544 for ( k = 0; k < nLits; k++ )
1548 pPermStart += pFanin->
nSupp;
1551 if ( RetValue == 1 || (RetValue == 0 &&
Abc_LitIsCompl(pLits[0])) )
1557 ABC_SWAP(
int, pLits[1], pLits[2] );
1558 for ( j = k = 0; k < nSupp0; k++ )
1559 pPermNew[j++] = pPerm[k];
1560 for ( k = 0; k < nSupp2; k++ )
1561 pPermNew[j++] = pPerm[nSupp0 + nSupp1 + k];
1562 for ( k = 0; k < nSupp1; k++ )
1563 pPermNew[j++] = pPerm[nSupp0 + k];
1564 for ( j = 0; j < nSupp0 + nSupp1 + nSupp2; j++ )
1565 pPerm[j] = pPermNew[j];
1574 for ( k = 0; k < nLits; k++ )
1578 pPermStart += pFanin->
nSupp;
1586 fCompl = ((uCanonPhase >> nLits) & 1);
1588 for ( j = i = 0; i < nLits; i++ )
1590 int iLitNew =
Abc_LitNotCond( pLits[(
int)pCanonPerm[i]], ((uCanonPhase>>i)&1) );
1592 pPermStart = pPerm + pFirsts[(int)pCanonPerm[i]];
1594 for ( k = 0; k < (int)pFanin->
nSupp; k++ )
1595 pPermNew[j++] = pPermStart[k];
1598 for ( j = 0; j < nSSize; j++ )
1599 pPerm[j] = pPermNew[j];
1623 for ( i = 0; pDsd[i]; i++ )
1626 if ( pDsd[i] ==
'(' || pDsd[i] ==
'[' || pDsd[i] ==
'<' || pDsd[i] ==
'{' )
1627 pNested[nNested++] = i;
1628 else if ( pDsd[i] ==
')' || pDsd[i] ==
']' || pDsd[i] ==
'>' || pDsd[i] ==
'}' )
1629 pMatches[pNested[--nNested]] = i;
1636 unsigned char * pPermStart = pPerm + *pnSupp;
1637 int iRes = -1, fCompl = 0;
1643 if ( **p >=
'a' && **p <=
'z' )
1645 pPerm[(*pnSupp)++] =
Abc_Var2Lit( **p -
'a', fCompl );
1648 if ( **p ==
'(' || **p ==
'[' || **p ==
'<' || **p ==
'{' )
1651 char * q = pStr + pMatches[ *p - pStr ];
1654 else if ( **p ==
'[' )
1656 else if ( **p ==
'<' )
1658 else if ( **p ==
'{' )
1661 assert( *q == **p + 1 + (**p !=
'(') );
1662 for ( (*p)++; *p < q; (*p)++ )
1668 if ( (**p >=
'A' && **p <=
'F') || (**p >=
'0' && **p <=
'9') )
1675 q = pStr + pMatches[ *p - pStr ];
1676 assert( **p ==
'{' && *q ==
'}' );
1677 for ( i = 0, (*p)++; *p < q; (*p)++, i++ )
1689 int iRes = -1, fCompl = 0;
1724 unsigned uSign = 0;
int i;
1727 return (1 << (2*(*pnSupp)++));
1736 return fShared ? (uSign << 1) | uSign : uSign;
1748 int i[6], LimitOut, SizeIn, SizeOut, pSSizes[
DAU_MAX_VAR];
1754 LimitOut = LutSize - (nSuppAll - pObj->
nSupp + 1);
1755 assert( LimitOut < LutSize );
1756 for ( i[0] = 0; i[0] < nFans; i[0]++ )
1757 for ( i[1] = i[0]+1; i[1] < nFans; i[1]++ )
1759 SizeIn = pSSizes[i[0]] + pSSizes[i[1]];
1760 SizeOut = pObj->
nSupp - SizeIn;
1761 if ( SizeIn > LutSize || SizeOut > LimitOut )
1766 uRes =
If_DsdSign(p, pObj, i[0], iFirst + pFirsts[i[0]], 0) |
1767 If_DsdSign(p, pObj, i[1], iFirst + pFirsts[i[1]], 0);
1768 if ( uRes & uMaskNot )
1772 if ( pObj->
nFans == 3 )
1774 for ( i[0] = 0; i[0] < nFans; i[0]++ )
1775 for ( i[1] = i[0]+1; i[1] < nFans; i[1]++ )
1776 for ( i[2] = i[1]+1; i[2] < nFans; i[2]++ )
1778 SizeIn = pSSizes[i[0]] + pSSizes[i[1]] + pSSizes[i[2]];
1779 SizeOut = pObj->
nSupp - SizeIn;
1780 if ( SizeIn > LutSize || SizeOut > LimitOut )
1785 uRes =
If_DsdSign(p, pObj, i[0], iFirst + pFirsts[i[0]], 0) |
1786 If_DsdSign(p, pObj, i[1], iFirst + pFirsts[i[1]], 0) |
1787 If_DsdSign(p, pObj, i[2], iFirst + pFirsts[i[2]], 0);
1788 if ( uRes & uMaskNot )
1792 if ( pObj->
nFans == 4 )
1794 for ( i[0] = 0; i[0] < nFans; i[0]++ )
1795 for ( i[1] = i[0]+1; i[1] < nFans; i[1]++ )
1796 for ( i[2] = i[1]+1; i[2] < nFans; i[2]++ )
1797 for ( i[3] = i[2]+1; i[3] < nFans; i[3]++ )
1799 SizeIn = pSSizes[i[0]] + pSSizes[i[1]] + pSSizes[i[2]] + pSSizes[i[3]];
1800 SizeOut = pObj->
nSupp - SizeIn;
1801 if ( SizeIn > LutSize || SizeOut > LimitOut )
1806 uRes =
If_DsdSign(p, pObj, i[0], iFirst + pFirsts[i[0]], 0) |
1807 If_DsdSign(p, pObj, i[1], iFirst + pFirsts[i[1]], 0) |
1808 If_DsdSign(p, pObj, i[2], iFirst + pFirsts[i[2]], 0) |
1809 If_DsdSign(p, pObj, i[3], iFirst + pFirsts[i[3]], 0);
1810 if ( uRes & uMaskNot )
1825 assert( LimitOut < LutSize );
1827 SizeIn = pSSizes[0] + pSSizes[1];
1828 SizeOut = pSSizes[0] + pSSizes[2] + 1;
1829 if ( SizeIn <= LutSize && SizeOut <= LimitOut )
1834 uRes =
If_DsdSign(p, pObj, 0, iFirst + pFirsts[0], 1) |
If_DsdSign(p, pObj, 1, iFirst + pFirsts[1], 0);
1835 if ( (uRes & uMaskNot) == 0 )
1839 SizeIn = pSSizes[0] + pSSizes[2];
1840 SizeOut = pSSizes[0] + pSSizes[1] + 1;
1841 if ( SizeIn <= LutSize && SizeOut <= LimitOut )
1846 uRes =
If_DsdSign(p, pObj, 0, iFirst + pFirsts[0], 1) |
If_DsdSign(p, pObj, 2, iFirst + pFirsts[2], 0);
1847 if ( (uRes & uMaskNot) == 0 )
1867 assert( LimitOut < LutSize );
1870 SizeIn = SizeOut = 0;
1871 for ( v = 0; v < nFans; v++ )
1873 int Value = ((set >> (v << 1)) & 3);
1875 SizeOut += pSSizes[v];
1876 else if ( Value == 1 )
1877 SizeIn += pSSizes[v];
1878 else if ( Value == 3 )
1880 SizeIn += pSSizes[v];
1881 SizeOut += pSSizes[v];
1884 if ( SizeIn > LutSize || SizeOut > LimitOut )
1893 for ( v = 0; v < nFans; v++ )
1895 int Value = ((set >> (v << 1)) & 3);
1898 else if ( Value == 1 )
1899 uRes |=
If_DsdSign(p, pObj, v, iFirst + pFirsts[v], 0);
1900 else if ( Value == 3 )
1901 uRes |=
If_DsdSign(p, pObj, v, iFirst + pFirsts[v], 1);
1904 if ( uRes & uMaskNot )
1914 int i, Mask, iFirst;
1922 printf(
" Trivial\n" );
1930 printf(
" Dec using node " );
1935 if ( uRes & uMaskNot )
1949 printf(
" Using multi-input AND/XOR node\n" );
1963 printf(
" Using multi-input MUX node\n" );
1977 printf(
" Using prime node\n" );
1982 printf(
" UNDEC\n" );
1989 if ( uSet == 0 && fHighEffort )
2036 int iDsd, nSizeNonDec, nSupp = 0;
2044 if ( nSizeNonDec > 0 )
2046 memset( pPerm, 0xFF, nLeaves );
2050 assert( nSupp == nLeaves );
2059 printf(
"Verification failed!\n" );
2060 printf(
"%s\n", pDsd );
2109 int iCutVar =
Abc_Lit2Var(pPermLits[(*pnSupp)++]);
2111 return pTimes[iCutVar];
2115 word pFaninRes[3], Res0, Res1;
2116 int i, iFanin, Delays[3];
2137 int i, iFanin, Delay, Result = 0;
2189 assert( iVar >= 0 && iVar < nVars );
2190 for ( i = 0; i < nVars; i++ )
2217 return pTimes[iCutVar];
2221 int i, iFanin, Delays[3], pFaninLits[3];
2225 if ( Delays[i] == -1 )
2230 *piLit =
If_LogCreateMux( vAig, pFaninLits[0], pFaninLits[1], pFaninLits[2], nSuppAll );
2244 if ( Delays[i] == -1 )
2252 int i, iFanin, Delay, Result = 0;
2262 Result =
If_LogCounterAddAig( pCounter, &nCounter, pFaninLits, Delay, pFaninLits[i], vAig, nSuppAll, fXor, fXorFunc );
2270 *pArea += (pObj->
nFans - 1) * (1 + 2 * fXor);
2276 int nSupp = 0, iLit = 0;
2281 assert( nSupp == nSuppAll );
2316 int Delay, Area = 0;
2326 int iMax = 0, nCountMax = 1;
2328 if ( pTimes[i] > pTimes[iMax] )
2329 iMax = i, nCountMax = 1;
2330 else if ( pTimes[i] == pTimes[iMax] )
2337 Delay = pTimes[iMax] + 2;
2354 printf(
"%3d ", pTimes[
Abc_Lit2Var(pPermLits[i])] );
2357 printf(
"-> %3d ", Delay );
2383 int i, Value, nVars;
2385 if ( !fAdd || !LutSize )
2397 if ( nVars <= LutSize )
2399 if ( fAdd && !pObj->
fMark )
2437 int fVeryVerbose = 0;
2440 word * pTruth, Perm;
2441 int i, nVars, Value, LutSize;
2456 printf(
"Warning: The support of DSD manager (%d) is less than the support of the structure (%d).\n",
If_DsdManVarNum(p),
Ifn_NtkInputNum(pNtk) );
2461 printf(
"Considering programmable cell: " );
2463 printf(
"Largest LUT size = %d.\n", LutSize );
2478 if ( (i & 0xFF) == 0 )
2481 if ( nVars <= LutSize )
2487 printf(
"%6d : %2d ", i, nVars );
2488 Value =
Ifn_NtkMatch( pNtk, pTruth, nVars, nConfls, fVerbose, fVeryVerbose, &Perm );
2518 #ifndef ABC_USE_PTHREADS
2523 #else // pthreads are used
2526 #define PAR_THR_MAX 100
2527 typedef struct Ifn_ThData_t_
2539 void * Ifn_WorkerThread(
void * pArg )
2541 Ifn_ThData_t * pThData = (Ifn_ThData_t *)pArg;
2542 volatile int * pPlace = &pThData->Status;
2546 while ( *pPlace == 0 );
2547 assert( pThData->Status == 1 );
2548 if ( pThData->Id == -1 )
2550 pthread_exit( NULL );
2555 pThData->Result =
Ifn_NtkMatch( pThData->pNtk, pThData->pTruth, pThData->nVars, pThData->nConfls, 0, 0, &pThData->Perm );
2557 pThData->Status = 0;
2565 int fVeryVerbose = 0;
2567 int i, k, nVars, LutSize;
2576 if ( nProcs > PAR_THR_MAX )
2578 printf(
"The number of processes (%d) exceeds the precompiled limit (%d).\n", nProcs, PAR_THR_MAX );
2594 printf(
"Warning: The support of DSD manager (%d) is less than the support of the structure (%d).\n",
If_DsdManVarNum(p),
Ifn_NtkInputNum(pNtk) );
2599 printf(
"Considering programmable cell: " );
2601 printf(
"Largest LUT size = %d.\n", LutSize );
2608 if ( i >= p->nObjsPrev )
2610 if ( p->vPerms == NULL )
2618 pthread_t WorkerThread[PAR_THR_MAX];
2619 Ifn_ThData_t ThData[PAR_THR_MAX];
2621 int status, fRunning = 1, iCurrentObj = p->
nObjsPrev;
2623 for ( i = 0; i < nProcs; i++ )
2626 ThData[i].nVars = -1;
2628 ThData[i].nConfls = nConfls;
2629 ThData[i].Result = -1;
2630 ThData[i].Status = 0;
2631 ThData[i].clkUsed = 0;
2632 status = pthread_create( WorkerThread + i, NULL, Ifn_WorkerThread, (
void *)(ThData + i) );
assert( status == 0 );
2637 for ( i = 0; i < nProcs; i++ )
2639 if ( ThData[i].Status )
2641 assert( ThData[i].Status == 0 );
2642 if ( ThData[i].Id >= 0 )
2645 assert( ThData[i].Result == 0 || ThData[i].Result == 1 );
2646 if ( ThData[i].Result == 0 )
2651 ThData[i].Result = -1;
2655 if ( (k & 0xFF) == 0 )
2659 if ( nVars <= LutSize )
2664 ThData[i].nVars = nVars;
2666 ThData[i].Result = -1;
2667 ThData[i].Status = 1;
2674 for ( i = 0; i < nProcs; i++ )
2675 if ( ThData[i].Status == 1 || (ThData[i].Status == 0 && ThData[i].Id >= 0) )
2680 for ( i = 0; i < nProcs; i++ )
2682 assert( ThData[i].Status == 0 );
2684 ThData[i].Status = 1;
2689 printf(
"Main : " );
2691 for ( i = 0; i < nProcs; i++ )
2693 printf(
"Thread %d : ", i );
2708 #endif // pthreads are used
2724 int fVeryVerbose = 0;
2728 word * pTruth, Perm;
2729 int i, nVars, Value;
2731 assert( fUnate != fThresh );
2745 if ( (i & 0xFF) == 0 )
2754 printf(
"%6d : %2d ", i, nVars );
void If_DsdManTune(If_DsdMan_t *p, int LutSize, int fFast, int fAdd, int fSpec, int fVerbose)
void If_DsdManSetNewAsUseless(If_DsdMan_t *p)
unsigned If_DsdManCheckPrime(If_DsdMan_t *p, int iFirst, unsigned uMaskNot, If_DsdObj_t *pObj, int nSuppAll, int LutSize, int fDerive, int fVerbose)
static int * Vec_IntArray(Vec_Int_t *p)
static int If_LogCounterAddAig(int *pTimes, int *pnTimes, int *pFaninLits, int Num, int iLit, Vec_Int_t *vAig, int nSuppAll, int fXor, int fXorFunc)
static int If_DsdObjId(If_DsdObj_t *pObj)
static int If_DsdVecObjSuppSize(Vec_Ptr_t *p, int iObj)
Vec_Mem_t * vTtMem[IF_MAX_FUNC_LUTSIZE+1]
int If_DsdManComputeFirst(If_DsdMan_t *p, If_DsdObj_t *pObj, int *pFirsts)
static unsigned If_DsdObjHashKey(If_DsdMan_t *p, int Type, int *pLits, int nLits, int truthId)
int If_CutDsdBalanceEval_rec(If_DsdMan_t *p, int Id, int *pTimes, int *pnSupp, Vec_Int_t *vAig, int *piLit, int nSuppAll, int *pArea, char *pPermLits)
void If_DsdManCollect(If_DsdMan_t *p, int Id, Vec_Int_t *vNodes, Vec_Int_t *vFirsts)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
struct If_DsdObj_t_ If_DsdObj_t
static int Abc_PrimeCudd(unsigned int p)
void Ifn_NtkPrint(Ifn_Ntk_t *p)
static Vec_Wec_t * Vec_WecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Abc_Lit2LitV(int *pMap, int Lit)
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
static int If_DsdVecLitSuppSize(Vec_Ptr_t *p, int iLit)
static word If_CutPinDelayInit(int v)
#define Vec_PtrForEachEntryStart(Type, vVec, pEntry, i, Start)
word If_DsdManGetFuncPerm(If_DsdMan_t *p, int iDsd)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
static If_DsdObj_t * If_DsdVecConst0(Vec_Ptr_t *p)
int If_DsdManCheckDec(If_DsdMan_t *p, int iDsd)
static int Gia_ManAppendCo(Gia_Man_t *p, int iLit0)
static double Vec_VecMemoryInt(Vec_Vec_t *p)
static int If_DsdObjIsVar(If_DsdObj_t *pObj)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static word If_CutPinDelayMax(word D1, word D2, int nVars, int AddOn)
static void If_DsdVecObjClearMark(Vec_Ptr_t *p, int iObj)
If_DsdMan_t * If_DsdManLoad(char *pFileName)
#define ABC_REALLOC(type, obj, num)
static void Vec_PtrGrow(Vec_Ptr_t *p, int nCapMin)
void If_DsdManPrint(If_DsdMan_t *p, char *pFileName, int Number, int Support, int fOccurs, int fTtDump, int fVerbose)
static void Vec_MemHashAlloc(Vec_Mem_t *p, int nTableSize)
#define Vec_MemForEachEntry(p, pEntry, i)
MACRO DEFINITIONS ///.
static int If_DsdObjWordNum(int nFans)
static int Dau_DsdReadVar(char *p)
static int If_CutLeaveNum(If_Cut_t *pCut)
static void Abc_TtPrintHexRev(FILE *pFile, word *pTruth, int nVars)
static void Vec_WecFree(Vec_Wec_t *p)
int If_DsdManOperation(If_DsdMan_t *p, int Type, int *pLits, int nLits, unsigned char *pPerm, word *pTruth)
Vec_Ptr_t * vTtDecs[IF_MAX_FUNC_LUTSIZE+1]
static Vec_Int_t * Vec_WecPushLevel(Vec_Wec_t *p)
static int Abc_Var2Lit(int Var, int fCompl)
static void Vec_PtrFillExtra(Vec_Ptr_t *p, int nSize, void *Fill)
int If_DsdObjCompare(If_DsdMan_t *pMan, Vec_Ptr_t *p, int iLit0, int iLit1)
static int Vec_MemEntrySize(Vec_Mem_t *p)
void If_DsdManCleanMarks(If_DsdMan_t *p, int fVerbose)
void If_DsdManPrintDistrib(If_DsdMan_t *p)
int If_DsdObjCreate(If_DsdMan_t *p, int Type, int *pLits, int nLits, int truthId)
void If_DsdManPrintOccurs(FILE *pFile, If_DsdMan_t *p)
unsigned If_DsdManCheckXY(If_DsdMan_t *p, int iDsd, int LutSize, int fDerive, unsigned uMaskNot, int fHighEffort, int fVerbose)
void Id_DsdManTuneThresh(If_DsdMan_t *p, int fUnate, int fThresh, int fVerbose)
typedefABC_NAMESPACE_IMPL_START struct Vec_Mem_t_ Vec_Mem_t
DECLARATIONS ///.
void Dau_DsdPrintFromTruth(word *pTruth, int nVarsInit)
static void If_DsdVecObjIncRef(Vec_Ptr_t *p, int iObj)
void If_DsdManPrintOne(FILE *pFile, If_DsdMan_t *p, int iObjId, unsigned char *pPermLits, int fNewLine)
static int Vec_MemEntryNum(Vec_Mem_t *p)
Vec_Int_t * Dau_DecFindSets_int(word *pInit, int nVars, int *pSched[16])
int Dau_DsdDecompose(word *pTruth, int nVarsInit, int fSplitPrime, int fWriteTruth, char *pRes)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
int Ifn_NtkLutSizeMax(Ifn_Ntk_t *p)
void If_DsdManSave(If_DsdMan_t *p, char *pFileName)
#define ABC_ALLOC(type, num)
static If_Cut_t * If_ObjCutBest(If_Obj_t *pObj)
static word If_LogPinDelaysMulti(word *pPinDels, int nFanins, int nSuppAll, int fXor)
#define If_DsdVecForEachObjStart(vVec, pObj, i, Start)
Vec_Wec_t * vIsops[IF_MAX_FUNC_LUTSIZE+1]
static abctime Abc_Clock()
static int Abc_MaxInt(int a, int b)
static int Vec_PtrSize(Vec_Ptr_t *p)
void If_DsdManDumpDsd(If_DsdMan_t *p, int Support)
static void Vec_VecFree(Vec_Vec_t *p)
static int Vec_WrdSize(Vec_Wrd_t *p)
static void Vec_WrdFreeP(Vec_Wrd_t **p)
int If_DsdManObjNum(If_DsdMan_t *p)
Vec_Int_t * Dau_DecFindSets(word *pInit, int nVars)
static int If_DsdObjTruthId(If_DsdMan_t *p, If_DsdObj_t *pObj)
static Vec_Int_t * Vec_IntStartFull(int nSize)
static word * If_DsdObjTruth(If_DsdMan_t *p, If_DsdObj_t *pObj)
char * If_DsdManFileName(If_DsdMan_t *p)
FUNCTION DEFINITIONS ///.
static void Abc_TtConst1(word *pIn1, int nWords)
static int Abc_LitNotCond(int Lit, int c)
int If_CutDsdBalanceEvalInt(If_DsdMan_t *p, int iDsd, int *pTimes, Vec_Int_t *vAig, int *pArea, char *pPermLits)
static int Vec_WecSize(Vec_Wec_t *p)
#define ABC_SWAP(Type, a, b)
char * Mem_FlexEntryFetch(Mem_Flex_t *p, int nBytes)
static int If_DsdObjType(If_DsdObj_t *pObj)
void Gia_ManStopP(Gia_Man_t **p)
static int If_DsdVecObjRef(Vec_Ptr_t *p, int iObj)
static int If_LogCounterPinDelays(int *pTimes, int *pnTimes, word *pPinDels, int Num, word PinDel, int nSuppAll, int fXor)
static void If_DsdObjHashResize(If_DsdMan_t *p)
static If_DsdObj_t * If_DsdObjFanin(Vec_Ptr_t *p, If_DsdObj_t *pObj, int i)
static int Abc_TtReadHex(word *pTruth, char *pString)
static void Vec_IntGrow(Vec_Int_t *p, int nCapMin)
static void Abc_PrintTime(int level, const char *pStr, abctime time)
int * Abc_MergeSortCost(int *pCosts, int nSize)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
Mem_Flex_t * Mem_FlexStart()
static Vec_Mem_t * Vec_MemAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Gia_ManAndNum(Gia_Man_t *p)
If_DsdObj_t * If_DsdObjAlloc(If_DsdMan_t *p, int Type, int nFans)
static int s_Primes[MAX_PRIMES]
static int Abc_MinInt(int a, int b)
static Vec_Int_t * Vec_IntStart(int nSize)
void Dau_DecPrintSets(Vec_Int_t *vSets, int nVars)
static int Abc_LitIsCompl(int Lit)
int If_CutDsdBalanceEval(If_Man_t *p, If_Cut_t *pCut, Vec_Int_t *vAig)
static int Abc_TtHexDigitNum(int nVars)
static int If_DsdObjFaninNum(If_DsdObj_t *pObj)
static void Abc_TtCopy(word *pOut, word *pIn, int nWords, int fCompl)
int If_DsdManComputeFirstArray(If_DsdMan_t *p, int *pLits, int nLits, int *pFirsts)
void If_DsdManCleanOccur(If_DsdMan_t *p, int fVerbose)
int If_DsdManAddDsd(If_DsdMan_t *p, char *pDsd, word *pTruth, unsigned char *pPerm, int *pnSupp)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
unsigned If_DsdSign_rec(If_DsdMan_t *p, If_DsdObj_t *pObj, int *pnSupp)
int If_CutSopBalanceEvalInt(Vec_Int_t *vCover, int *pTimes, int *pFaninLits, Vec_Int_t *vAig, int *piRes, int nSuppAll, int *pArea)
#define DAU_MAX_VAR
INCLUDES ///.
void If_DsdManFilter_rec(If_DsdMan_t *pNew, If_DsdMan_t *p, int i, Vec_Int_t *vMap)
unsigned If_ManSatCheckXYall(void *pSat, int nLutSize, word *pTruth, int nVars, Vec_Int_t *vLits)
#define If_DsdObjForEachFanin(vVec, pObj, pFanin, i)
int Kit_TruthIsop(unsigned *puTruth, int nVars, Vec_Int_t *vMemory, int fTryBoth)
FUNCTION DEFINITIONS ///.
static void Vec_WrdShrink(Vec_Wrd_t *p, int nSizeNew)
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
#define If_DsdVecForEachObjVec(vNodes, vVec, pObj, i)
unsigned * If_DsdObjHashLookup(If_DsdMan_t *p, int Type, int *pLits, int nLits, int truthId)
static void Vec_WrdWriteEntry(Vec_Wrd_t *p, int i, word Entry)
static void Abc_TtPrintBinary(word *pTruth, int nVars)
char * If_DsdManGetCellStr(If_DsdMan_t *p)
unsigned If_DsdManCheckMux(If_DsdMan_t *p, int iFirst, unsigned uMaskNot, If_DsdObj_t *pObj, int nSuppAll, int LutSize, int fDerive, int fVerbose)
void If_DsdManDumpAll(If_DsdMan_t *p, int Support)
static If_Obj_t * If_CutLeaf(If_Man_t *p, If_Cut_t *pCut, int i)
static int Vec_IntEntry(Vec_Int_t *p, int i)
unsigned __int64 word
DECLARATIONS ///.
static int Abc_Base10Log(unsigned n)
void If_DsdManGetSuppSizes(If_DsdMan_t *p, If_DsdObj_t *pObj, int *pSSizes)
#define If_DsdObjForEachFaninLit(vVec, pObj, iLit, i)
#define ABC_NAMESPACE_IMPL_END
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
static word Abc_Tt6Stretch(word t, int nVars)
static void Abc_TtStretch6(word *pInOut, int nVarS, int nVarB)
word * If_DsdManComputeTruth(If_DsdMan_t *p, int iDsd, unsigned char *pPermLits)
static void If_DsdMergeMatches(char *pDsd, int *pMatches)
void If_DsdManPrint_rec(FILE *pFile, If_DsdMan_t *p, int iDsdLit, unsigned char *pPermLits, int *pnSupp)
#define IF_MAX_FUNC_LUTSIZE
int If_DsdManCheckNonDec_rec(If_DsdMan_t *p, int Id)
int Ifn_NtkInputNum(Ifn_Ntk_t *p)
void Dau_DsdTruthCompose_rec(word *pFunc, word pFanins[DAU_MAX_VAR][DAU_MAX_WORD], word *pRes, int nVars, int nWordsR)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
int If_DsdManCheckInv_rec(If_DsdMan_t *p, int iLit)
void Id_DsdManTuneStr(If_DsdMan_t *p, char *pStruct, int nConfls, int nProcs, int fVerbose)
int If_DsdManPushInv_rec(If_DsdMan_t *p, int iLit, unsigned char *pPerm)
void If_DsdManComputeTruthPtr(If_DsdMan_t *p, int iDsd, unsigned char *pPermLits, word *pRes)
void * If_ManSatBuildXY(int nLutSize)
DECLARATIONS ///.
void If_ManSatUnbuild(void *p)
static void If_DsdObjClean(If_DsdObj_t *pObj)
int If_CutSopBalancePinDelaysInt(Vec_Int_t *vCover, int *pTimes, word *pFaninRes, int nSuppAll, word *pRes)
static void Vec_IntFreeP(Vec_Int_t **p)
int If_DsdManVarNum(If_DsdMan_t *p)
static int Vec_IntCap(Vec_Int_t *p)
static int If_LogCreateMux(Vec_Int_t *vAig, int iLitC, int iLit1, int iLit0, int nSuppAll)
static void Vec_MemDumpTruthTables(Vec_Mem_t *p, char *pName, int nLutSize)
static void Vec_MemFree(Vec_Mem_t *p)
void Id_DsdManTuneStr1(If_DsdMan_t *p, char *pStruct, int nConfls, int fVerbose)
unsigned If_DsdManCheckXYZ(If_DsdMan_t *p, int iDsd, int LutSize, int fDerive, int fVerbose)
static int Vec_PtrCap(Vec_Ptr_t *p)
static void Vec_PtrWriteEntry(Vec_Ptr_t *p, int i, void *Entry)
static If_DsdObj_t * If_DsdVecVar(Vec_Ptr_t *p, int v)
void Mem_FlexStop(Mem_Flex_t *p, int fVerbose)
void If_DsdManInvertMarks(If_DsdMan_t *p, int fVerbose)
unsigned If_DsdSign(If_DsdMan_t *p, If_DsdObj_t *pObj, int iFan, int iFirst, int fShared)
int If_CutDsdBalancePinDelays(If_Man_t *p, If_Cut_t *pCut, char *pPerm)
#define ABC_NAMESPACE_IMPL_START
void Dau_DecPrintSet(unsigned set, int nVars, int fNewLine)
static Vec_Int_t * Vec_WecEntry(Vec_Wec_t *p, int i)
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
void If_DsdManComputeTruth_rec(If_DsdMan_t *p, int iDsd, word *pRes, unsigned char *pPermLits, int *pnSupp)
static void If_DsdObjSetTruth(If_DsdMan_t *p, If_DsdObj_t *pObj, int Id)
static Vec_Wrd_t * Vec_WrdStart(int nSize)
static int If_LogCreateAndXorMulti(Vec_Int_t *vAig, int *pFaninLits, int nFanins, int nSuppAll, int fXor)
void If_DsdObjSort(If_DsdMan_t *pMan, Vec_Ptr_t *p, int *pLits, int nLits, int *pPerm)
int If_CutDsdPermLitMax(char *pPermLits, int nVars, int iVar)
static int Abc_LitNot(int Lit)
static int If_CutDsdLit(If_Man_t *p, If_Cut_t *pCut)
int Kit_TruthToGia(Gia_Man_t *pMan, unsigned *pTruth, int nVars, Vec_Int_t *vMemory, Vec_Int_t *vLeaves, int fHash)
DECLARATIONS ///.
static int Dau_DsdIsConst1(char *p)
static int Vec_IntSize(Vec_Int_t *p)
int * pSched[IF_MAX_FUNC_LUTSIZE]
void If_DsdManPrintDecs(FILE *pFile, If_DsdMan_t *p)
void If_DsdManAllocIsops(If_DsdMan_t *p, int nLutSize)
static word * Vec_WrdArray(Vec_Wrd_t *p)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Abc_TtWordNum(int nVars)
int If_DsdManPushInv(If_DsdMan_t *p, int iLit, unsigned char *pPerm)
If_DsdMan_t * If_DsdManFilter(If_DsdMan_t *p, int Limit)
static word ** If_ManDsdTtElems()
static void Abc_TtMux(word *pOut, word *pCtrl, word *pIn1, word *pIn0, int nWords)
static int If_DsdObjFaninLit(If_DsdObj_t *pObj, int i)
int Ifn_NtkMatch(Ifn_Ntk_t *p, word *pTruth, int nVars, int nConfls, int fVerbose, int fVeryVerbose, word *pPerm)
int If_DsdObjFindOrAdd(If_DsdMan_t *p, int Type, int *pLits, int nLits, word *pTruth)
static int If_DsdObjFaninC(If_DsdObj_t *pObj, int i)
static int Abc_TtEqual(word *pIn1, word *pIn2, int nWords)
static void Abc_TtConst0(word *pIn1, int nWords)
int Mem_FlexReadMemUsage(Mem_Flex_t *p)
int If_CutDsdBalancePinDelays_rec(If_DsdMan_t *p, int Id, int *pTimes, word *pRes, int *pnSupp, int nSuppAll, char *pPermLits)
static void If_CutPinDelayTranslate(word D, int nVars, char *pPerm)
int If_DsdManAddDsd_rec(char *pStr, char **p, int *pMatches, If_DsdMan_t *pMan, word *pTruth, unsigned char *pPerm, int *pnSupp)
static word Vec_WrdEntry(Vec_Wrd_t *p, int i)
#define ABC_CALLOC(type, num)
static int Abc_Lit2Var(int Lit)
void If_DsdManSetLutSize(If_DsdMan_t *p, int nLutSize)
static int If_DsdObjSuppSize(If_DsdObj_t *pObj)
static int Abc_TtSupportSize(word *t, int nVars)
unsigned Abc_TtCanonicize(word *pTruth, int nVars, char *pCanonPerm)
FUNCTION DECLARATIONS ///.
int If_DsdManHasMarks(If_DsdMan_t *p)
static If_DsdObj_t * If_DsdVecObj(Vec_Ptr_t *p, int Id)
unsigned If_DsdManCheckXY_int(If_DsdMan_t *p, int iDsd, int LutSize, int fDerive, unsigned uMaskNot, int fVerbose)
int If_DsdManCompute(If_DsdMan_t *p, word *pTruth, int nLeaves, unsigned char *pPerm, char *pLutStruct)
#define If_DsdVecForEachObj(vVec, pObj, i)
static int Vec_MemHashInsert(Vec_Mem_t *p, word *pEntry)
void If_DsdManHashProfile(If_DsdMan_t *p)
static void Vec_MemHashFree(Vec_Mem_t *p)
static int Abc_TtIsUnate(word *t, int nVars)
unsigned If_DsdManCheckAndXor(If_DsdMan_t *p, int iFirst, unsigned uMaskNot, If_DsdObj_t *pObj, int nSuppAll, int LutSize, int fDerive, int fVerbose)
static int If_DsdVecObjMark(Vec_Ptr_t *p, int iObj)
static int * Vec_IntEntryP(Vec_Int_t *p, int i)
int If_DsdManReadMark(If_DsdMan_t *p, int iDsd)
static int Dau_DsdIsVar(char *p)
static int If_LogCounterDelayXor(int *pTimes, int nTimes)
int If_DsdManCheckNonTriv(If_DsdMan_t *p, int Id, int nVars, int iVarMax)
void If_DsdManCollect_rec(If_DsdMan_t *p, int Id, Vec_Int_t *vNodes, Vec_Int_t *vFirsts, int *pnSupp)
static int Dau_DsdIsConst0(char *p)
int If_DsdManLutSize(If_DsdMan_t *p)
int If_DsdManSuppSize(If_DsdMan_t *p, int iDsd)
static word * Vec_MemReadEntry(Vec_Mem_t *p, int i)
static void Abc_TtAnd(word *pOut, word *pIn1, word *pIn2, int nWords, int fCompl)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
#define If_DsdVecForEachNode(vVec, pObj, i)
static void Vec_IntClear(Vec_Int_t *p)
static void Vec_WrdFillExtra(Vec_Wrd_t *p, int nSize, word Fill)
static char * If_CutDsdPerm(If_Man_t *p, If_Cut_t *pCut)
char * Abc_UtilStrsav(char *s)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static void If_DsdVecObjSetMark(Vec_Ptr_t *p, int iObj)
If_DsdType_t
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Wrd_t_ Vec_Wrd_t
INCLUDES ///.
static void Abc_TtXor(word *pOut, word *pIn1, word *pIn2, int nWords, int fCompl)
static void Abc_TtElemInit(word **pTtElems, int nVars)
static void Abc_TtNot(word *pOut, int nWords)
void If_DsdManMerge(If_DsdMan_t *p, If_DsdMan_t *pNew)
void If_DsdManFree(If_DsdMan_t *p, int fVerbose)
If_DsdMan_t * If_DsdManAlloc(int nVars, int LutSize)
Ifn_Ntk_t * Ifn_NtkParse(char *pStr)