172 char * pFileName, * pTemp;
173 int c, fCheck, fBarBufs, fReadGia;
207 for ( pTemp = pFileName; *pTemp; pTemp++ )
208 if ( *pTemp ==
'>' || *pTemp ==
'\\' )
214 sprintf( Command,
"read_genlib %s", pFileName );
216 sprintf( Command,
"read_lib %s", pFileName );
218 sprintf( Command,
"read_scl %s", pFileName );
220 sprintf( Command,
"read_super %s", pFileName );
222 sprintf( Command,
"read_constr %s", pFileName );
224 sprintf( Command,
"so %s", pFileName );
226 sprintf( Command,
"dsd_load %s", pFileName );
241 Abc_Print( 1,
"Abc_CommandBlast(): Bit-blasting has failed.\n" );
251 Abc_Print( 1,
"Cannot read mapped design when the library is not given.\n" );
260 Abc_Print( 0,
"The new network has no primary inputs. It is recommended\n" );
261 Abc_Print( 1,
"to add a dummy PI to make sure all commands work correctly.\n" );
270 fprintf( pAbc->Err,
"usage: read [-mcbgh] <file>\n" );
271 fprintf( pAbc->Err,
"\t replaces the current network by the network read from <file>\n" );
272 fprintf( pAbc->Err,
"\t by calling the parser that matches the extension of <file>\n" );
273 fprintf( pAbc->Err,
"\t (to read a hierarchical design, use \"read_hie\")\n" );
274 fprintf( pAbc->Err,
"\t-m : toggle reading mapped Verilog [default = %s]\n",
glo_fMapped?
"yes":
"no" );
275 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
276 fprintf( pAbc->Err,
"\t-b : toggle reading barrier buffers [default = %s]\n", fBarBufs?
"yes":
"no" );
277 fprintf( pAbc->Err,
"\t-g : toggle reading and flattening into &-space [default = %s]\n", fBarBufs?
"yes":
"no" );
278 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
279 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
330 fprintf( pAbc->Err,
"usage: read_aiger [-ch] <file>\n" );
331 fprintf( pAbc->Err,
"\t reads the network in the AIGER format (http://fmv.jku.at/aiger)\n" );
332 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
333 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
334 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
385 fprintf( pAbc->Err,
"usage: read_baf [-ch] <file>\n" );
386 fprintf( pAbc->Err,
"\t reads the network in Binary Aig Format (BAF)\n" );
387 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
388 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
389 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
440 fprintf( pAbc->Err,
"usage: read_bblif [-ch] <file>\n" );
441 fprintf( pAbc->Err,
"\t reads the network in a binary BLIF format\n" );
442 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
443 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
444 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
504 else if ( fUseNewParser )
528 fprintf( pAbc->Err,
"usage: read_blif [-nmach] <file>\n" );
529 fprintf( pAbc->Err,
"\t reads the network in binary BLIF format\n" );
530 fprintf( pAbc->Err,
"\t (if this command does not work, try \"read\")\n" );
531 fprintf( pAbc->Err,
"\t-n : toggle using old BLIF parser without hierarchy support [default = %s]\n", !fUseNewParser?
"yes":
"no" );
532 fprintf( pAbc->Err,
"\t-m : toggle saving original circuit names into a file [default = %s]\n", fSaveNames?
"yes":
"no" );
533 fprintf( pAbc->Err,
"\t-a : toggle creating AIG while reading the file [default = %s]\n", fReadAsAig?
"yes":
"no" );
534 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
535 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
536 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
587 fprintf( pAbc->Err,
"usage: read_blif_mv [-ch] <file>\n" );
588 fprintf( pAbc->Err,
"\t reads the network in BLIF-MV format\n" );
589 fprintf( pAbc->Err,
"\t (if this command does not work, try \"read\")\n" );
590 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
591 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
592 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
643 fprintf( pAbc->Err,
"usage: read_bench [-ch] <file>\n" );
644 fprintf( pAbc->Err,
"\t reads the network in BENCH format\n" );
645 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
646 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
647 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
699 fprintf( pAbc->Err,
"usage: read_dsd [-h] <formula>\n" );
700 fprintf( pAbc->Err,
"\t parses a formula representing DSD of a function\n" );
701 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
702 fprintf( pAbc->Err,
"\tformula : the formula representing disjoint-support decomposition (DSD)\n" );
703 fprintf( pAbc->Err,
"\t Example of a formula: !(a*(b+CA(!d,e*f,c))*79B3(g,h,i,k))\n" );
704 fprintf( pAbc->Err,
"\t where \'!\' is an INV, \'*\' is an AND, \'+\' is an XOR, \n" );
705 fprintf( pAbc->Err,
"\t CA and 79B3 are hexadecimal representations of truth tables\n" );
706 fprintf( pAbc->Err,
"\t (in this case CA=11001010 is truth table of MUX(Data0,Data1,Ctrl))\n" );
707 fprintf( pAbc->Err,
"\t The lower chars (a,b,c,etc) are reserved for elementary variables.\n" );
708 fprintf( pAbc->Err,
"\t The upper chars (A,B,C,etc) are reserved for hexadecimal digits.\n" );
709 fprintf( pAbc->Err,
"\t No spaces are allowed in formulas. In parantheses, LSB goes first.\n" );
760 fprintf( pAbc->Err,
"usage: read_edif [-ch] <file>\n" );
761 fprintf( pAbc->Err,
"\t reads the network in EDIF (works only for ISCAS benchmarks)\n" );
762 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
763 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
764 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
815 fprintf( pAbc->Err,
"usage: read_eqn [-ch] <file>\n" );
816 fprintf( pAbc->Err,
"\t reads the network in equation format\n" );
817 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
818 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
819 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
861 fprintf( pErr,
"Empty network.\n" );
867 else if ( pNtk->
pSpec )
871 printf(
"File name should be given on the command line.\n" );
884 fprintf( pAbc->Err,
"usage: read_init [-h] <file>\n" );
885 fprintf( pAbc->Err,
"\t reads initial state of the network in BENCH format\n" );
886 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
887 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
937 pNtk =
Io_ReadPla( pFileName, fZeros, fCheck );
940 printf(
"Reading PLA file has failed.\n" );
956 fprintf( pAbc->Err,
"usage: read_pla [-zch] <file>\n" );
957 fprintf( pAbc->Err,
"\t reads the network in PLA\n" );
958 fprintf( pAbc->Err,
"\t-z : toggle reading on-set and off-set [default = %s]\n", fZeros?
"off-set":
"on-set" );
959 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
960 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
961 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1009 if ( pSopCover == NULL || pSopCover[0] == 0 )
1012 fprintf( pAbc->Err,
"Reading truth table has failed.\n" );
1020 fprintf( pAbc->Err,
"Deriving the network has failed.\n" );
1029 fprintf( pAbc->Err,
"usage: read_truth [-xh] <truth>\n" );
1030 fprintf( pAbc->Err,
"\t creates network with node having given truth table\n" );
1031 fprintf( pAbc->Err,
"\t-x : toggles between bin and hex representation [default = %s]\n", fHex?
"hex":
"bin" );
1032 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1033 fprintf( pAbc->Err,
"\ttruth : truth table with most signficant bit first (e.g. 1000 for AND(a,b))\n" );
1052 int fCheck, fBarBufs;
1092 fprintf( pAbc->Err,
"usage: read_verilog [-mcbh] <file>\n" );
1093 fprintf( pAbc->Err,
"\t reads the network in Verilog (IWLS 2002/2005 subset)\n" );
1094 fprintf( pAbc->Err,
"\t-m : toggle reading mapped Verilog [default = %s]\n",
glo_fMapped?
"yes":
"no" );
1095 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
1096 fprintf( pAbc->Err,
"\t-b : toggle reading barrier buffers [default = %s]\n", fBarBufs?
"yes":
"no" );
1097 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1098 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1138 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
1140 fprintf( pAbc->Err,
"Cannot open input file \"%s\". \n", pFileName );
1151 fprintf( pAbc->Err,
"usage: read_status [-ch] <file>\n" );
1152 fprintf( pAbc->Err,
"\t reads verification log file\n" );
1153 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1154 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1195 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
1197 fprintf( pAbc->Err,
"Cannot open input file \"%s\". \n", pFileName );
1208 fprintf( pAbc->Err,
"usage: &read_gig [-h] <file>\n" );
1209 fprintf( pAbc->Err,
"\t reads design in GIG format\n" );
1210 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1211 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1252 sprintf( Command,
"write_genlib %s", pFileName );
1254 sprintf( Command,
"write_liberty %s", pFileName );
1256 sprintf( Command,
"dsd_save %s", pFileName );
1262 if ( pAbc->pNtkCur == NULL )
1264 fprintf( pAbc->Out,
"Empty network.\n" );
1272 fprintf( pAbc->Err,
"usage: write [-h] <file>\n" );
1273 fprintf( pAbc->Err,
"\t writes the current network into <file> by calling\n" );
1274 fprintf( pAbc->Err,
"\t the writer that matches the extension of <file>\n" );
1275 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
1276 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
1293 char * pBaseName, * pFileName;
1311 if ( pAbc->pNtkCur == NULL )
1313 fprintf( pAbc->Out,
"Empty network.\n" );
1323 Io_WriteHie( pAbc->pNtkCur, pBaseName, pFileName );
1327 fprintf( pAbc->Err,
"usage: write_hie [-h] <orig> <file>\n" );
1328 fprintf( pAbc->Err,
"\t writes the current network into <file> by calling\n" );
1329 fprintf( pAbc->Err,
"\t the hierarchical writer that matches the extension of <file>\n" );
1330 fprintf( pAbc->Err,
"\t-m : toggle reading mapped Verilog for <orig> [default = %s]\n",
glo_fMapped?
"yes":
"no" );
1331 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
1332 fprintf( pAbc->Err,
"\torig : the name of the original file with the hierarchical design\n" );
1333 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
1384 if ( pAbc->pNtkCur == NULL )
1386 fprintf( pAbc->Out,
"Empty network.\n" );
1396 fprintf( stdout,
"Writing this format is only possible for structurally hashed AIGs.\n" );
1408 Io_WriteAiger( pTemp, pFileName, fWriteSymbols, fCompact, fUnique );
1412 Io_WriteAiger( pAbc->pNtkCur, pFileName, fWriteSymbols, fCompact, fUnique );
1416 fprintf( pAbc->Err,
"usage: write_aiger [-scuvh] <file>\n" );
1417 fprintf( pAbc->Err,
"\t writes the network in the AIGER format (http://fmv.jku.at/aiger)\n" );
1418 fprintf( pAbc->Err,
"\t-s : toggle saving I/O names [default = %s]\n", fWriteSymbols?
"yes" :
"no" );
1419 fprintf( pAbc->Err,
"\t-c : toggle writing more compactly [default = %s]\n", fCompact?
"yes" :
"no" );
1420 fprintf( pAbc->Err,
"\t-u : toggle writing canonical AIG structure [default = %s]\n", fUnique?
"yes" :
"no" );
1421 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes" :
"no" );
1422 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
1423 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .aig)\n" );
1453 if ( pAbc->pCex == NULL )
1455 fprintf( pAbc->Out,
"There is no current CEX.\n" );
1466 fprintf( pAbc->Err,
"usage: write_aiger_cex [-h] <file>\n" );
1467 fprintf( pAbc->Err,
"\t writes the current CEX in the AIGER format (http://fmv.jku.at/aiger)\n" );
1468 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
1469 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
1500 if ( pAbc->pNtkCur == NULL )
1502 fprintf( pAbc->Out,
"Empty network.\n" );
1514 fprintf( pAbc->Err,
"usage: write_baf [-h] <file>\n" );
1515 fprintf( pAbc->Err,
"\t writes the network into a BLIF file\n" );
1516 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
1517 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .baf)\n" );
1548 if ( pAbc->pNtkCur == NULL )
1550 fprintf( pAbc->Out,
"Empty network.\n" );
1562 fprintf( pAbc->Err,
"usage: write_bblif [-h] <file>\n" );
1563 fprintf( pAbc->Err,
"\t writes the network into a binary BLIF file\n" );
1564 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
1565 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .bblif)\n" );
1583 char * pLutStruct = NULL;
1584 int c, fSpecial = 0;
1595 Abc_Print( -1,
"Command line switch \"-S\" should be followed by string.\n" );
1600 if (
strlen(pLutStruct) != 2 &&
strlen(pLutStruct) != 3 )
1602 Abc_Print( -1,
"Command line switch \"-S\" should be followed by a 2- or 3-char string (e.g. \"44\" or \"555\").\n" );
1618 if ( pAbc->pNtkCur == NULL )
1620 fprintf( pAbc->Out,
"Empty network.\n" );
1628 if ( fSpecial || pLutStruct )
1635 fprintf( pAbc->Err,
"usage: write_blif [-S str] [-jah] <file>\n" );
1636 fprintf( pAbc->Err,
"\t writes the network into a BLIF file\n" );
1637 fprintf( pAbc->Err,
"\t-S str : string representing the LUT structure [default = %s]\n", pLutStruct ? pLutStruct :
"not used" );
1638 fprintf( pAbc->Err,
"\t-j : enables special BLIF writing [default = %s]\n", fSpecial?
"yes" :
"no" );;
1639 fprintf( pAbc->Err,
"\t-a : enables hierarchical BLIF writing for LUT structures [default = %s]\n", fUseHie?
"yes" :
"no" );;
1640 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
1641 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .blif)\n" );
1672 if ( pAbc->pNtkCur == NULL )
1674 fprintf( pAbc->Out,
"Empty network.\n" );
1686 fprintf( pAbc->Err,
"usage: write_blif_mv [-h] <file>\n" );
1687 fprintf( pAbc->Err,
"\t writes the network into a BLIF-MV file\n" );
1688 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
1689 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .mv)\n" );
1725 if ( pAbc->pNtkCur == NULL )
1727 fprintf( pAbc->Out,
"Empty network.\n" );
1737 else if ( pAbc->pNtkCur )
1746 printf(
"There is no current network.\n" );
1750 fprintf( pAbc->Err,
"usage: write_bench [-lh] <file>\n" );
1751 fprintf( pAbc->Err,
"\t writes the network in BENCH format\n" );
1752 fprintf( pAbc->Err,
"\t-l : toggle using LUTs in the output [default = %s]\n", fUseLuts?
"yes" :
"no" );
1753 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
1754 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .bench)\n" );
1793 fprintf( pAbc->Err,
"usage: write_book [-h] <file> [-options]\n" );
1794 fprintf( pAbc->Err,
"\t-h : prints the help massage\n" );
1795 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .aux, .nodes, .nets)\n" );
1796 fprintf( pAbc->Err,
"\t\n" );
1797 fprintf( pAbc->Err,
"\tThis command is developed by Myungchul Kim (University of Michigan).\n" );
1830 if ( pAbc->pNtkCur == NULL )
1832 fprintf( pAbc->Out,
"Empty network.\n" );
1837 pNtk = pAbc->pNtkCur;
1843 fprintf( pAbc->Out,
"The network should be a logic network (if it an AIG, use command \"logic\")\n" );
1850 fprintf( pAbc->Err,
"usage: write_cellnet [-h] <file>\n" );
1851 fprintf( pAbc->Err,
"\t writes the network is the cellnet format\n" );
1852 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
1853 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
1910 if ( pAbc->pNtkCur == NULL )
1912 fprintf( pAbc->Out,
"Empty network.\n" );
1923 printf(
"Warning: Selected option to write all primes has no effect when deriving CNF from AIG.\n" );
1928 else if ( fNewAlgo )
1930 else if ( fAllPrimes )
1937 fprintf( pAbc->Err,
"usage: write_cnf [-nfpcvh] <file>\n" );
1938 fprintf( pAbc->Err,
"\t generates CNF for the miter (see also \"&write_cnf\")\n" );
1939 fprintf( pAbc->Err,
"\t-n : toggle using new algorithm [default = %s]\n", fNewAlgo?
"yes" :
"no" );
1940 fprintf( pAbc->Err,
"\t-f : toggle using fast algorithm [default = %s]\n", fFastAlgo?
"yes" :
"no" );
1941 fprintf( pAbc->Err,
"\t-p : toggle using all primes to enhance implicativity [default = %s]\n", fAllPrimes?
"yes" :
"no" );
1942 fprintf( pAbc->Err,
"\t-c : toggle adjasting polarity of internal variables [default = %s]\n", fChangePol?
"yes" :
"no" );
1943 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes" :
"no" );
1944 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
1945 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
1963 extern void Mf_ManDumpCnf(
Gia_Man_t * p,
char * pFileName,
int nLutSize,
int fCnfObjIds,
int fAddOrCla,
int fVerbose );
1970 int c, fVerbose = 0;
1979 Abc_Print( -1,
"Command line switch \"-K\" should be followed by an integer.\n" );
2003 if ( pAbc->pGia == NULL )
2005 Abc_Print( -1,
"IoCommandWriteCnf2(): There is no AIG.\n" );
2010 Abc_Print( -1,
"IoCommandWriteCnf2(): Works only for combinational miters.\n" );
2013 if ( nLutSize < 3 || nLutSize > 8 )
2015 Abc_Print( -1,
"IoCommandWriteCnf2(): Invalid LUT size (%d).\n", nLutSize );
2020 Abc_Print( -1,
"IoCommandWriteCnf2(): Cannot input precomputed DSD information.\n" );
2027 pFile = fopen( pFileName,
"wb" );
2028 if ( pFile == NULL )
2030 printf(
"Cannot open file \"%s\" for writing.\n", pFileName );
2035 Mf_ManDumpCnf( pAbc->pGia, pFileName, nLutSize, fCnfObjIds, fAddOrCla, fVerbose );
2041 fprintf( pAbc->Err,
"usage: &write_cnf [-Kaiovh] <file>\n" );
2042 fprintf( pAbc->Err,
"\t writes CNF produced by a new generator\n" );
2043 fprintf( pAbc->Err,
"\t-K <num> : the LUT size (3 <= num <= 8) [default = %d]\n", nLutSize );
2044 fprintf( pAbc->Err,
"\t-a : toggle using new algorithm [default = %s]\n", fNewAlgo?
"yes" :
"no" );
2045 fprintf( pAbc->Err,
"\t-i : toggle using AIG object IDs as CNF variables [default = %s]\n", fCnfObjIds?
"yes" :
"no" );
2046 fprintf( pAbc->Err,
"\t-o : toggle adding OR clause for the outputs [default = %s]\n", fAddOrCla?
"yes" :
"no" );
2047 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes" :
"no" );
2048 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2049 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2081 if ( pAbc->pNtkCur == NULL )
2083 fprintf( pAbc->Out,
"Empty network.\n" );
2095 fprintf( pAbc->Err,
"usage: write_dot [-h] <file>\n" );
2096 fprintf( pAbc->Err,
"\t writes the current network into a DOT file\n" );
2097 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2098 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2168 pNtk = pAbc->pNtkCur;
2171 fprintf( pAbc->Out,
"Empty network.\n" );
2174 if ( pNtk->
pModel == NULL && pAbc->pCex == NULL )
2176 fprintf( pAbc->Out,
"Counter-example is not available.\n" );
2181 printf(
"File name is missing on the command line.\n" );
2197 fprintf( stdout,
"IoCommandWriteCex(): The init-state should be all-0 for counter-example to work.\n" );
2198 fprintf( stdout,
"Run commands \"undc\" and \"zero\" and then rerun the equivalence check.\n" );
2202 pFile = fopen( pFileName,
"w" );
2203 if ( pFile == NULL )
2205 fprintf( stdout,
"IoCommandWriteCex(): Cannot open the output file \"%s\".\n", pFileName );
2216 for ( f = 0; f <= pCex->iFrame; f++ )
2242 for ( f = 0; f <= pCex->iFrame; f++ )
2244 if ( !pCare ||
Abc_InfoHasBit(pCare->pData, pCare->nRegs+pCare->nPis*f + i) )
2253 for ( i = pCex->nRegs; i < pCex->nBits; i++ )
2255 if ( fAiger && (i-pCex->nRegs)%pCex->nPis == 0)
2256 fprintf( pFile,
"\n");
2260 fprintf( pFile,
"\n" );
2266 FILE * pFile = fopen( pFileName,
"w" );
2268 if ( pFile == NULL )
2270 fprintf( stdout,
"IoCommandWriteCex(): Cannot open the output file \"%s\".\n", pFileName );
2275 const char *cycle_ctr = forceSeq?
"@0":
"";
2278 fprintf( pFile,
"%s%s=%c\n",
Abc_ObjName(pObj), cycle_ctr,
'0'+(pNtk->
pModel[i]==1) );
2283 fprintf( pFile,
"%c",
'0'+(pNtk->
pModel[i]==1) );
2285 fprintf( pFile,
"\n" );
2292 fprintf( pAbc->Err,
"usage: write_cex [-snmocfvh] <file>\n" );
2293 fprintf( pAbc->Err,
"\t saves counter-example derived by \"sat\", \"iprove\", or \"dprove\"\n" );
2294 fprintf( pAbc->Err,
"\t the file contains values for each PI in the natural order\n" );
2295 fprintf( pAbc->Err,
"\t-s : always report a sequential ctrex (cycle 0 for comb) [default = %s]\n", forceSeq?
"yes":
"no" );
2296 fprintf( pAbc->Err,
"\t-n : write input names into the file [default = %s]\n", fNames?
"yes":
"no" );
2297 fprintf( pAbc->Err,
"\t-m : minimize counter-example by dropping don't-care values [default = %s]\n", fMinimize?
"yes":
"no" );
2298 fprintf( pAbc->Err,
"\t-o : use old counter-example minimization algorithm [default = %s]\n", fUseOldMin?
"yes":
"no" );
2299 fprintf( pAbc->Err,
"\t-c : check generated counter-example using ternary simulation [default = %s]\n", fCheckCex?
"yes":
"no" );
2300 fprintf( pAbc->Err,
"\t-a : print cex in AIGER 1.9 format [default = %s].\n", fAiger?
"yes":
"no" );
2301 fprintf( pAbc->Err,
"\t-f : enable printing flop values in each timeframe [default = %s].\n", fPrintFull?
"yes":
"no" );
2302 fprintf( pAbc->Err,
"\t-v : enable verbose output [default = %s].\n", fVerbose?
"yes":
"no" );
2303 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2304 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2335 if ( pAbc->pNtkCur == NULL )
2337 fprintf( pAbc->Out,
"Empty network.\n" );
2349 fprintf( pAbc->Err,
"usage: write_eqn [-h] <file>\n" );
2350 fprintf( pAbc->Err,
"\t writes the current network in the equation format\n" );
2351 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2352 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2383 if ( pAbc->pNtkCur == NULL )
2385 fprintf( pAbc->Out,
"Empty network.\n" );
2397 fprintf( pAbc->Err,
"usage: write_gml [-h] <file>\n" );
2398 fprintf( pAbc->Err,
"\t writes network using graph representation formal GML\n" );
2399 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2400 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2421 printf(
"This command currently does not work.\n" );
2439 if ( pAbc->pNtkCur == NULL )
2441 fprintf( pAbc->Out,
"Empty network.\n" );
2460 fprintf( pAbc->Err,
"usage: write_list [-nh] <file>\n" );
2461 fprintf( pAbc->Err,
"\t writes network using graph representation formal GML\n" );
2462 fprintf( pAbc->Err,
"\t-n : toggle writing host node [default = %s]\n", fUseHost?
"yes":
"no" );
2463 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2464 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2495 if ( pAbc->pNtkCur == NULL )
2497 fprintf( pAbc->Out,
"Empty network.\n" );
2509 fprintf( pAbc->Err,
"usage: write_pla [-h] <file>\n" );
2510 fprintf( pAbc->Err,
"\t writes the collapsed network into a PLA file\n" );
2511 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2512 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2543 if ( pAbc->pNtkCur == NULL )
2545 fprintf( pAbc->Out,
"Empty network.\n" );
2557 fprintf( pAbc->Err,
"usage: write_verilog [-h] <file>\n" );
2558 fprintf( pAbc->Err,
"\t writes the current network in Verilog format\n" );
2559 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2560 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2591 fprintf( stdout,
"Command line switch \"-N\" should be followed by an integer.\n" );
2600 if ( globalUtilOptind >= argc )
2602 fprintf( stdout,
"Command line switch \"-Q\" should be followed by an integer.\n" );
2605 nQueens = atoi(argv[globalUtilOptind]);
2625 fprintf( pAbc->Err,
"usage: write_sorter_cnf [-N <num>] [-Q <num>] <file>\n" );
2626 fprintf( pAbc->Err,
"\t writes CNF for the sorter\n" );
2627 fprintf( pAbc->Err,
"\t-N num : the number of sorter bits [default = %d]\n", nVars );
2628 fprintf( pAbc->Err,
"\t-Q num : the number of bits to be asserted to 1 [default = %d]\n", nQueens );
2629 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2630 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2670 if ( pAbc->pNtkCur == NULL )
2672 printf(
"Current network is not available.\n" );
2677 printf(
"Current network should not an AIG. Run \"logic\".\n" );
2682 printf(
"Current network should have exactly one primary output.\n" );
2687 printf(
"Current network should have exactly one node.\n" );
2693 printf(
"Can only write logic function with 0 inputs.\n" );
2698 printf(
"Can only write logic function with no more than 16 inputs.\n" );
2709 pFile = fopen( pFileName,
"w" );
2710 if ( pFile == NULL )
2713 printf(
"Cannot open file \"%s\" for writing.\n", pFileName );
2722 fprintf( pAbc->Err,
"usage: write_truth [-rh] <file>\n" );
2723 fprintf( pAbc->Err,
"\t writes truth table into a file\n" );
2724 fprintf( pAbc->Err,
"\t-r : toggle reversing bits in the truth table [default = %s]\n", fReverse?
"yes":
"no" );
2725 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2726 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2770 if ( pAbc->pGia == NULL )
2772 Abc_Print( -1,
"IoCommandWriteTruths(): There is no AIG.\n" );
2777 Abc_Print( -1,
"IoCommandWriteTruths(): Can write truth tables up to 16 inputs.\n" );
2782 Abc_Print( -1,
"IoCommandWriteTruths(): Can write truth tables for 3 inputs or more.\n" );
2790 pFile = fopen( pFileName,
"wb" );
2791 if ( pFile == NULL )
2793 printf(
"Cannot open file \"%s\" for writing.\n", pFileName );
2801 fwrite( pTruth, nBytes, 1, pFile );
2809 fprintf( pAbc->Err,
"usage: &write_truths [-rbh] <file>\n" );
2810 fprintf( pAbc->Err,
"\t writes truth tables of each PO of GIA manager into a file\n" );
2811 fprintf( pAbc->Err,
"\t-r : toggle reversing bits in the truth table [default = %s]\n", fReverse?
"yes":
"no" );
2812 fprintf( pAbc->Err,
"\t-b : toggle using binary format [default = %s]\n", fBinary?
"yes":
"no" );
2813 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2814 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2855 fprintf( pAbc->Err,
"usage: write_status [-h] <file>\n" );
2856 fprintf( pAbc->Err,
"\t writes verification log file\n" );
2857 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2858 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2891 if ( pAbc->pNtkCur == NULL )
2893 fprintf( pAbc->Out,
"Empty network.\n" );
2905 fprintf( pAbc->Err,
"usage: write_smv [-h] <file>\n" );
2906 fprintf( pAbc->Err,
"\t write the network in SMV format\n" );
2907 fprintf( pAbc->Err,
"\t-h : print the help message\n" );
2908 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .smv)\n" );
static int IoCommandReadEdif(Abc_Frame_t *pAbc, int argc, char **argv)
ABC_DLL void Abc_NtkStartNameIds(Abc_Ntk_t *p)
static int IoCommandReadTruth(Abc_Frame_t *pAbc, int argc, char **argv)
void Io_Init(Abc_Frame_t *pAbc)
FUNCTION DEFINITIONS ///.
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
ABC_DLL void * Abc_FrameReadLibGen()
void Io_WriteHie(Abc_Ntk_t *pNtk, char *pBaseName, char *pFileName)
static int IoCommandWriteDot(Abc_Frame_t *pAbc, int argc, char **argv)
void Abc_FrameCopyLTLDataBase(Abc_Frame_t *pAbc, Abc_Ntk_t *pNtk)
Abc_Ntk_t * Io_ReadBlif(char *pFileName, int fCheck)
FUNCTION DEFINITIONS ///.
#define Gia_ManForEachCo(p, pObj, i)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
static int IoCommandReadBblif(Abc_Frame_t *pAbc, int argc, char **argv)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Aig_ManStop(Aig_Man_t *p)
static int IoCommandWriteVerilog(Abc_Frame_t *pAbc, int argc, char **argv)
int Cmd_CommandExecute(void *pAbc, char *pCommandLine)
static int Abc_InfoHasBit(unsigned *p, int i)
static int IoCommandWriteAigerCex(Abc_Frame_t *pAbc, int argc, char **argv)
static int IoCommandWriteBblif(Abc_Frame_t *pAbc, int argc, char **argv)
static int IoCommandWriteEqn(Abc_Frame_t *pAbc, int argc, char **argv)
static int Abc_Truth6WordNum(int nVars)
int Abc_NtkReadLogFile(char *pFileName, Abc_Cex_t **ppCex, int *pnFrames)
static int IoCommandReadBlifMv(Abc_Frame_t *pAbc, int argc, char **argv)
Abc_Ntk_t * Io_ReadNetlist(char *pFileName, Io_FileType_t FileType, int fCheck)
static int IoCommandReadEqn(Abc_Frame_t *pAbc, int argc, char **argv)
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
static int IoCommandReadGig(Abc_Frame_t *pAbc, int argc, char **argv)
static int IoCommandWritePla(Abc_Frame_t *pAbc, int argc, char **argv)
static int IoCommandReadInit(Abc_Frame_t *pAbc, int argc, char **argv)
static int IoCommandWriteGml(Abc_Frame_t *pAbc, int argc, char **argv)
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
void Io_WriteCellNet(Abc_Ntk_t *pNtk, char *pFileName)
void Cmd_CommandAdd(Abc_Frame_t *pAbc, const char *sGroup, const char *sName, Cmd_CommandFuncType pFunc, int fChanges)
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
static int IoCommandReadBlif(Abc_Frame_t *pAbc, int argc, char **argv)
static int IoCommandWrite(Abc_Frame_t *pAbc, int argc, char **argv)
static int Abc_LatchIsInit0(Abc_Obj_t *pLatch)
ABC_DLL Abc_Ntk_t * Abc_NtkToNetlist(Abc_Ntk_t *pNtk)
static int IoCommandWriteBlifMv(Abc_Frame_t *pAbc, int argc, char **argv)
void Abc_NtkWriteSorterCnf(char *pFileName, int nVars, int nQueens)
void Mf_ManDumpCnf(Gia_Man_t *p, char *pFileName, int nLutSize, int fCnfObjIds, int fAddOrCla, int fVerbose)
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
static int IoCommandWriteBlif(Abc_Frame_t *pAbc, int argc, char **argv)
ABC_DLL char * Abc_SopFromTruthHex(char *pTruth)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
word * Gia_ObjComputeTruthTable(Gia_Man_t *p, Gia_Obj_t *pObj)
ABC_DLL Abc_Ntk_t * Abc_NtkToLogic(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
ABC_DLL void Abc_FrameClearVerifStatus(Abc_Frame_t *p)
void Io_Write(Abc_Ntk_t *pNtk, char *pFileName, Io_FileType_t FileType)
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
static int Abc_NtkNodeNum(Abc_Ntk_t *pNtk)
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
static int IoCommandWriteCnf(Abc_Frame_t *pAbc, int argc, char **argv)
void Io_WriteAigerCex(Abc_Cex_t *pCex, Abc_Ntk_t *pNtk, void *pG, char *pFileName)
void Io_WriteList(Abc_Ntk_t *pNtk, char *pFileName, int fUseHost)
FUNCTION DEFINITIONS ///.
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int IoCommandReadStatus(Abc_Frame_t *pAbc, int argc, char **argv)
static int IoCommandWriteBaf(Abc_Frame_t *pAbc, int argc, char **argv)
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
Abc_Cex_t * Saig_ManCbaFindCexCareBits(Aig_Man_t *pAig, Abc_Cex_t *pCex, int nInputs, int fVerbose)
static int IoCommandWriteSortCnf(Abc_Frame_t *pAbc, int argc, char **argv)
unsigned __int64 word
DECLARATIONS ///.
ABC_DLL char * Abc_SopFromTruthBin(char *pTruth)
void Abc_CexFreeP(Abc_Cex_t **p)
#define ABC_NAMESPACE_IMPL_END
void Jf_ManDumpCnf(Gia_Man_t *p, char *pFileName, int fVerbose)
static int IoCommandReadAiger(Abc_Frame_t *pAbc, int argc, char **argv)
void Io_WriteBlifSpecial(Abc_Ntk_t *pNtk, char *FileName, char *pLutStruct, int fUseHie)
Abc_Ntk_t * Abc_NtkDarToCnf(Abc_Ntk_t *pNtk, char *pFileName, int fFastAlgo, int fChangePol, int fVerbose)
int Io_WriteBenchLut(Abc_Ntk_t *pNtk, char *FileName)
static int IoCommandWriteList(Abc_Frame_t *pAbc, int argc, char **argv)
#define Abc_NtkForEachLatch(pNtk, pObj, i)
static int IoCommandWriteBench(Abc_Frame_t *pAbc, int argc, char **argv)
ABC_DLL void Abc_NtkWriteLogFile(char *pFileName, Abc_Cex_t *pSeqCex, int Status, int nFrames, char *pCommand)
DECLARATIONS ///.
ABC_DLL Gia_Man_t * Abc_NtkFlattenHierarchyGia(Abc_Ntk_t *pNtk, Vec_Ptr_t **pvBuffers, int fVerbose)
static void Abc_Print(int level, const char *format,...)
static int IoCommandReadDsd(Abc_Frame_t *pAbc, int argc, char **argv)
Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
void Bmc_CexCareVerify(Aig_Man_t *p, Abc_Cex_t *pCex, Abc_Cex_t *pCexMin, int fVerbose)
#define ABC_NAMESPACE_IMPL_START
Abc_Ntk_t * Io_ReadPla(char *pFileName, int fZeros, int fCheck)
FUNCTION DEFINITIONS ///.
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
ABC_DLL Abc_Ntk_t * Abc_NtkCreateWithNode(char *pSop)
static Abc_Obj_t * Abc_NtkPo(Abc_Ntk_t *pNtk, int i)
void Extra_PrintBinary(FILE *pFile, unsigned Sign[], int nBits)
#define Abc_NtkForEachCi(pNtk, pCi, i)
static int Abc_NtkPoNum(Abc_Ntk_t *pNtk)
static int IoCommandWriteCellNet(Abc_Frame_t *pAbc, int argc, char **argv)
static int IoCommandReadBench(Abc_Frame_t *pAbc, int argc, char **argv)
static int IoCommandWriteBook(Abc_Frame_t *pAbc, int argc, char **argv)
static int Abc_NtkPiNum(Abc_Ntk_t *pNtk)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
Abc_Ntk_t * Io_ReadBlifAsAig(char *pFileName, int fCheck)
FUNCTION DEFINITIONS ///.
static int IoCommandWriteTruths(Abc_Frame_t *pAbc, int argc, char **argv)
Gia_Man_t * Gia_ManReadGig(char *pFileName)
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
Abc_Ntk_t * Io_ReadDsd(char *pForm)
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
Abc_Cex_t * Saig_ManExtendCex(Aig_Man_t *pAig, Abc_Cex_t *p)
static int IoCommandWriteCnf2(Abc_Frame_t *pAbc, int argc, char **argv)
unsigned * Hop_ManConvertAigToTruth(Hop_Man_t *p, Hop_Obj_t *pRoot, int nVars, Vec_Int_t *vTruth, int fMsbFirst)
static int IoCommandReadVerilog(Abc_Frame_t *pAbc, int argc, char **argv)
ABC_DLL void Abc_NtkTransferNameIds(Abc_Ntk_t *p, Abc_Ntk_t *pNew)
ABC_DLL FILE * Abc_FrameReadErr(Abc_Frame_t *p)
Aig_Man_t * Saig_ManDupIsoCanonical(Aig_Man_t *pAig, int fVerbose)
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
Abc_Cex_t * Bmc_CexCareMinimize(Aig_Man_t *p, Abc_Cex_t *pCex, int fCheck, int fVerbose)
static int IoCommandWriteStatus(Abc_Frame_t *pAbc, int argc, char **argv)
void Io_ReadBenchInit(Abc_Ntk_t *pNtk, char *pFileName)
int Io_WriteCnf(Abc_Ntk_t *pNtk, char *FileName, int fAllPrimes)
FUNCTION DEFINITIONS ///.
ABC_DLL FILE * Abc_FrameReadOut(Abc_Frame_t *p)
static int IoCommandWriteSmv(Abc_Frame_t *pAbc, int argc, char **argv)
static int IoCommandWriteTruth(Abc_Frame_t *pAbc, int argc, char **argv)
static void Vec_IntFree(Vec_Int_t *p)
static int Gia_ManPiNum(Gia_Man_t *p)
static int IoCommandWriteAiger(Abc_Frame_t *pAbc, int argc, char **argv)
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
void Io_WriteAiger(Abc_Ntk_t *pNtk, char *pFileName, int fWriteSymbols, int fCompact, int fUnique)
static int IoCommandReadPla(Abc_Frame_t *pAbc, int argc, char **argv)
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
static int IoCommandWriteHie(Abc_Frame_t *pAbc, int argc, char **argv)
#define Abc_NtkForEachPi(pNtk, pPi, i)
static int IoCommandReadBaf(Abc_Frame_t *pAbc, int argc, char **argv)
static int IoCommandWriteCex(Abc_Frame_t *pAbc, int argc, char **argv)
static ABC_NAMESPACE_IMPL_START int IoCommandRead(Abc_Frame_t *pAbc, int argc, char **argv)
DECLARATIONS ///.
static int Gia_ManRegNum(Gia_Man_t *p)
void Io_End(Abc_Frame_t *pAbc)