ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
abcDec.c
Go to the documentation of this file.
1
20
21#include "misc/extra/extra.h"
22#include "misc/vec/vec.h"
23
24#include "bool/bdc/bdc.h"
25#include "bool/dec/dec.h"
26#include "bool/kit/kit.h"
27#include "opt/dau/dau.h"
28#include "misc/util/utilTruth.h"
29#include "opt/dsc/dsc.h"
30
32
33
37
38// decomposition type
39// 0 - none
40// 1 - factoring
41// 2 - bi-decomposition
42// 3 - DSD
43
44// data-structure to store a bunch of truth tables
47{
48 int nVars;
49 int nWords;
50 int nFuncs;
52};
53
54// read/write/flip i-th bit of a bit string table:
55static inline int Abc_TruthGetBit( word * p, int i ) { return (int)(p[i>>6] >> (i & 63)) & 1; }
56static inline void Abc_TruthSetBit( word * p, int i ) { p[i>>6] |= (((word)1)<<(i & 63)); }
57static inline void Abc_TruthXorBit( word * p, int i ) { p[i>>6] ^= (((word)1)<<(i & 63)); }
58
59// read/write k-th digit d of a hexadecimal number:
60static inline int Abc_TruthGetHex( word * p, int k ) { return (int)(p[k>>4] >> ((k<<2) & 63)) & 15; }
61static inline void Abc_TruthSetHex( word * p, int k, int d ) { p[k>>4] |= (((word)d)<<((k<<2) & 63)); }
62static inline void Abc_TruthXorHex( word * p, int k, int d ) { p[k>>4] ^= (((word)d)<<((k<<2) & 63)); }
63
67
68// read one hex character
69static inline int Abc_TruthReadHexDigit( char HexChar )
70{
71 if ( HexChar >= '0' && HexChar <= '9' )
72 return HexChar - '0';
73 if ( HexChar >= 'A' && HexChar <= 'F' )
74 return HexChar - 'A' + 10;
75 if ( HexChar >= 'a' && HexChar <= 'f' )
76 return HexChar - 'a' + 10;
77 assert( 0 ); // not a hexadecimal symbol
78 return -1; // return value which makes no sense
79}
80
81// write one hex character
82static inline void Abc_TruthWriteHexDigit( FILE * pFile, int HexDigit )
83{
84 assert( HexDigit >= 0 && HexDigit < 16 );
85 if ( HexDigit < 10 )
86 fprintf( pFile, "%d", HexDigit );
87 else
88 fprintf( pFile, "%c", 'A' + HexDigit-10 );
89}
90
91// read one truth table in hexadecimal
92void Abc_TruthReadHex( word * pTruth, char * pString, int nVars )
93{
94 int nWords = (nVars < 7)? 1 : (1 << (nVars-6));
95 int k, Digit, nDigits = (nVars < 7) ? (1 << (nVars-2)) : (nWords << 4);
96 char EndSymbol;
97 // skip the first 2 symbols if they are "0x"
98 if ( pString[0] == '0' && pString[1] == 'x' )
99 pString += 2;
100 // get the last symbol
101 EndSymbol = pString[nDigits];
102 // the end symbol of the TT (the one immediately following hex digits)
103 // should be one of the following: space, a new-line, or a zero-terminator
104 // (note that on Windows symbols '\r' can be inserted before each '\n')
105 assert( EndSymbol == ' ' || EndSymbol == '\n' || EndSymbol == '\r' || EndSymbol == '\0' );
106 // read hexadecimal digits in the reverse order
107 // (the last symbol in the string is the least significant digit)
108 for ( k = 0; k < nDigits; k++ )
109 {
110 Digit = Abc_TruthReadHexDigit( pString[nDigits - 1 - k] );
111 assert( Digit >= 0 && Digit < 16 );
112 Abc_TruthSetHex( pTruth, k, Digit );
113 }
114}
115
116// write one truth table in hexadecimal (do not add end-of-line!)
117void Abc_TruthWriteHex( FILE * pFile, word * pTruth, int nVars )
118{
119 int nDigits, Digit, k;
120 nDigits = (1 << (nVars-2));
121 for ( k = 0; k < nDigits; k++ )
122 {
123 Digit = Abc_TruthGetHex( pTruth, k );
124 assert( Digit >= 0 && Digit < 16 );
125 Abc_TruthWriteHexDigit( pFile, Digit );
126 }
127}
128
129
141Abc_TtStore_t * Abc_TruthStoreAlloc( int nVars, int nFuncs )
142{
144 int i;
145 p = (Abc_TtStore_t *)malloc( sizeof(Abc_TtStore_t) );
146 p->nVars = nVars;
147 p->nWords = (nVars < 7) ? 1 : (1 << (nVars-6));
148 p->nFuncs = nFuncs;
149 // alloc storage for 'nFuncs' truth tables as one chunk of memory
150 p->pFuncs = (word **)malloc( (sizeof(word *) + sizeof(word) * p->nWords) * p->nFuncs );
151 // assign and clean the truth table storage
152 p->pFuncs[0] = (word *)(p->pFuncs + p->nFuncs);
153 memset( p->pFuncs[0], 0, sizeof(word) * p->nWords * p->nFuncs );
154 // split it up into individual truth tables
155 for ( i = 1; i < p->nFuncs; i++ )
156 p->pFuncs[i] = p->pFuncs[i-1] + p->nWords;
157 return p;
158}
159Abc_TtStore_t * Abc_TruthStoreAlloc2( int nVars, int nFuncs, word * pBuffer )
160{
162 int i;
163 p = (Abc_TtStore_t *)malloc( sizeof(Abc_TtStore_t) );
164 p->nVars = nVars;
165 p->nWords = (nVars < 7) ? 1 : (1 << (nVars-6));
166 p->nFuncs = nFuncs;
167 // alloc storage for 'nFuncs' truth tables as one chunk of memory
168 p->pFuncs = (word **)malloc( sizeof(word *) * p->nFuncs );
169 // assign and clean the truth table storage
170 p->pFuncs[0] = pBuffer;
171 // split it up into individual truth tables
172 for ( i = 1; i < p->nFuncs; i++ )
173 p->pFuncs[i] = p->pFuncs[i-1] + p->nWords;
174 return p;
175}
176void Abc_TtStoreFree( Abc_TtStore_t * p, int nVarNum )
177{
178 if ( nVarNum >= 0 )
179 ABC_FREE( p->pFuncs[0] );
180 ABC_FREE( p->pFuncs );
181 ABC_FREE( p );
182}
183
195int Abc_FileSize( char * pFileName )
196{
197 FILE * pFile;
198 int nFileSize;
199 pFile = fopen( pFileName, "rb" );
200 if ( pFile == NULL )
201 {
202 printf( "Cannot open file \"%s\" for reading.\n", pFileName );
203 return -1;
204 }
205 // get the file size, in bytes
206 fseek( pFile, 0, SEEK_END );
207 nFileSize = ftell( pFile );
208 fclose( pFile );
209 return nFileSize;
210}
211
223char * Abc_FileRead( char * pFileName )
224{
225 FILE * pFile;
226 char * pBuffer;
227 int nFileSize, RetValue;
228 pFile = fopen( pFileName, "rb" );
229 if ( pFile == NULL )
230 {
231 printf( "Cannot open file \"%s\" for reading.\n", pFileName );
232 return NULL;
233 }
234 // get the file size, in bytes
235 fseek( pFile, 0, SEEK_END );
236 nFileSize = ftell( pFile );
237 // move the file current reading position to the beginning
238 rewind( pFile );
239 // load the contents of the file into memory
240 pBuffer = (char *)malloc( nFileSize + 3 );
241 RetValue = fread( pBuffer, nFileSize, 1, pFile );
242 // add several empty lines at the end
243 // (these will be used to signal the end of parsing)
244 pBuffer[ nFileSize + 0] = '\n';
245 pBuffer[ nFileSize + 1] = '\n';
246 // terminate the string with '\0'
247 pBuffer[ nFileSize + 2] = '\0';
248 fclose( pFile );
249 return pBuffer;
250}
251
263void Abc_TruthGetParams( char * pFileName, int * pnVars, int * pnTruths )
264{
265 char * pContents;
266 int i, nVars, nLines;
267 // prepare the output
268 if ( pnVars )
269 *pnVars = 0;
270 if ( pnTruths )
271 *pnTruths = 0;
272 // read data from file
273 pContents = Abc_FileRead( pFileName );
274 if ( pContents == NULL )
275 return;
276 // count the number of symbols before the first space or new-line
277 // (note that on Windows symbols '\r' can be inserted before each '\n')
278 for ( i = 0; pContents[i]; i++ )
279 if ( pContents[i] == ' ' || pContents[i] == '\n' || pContents[i] == '\r' )
280 break;
281 if ( pContents[i] == 0 )
282 printf( "Strange, the input file does not have spaces and new-lines...\n" );
283
284 // acount for the fact that truth tables may have "0x" at the beginning of each line
285 if ( pContents[0] == '0' && pContents[1] == 'x' )
286 i = i - 2;
287
288 // determine the number of variables
289 for ( nVars = 0; nVars < 32; nVars++ )
290 if ( 4 * i == (1 << nVars) ) // the number of bits equal to the size of truth table
291 break;
292 if ( nVars < 2 || nVars > 16 )
293 {
294 printf( "Does not look like the input file contains truth tables...\n" );
295 return;
296 }
297 if ( pnVars )
298 *pnVars = nVars;
299
300 // determine the number of functions by counting the lines
301 nLines = 0;
302 for ( i = 0; pContents[i]; i++ )
303 nLines += (pContents[i] == '\n');
304 if ( pnTruths )
305 *pnTruths = nLines;
306 ABC_FREE( pContents );
307}
308
309
321void Abc_TruthStoreRead( char * pFileName, Abc_TtStore_t * p )
322{
323 char * pContents;
324 int i, nLines;
325 pContents = Abc_FileRead( pFileName );
326 if ( pContents == NULL )
327 return;
328 // here it is assumed (without checking!) that each line of the file
329 // begins with a string of hexadecimal chars followed by space
330
331 // the file will be read till the first empty line (pContents[i] == '\n')
332 // (note that Abc_FileRead() added several empty lines at the end of the file contents)
333 for ( nLines = i = 0; pContents[i] != '\n'; )
334 {
335 // read one line
336 Abc_TruthReadHex( p->pFuncs[nLines++], &pContents[i], p->nVars );
337 // skip till after the end-of-line symbol
338 // (note that end-of-line symbol is also skipped)
339 while ( pContents[i++] != '\n' );
340 }
341 // adjust the number of functions read
342 // (we may have allocated more storage because some lines in the file were empty)
343 assert( p->nFuncs >= nLines );
344 p->nFuncs = nLines;
345 ABC_FREE( pContents );
346}
347
359void Abc_TtStoreWrite( char * pFileName, Abc_TtStore_t * p, int fBinary )
360{
361 FILE * pFile;
362 char pBuffer[1000];
363 int i, nBytes = 8 * Abc_Truth6WordNum( p->nVars );
364 pFile = fopen( pFileName, "wb" );
365 if ( pFile == NULL )
366 {
367 printf( "Cannot open file \"%s\" for writing.\n", pFileName );
368 return;
369 }
370 for ( i = 0; i < p->nFuncs; i++ )
371 {
372 if ( fBinary )
373 fwrite( p->pFuncs[i], nBytes, 1, pFile );
374 else
375 {
376 Abc_TruthWriteHex( pFile, p->pFuncs[i], p->nVars ), fprintf( pFile, " " );
377 Dau_DsdDecompose( p->pFuncs[i], p->nVars, 0, (int)(p->nVars <= 10), pBuffer );
378 fprintf( pFile, "%s\n", pBuffer );
379 }
380 }
381 fclose( pFile );
382}
383
384
396Abc_TtStore_t * Abc_TtStoreLoad( char * pFileName, int nVarNum )
397{
399 if ( nVarNum < 0 )
400 {
401 int nVars, nTruths;
402 // figure out how many truth table and how many variables
403 Abc_TruthGetParams( pFileName, &nVars, &nTruths );
404 if ( nVars < 2 || nVars > 16 || nTruths == 0 )
405 return NULL;
406 // allocate data-structure
407 p = Abc_TruthStoreAlloc( nVars, nTruths );
408 // read info from file
409 Abc_TruthStoreRead( pFileName, p );
410 }
411 else
412 {
413 char * pBuffer;
414 int nFileSize = Abc_FileSize( pFileName );
415 int nBytes = (1 << (nVarNum-3));
416 int nTruths = nFileSize / nBytes;
417 if ( nFileSize == -1 )
418 return NULL;
419 assert( nVarNum >= 6 );
420 if ( nFileSize % nBytes != 0 )
421 Abc_Print( 0, "The file size (%d) is divided by the truth table size (%d) with remainder (%d).\n",
422 nFileSize, nBytes, nFileSize % nBytes );
423 // read file contents
424 pBuffer = Abc_FileRead( pFileName );
425 // allocate data-structure
426 p = Abc_TruthStoreAlloc2( nVarNum, nTruths, (word *)pBuffer );
427 }
428 return p;
429}
430
442void Abc_TtStoreLoadSave( char * pFileName )
443{
445 char * pFileInput = pFileName;
446 char * pFileOutput = Extra_FileNameGenericAppend(pFileName, "_binary.data");
447
448 // read info from file
449 p = Abc_TtStoreLoad( pFileInput, -1 );
450 if ( p == NULL )
451 return;
452
453 // write into another file
454 Abc_TtStoreWrite( pFileOutput, p, 1 );
455
456 // delete data-structure
457 Abc_TtStoreFree( p, -1 );
458 printf( "Input file \"%s\" was copied into output file \"%s\".\n", pFileInput, pFileOutput );
459}
460
472void Abc_TtStoreDump( char * pFileName, Vec_Mem_t * vTtMem, int nBytes )
473{
474 word * pTruth; int i;
475 FILE * pFile = fopen( pFileName, "wb" );
476 if ( pFile == NULL )
477 {
478 printf( "Cannot open file \"%s\" for writing.\n", pFileName );
479 return;
480 }
481 Vec_MemForEachEntry( vTtMem, pTruth, i )
482 fwrite( pTruth, nBytes, 1, pFile );
483 fclose( pFile );
484}
485
497void Abc_TtStoreLoadSaveBin( char * pFileName )
498{
499 unsigned * pTruth = ABC_CALLOC( unsigned, (1 << 11) );
500 char * pBuffer = ABC_CALLOC( char, (1 << 16) );
501 char * pFileInput = pFileName;
502 char * pFileOutput = Extra_FileNameGenericAppend(pFileName, "_binary.data");
503 FILE * pFileI = fopen( pFileInput, "rb" );
504 FILE * pFileO = fopen( pFileOutput, "wb" );
505 int i, Value, nVarsAll = -1;
506 if ( pFileI == NULL )
507 return;
508 while ( fgets(pBuffer, (1 << 16), pFileI) )
509 {
510 int Len = strlen(pBuffer)-1; // subtract 1 for end-of-line
511 int nVars = Abc_Base2Log(Len);
512 int nInts = Abc_BitWordNum(Len);
513 assert( Len == (1 << nVars) );
514 if ( nVarsAll == -1 )
515 nVarsAll = nVars;
516 else
517 assert( nVarsAll == nVars );
518 memset( pTruth, 0, sizeof(int)*nInts );
519 for ( i = 0; i < Len; i++ )
520 if ( pBuffer[i] == '1' )
521 Abc_InfoSetBit( pTruth, i );
522 else
523 assert( pBuffer[i] == '0' );
524 Value = fwrite( pTruth, 1, sizeof(int) * nInts, pFileO );
525 assert( Value == (int)sizeof(int) * nInts );
526 }
527 ABC_FREE( pTruth );
528 ABC_FREE( pBuffer );
529 fclose( pFileI );
530 fclose( pFileO );
531 printf( "Input file \"%s\" was copied into output file \"%s\".\n", pFileInput, pFileOutput );
532}
533
545void Abc_TtStoreTest( char * pFileName )
546{
548 char * pFileInput = pFileName;
549 char * pFileOutput = "out.txt";
550
551 // read info from file
552 p = Abc_TtStoreLoad( pFileInput, -1 );
553 if ( p == NULL )
554 return;
555
556 // write into another file
557 Abc_TtStoreWrite( pFileOutput, p, 0 );
558
559 // delete data-structure
560 Abc_TtStoreFree( p, -1 );
561 printf( "Input file \"%s\" was copied into output file \"%s\".\n", pFileInput, pFileOutput );
562}
563
575void Abc_TruthDecPerform( Abc_TtStore_t * p, int DecType, int fVerbose )
576{
577 abctime clk = Abc_Clock();
578 int i, nNodes = 0;
579
580 char * pAlgoName = NULL;
581 if ( DecType == 1 )
582 pAlgoName = "factoring";
583 else if ( DecType == 2 )
584 pAlgoName = "bi-decomp";
585 else if ( DecType == 3 )
586 pAlgoName = "DSD";
587 else if ( DecType == 4 )
588 pAlgoName = "fast DSD";
589 else if ( DecType == 5 )
590 pAlgoName = "analysis";
591 else if ( DecType == 6 )
592 pAlgoName = "DSD ICCD'15";
593
594 if ( pAlgoName )
595 printf( "Applying %-10s to %8d func%s of %2d vars... ",
596 pAlgoName, p->nFuncs, (p->nFuncs == 1 ? "":"s"), p->nVars );
597 if ( fVerbose )
598 printf( "\n" );
599
600 if ( DecType == 1 )
601 {
602 // perform algebraic factoring and count AIG nodes
603 Dec_Graph_t * pFForm;
604 Vec_Int_t * vCover;
605 Vec_Str_t * vStr;
606 char * pSopStr;
607 vStr = Vec_StrAlloc( 10000 );
608 vCover = Vec_IntAlloc( 1 << 16 );
609 for ( i = 0; i < p->nFuncs; i++ )
610 {
611// extern int Abc_IsopTest( word * pFunc, int nVars, Vec_Int_t * vCover );
612// if ( i == 0 ) printf( "\n" );
613// Abc_IsopTest( p->pFuncs[i], p->nVars, vCover );
614// continue;
615 if ( fVerbose )
616 printf( "%7d : ", i );
617 pSopStr = Kit_PlaFromTruthNew( (unsigned *)p->pFuncs[i], p->nVars, vCover, vStr );
618 pFForm = Dec_Factor( pSopStr );
619 nNodes += Dec_GraphNodeNum( pFForm );
620 if ( fVerbose )
621 Dec_GraphPrint( stdout, pFForm, NULL, NULL );
622 Dec_GraphFree( pFForm );
623 }
624 Vec_IntFree( vCover );
625 Vec_StrFree( vStr );
626 }
627 else if ( DecType == 2 )
628 {
629 // perform bi-decomposition and count AIG nodes
630 Bdc_Man_t * pManDec;
631 Bdc_Par_t Pars = {0}, * pPars = &Pars;
632 pPars->nVarsMax = p->nVars;
633 pManDec = Bdc_ManAlloc( pPars );
634 for ( i = 0; i < p->nFuncs; i++ )
635 {
636 if ( fVerbose )
637 printf( "%7d : ", i );
638 Bdc_ManDecompose( pManDec, (unsigned *)p->pFuncs[i], NULL, p->nVars, NULL, 1000 );
639 nNodes += Bdc_ManAndNum( pManDec );
640 if ( fVerbose )
641 Bdc_ManDecPrint( pManDec );
642 }
643 Bdc_ManFree( pManDec );
644 }
645 else if ( DecType == 3 )
646 {
647 // perform disjoint-support decomposition and count AIG nodes
648 // (non-DSD blocks are decomposed into 2:1 MUXes, each counting as 3 AIG nodes)
649 Kit_DsdNtk_t * pNtk;
650 for ( i = 0; i < p->nFuncs; i++ )
651 {
652 if ( fVerbose )
653 printf( "%7d : ", i );
654 pNtk = Kit_DsdDecomposeMux( (unsigned *)p->pFuncs[i], p->nVars, 3 );
655 if ( fVerbose )
656 Kit_DsdPrintExpanded( pNtk ), printf( "\n" );
657 nNodes += Kit_DsdCountAigNodes( pNtk );
658 Kit_DsdNtkFree( pNtk );
659 }
660 }
661 else if ( DecType == 4 )
662 {
663 char pDsd[DAU_MAX_STR];
664 for ( i = 0; i < p->nFuncs; i++ )
665 {
666 if ( fVerbose )
667 printf( "%7d : ", i );
668 Dau_DsdDecompose( p->pFuncs[i], p->nVars, 0, 1, pDsd );
669 if ( fVerbose )
670 printf( "%s\n", pDsd );
671 nNodes += Dau_DsdCountAnds( pDsd );
672 }
673 }
674 else if ( DecType == 5 )
675 {
676 for ( i = 0; i < p->nFuncs; i++ )
677 {
678 extern void Dau_DecTrySets( word * pInit, int nVars, int fVerbose );
679 int nSuppSize = Abc_TtSupportSize( p->pFuncs[i], p->nVars );
680 if ( fVerbose )
681 printf( "%7d : ", i );
682 Dau_DecTrySets( p->pFuncs[i], nSuppSize, fVerbose );
683 if ( fVerbose )
684 printf( "\n" );
685 }
686 } else if ( DecType == 6 )
687 {
688 char pDsd[DSC_MAX_STR];
689 /* memory pool with a capacity of storing 3*nVars
690 truth-tables for negative and positive cofactors and
691 the boolean difference for each input variable */
692 word *mem_pool = Dsc_alloc_pool(p->nVars);
693 for ( i = 0; i < p->nFuncs; i++ )
694 {
695 if ( fVerbose )
696 printf( "%7d : ", i );
697 Dsc_Decompose(p->pFuncs[i], p->nVars, pDsd, mem_pool);
698 if ( fVerbose )
699 printf( "%s\n", pDsd[0] ? pDsd : "NULL");
700 nNodes += Dsc_CountAnds( pDsd );
701 }
702 Dsc_free_pool(mem_pool);
703 }
704 else assert( 0 );
705
706 printf( "AIG nodes =%9d ", nNodes );
707 Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
708}
709
721void Abc_TruthDecTest( char * pFileName, int DecType, int nVarNum, int fVerbose )
722{
724
725 // allocate data-structure
726 p = Abc_TtStoreLoad( pFileName, nVarNum );
727 if ( p == NULL ) return;
728
729 // consider functions from the file
730 Abc_TruthDecPerform( p, DecType, fVerbose );
731
732 // delete data-structure
733 Abc_TtStoreFree( p, nVarNum );
734// printf( "Finished decomposing truth tables from file \"%s\".\n", pFileName );
735}
736
748Vec_Mem_t * Abc_TruthDecRead( char * pFileName, int nVarNum )
749{
750 Abc_TtStore_t * p; int i;
751 if ( nVarNum < 6 )
752 nVarNum = 6;
753
754 // allocate data-structure
755 p = Abc_TtStoreLoad( pFileName, nVarNum );
756 if ( p == NULL ) return NULL;
757
758 // consider functions from the file
759 Vec_Mem_t * vTtMem = Vec_MemAllocForTTSimple( nVarNum );
760 for ( i = 0; i < p->nFuncs; i++ )
761 Vec_MemHashInsert( vTtMem, (word *)p->pFuncs[i] );
762
763 // delete data-structure
764 Abc_TtStoreFree( p, nVarNum );
765// printf( "Finished decomposing truth tables from file \"%s\".\n", pFileName );
766 return vTtMem;
767}
768
769
781int Abc_DecTest( char * pFileName, int DecType, int nVarNum, int fVerbose )
782{
783 if ( fVerbose )
784 printf( "Using truth tables from file \"%s\"...\n", pFileName );
785 if ( DecType == 0 )
786 { if ( nVarNum < 0 ) Abc_TtStoreTest( pFileName ); }
787 else if ( DecType >= 1 && DecType <= 6 )
788 Abc_TruthDecTest( pFileName, DecType, nVarNum, fVerbose );
789 else
790 printf( "Unknown decomposition type value (%d).\n", DecType );
791 fflush( stdout );
792 return 0;
793}
794
798
799
801
void Abc_TruthWriteHex(FILE *pFile, word *pTruth, int nVars)
Definition abcDec.c:117
void Abc_TtStoreLoadSaveBin(char *pFileName)
Definition abcDec.c:497
int Abc_DecTest(char *pFileName, int DecType, int nVarNum, int fVerbose)
Definition abcDec.c:781
void Abc_TruthStoreRead(char *pFileName, Abc_TtStore_t *p)
Definition abcDec.c:321
int Abc_FileSize(char *pFileName)
Definition abcDec.c:195
void Abc_TruthReadHex(word *pTruth, char *pString, int nVars)
Definition abcDec.c:92
void Abc_TtStoreLoadSave(char *pFileName)
Definition abcDec.c:442
Abc_TtStore_t * Abc_TruthStoreAlloc2(int nVars, int nFuncs, word *pBuffer)
Definition abcDec.c:159
void Abc_TruthDecTest(char *pFileName, int DecType, int nVarNum, int fVerbose)
Definition abcDec.c:721
void Abc_TruthGetParams(char *pFileName, int *pnVars, int *pnTruths)
Definition abcDec.c:263
Vec_Mem_t * Abc_TruthDecRead(char *pFileName, int nVarNum)
Definition abcDec.c:748
void Abc_TtStoreDump(char *pFileName, Vec_Mem_t *vTtMem, int nBytes)
Definition abcDec.c:472
void Abc_TtStoreWrite(char *pFileName, Abc_TtStore_t *p, int fBinary)
Definition abcDec.c:359
void Abc_TtStoreFree(Abc_TtStore_t *p, int nVarNum)
Definition abcDec.c:176
void Abc_TruthDecPerform(Abc_TtStore_t *p, int DecType, int fVerbose)
Definition abcDec.c:575
Abc_TtStore_t * Abc_TtStoreLoad(char *pFileName, int nVarNum)
Definition abcDec.c:396
Abc_TtStore_t * Abc_TruthStoreAlloc(int nVars, int nFuncs)
Definition abcDec.c:141
void Abc_TtStoreTest(char *pFileName)
Definition abcDec.c:545
char * Abc_FileRead(char *pFileName)
Definition abcDec.c:223
int nWords
Definition abcNpn.c:127
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_CALLOC(type, num)
Definition abc_global.h:265
#define ABC_FREE(obj)
Definition abc_global.h:267
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition bblif.c:37
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46
struct Bdc_Par_t_ Bdc_Par_t
Definition bdc.h:44
struct Bdc_Man_t_ Bdc_Man_t
Definition bdc.h:43
void Bdc_ManDecPrint(Bdc_Man_t *p)
Definition bdcCore.c:260
void Bdc_ManFree(Bdc_Man_t *p)
Definition bdcCore.c:113
int Bdc_ManAndNum(Bdc_Man_t *p)
Definition bdcCore.c:49
int Bdc_ManDecompose(Bdc_Man_t *p, unsigned *puFunc, unsigned *puCare, int nVars, Vec_Ptr_t *vDivs, int nNodesMax)
Definition bdcCore.c:291
Bdc_Man_t * Bdc_ManAlloc(Bdc_Par_t *pPars)
MACRO DEFINITIONS ///.
Definition bdcCore.c:68
void Dau_DecTrySets(word *pInit, int nVars, int fVerbose)
Definition dauNonDsd.c:831
int Dau_DsdDecompose(word *pTruth, int nVarsInit, int fSplitPrime, int fWriteTruth, char *pRes)
Definition dauDsd.c:1912
#define DAU_MAX_STR
Definition dau.h:43
int Dau_DsdCountAnds(char *pDsd)
Definition dauDsd.c:316
void Dec_GraphPrint(FILE *pFile, Dec_Graph_t *pGraph, char *pNamesIn[], char *pNameOut)
FUNCTION DEFINITIONS ///.
Definition decPrint.c:49
Dec_Graph_t * Dec_Factor(char *pSop)
FUNCTION DECLARATIONS ///.
Definition decFactor.c:58
struct Dec_Graph_t_ Dec_Graph_t
Definition dec.h:68
#define Len
Definition deflate.h:78
int Dsc_CountAnds(char *pDsd)
Definition dsc.c:513
void Dsc_free_pool(word *pool)
Definition dsc.c:297
int Dsc_Decompose(word *pTruth, const int nVarsInit, char *const pRes, word *pool)
Definition dsc.c:311
word * Dsc_alloc_pool(int nVars)
BASIC TYPES ///.
Definition dsc.c:290
#define DSC_MAX_STR
Definition dsc.h:41
Cube * p
Definition exorList.c:222
char * Extra_FileNameGenericAppend(char *pBase, char *pSuffix)
unsigned __int64 word
DECLARATIONS ///.
Definition kitPerm.c:36
char * Kit_PlaFromTruthNew(unsigned *pTruth, int nVars, Vec_Int_t *vCover, Vec_Str_t *vStr)
Definition kitPla.c:406
void Kit_DsdNtkFree(Kit_DsdNtk_t *pNtk)
Definition kitDsd.c:164
int Kit_DsdCountAigNodes(Kit_DsdNtk_t *pNtk)
Definition kitDsd.c:1896
struct Kit_DsdNtk_t_ Kit_DsdNtk_t
Definition kit.h:124
Kit_DsdNtk_t * Kit_DsdDecomposeMux(unsigned *pTruth, int nVars, int nDecMux)
Definition kitDsd.c:2351
void Kit_DsdPrintExpanded(Kit_DsdNtk_t *pNtk)
Definition kitDsd.c:472
word ** pFuncs
Definition abcDec.c:51
int nVarsMax
Definition bdc.h:48
typedefABC_NAMESPACE_IMPL_START struct Vec_Mem_t_ Vec_Mem_t
DECLARATIONS ///.
Definition utilMem.c:35
#define assert(ex)
Definition util_old.h:213
char * memset()
int strlen()
VOID_HACK rewind()
char * malloc()
#define Vec_MemForEachEntry(p, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecMem.h:68
#define SEEK_END
Definition zconf.h:392