50 int nInputs = 32*32*24;
53 int i, e, iLitOut[10] = {0};
55 assert( Vec_WrdSize(vSims) % nInputs == 0 );
57 for ( i = 0; i < nInputs; i++ )
58 Gia_ManAppendCi( pNew );
60 for ( e = 0; e < nExamps; e++ )
62 int Class = Vec_StrEntry( vSimsOut, e );
64 word * pSim = Vec_WrdEntryP( vSims, e*
nWords );
65 for ( i = 0; i < nInputs; i++ )
66 This =
Gia_ManHashAnd( pNew, This, Abc_Var2Lit(i+1, !Abc_TtGetBit(pSim, i)) );
67 assert( Class >= 0 && Class <= 9 );
71 for ( i = 0; i < 10; i++ )
72 Gia_ManAppendCo( pNew, iLitOut[i] );
80 char pFileName[100] =
"test";
87 printf(
"Dumped file \"%s\".\n",
"examples64.aig" );
89 Vec_WrdFree( vSimsIn );
90 Vec_StrFree( vSimsOut );
108 return Vec_WrdEntryP(
p->vSims,
p->nSimWords * iObj );
110static inline void Gia_ManObjSimPi(
Gia_Man_t *
p,
int iObj )
113 word * pSim = Gia_ManObjSim(
p, iObj );
114 for ( w = 0; w <
p->nSimWords; w++ )
118static inline void Gia_ManObjSimPo(
Gia_Man_t *
p,
int iObj )
122 word * pSimCo = Gia_ManObjSim(
p, iObj );
123 word * pSimDri = Gia_ManObjSim(
p, Gia_ObjFaninId0(pObj, iObj) );
124 if ( Gia_ObjFaninC0(pObj) )
125 for ( w = 0; w <
p->nSimWords; w++ )
126 pSimCo[w] = ~pSimDri[w];
128 for ( w = 0; w <
p->nSimWords; w++ )
129 pSimCo[w] = pSimDri[w];
131static inline void Gia_ManObjSimAnd(
Gia_Man_t *
p,
int iObj )
135 word * pSim = Gia_ManObjSim(
p, iObj );
136 word * pSim0 = Gia_ManObjSim(
p, Gia_ObjFaninId0(pObj, iObj) );
137 word * pSim1 = Gia_ManObjSim(
p, Gia_ObjFaninId1(pObj, iObj) );
138 if ( Gia_ObjFaninC0(pObj) && Gia_ObjFaninC1(pObj) )
139 for ( w = 0; w <
p->nSimWords; w++ )
140 pSim[w] = ~pSim0[w] & ~pSim1[w];
141 else if ( Gia_ObjFaninC0(pObj) && !Gia_ObjFaninC1(pObj) )
142 for ( w = 0; w <
p->nSimWords; w++ )
143 pSim[w] = ~pSim0[w] & pSim1[w];
144 else if ( !Gia_ObjFaninC0(pObj) && Gia_ObjFaninC1(pObj) )
145 for ( w = 0; w <
p->nSimWords; w++ )
146 pSim[w] = pSim0[w] & ~pSim1[w];
148 for ( w = 0; w <
p->nSimWords; w++ )
149 pSim[w] = pSim0[w] & pSim1[w];
155 Vec_WrdFreeP( &
p->vSims );
156 p->vSims = Vec_WrdStart( Gia_ManObjNum(
p) *
nWords );
161 if ( Gia_ObjIsAnd(pObj) )
162 Gia_ManObjSimAnd(
p, i );
163 else if ( Gia_ObjIsCi(pObj) )
164 Gia_ManObjSimPi(
p, i );
165 else if ( Gia_ObjIsCo(pObj) )
166 Gia_ManObjSimPo(
p, i );
175 int nWords = Vec_WrdSize(vSimsIn) / Gia_ManCiNum(
p);
178 Vec_WrdFreeP( &
p->vSims );
179 p->vSims = Vec_WrdStart( Gia_ManObjNum(
p) *
nWords );
187 if ( Gia_ObjIsAnd(pObj) )
188 Gia_ManObjSimAnd(
p, i );
189 else if ( Gia_ObjIsCi(pObj) )
191 else if ( Gia_ObjIsCo(pObj) )
192 Gia_ManObjSimPo(
p, i );
201 int nWords = Vec_WrdSize(vSimsIn) / Gia_ManCiNum(
p);
205 Vec_WrdFreeP( &
p->vSims );
206 p->vSims = Vec_WrdStart( Gia_ManObjNum(
p) *
nWords );
214 if ( Gia_ObjIsAnd(pObj) )
215 Gia_ManObjSimAnd(
p, i );
216 else if ( Gia_ObjIsCi(pObj) )
218 else if ( Gia_ObjIsCo(pObj) )
219 Gia_ManObjSimPo(
p, i );
225 Vec_WrdFreeP( &
p->vSims );
243 int n, nSize[2] = {nCexesT*64, nCexesV*64};
245 char pFileNameOutTX[100];
246 char pFileNameOutTY[100];
247 char pFileNameOutVX[100];
248 char pFileNameOutVY[100];
249 char pFileNameOut[100];
256 sprintf( pFileNameOutTX,
"%s_x.train.data", pFileName ? pFileName : Gia_ManName(
p) );
257 sprintf( pFileNameOutTY,
"%s_y.train.data", pFileName ? pFileName : Gia_ManName(
p) );
258 sprintf( pFileNameOutVX,
"%s_x.test.data", pFileName ? pFileName : Gia_ManName(
p) );
259 sprintf( pFileNameOutVY,
"%s_y.test.data", pFileName ? pFileName : Gia_ManName(
p) );
262 for ( n = 0; n < Seed; n++ )
264 for ( n = 0; n < 2; n++ )
268 Vec_Bit_t * vBitX = Vec_BitAlloc( nSize[n] * Gia_ManCiNum(
p) );
269 Vec_Bit_t * vBitY = Vec_BitAlloc( nSize[n] * Gia_ManCoNum(
p) );
271 FILE * pFileOutX = fopen( n ? pFileNameOutVX : pFileNameOutTX,
"wb" );
272 FILE * pFileOutY = fopen( n ? pFileNameOutVY : pFileNameOutTY,
"wb" );
274 int i, k, Id, Num, Value, nBytes;
275 for ( k = 0; k < nSize[n]; k++ )
279 Vec_BitPush( vBitX, Abc_TtGetBit(Gia_ManObjSim(
p, Id), k) );
285 Vec_BitPush( vBitY, Abc_TtGetBit(Gia_ManObjSim(
p, Id), k) );
290 assert( Vec_BitSize(vBitX) <= Vec_BitCap(vBitX) );
291 assert( Vec_BitSize(vBitY) <= Vec_BitCap(vBitY) );
293 Num = 2; Value = fwrite( &Num, 1, 4, pFileOutX );
assert( Value == 4 );
294 Num = nSize[n]; Value = fwrite( &Num, 1, 4, pFileOutX );
assert( Value == 4 );
295 Num = Gia_ManCiNum(
p); Value = fwrite( &Num, 1, 4, pFileOutX );
assert( Value == 4 );
297 nBytes = nSize[n] * Gia_ManCiNum(
p) / 8;
298 assert( nSize[n] * Gia_ManCiNum(
p) % 8 == 0 );
299 Value = fwrite( Vec_BitArray(vBitX), 1, nBytes, pFileOutX );
300 assert( Value == nBytes );
302 Num = 2; Value = fwrite( &Num, 1, 4, pFileOutY );
assert( Value == 4 );
303 Num = nSize[n]; Value = fwrite( &Num, 1, 4, pFileOutY );
assert( Value == 4 );
304 Num = Gia_ManCoNum(
p); Value = fwrite( &Num, 1, 4, pFileOutY );
assert( Value == 4 );
306 nBytes = nSize[n] * Gia_ManCoNum(
p) / 8;
307 assert( nSize[n] * Gia_ManCoNum(
p) % 8 == 0 );
308 Value = fwrite( Vec_BitArray(vBitY), 1, nBytes, pFileOutY );
309 assert( Value == nBytes );
314 Vec_BitFree( vBitX );
315 Vec_BitFree( vBitY );
319 printf(
"Finished dumping files \"%s\" and \"%s\".\n", pFileNameOutTX, pFileNameOutTY );
320 printf(
"Finished dumping files \"%s\" and \"%s\".\n", pFileNameOutVX, pFileNameOutVY );
322 sprintf( pFileNameOut,
"%s.flist", pFileName ? pFileName : Gia_ManName(
p) );
324 FILE * pFile = fopen( pFileNameOut,
"wb" );
325 fprintf( pFile,
"%s\n", pFileNameOutTX );
326 fprintf( pFile,
"%s\n", pFileNameOutTY );
327 fprintf( pFile,
"%s\n", pFileNameOutVX );
328 fprintf( pFile,
"%s\n", pFileNameOutVY );
330 printf(
"Finished dumping file list \"%s\".\n", pFileNameOut );
347 int n, nSize[3] = {nCexesT, nCexesV, nCexesV};
349 char pFileNameOut[3][100];
351 sprintf( pFileNameOut[0],
"%s.train.pla", pFileName ? pFileName : Gia_ManName(
p) );
352 sprintf( pFileNameOut[1],
"%s.valid.pla", pFileName ? pFileName : Gia_ManName(
p) );
353 sprintf( pFileNameOut[2],
"%s.test.pla", pFileName ? pFileName : Gia_ManName(
p) );
356 for ( n = 0; n < Seed; n++ )
358 for ( n = 0; n < 3; n++ )
363 FILE * pFileOut = fopen( pFileNameOut[n],
"wb" );
365 fprintf( pFileOut,
".i %d\n", Gia_ManCiNum(
p) );
366 fprintf( pFileOut,
".o %d\n", Gia_ManCoNum(
p) );
367 fprintf( pFileOut,
".p %d\n", nSize[n]*64 );
368 fprintf( pFileOut,
".type fr\n" );
369 for ( k = 0; k < nSize[n]*64; k++ )
374 fprintf( pFileOut,
"%d", Abc_TtGetBit(Gia_ManObjSim(
p, Id), k) );
376 fprintf( pFileOut,
" " );
380 fprintf( pFileOut,
"%d", Abc_TtGetBit(Gia_ManObjSim(
p, Id), k) );
382 fprintf( pFileOut,
"\n" );
384 fprintf( pFileOut,
".e\n" );
390 printf(
"Finished dumping files: \"%s.{train, valid, test}.pla\".\n", pFileName ? pFileName : Gia_ManName(
p) );
406 FILE * pTable = fopen( pDumpFile,
"wb" );
407 fprintf( pTable,
"{\n" );
408 fprintf( pTable,
" \"name\" : \"%s\",\n",
p->pName );
409 fprintf( pTable,
" \"input\" : %d,\n", Gia_ManCiNum(
p) );
410 fprintf( pTable,
" \"output\" : %d,\n", Gia_ManCoNum(
p) );
411 fprintf( pTable,
" \"and\" : %d,\n", Gia_ManAndNum(
p) );
413 fprintf( pTable,
" \"total\" : %d,\n", Total );
414 fprintf( pTable,
" \"correct\" : %d,\n", Correct );
415 fprintf( pTable,
" \"guess\" : %d\n", Guess );
416 fprintf( pTable,
"}\n" );
421 int c, nIns = -1, nLines = 0, Count = 0, fReadDot = 0;
422 FILE * pFile = fopen( pFileName,
"rb" );
425 printf(
"Cannot open file \"%s\" for reading.\n", pFileName );
428 while ( (c = fgetc(pFile)) != EOF )
438 else if ( nIns != Count )
440 printf(
"The number of symbols (%d) does not match other lines (%d).\n", Count, nIns );
451 if ( c !=
'0' && c !=
'1' )
455 if ( nLines % 64 > 0 )
457 printf(
"The number of lines (%d) is not divisible by 64.\n", nLines );
462 *pnWords = nLines / 64;
469 int c, nPats = 0, Count = 0, fReadDot = 0;
470 FILE * pFile = fopen( pFileName,
"rb" );
473 printf(
"Cannot open file \"%s\" for reading.\n", pFileName );
477 while ( (c = fgetc(pFile)) != EOF )
485 if ( c !=
'0' && c !=
'1' )
489 Vec_IntPush( vValues, c -
'0' );
496 Abc_TtSetBit( Vec_WrdEntryP(vSimsIn, Count *
nWords), nPats );
502 printf(
"Finished reading %d simulation patterns for %d inputs. Probability of 1 at the output is %6.2f %%.\n", 64*
nWords, nIns, 100.0*Vec_IntSum(vValues)/nPats );
506 int i, Value, Guess, Count = 0,
nWords = Vec_WrdSize(vSimsIn) / Gia_ManCiNum(
p);
511 pSims = Gia_ManObjSim(
p, Gia_ObjId(
p, Gia_ManCo(
p, 0)) );
513 if ( Abc_TtGetBit(pSims, i) == Value )
515 Guess = (Vec_IntSum(vValues) >
nWords * 32) ? Vec_IntSum(vValues) :
nWords * 64 - Vec_IntSum(vValues);
516 printf(
"Total = %6d. Errors = %6d. Correct = %6d. (%6.2f %%) Naive guess = %6d. (%6.2f %%)\n",
517 Vec_IntSize(vValues), Vec_IntSize(vValues) - Count,
518 Count, 100.0*Count/Vec_IntSize(vValues),
519 Guess, 100.0*Guess/Vec_IntSize(vValues));
520 if ( pDumpFile == NULL )
523 printf(
"Finished dumping statistics into file \"%s\".\n", pDumpFile );
539 char * pTemp, pBuffer[1000];
540 Vec_Wrd_t * vSimsIn = NULL, * vSimsOut = NULL;
541 int i, iPat = 0, nWordsI, nWordsO, nIns = -1, nOuts = -1, nPats = -1;
542 FILE * pFile = fopen( pFileName,
"rb" );
545 printf(
"Cannot open file \"%s\" for reading.\n", pFileName );
548 while ( fgets( pBuffer, 1000, pFile ) != NULL )
551 if ( pTemp[0] ==
'\0' || pTemp[0] ==
'#' || pTemp[0] ==
' ' )
553 if ( pTemp[0] !=
'.' )
555 if ( pTemp[1] ==
'i' )
556 nIns = atoi(pTemp+2);
557 else if ( pTemp[1] ==
'o' )
558 nOuts = atoi(pTemp+2);
559 else if ( pTemp[1] ==
'p' )
561 if ( atoi(pTemp+2) % 64 == 0 )
562 printf(
"Expecting the number of patterns divisible by 64.\n" );
563 nPats = atoi(pTemp+2) / 64;
566 if ( nIns == -1 || nOuts == -1 || nPats == -1 )
568 printf(
"Some of the parameters (inputs, outputs, patterns) is not specified.\n" );
572 nWordsI = (nIns + 63) / 64;
573 nWordsO = (nOuts + 63) / 64;
575 vSimsIn = Vec_WrdStart( nPats * nWordsI );
576 vSimsOut = Vec_WrdStart( nPats * nWordsO );
578 while ( fgets( pBuffer, 1000, pFile ) != NULL )
580 if ( pTemp[0] ==
'\0' || pTemp[0] ==
'.' )
582 for ( i = 0, pTemp = pBuffer; *pTemp !=
'\n'; pTemp++ )
583 if ( *pTemp ==
'0' || *pTemp ==
'1' )
588 Abc_TtSetBit( Vec_WrdEntryP(vSimsIn, nWordsI*iPat), i );
590 Abc_TtSetBit( Vec_WrdEntryP(vSimsOut, nWordsO*iPat), i-nIns );
597 printf(
"The number of patterns does not match.\n" );
603 *pvSimsOut = vSimsOut;
621 int nExamples = 1 << 16;
622 int nInputs = nFileSize / nExamples - 1;
623 int nWords = (8*nInputs + 63)/64, i;
627 Vec_Str_t * vSimsOut = Vec_StrAlloc( nExamples );
628 assert( nFileSize % nExamples == 0 );
629 for ( i = 0; i < nExamples; i++ )
631 memcpy( (
void *)Vec_WrdEntryP(vSimsIn, i*
nWords), (
void *)(pContents + i*(nInputs+1)), nInputs );
632 Vec_StrPush( vSimsOut, pContents[i*(nInputs+1) + nInputs] );
635 Vec_WrdShrink( vSimsIn2, 8*nInputs * nExamples/64 );
636 Vec_WrdFree( vSimsIn );
637 *pvSimsIn = vSimsIn2;
638 *pvSimsOut = vSimsOut;
656 FILE * pTable = fopen( pDumpFile,
"wb" );
657 fprintf( pTable,
"{\n" );
658 fprintf( pTable,
" \"name\" : \"%s\",\n",
p->pName );
659 fprintf( pTable,
" \"input\" : %d,\n", Gia_ManCiNum(
p) );
660 fprintf( pTable,
" \"output\" : %d,\n", Gia_ManCoNum(
p) );
661 fprintf( pTable,
" \"and\" : %d,\n", Gia_ManAndNum(
p) );
663 fprintf( pTable,
" \"total\" : %d,\n", Total );
664 fprintf( pTable,
" \"positive\" : %d,\n", nPositives );
665 fprintf( pTable,
" \"error\" : %e,\n", ErrorTotal );
666 fprintf( pTable,
" \"guess\" : %e\n", GuessTotal );
667 fprintf( pTable,
"}\n" );
672 int o, Sign = 0, ValueSim = 0;
673 for ( o = 0; o < nSims; o++ )
674 if ( (Sign = Abc_TtGetBit(ppSims[o], iExample)) )
675 ValueSim |= (1 << o);
677 ValueSim |= ~0 << nSims;
682 float Error1, ErrorTotal = 0, Guess1, GuessTotal = 0;
683 int i, o, nPositives = 0,
nWords = Vec_WrdSize(vSimsIn) / Gia_ManCiNum(
p);
687 assert( Vec_WrdSize(vSimsIn) % Gia_ManCiNum(
p) == 0 );
688 assert( Vec_StrSize(vValues) == (1 << 16) );
695 ppSims[o] = Gia_ManObjSim(
p, Gia_ObjId(
p, pObj) );
697 for ( i = 0; i <
nWords*64; i++ )
699 int ValueGold = (int)Vec_StrEntry( vValues, i );
702 Error1 = (float)(ValueGold - ValueImpl)/256;
703 ErrorTotal += Error1 * Error1;
705 Guess1 = ValueGold > 0 ? Abc_AbsInt(ValueImpl) : 0;
706 GuessTotal += Guess1 * Guess1;
708 nPositives += (int)(ValueGold > 0);
711 printf(
"Total = %6d. Positive = %6d. (%6.2f %%) Errors = %e. Guess = %e. (%6.2f %%)\n",
712 Vec_StrSize(vValues), nPositives, 100.0*nPositives/Vec_StrSize(vValues),
713 ErrorTotal, GuessTotal, 100.0*ErrorTotal/GuessTotal );
714 if ( pDumpFile == NULL )
717 printf(
"Finished dumping statistics into file \"%s\".\n", pDumpFile );
736 if ( Gia_ManCiNum(
p) == 8*nInputs )
739 printf(
"The number of inputs in the AIG (%d) and in the file (%d) does not match.\n", Gia_ManCiNum(
p), 8*nInputs );
740 Vec_WrdFree( vSimsIn );
741 Vec_StrFree( vSimsOut );
762 if ( nIns != Gia_ManCiNum(
p) )
764 printf(
"The number of inputs in the file \"%s\" (%d) does not match the AIG (%d).\n", pFileName, nIns, Gia_ManCiNum(
p) );
767 vSimsIn = Vec_WrdStart( nIns *
nWords );
768 vValues = Vec_IntAlloc(
nWords * 64 );
771 Vec_WrdFree( vSimsIn );
772 Vec_IntFree( vValues );
789 int nPixels = 32*32*3;
791 int nExamples = nFileSize / (nPixels + 1);
792 int nWordsIn = nPixels / 8;
793 int nWordsOut = (nExamples + 63) / 64;
int e;
794 if ( nFileSize % (nPixels + 1) )
796 printf(
"The input file \"%s\" with image data does not appear to be in CIFAR10 format.\n", pFileName );
801 Vec_Wrd_t * vSimsIn = Vec_WrdStart( 64 * nWordsOut * nWordsIn );
802 Vec_Str_t * vSimsOut = Vec_StrAlloc( 64 * nWordsOut );
803 unsigned char * pBuffer =
ABC_ALLOC(
unsigned char, nFileSize );
804 FILE * pFile = fopen( pFileName,
"rb" );
805 int Value = fread( pBuffer, 1, nFileSize, pFile );
807 assert( Value == nFileSize );
808 printf(
"Successfully read %5.2f MB (%d images) from file \"%s\".\n", (
float)nFileSize/(1<<20), nExamples, pFileName );
809 for ( e = 0; e < nExamples; e++ )
811 Vec_StrPush( vSimsOut, (
char)pBuffer[e*(nPixels + 1)] );
812 memcpy( Vec_WrdEntryP(vSimsIn, e*nWordsIn), pBuffer + e*(nPixels + 1) + 1, nPixels );
815 for ( ; e < 64 * nWordsOut; e++ )
816 Vec_StrPush( vSimsOut, (
char)0 );
817 memset( Vec_WrdEntryP(vSimsIn, nExamples*nWordsIn), 0, (64*nWordsOut - nExamples)*nWordsIn );
819 *pvSimsOut = vSimsOut;
820 *pnExamples = nExamples;
841 assert( Gia_ManCiNum(
p) == Vec_WrdSize(vSimsIn) );
842 assert( Gia_ManCoNum(
p) == 10 );
845 ppSims[o] = Gia_ManObjSim(
p, Gia_ObjId(
p, pObj) );
846 for ( i = 0; i < Limit; i++ )
849 for ( o = 0; o < 10; o++ )
850 if ( Abc_TtGetBit(ppSims[o], i) )
855 Vec_StrPush( vSimsOut, (
char)Value );
856 Count += Value == (int)Vec_StrEntry( vSimsOut2, 64*b+i );
863 Vec_Str_t * vRes = Vec_StrAlloc( 100 );
int b, Count;
864 int nWordsIn = 32*32*24/64;
865 int nWordsOut = Vec_WrdSize(vSimsIn)/(nWordsIn*64);
866 assert( Vec_WrdSize(vSimsIn) % nWordsIn == 0 );
867 for ( b = 0; b < nWordsOut; b++ )
869 int Limit = b == nWordsOut-1 ? nExamples-b*64 : 64;
870 Vec_Wrd_t * vSimsIn1 = Vec_WrdStart( nWordsIn*64 );
871 Vec_Wrd_t * vSimsIn2 = Vec_WrdStart( nWordsIn*64 );
872 memcpy( Vec_WrdArray(vSimsIn1), Vec_WrdEntryP(vSimsIn, b*nWordsIn*64),
sizeof(
word)*nWordsIn*64 );
874 Vec_WrdFree( vSimsIn1 );
876 Vec_WrdFree( vSimsIn2 );
878 printf(
"Finished simulating word %4d (out of %4d). Correct = %2d. (Limit = %2d.)\n", b, nWordsOut, Count, Limit );
880 assert( Vec_StrSize(vRes) == nExamples );
885 int i, Guess = (nExamples+9)/10, Count = 0;
886 for ( i = 0; i < nExamples; i++ )
888 char ValueReal = Vec_StrEntry(vRes, i);
889 char ValueGold = Vec_StrEntry(vSimsOut, i);
890 if ( ValueReal == ValueGold )
893 printf(
"Summary: Total = %6d. Errors = %6d. Correct = %6d. (%6.2f %%) Naive guess = %6d. (%6.2f %%)\n",
894 nExamples, nExamples - Count,
895 Count, 100.0*Count/nExamples,
896 Guess, 100.0*Guess/nExamples);
897 if ( pDumpFile == NULL )
900 printf(
"Finished dumping statistics into file \"%s\".\n", pDumpFile );
907 int i, nExamples = 0;
909 char * pKnownFileNames[3] = {
"small.aig",
"medium.aig",
"large.aig"};
910 int pLimitFileSizes[3] = {10000, 100000, 1000000};
911 for ( i = 0; i < 3; i++ )
912 if (
p->pSpec && !
strncmp(
p->pSpec, pKnownFileNames[i], 5) && Gia_ManAndNum(
p) > pLimitFileSizes[i] )
913 printf(
"Warning: The input file \"%s\" contains more than %d internal and-nodes.\n", pKnownFileNames[i], pLimitFileSizes[i] );
914 if ( nInputs == Gia_ManCiNum(
p) )
921 printf(
"The primary input counts in the AIG (%d) and in the image data (%d) do not match.\n", Gia_ManCiNum(
p), nInputs );
922 Vec_WrdFree( vSimsIn );
923 Vec_StrFree( vSimsOut );
924 Abc_PrintTime( 1,
"Total checking time", Abc_Clock() - clk );
941 int i, Ent, Count = 0, Sum = 0;
942 for ( i = 0;
p[i]; i++ ) {
943 Ent = (
p[i] >=
'0' &&
p[i] <=
'9') ?
p[i]-
'0' :
p[i]-
'A'+10;
944 Count += Vec_IntEntry(vDec, Ent) + b * (1 << (Sum += Ent));
946 return Count + b * ((1 << Sum) - 1);
952 Vec_StrPush( vRes,
'1' );
953 Vec_StrPush( vRes,
'\0' );
957 for (
int i = 1; i < Num; i++ ) {
960 for (
int c0 = 0; c0 < Vec_StrSize(vRes0); c0 +=
strlen(Vec_StrEntryP(vRes0,c0))+1 )
961 for (
int c1 = 0; c1 < Vec_StrSize(vRes1); c1 +=
strlen(Vec_StrEntryP(vRes1,c1))+1 )
962 Vec_StrPrintF( vRes,
"%s%s%c", Vec_StrEntryP(vRes0,c0), Vec_StrEntryP(vRes1,c1),
'\0' );
963 Vec_StrPrintF( vRes,
"%c%c", Num < 10 ?
'0'+Num :
'A'+Num-10,
'\0' );
964 Vec_StrFree( vRes0 );
965 Vec_StrFree( vRes1 );
972 for (
int b = 1; b <= 256; b <<= 1 ) {
974 for (
int c0 = 0; c0 < Vec_StrSize(vRes); c0 +=
strlen(Vec_StrEntryP(vRes,c0))+1 ) {
976 if ( CountBest > CountCur )
977 CountBest = CountCur, iBest = c0;
979 printf(
" %8d", CountBest );
988 Vec_Int_t * vDec = Vec_IntAlloc( n + 1 );
989 Vec_IntPush( vDec, 0 );
990 Vec_IntPush( vDec, 0 );
991 Vec_IntPush( vDec, 4 );
992 Vec_IntPush( vDec, 12 );
993 for (
int i = 4; i <= n; i++ ) {
994 int Ent0 = Vec_IntEntry( vDec, i / 2 );
995 int Ent1 = Vec_IntEntry( vDec, i - i / 2 );
996 assert( Vec_IntSize(vDec) == i );
997 Vec_IntPush( vDec, Ent0 + Ent1 + (1 << i / 2) * (1 << (i - i / 2)) );
1005 for (
int b = 1; b <= 256; b <<= 1 )
1006 printf(
" %8d", b );
1008 for (
int i = 1; i <= 15; i++ ) {
1009 printf(
"%2d :", i );
1013 Vec_IntFree( vDec );
1030 FILE * pFile = fopen(
"temp.v",
"wb" );
1031 if ( pFile == NULL ) {
1032 printf(
"Cannot open output file.\n" );
1035 fprintf( pFile,
"module neuron_%d_%d_%d ( input [%d:0] i, output [%d:0] o );\n",
1036 Vec_WrdSize(vData)-1, nIBits, nOBits, (Vec_WrdSize(vData)-1)*nIBits-1, nOBits-1 );
1037 fprintf( pFile,
"assign o = %d'h%lX", nOBits, Vec_WrdEntryLast(vData) );
1040 fprintf( pFile,
"\n + %d'h%lX * i[%d:%d]", nOBits, Data, nIBits*(i+1)-1, nIBits*i );
1041 fprintf( pFile,
";\nendmodule\n\n" );
1043 printf(
"Dumped the neuron specification into file \"temp.v\".\n" );
1049 Vec_IntClear( vRes );
1050 for ( i = 0; i < nLits; i++ ) {
1052 Vec_IntPush( vRes, Res );
1058 assert( Vec_IntSize(vIn0) == Vec_IntSize(vIn1) );
1059 assert( Vec_IntSize(vIn0) == Vec_IntSize(vIn2) );
1060 Vec_IntPush( vOut1, 0 );
1061 int i, Lit0, Lit1, Lit2, Out0, Out1;
1064 Vec_IntPush( vOut0, Out0 );
1065 Vec_IntPush( vOut1, Out1 );
1067 Vec_IntPop( vOut1 );
1068 assert( Vec_IntSize(vIn0) == Vec_IntSize(vOut0) );
1069 assert( Vec_IntSize(vIn0) == Vec_IntSize(vOut1) );
1073 word Data = Vec_WrdEntryLast(vData);
int i, b, n, nLits = 2;
1074 Vec_Wec_t * vArgs = Vec_WecAlloc( Vec_WrdSize(vData) * nIBits );
1075 Vec_Int_t * vLev = Vec_WecPushLevel( vArgs );
1076 Vec_IntFill( vLev, nOBits, 0 );
1077 for ( b = 0; b < nOBits; b++ )
1078 if ( (Data >> b) & 1 )
1079 Vec_IntWriteEntry( vLev, b, 1 );
1081 for ( n = 0; n < nIBits; n++, nLits += 2 ) {
1082 Vec_Int_t * vLev = Vec_WecPushLevel( vArgs );
1083 Vec_IntFill( vLev, nOBits, 0 );
1084 for ( b = 0; b < nOBits; b++ )
1085 if ( ((Data >> b) & 1) && b+n < nOBits )
1086 Vec_IntWriteEntry( vLev, b+n, nLits );
1093 int i, nParts = (Vec_WecSize(vArgs) + nLutSize - 2) / nLutSize;
1094 while ( Vec_WecSize(vArgs) < nLutSize*nParts+1 )
1095 Vec_IntFill( Vec_WecPushLevel(vArgs), nOBits, 0 );
1096 assert( Vec_WecSize(vArgs) == nLutSize*nParts+1 );
1097 Vec_Wec_t * vNew = Vec_WecAlloc( nParts );
1098 Vec_Int_t * vRes = Vec_WecPushLevel( vNew ), * vArg;
1099 Vec_IntAppend( vRes, Vec_WecEntry(vArgs, 0) );
1102 if ( (i-1) % nLutSize == nLutSize-1 && i < Vec_WecSize(vArgs)-1 ) {
1103 vRes = Vec_WecPushLevel( vNew );
1104 Vec_IntFill( vRes, nOBits, 0 );
1107 assert( Vec_WecSize(vNew) == nParts );
1112 int i, nParts = Vec_WecSize(vArgs) / 3;
1113 Vec_Wec_t * vNew = Vec_WecAlloc( 2 * nParts + Vec_WecSize(vArgs) % 3 );
1114 for ( i = 0; i < nParts; i++ ) {
1115 Vec_Int_t * vIn0 = Vec_WecEntry(vArgs, 3*i+0);
1116 Vec_Int_t * vIn1 = Vec_WecEntry(vArgs, 3*i+1);
1117 Vec_Int_t * vIn2 = Vec_WecEntry(vArgs, 3*i+2);
1118 Vec_Int_t * vOut0 = Vec_WecPushLevel(vNew);
1119 Vec_Int_t * vOut1 = Vec_WecPushLevel(vNew);
1122 for ( i = 3*nParts; i < Vec_WecSize(vArgs); i++ )
1123 Vec_IntAppend( Vec_WecPushLevel(vNew), Vec_WecEntry(vArgs, i) );
1124 assert( Vec_WecSize(vNew) == 2 * nParts + Vec_WecSize(vArgs) % 3 );
1129 Vec_Int_t * vRes = Vec_IntAlloc( nOBits ), * vArg;
int i;
1130 Vec_IntAppend( vRes, Vec_WecEntry(vArgs, 0) );
1137 int i, InMask = (1<<nIBits)-1;
1138 word Data, DataMax = Vec_WrdEntryLast(vData);
1140 DataMax += InMask * Data;
1141 return Abc_Base2LogW(DataMax);
1147 if ( vData == NULL )
1151 assert( 0 < nIBits && nIBits < 32 );
1156 pNew->
pName = Abc_UtilStrsav(
"neuron" );
1157 for ( i = 0; i < nIBits * (Vec_WrdSize(vData)-1); i++ )
1158 Gia_ManAppendCi( pNew );
1162 Vec_WrdFree( vData );
1166 Vec_WecFree( vTemp );
1167 while ( Vec_WecSize(vArgs) > 2 ) {
1169 Vec_WecFree( vTemp );
1175 Gia_ManAppendCo( pNew, Lit );
1176 Vec_IntFree( vRes );
1177 Vec_WecFree( vArgs );
1197 Gia_Man_t * pNew, * pTemp;
int i, iLit = 1;
1198 Vec_Int_t * vBitsA = Vec_IntAlloc( nBits + 1 );
1199 Vec_Int_t * vBitsB = Vec_IntAlloc( nBits + 1 );
1201 pNew->
pName = Abc_UtilStrsav(
"comp" );
1203 if ( fInterleave ) {
1204 for ( i = 0; i < nBits; i++ )
1205 Vec_IntPush( vBitsA, Gia_ManAppendCi(pNew) ),
1206 Vec_IntPush( vBitsB, Gia_ManAppendCi(pNew) );
1209 for ( i = 0; i < nBits; i++ )
1210 Vec_IntPush( vBitsA, Gia_ManAppendCi(pNew) );
1211 for ( i = 0; i < nBits; i++ )
1212 Vec_IntPush( vBitsB, Gia_ManAppendCi(pNew) );
1214 Vec_IntPush( vBitsA, 0 );
1215 Vec_IntPush( vBitsB, 0 );
1216 for ( i = 0; i < nBits; i++ ) {
1217 int iLitA0 = Vec_IntEntry(vBitsA, i);
1218 int iLitA1 = Vec_IntEntry(vBitsA, i+1);
1219 int iLitB0 = Vec_IntEntry(vBitsB, i);
1220 int iLitB1 = Vec_IntEntry(vBitsB, i+1);
1223 iOrLit0 =
Gia_ManHashOr(pNew, Abc_LitNotCond(iLitA0, !(i&1)), Abc_LitNotCond(iLitB0, i&1));
1225 iOrLit0 =
Gia_ManHashAnd(pNew, Abc_LitNotCond(iLitA0, !(i&1)), Abc_LitNotCond(iLitB0, i&1));
1226 int iOrLit1 =
Gia_ManHashAnd(pNew, Abc_LitNotCond(iLitA1, !(i&1)), Abc_LitNotCond(iLitB1, i&1));
1230 Gia_ManAppendCo( pNew, Abc_LitNotCond(iLit, nBits&1) );
1233 Vec_IntFree( vBitsA );
1234 Vec_IntFree( vBitsB );
1254 Vec_IntPush( vRes, Abc_LitNot(pLits[0]) );
1255 Vec_IntPush( vRes, pLits[0] );
1259 int nPart1 = nLits / 2;
1260 int nPart2 = nLits - nPart1;
1263 Vec_Int_t * vRes = Vec_IntAlloc( Vec_IntSize(vRes1) * Vec_IntSize(vRes2) );
1264 int i, k, Lit1, Lit2;
1268 Vec_IntFree( vRes1 );
1269 Vec_IntFree( vRes2 );
1274 Vec_Int_t * vIns = Vec_IntAlloc( nIns );
1275 Vec_Int_t * vData = Vec_IntAlloc( 1 << nIns );
1277 int i, iStart = 0, nSize = 1 << nIns;
1278 p->pName = Abc_UtilStrsav(
"mux" );
1279 for ( i = 0; i < nIns; i++ )
1280 Vec_IntPush( vIns, Gia_ManAppendCi(
p) );
1281 for ( i = 0; i < nSize; i++ )
1282 Vec_IntPush( vData, Gia_ManAppendCi(
p) );
1284 for ( i = (
int)
strlen(pNums)-1; i >= 0; i-- )
1286 int k, b, nBits = (int)(pNums[i] -
'0');
1288 for ( k = 0; k < nSize; k++ )
1289 Vec_IntWriteEntry( vData, k,
Gia_ManHashAnd(
p, Vec_IntEntry(vData, k), Vec_IntEntry(vDec, k%Vec_IntSize(vDec))) );
1290 for ( b = 0; b < nBits; b++, nSize /= 2 )
1291 for ( k = 0; k < nSize/2; k++ )
1292 Vec_IntWriteEntry( vData, k,
Gia_ManHashOr(
p, Vec_IntEntry(vData, 2*k), Vec_IntEntry(vData, 2*k+1)) );
1293 Vec_IntFree( vDec );
1297 Gia_ManAppendCo(
p, Vec_IntEntry(vData, 0) );
1298 Vec_IntFree( vIns );
1299 Vec_IntFree( vData );
1317static inline void Gia_ManGenSorterOne(
Gia_Man_t *
p,
int * pLits,
int i,
int k )
1319 int Lit1 = Gia_ManAppendAnd(
p, pLits[i], pLits[k] );
1320 int Lit2 = Gia_ManAppendOr (
p, pLits[i], pLits[k] );
1324static inline void Gia_ManGenSorterConstrMerge(
Gia_Man_t *
p,
int * pLits,
int lo,
int hi,
int r )
1326 int i, step = r * 2;
1327 if ( step < hi - lo )
1329 Gia_ManGenSorterConstrMerge(
p, pLits, lo, hi-r, step );
1330 Gia_ManGenSorterConstrMerge(
p, pLits, lo+r, hi, step );
1331 for ( i = lo+r; i < hi-r; i += step )
1332 Gia_ManGenSorterOne(
p, pLits, i, i+r );
1335static inline void Gia_ManGenSorterConstrRange(
Gia_Man_t *
p,
int * pLits,
int lo,
int hi )
1339 int i, mid = lo + (hi - lo) / 2;
1340 for ( i = lo; i <= mid; i++ )
1341 Gia_ManGenSorterOne(
p, pLits, i, i + (hi - lo + 1) / 2 );
1342 Gia_ManGenSorterConstrRange(
p, pLits, lo, mid );
1343 Gia_ManGenSorterConstrRange(
p, pLits, mid+1, hi );
1344 Gia_ManGenSorterConstrMerge(
p, pLits, lo, hi, 1 );
1349 int i, nVars = 1 << LogN;
1350 int nVarsAlloc = nVars + 2 * (nVars * LogN * (LogN-1) / 4 + nVars - 1);
1351 Vec_Int_t * vLits = Vec_IntAlloc( nVars );
1353 p->pName = Abc_UtilStrsav(
"sorter" );
1354 for ( i = 0; i < nVars; i++ )
1355 Vec_IntPush( vLits, Gia_ManAppendCi(
p) );
1356 Gia_ManGenSorterConstrRange(
p, Vec_IntArray(vLits), 0, nVars - 1 );
1357 for ( i = 0; i < nVars; i++ )
1358 Gia_ManAppendCo(
p, Vec_IntEntry(vLits, i) );
1359 Vec_IntFree( vLits );
1377 for ( i = 0; i < nVars; i++ )
1378 for ( k = 0; k < nVars; k++ )
1383 int i, k, nBits = Abc_Base2Log(nVars);
1384 for ( i = 0; i < nBits; i++ )
1385 for ( k = 0; k < nVars; k++ )
1387 p[i+1][k] = ((1 << i) - 1) | ((k >> (i+1)) << (i+1));
1391 int i, k, nBits = Abc_Base2Log(nVars);
1393 for ( i = 1; i < nBits; i++ )
1394 for ( k = (1 << i) - 1; k < nVars; k += (1 << i) )
1395 p[i][k] = k - (1 << (i-1));
1396 p[nBits][nVars-1] = (1<<(nBits-1))-1;
1397 for ( i = 1; i < nBits; i++ )
1398 for ( k = (1 << i) - 1; k < nVars-(1 << i); k += (1 << i) )
1399 p[2*nBits-1-i][nVars-1-k+((1<<(i-1))-1)] = nVars-1-k+((1<<(i-1))-1) - (1 << (i-1));
1403 int i, k, nBits = Abc_Base2Log(nVars);
1405 for ( k = 1; k < nVars; k += 2 )
1407 for ( i = 2; i <= nBits; i++ )
1408 for ( k = 1 + (1 << (i-1)); k < nVars; k += 2 )
1409 p[i][k] = k - (1 << (i-1));
1410 for ( k = 2; k < nVars; k += 2 )
1411 p[nBits+1][k] = k - 1;
1416 for ( i = 1; i < nVars; i++ )
1422 for ( i = nVars-1; i >= 0; i-- )
1423 printf(
"%2d ", i );
1425 for ( i = 0; i < nVars; i++ ) {
1426 for ( k = nVars-1; k >= 0; k-- )
1429 for ( k = nVars-1; k >= 0; k-- )
1430 if (
p[i][k] == -1 )
1433 printf(
"%2d ",
p[i][k] );
1445 int i, k, nBits = Abc_Base2Log(nVars), nVarsAlloc = (1 << nBits) + 2;
1447 printf(
"Generating %d-bit ", nVars );
1454 Gia_ManGenHC( nVars, pStore ), printf(
"Huan-Carlsson ");
1457 printf(
"adder with%s carry-in and carry-out\n", fCarries ?
"":
"out" );
1460 p->pName = Abc_UtilStrsav(
"adder" );
1461 int * pLitsI =
ABC_CALLOC(
int, 2*nVars+10 );
1462 for ( k = 0; k < nVars; k++ )
1463 pLitsI[2*k] = Gia_ManAppendCi(
p);
1464 for ( k = 0; k < nVars; k++ )
1465 pLitsI[2*k+1] = Gia_ManAppendCi(
p);
1466 int Carry = fCarries ? Gia_ManAppendCi(
p) : 0;
1468 for ( k = 0; k < nVars; k++ )
1469 Wlc_BlastFullAdder(
p, pLitsI[2*k], pLitsI[2*k+1], k ? 0 : Carry, &pLitsI[2*k+1], &pLitsI[2*k] );
1471 memcpy( pLits, pLitsI,
sizeof(
int)*2*nVars );
1472 for ( i = 1; i < nVars; i++ )
1473 for ( k = 1; k < nVars; k++ )
1474 if ( pStore[i][k] >= 0 )
1475 Gia_ManGenPrefix(
p, &pLits[2*k], &pLits[2*k+1], pLits[2*pStore[i][k]], pLits[2*pStore[i][k]+1] );
1476 for ( k = 0; k < nVars; k++ )
1477 Gia_ManAppendCo(
p, k ?
Gia_ManHashXor(
p, pLitsI[2*k], pLits[2*(k-1)+1]) : pLitsI[2*k] );
1479 Gia_ManAppendCo(
p, pLits[2*(k-1)+1] );
#define ABC_ALLOC(type, num)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
struct Vec_Str_t_ Vec_Str_t
ABC_NAMESPACE_IMPL_START void Extra_BitMatrixTransposeP(Vec_Wrd_t *vSimsIn, int nWordsIn, Vec_Wrd_t *vSimsOut, int nWordsOut)
DECLARATIONS ///.
int Gia_ManSimulateWordsInit(Gia_Man_t *p, Vec_Wrd_t *vSimsIn)
Vec_Int_t * Gia_ManSumGenDec(int n)
void Gia_ManGenCompact(Gia_Man_t *p, Vec_Int_t *vIn0, Vec_Int_t *vIn1, Vec_Int_t *vIn2, Vec_Int_t *vOut0, Vec_Int_t *vOut1)
Vec_Wec_t * Gia_ManGenNeuronCreateArgs(Vec_Wrd_t *vData, int nIBits, int nOBits)
void Gia_ManGenHC(int nVars, int **p)
Vec_Wrd_t * Gia_ManSimulateWordsOut(Gia_Man_t *p, Vec_Wrd_t *vSimsIn)
void Gia_ManSimLogStats(Gia_Man_t *p, char *pDumpFile, int Total, int Correct, int Guess)
void Gia_ManGenPrefix(Gia_Man_t *pNew, int *p, int *g, int p2, int g2)
void Gia_ManTestOneFile(Gia_Man_t *p, char *pFileName, char *pDumpFile)
Gia_Man_t * Gia_ManGenNeuron(char *pFileName, int nIBits, int nLutSize, int fDump, int fVerbose)
void Gia_ManDumpFiles(Gia_Man_t *p, int nCexesT, int nCexesV, int Seed, char *pFileName)
Vec_Str_t * Gia_ManSimulateAll(Gia_Man_t *p, Vec_Wrd_t *vSimsIn, Vec_Str_t *vSimsOut, int nExamples, int fVerbose)
Vec_Int_t * Gia_ManGenNeuronFinal(Gia_Man_t *pNew, Vec_Wec_t *vArgs, int nOBits)
void Gia_ManGenSK(int nVars, int **p)
void Gia_ManTestWordFile(Gia_Man_t *p, char *pFileName, char *pDumpFile, int fVerbose)
int Gia_ManSimulateWords(Gia_Man_t *p, int nWords)
void Gia_ManGenBK(int nVars, int **p)
void Gia_ManCompareValues2(int nInputs, Gia_Man_t *p, Vec_Wrd_t *vSimsIn, Vec_Str_t *vValues, char *pDumpFile)
void Gia_ManSumEnum(int n, Vec_Int_t *vDec)
void Gia_ManReadSimFile(char *pFileName, int *pnIns, int *pnOuts, int *pnPats, Vec_Wrd_t **pvSimsIn, Vec_Wrd_t **pvSimsOut)
Vec_Wec_t * Gia_ManGenNeuronTransformArgs(Gia_Man_t *pNew, Vec_Wec_t *vArgs, int nLutSize, int nOBits)
void Gia_ManGenPrint(int nVars, int **p)
void Gia_ManSumEnumTest()
void Gia_ManDumpPlaFiles(Gia_Man_t *p, int nCexesT, int nCexesV, int Seed, char *pFileName)
Vec_Int_t * Gia_GenDecoder(Gia_Man_t *p, int *pLits, int nLits)
void Gia_ManTestWordFileUnused(Gia_Man_t *p, char *pFileName, char *pDumpFile)
int Gia_ManSumCount(char *p, Vec_Int_t *vDec, int b)
void Gia_ManSimFileRead(char *pFileName, int nIns, int nWords, Vec_Wrd_t *vSimsIn, Vec_Int_t *vValues)
void Gia_ManGenRca(int nVars, int **p)
int Gia_ManReadCifar10File(char *pFileName, Vec_Wrd_t **pvSimsIn, Vec_Str_t **pvSimsOut, int *pnExamples)
int Gia_ManGenNeuronBitWidth(Vec_Wrd_t *vData, int nIBits)
Gia_Man_t * Gia_ManDupGenComp(int nBits, int fInterleave)
int Gia_ManSimParamRead(char *pFileName, int *pnIns, int *pnWords)
Gia_Man_t * Gia_ManGenMux(int nIns, char *pNums)
ABC_NAMESPACE_IMPL_START Gia_Man_t * Gia_DeriveAig(Vec_Wrd_t *vSims, Vec_Str_t *vSimsOut)
DECLARATIONS ///.
void Gia_ManGenNeuronAdder(Gia_Man_t *p, int nLits, int *pLitsA, int *pLitsB, int Carry, Vec_Int_t *vRes)
Gia_Man_t * Gia_ManGenAdder(int nVars, int fSK, int fBK, int fHC, int fCarries, int fVerbose)
void Gia_ManGenPrep(int nVars, int **p)
Vec_Wec_t * Gia_ManGenNeuronCompactArgs(Gia_Man_t *pNew, Vec_Wec_t *vArgs, int nLutSize, int nOBits)
void Gia_ManSimLogStats2(Gia_Man_t *p, char *pDumpFile, int Total, int nPositives, float ErrorTotal, float GuessTotal)
Gia_Man_t * Gia_ManGenSorter(int LogN)
int Gia_ManReadBinaryFile(char *pFileName, Vec_Wrd_t **pvSimsIn, Vec_Str_t **pvSimsOut)
int Gia_ManGetExampleValue(word **ppSims, int nSims, int iExample)
void Gia_ManGenNeuronDumpVerilog(Vec_Wrd_t *vData, int nIBits, int nOBits)
void Gia_ManCompareCifar10Values(Gia_Man_t *p, Vec_Str_t *vRes, Vec_Str_t *vSimsOut, char *pDumpFile, int nExamples)
void Gia_ManCompareValues(Gia_Man_t *p, Vec_Wrd_t *vSimsIn, Vec_Int_t *vValues, char *pDumpFile)
Vec_Str_t * Gia_ManSumEnum_rec(int Num)
int Gia_ManSimulateBatch(Gia_Man_t *p, Vec_Wrd_t *vSimsIn, Vec_Str_t *vSimsOut, Vec_Str_t *vSimsOut2, int b, int Limit)
void Gia_ManStop(Gia_Man_t *p)
void Gia_ManHashStart(Gia_Man_t *p)
#define Gia_ManForEachCoId(p, Id, i)
word Gia_ManRandomW(int fReset)
void Gia_ManHashAlloc(Gia_Man_t *p)
Gia_Man_t * Gia_ManStart(int nObjsMax)
FUNCTION DEFINITIONS ///.
int Gia_ManHashOr(Gia_Man_t *p, int iLit0, int iLit1)
struct Gia_Obj_t_ Gia_Obj_t
int Gia_ManHashXor(Gia_Man_t *p, int iLit0, int iLit1)
struct Gia_Man_t_ Gia_Man_t
#define Gia_ManForEachObj1(p, pObj, i)
Gia_Man_t * Gia_ManCleanup(Gia_Man_t *p)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
#define Gia_ManForEachCo(p, pObj, i)
int Gia_ManLevelNum(Gia_Man_t *p)
#define Gia_ManForEachCiId(p, Id, i)
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact, int fWriteNewLine)
unsigned __int64 word
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Bit_t_ Vec_Bit_t
INCLUDES ///.
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
#define Vec_IntForEachEntryThree(vVec1, vVec2, vVec3, Entry1, Entry2, Entry3, i)
#define Vec_WecForEachLevelStart(vGlob, vVec, i, LevelStart)
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Wrd_t_ Vec_Wrd_t
INCLUDES ///.
#define Vec_WrdForEachEntryStop(vVec, Entry, i, Stop)
void Wlc_BlastFullAdder(Gia_Man_t *pNew, int a, int b, int c, int *pc, int *ps)