40static int IoCommandRead (
Abc_Frame_t * pAbc,
int argc,
char **argv );
41static int IoCommandReadAiger (
Abc_Frame_t * pAbc,
int argc,
char **argv );
42static int IoCommandReadBaf (
Abc_Frame_t * pAbc,
int argc,
char **argv );
43static int IoCommandReadBblif (
Abc_Frame_t * pAbc,
int argc,
char **argv );
44static int IoCommandReadBlif (
Abc_Frame_t * pAbc,
int argc,
char **argv );
45static int IoCommandReadBlifMv (
Abc_Frame_t * pAbc,
int argc,
char **argv );
46static int IoCommandReadBench (
Abc_Frame_t * pAbc,
int argc,
char **argv );
47static int IoCommandReadCex (
Abc_Frame_t * pAbc,
int argc,
char **argv );
48static int IoCommandReadDsd (
Abc_Frame_t * pAbc,
int argc,
char **argv );
49static int IoCommandReadEdif (
Abc_Frame_t * pAbc,
int argc,
char **argv );
50static int IoCommandReadEqn (
Abc_Frame_t * pAbc,
int argc,
char **argv );
51static int IoCommandReadFins (
Abc_Frame_t * pAbc,
int argc,
char **argv );
52static int IoCommandReadInit (
Abc_Frame_t * pAbc,
int argc,
char **argv );
53static int IoCommandReadPla (
Abc_Frame_t * pAbc,
int argc,
char **argv );
54static int IoCommandReadPlaMo (
Abc_Frame_t * pAbc,
int argc,
char **argv );
55static int IoCommandReadTruth (
Abc_Frame_t * pAbc,
int argc,
char **argv );
56static int IoCommandReadCnf (
Abc_Frame_t * pAbc,
int argc,
char **argv );
57static int IoCommandReadVerilog (
Abc_Frame_t * pAbc,
int argc,
char **argv );
58static int IoCommandReadStatus (
Abc_Frame_t * pAbc,
int argc,
char **argv );
59static int IoCommandReadGig (
Abc_Frame_t * pAbc,
int argc,
char **argv );
60static int IoCommandReadJson (
Abc_Frame_t * pAbc,
int argc,
char **argv );
61static int IoCommandReadSF (
Abc_Frame_t * pAbc,
int argc,
char **argv );
62static int IoCommandReadRom (
Abc_Frame_t * pAbc,
int argc,
char **argv );
63static int IoCommandReadMM (
Abc_Frame_t * pAbc,
int argc,
char **argv );
64static int IoCommandReadMMGia (
Abc_Frame_t * pAbc,
int argc,
char **argv );
66static int IoCommandWrite (
Abc_Frame_t * pAbc,
int argc,
char **argv );
67static int IoCommandWriteHie (
Abc_Frame_t * pAbc,
int argc,
char **argv );
68static int IoCommandWriteAiger (
Abc_Frame_t * pAbc,
int argc,
char **argv );
69static int IoCommandWriteAigerCex(
Abc_Frame_t * pAbc,
int argc,
char **argv );
70static int IoCommandWriteBaf (
Abc_Frame_t * pAbc,
int argc,
char **argv );
71static int IoCommandWriteBblif (
Abc_Frame_t * pAbc,
int argc,
char **argv );
72static int IoCommandWriteBlif (
Abc_Frame_t * pAbc,
int argc,
char **argv );
73static int IoCommandWriteEdgelist(
Abc_Frame_t * pAbc,
int argc,
char **argv );
74static int IoCommandWriteBlifMv (
Abc_Frame_t * pAbc,
int argc,
char **argv );
75static int IoCommandWriteBench (
Abc_Frame_t * pAbc,
int argc,
char **argv );
76static int IoCommandWriteBook (
Abc_Frame_t * pAbc,
int argc,
char **argv );
77static int IoCommandWriteCellNet(
Abc_Frame_t * pAbc,
int argc,
char **argv );
78static int IoCommandWriteCnf (
Abc_Frame_t * pAbc,
int argc,
char **argv );
79static int IoCommandWriteCnf2 (
Abc_Frame_t * pAbc,
int argc,
char **argv );
80static int IoCommandWriteCex (
Abc_Frame_t * pAbc,
int argc,
char **argv );
81static int IoCommandWriteDot (
Abc_Frame_t * pAbc,
int argc,
char **argv );
82static int IoCommandWriteEqn (
Abc_Frame_t * pAbc,
int argc,
char **argv );
83static int IoCommandWriteGml (
Abc_Frame_t * pAbc,
int argc,
char **argv );
84static int IoCommandWriteHMetis (
Abc_Frame_t * pAbc,
int argc,
char **argv );
85static int IoCommandWriteList (
Abc_Frame_t * pAbc,
int argc,
char **argv );
86static int IoCommandWritePla (
Abc_Frame_t * pAbc,
int argc,
char **argv );
87static int IoCommandWriteVerilog(
Abc_Frame_t * pAbc,
int argc,
char **argv );
88static int IoCommandWriteSortCnf(
Abc_Frame_t * pAbc,
int argc,
char **argv );
89static int IoCommandWriteTruth (
Abc_Frame_t * pAbc,
int argc,
char **argv );
90static int IoCommandWriteTruths (
Abc_Frame_t * pAbc,
int argc,
char **argv );
91static int IoCommandWriteStatus (
Abc_Frame_t * pAbc,
int argc,
char **argv );
92static int IoCommandWriteSmv (
Abc_Frame_t * pAbc,
int argc,
char **argv );
93static int IoCommandWriteJson (
Abc_Frame_t * pAbc,
int argc,
char **argv );
94static int IoCommandWriteResub (
Abc_Frame_t * pAbc,
int argc,
char **argv );
95static int IoCommandWriteMM (
Abc_Frame_t * pAbc,
int argc,
char **argv );
96static int IoCommandWriteMMGia (
Abc_Frame_t * pAbc,
int argc,
char **argv );
120 Cmd_CommandAdd( pAbc,
"I/O",
"read_aiger", IoCommandReadAiger, 1 );
122 Cmd_CommandAdd( pAbc,
"I/O",
"read_bblif", IoCommandReadBblif, 1 );
124 Cmd_CommandAdd( pAbc,
"I/O",
"read_blif_mv", IoCommandReadBlifMv, 1 );
125 Cmd_CommandAdd( pAbc,
"I/O",
"read_bench", IoCommandReadBench, 1 );
128 Cmd_CommandAdd( pAbc,
"I/O",
"read_formula", IoCommandReadDsd, 1 );
134 Cmd_CommandAdd( pAbc,
"I/O",
"read_plamo", IoCommandReadPlaMo, 1 );
135 Cmd_CommandAdd( pAbc,
"I/O",
"read_truth", IoCommandReadTruth, 1 );
137 Cmd_CommandAdd( pAbc,
"I/O",
"read_verilog", IoCommandReadVerilog, 1 );
138 Cmd_CommandAdd( pAbc,
"I/O",
"read_status", IoCommandReadStatus, 0 );
148 Cmd_CommandAdd( pAbc,
"I/O",
"write_aiger", IoCommandWriteAiger, 0 );
149 Cmd_CommandAdd( pAbc,
"I/O",
"write_aiger_cex", IoCommandWriteAigerCex, 0 );
151 Cmd_CommandAdd( pAbc,
"I/O",
"write_bblif", IoCommandWriteBblif, 0 );
152 Cmd_CommandAdd( pAbc,
"I/O",
"write_blif", IoCommandWriteBlif, 0 );
153 Cmd_CommandAdd( pAbc,
"I/O",
"write_blif_mv", IoCommandWriteBlifMv, 0 );
154 Cmd_CommandAdd( pAbc,
"I/O",
"write_bench", IoCommandWriteBench, 0 );
155 Cmd_CommandAdd( pAbc,
"I/O",
"write_book", IoCommandWriteBook, 0 );
156 Cmd_CommandAdd( pAbc,
"I/O",
"write_cellnet", IoCommandWriteCellNet, 0 );
159 Cmd_CommandAdd( pAbc,
"I/O",
"&write_cnf", IoCommandWriteCnf2, 0 );
162 Cmd_CommandAdd( pAbc,
"I/O",
"write_edgelist",IoCommandWriteEdgelist, 0 );
165 Cmd_CommandAdd( pAbc,
"I/O",
"write_hmetis", IoCommandWriteHMetis, 0 );
167 Cmd_CommandAdd( pAbc,
"I/O",
"write_verilog", IoCommandWriteVerilog, 0 );
169 Cmd_CommandAdd( pAbc,
"I/O",
"write_sorter_cnf", IoCommandWriteSortCnf, 0 );
170 Cmd_CommandAdd( pAbc,
"I/O",
"write_truth", IoCommandWriteTruth, 0 );
171 Cmd_CommandAdd( pAbc,
"I/O",
"&write_truth", IoCommandWriteTruths, 0 );
172 Cmd_CommandAdd( pAbc,
"I/O",
"&write_truths", IoCommandWriteTruths, 0 );
173 Cmd_CommandAdd( pAbc,
"I/O",
"write_status", IoCommandWriteStatus, 0 );
175 Cmd_CommandAdd( pAbc,
"I/O",
"write_json", IoCommandWriteJson, 0 );
176 Cmd_CommandAdd( pAbc,
"I/O",
"&write_resub", IoCommandWriteResub, 0 );
178 Cmd_CommandAdd( pAbc,
"I/O",
"&write_mm", IoCommandWriteMMGia, 0 );
207int IoCommandRead(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
211 char * pFileName, * pTemp;
212 int c, fCheck, fBarBufs, fReadGia;
246 for ( pTemp = pFileName; *pTemp; pTemp++ )
247 if ( *pTemp ==
'>' || *pTemp ==
'\\' )
253 sprintf( Command,
"read_genlib %s", pFileName );
255 sprintf( Command,
"read_lib %s", pFileName );
257 sprintf( Command,
"read_scl %s", pFileName );
259 sprintf( Command,
"read_super %s", pFileName );
261 sprintf( Command,
"read_constr %s", pFileName );
263 sprintf( Command,
"so %s", pFileName );
265 sprintf( Command,
"so %s", pFileName );
267 sprintf( Command,
"dsd_load %s", pFileName );
282 Abc_Print( 1,
"Abc_CommandBlast(): Bit-blasting has failed.\n" );
292 Abc_Print( 1,
"Cannot read mapped design when the library is not given.\n" );
300 sprintf( Command,
"source -x %s", pFileName );
303 fprintf( stdout,
"Cannot execute command \"%s\".\n", Command );
311 if ( Abc_NtkPiNum(pNtk) == 0 )
313 Abc_Print( 0,
"The new network has no primary inputs. It is recommended\n" );
314 Abc_Print( 1,
"to add a dummy PI to make sure all commands work correctly.\n" );
323 fprintf( pAbc->Err,
"usage: read [-mcbgh] <file>\n" );
324 fprintf( pAbc->Err,
"\t replaces the current network by the network read from <file>\n" );
325 fprintf( pAbc->Err,
"\t by calling the parser that matches the extension of <file>\n" );
326 fprintf( pAbc->Err,
"\t (to read a hierarchical design, use \"read_hie\")\n" );
327 fprintf( pAbc->Err,
"\t-m : toggle reading mapped Verilog [default = %s]\n",
glo_fMapped?
"yes":
"no" );
328 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
329 fprintf( pAbc->Err,
"\t-b : toggle reading barrier buffers [default = %s]\n", fBarBufs?
"yes":
"no" );
330 fprintf( pAbc->Err,
"\t-g : toggle reading and flattening into &-space [default = %s]\n", fBarBufs?
"yes":
"no" );
331 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
332 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
347int IoCommandReadAiger(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
383 fprintf( pAbc->Err,
"usage: read_aiger [-ch] <file>\n" );
384 fprintf( pAbc->Err,
"\t reads the network in the AIGER format (http://fmv.jku.at/aiger)\n" );
385 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
386 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
387 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
402int IoCommandReadBaf(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
438 fprintf( pAbc->Err,
"usage: read_baf [-ch] <file>\n" );
439 fprintf( pAbc->Err,
"\t reads the network in Binary Aig Format (BAF)\n" );
440 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
441 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
442 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
457int IoCommandReadBblif(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
493 fprintf( pAbc->Err,
"usage: read_bblif [-ch] <file>\n" );
494 fprintf( pAbc->Err,
"\t reads the network in a binary BLIF format\n" );
495 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
496 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
497 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
512int IoCommandReadBlif(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
557 else if ( fUseNewParser )
581 fprintf( pAbc->Err,
"usage: read_blif [-nmach] <file>\n" );
582 fprintf( pAbc->Err,
"\t reads the network in binary BLIF format\n" );
583 fprintf( pAbc->Err,
"\t (if this command does not work, try \"read\")\n" );
584 fprintf( pAbc->Err,
"\t-n : toggle using old BLIF parser without hierarchy support [default = %s]\n", !fUseNewParser?
"yes":
"no" );
585 fprintf( pAbc->Err,
"\t-m : toggle saving original circuit names into a file [default = %s]\n", fSaveNames?
"yes":
"no" );
586 fprintf( pAbc->Err,
"\t-a : toggle creating AIG while reading the file [default = %s]\n", fReadAsAig?
"yes":
"no" );
587 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
588 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
589 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
604int IoCommandReadBlifMv(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
640 fprintf( pAbc->Err,
"usage: read_blif_mv [-ch] <file>\n" );
641 fprintf( pAbc->Err,
"\t reads the network in BLIF-MV format\n" );
642 fprintf( pAbc->Err,
"\t (if this command does not work, try \"read\")\n" );
643 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
644 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
645 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
660int IoCommandReadBench(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
696 fprintf( pAbc->Err,
"usage: read_bench [-ch] <file>\n" );
697 fprintf( pAbc->Err,
"\t reads the network in BENCH format\n" );
698 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
699 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
700 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
721 int c, nRegs = -1, nFrames = -1;
722 pFile = fopen( pFileName,
"r" );
725 printf(
"Cannot open log file for reading \"%s\".\n" , pFileName );
729 vNums = Vec_IntAlloc( 100 );
733 int MaxLine = 1000000;
746 while ( fgets( Buffer, MaxLine, pFile ) != NULL )
748 if ( Buffer[0] ==
'#' || Buffer[0] ==
'c' || Buffer[0] ==
'f' || Buffer[0] ==
'u' )
750 BufferLen =
strlen(Buffer) - 1;
751 Buffer[BufferLen] =
'\0';
752 if (state==0 && BufferLen>1) {
759 if (state==1 && Buffer[0]!=
'b' && Buffer[0]!=
'j') {
763 Vec_IntPush( vNums, status );
766 if (Buffer[0] ==
'.' )
772 if ( c ==
'0' || c ==
'1' || c ==
'2' ) {
775 }
else if ( c ==
'x' ) {
780 Vec_IntPush( vNums, 2 );
781 nRegs = Vec_IntSize(vNums);
784 printf(
"ERROR: Bad aiger status line.\n" );
790 iPo = atoi(Buffer+1);
794 for (i=0; i<BufferLen;i++) {
796 if ( c ==
'0' || c ==
'1' )
797 Vec_IntPush( vNums, c -
'0' );
798 else if ( c ==
'x') {
802 Vec_IntPush( vNums, 2 );
805 nRegs = Vec_IntSize(vNums);
806 if ( nRegs < nRegsNtk )
808 printf(
"WARNING: Register number is smaller than in Ntk. Appending.\n" );
809 for (i=0; i<nRegsNtk-nRegs;i++) {
810 Vec_IntPush( vNums, 0 );
812 nRegs = Vec_IntSize(vNums);
814 else if ( nRegs > nRegsNtk )
816 printf(
"WARNING: Register number is larger than in Ntk. Truncating.\n" );
817 Vec_IntShrink( vNums, nRegsNtk );
823 for (i=0; i<BufferLen;i++) {
825 if ( c ==
'0' || c ==
'1' )
826 Vec_IntPush( vNums, c -
'0' );
827 else if ( c ==
'x') {
829 Vec_IntPush( vNums, 2 );
839 printf(
"Warning: Using 0 instead of x in latches or primary inputs\n" );
840 int iFrameCex = nFrames;
843 if (status == 0 || *fOldFormat == 0)
844 printf(
"Counter-example is not available.\n" );
846 printf(
"ERROR: Cannot read register number.\n" );
847 Vec_IntFree( vNums );
850 if ( nRegs != nRegsNtk )
852 printf(
"ERROR: Register number not coresponding to Ntk.\n" );
853 Vec_IntFree( vNums );
856 if ( Vec_IntSize(vNums)-nRegs == 0 )
858 printf(
"ERROR: Cannot read counter example.\n" );
859 Vec_IntFree( vNums );
862 if ( (Vec_IntSize(vNums)-nRegs) % (iFrameCex + 1) != 0 )
864 printf(
"ERROR: Incorrect number of bits.\n" );
865 Vec_IntFree( vNums );
868 int nPi = (Vec_IntSize(vNums)-nRegs)/(iFrameCex + 1);
869 if ( nPi != Abc_NtkPiNum(pNtk) )
871 printf(
"ERROR: Number of primary inputs not coresponding to Ntk.\n" );
872 Vec_IntFree( vNums );
875 if ( iPo >= Abc_NtkPoNum(pNtk) )
877 printf(
"WARNING: PO that failed verification not coresponding to Ntk, using first PO instead.\n" );
881 if ( Vec_IntEntry(vNums, i) == 1 )
882 Abc_LatchSetInit1(pObj);
883 else if ( Vec_IntEntry(vNums, i) == 2 && xMode )
884 Abc_LatchSetInitNone(pObj);
886 Abc_LatchSetInit0(pObj);
896 pCex->iFrame = iFrameCex;
897 pCexCare->iFrame = iFrameCex;
898 assert( Vec_IntSize(vNums) == pCex->nBits );
899 for ( c = 0; c < pCex->nBits; c++ ) {
900 if ( Vec_IntEntry(vNums, c) == 1)
902 Abc_InfoSetBit( pCex->pData, c );
903 Abc_InfoSetBit( pCexCare->pData, c );
905 else if ( Vec_IntEntry(vNums, c) == 2 && xMode )
910 Abc_InfoSetBit( pCexCare->pData, c );
913 Vec_IntFree( vNums );
921 *ppCexCare = pCexCare;
943int IoCommandReadCex(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
978 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
980 fprintf( pAbc->Err,
"Cannot open input file \"%s\". \n", pFileName );
985 pNtk = pAbc->pNtkCur;
988 fprintf( pAbc->Out,
"Empty network.\n" );
992 pAbc->Status =
Abc_NtkReadCexFile( pFileName, pNtk, &pCex, &pCexCare, &pAbc->nFrames, &fOldFormat, fXMode);
993 if ( fOldFormat && !fCheck )
994 printf(
"WARNING: Old witness format detected and checking is disabled. Reading might have failed.\n" );
996 if ( fCheck && pAbc->Status==1) {
1003 printf(
"Checking CEX for any PO.\n" );
1012 pAbc->pCex->iPo = verified;
1021 fprintf( pAbc->Err,
"usage: read_cex [-ch] <file>\n" );
1022 fprintf( pAbc->Err,
"\t reads the witness cex\n" );
1023 fprintf( pAbc->Err,
"\t-c : toggle check after reading [default = %s]\n", fCheck?
"yes":
"no" );
1024 fprintf( pAbc->Err,
"\t-x : read x bits for verification [default = %s]\n", fXMode?
"yes":
"no" );
1025 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1026 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1040int IoCommandReadDsd(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1077 fprintf( pAbc->Err,
"usage: read_dsd [-h] <formula>\n" );
1078 fprintf( pAbc->Err,
"\t parses a formula representing DSD of a function\n" );
1079 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1080 fprintf( pAbc->Err,
"\tformula : the formula representing disjoint-support decomposition (DSD)\n" );
1081 fprintf( pAbc->Err,
"\t Example of a formula: !(a*(b+CA(!d,e*f,c))*79B3(g,h,i,k))\n" );
1082 fprintf( pAbc->Err,
"\t where \'!\' is an INV, \'*\' is an AND, \'+\' is an XOR, \n" );
1083 fprintf( pAbc->Err,
"\t CA and 79B3 are hexadecimal representations of truth tables\n" );
1084 fprintf( pAbc->Err,
"\t (in this case CA=11001010 is truth table of MUX(Data0,Data1,Ctrl))\n" );
1085 fprintf( pAbc->Err,
"\t The lower chars (a,b,c,etc) are reserved for elementary variables.\n" );
1086 fprintf( pAbc->Err,
"\t The upper chars (A,B,C,etc) are reserved for hexadecimal digits.\n" );
1087 fprintf( pAbc->Err,
"\t No spaces are allowed in formulas. In parentheses, LSB goes first.\n" );
1102int IoCommandReadEdif(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1138 fprintf( pAbc->Err,
"usage: read_edif [-ch] <file>\n" );
1139 fprintf( pAbc->Err,
"\t reads the network in EDIF (works only for ISCAS benchmarks)\n" );
1140 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
1141 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1142 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1157int IoCommandReadEqn(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1193 fprintf( pAbc->Err,
"usage: read_eqn [-ch] <file>\n" );
1194 fprintf( pAbc->Err,
"\t reads the network in equation format\n" );
1195 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
1196 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1197 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1212int IoCommandReadFins(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1217 int c, fVerbose = 0;
1240 Abc_Print( -1,
"Empty network.\n" );
1244 Vec_IntFreeP( &pNtk->
vFins );
1249 fprintf( pAbc->Err,
"usage: read_fins [-vh] <file>\n" );
1250 fprintf( pAbc->Err,
"\t reads the network in equation format\n" );
1251 fprintf( pAbc->Err,
"\t-v : enable verbose output [default = %s].\n", fVerbose?
"yes":
"no" );
1252 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1253 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1268int IoCommandReadInit(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1270 FILE * pOut, * pErr;
1295 fprintf( pErr,
"Empty network.\n" );
1301 else if ( pNtk->
pSpec )
1305 printf(
"File name should be given on the command line.\n" );
1318 fprintf( pAbc->Err,
"usage: read_init [-h] <file>\n" );
1319 fprintf( pAbc->Err,
"\t reads initial state of the network in BENCH format\n" );
1320 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1321 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1336int IoCommandReadPla(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1340 int c, fZeros = 0, fBoth = 0, fOnDc = 0, fSkipPrepro = 0, fCheck = 1;
1373 if ( fZeros || fBoth || fOnDc || fSkipPrepro )
1376 pNtk =
Io_ReadPla( pFileName, fZeros, fBoth, fOnDc, fSkipPrepro, fCheck );
1379 printf(
"Reading PLA file has failed.\n" );
1395 fprintf( pAbc->Err,
"usage: read_pla [-zbdxch] <file>\n" );
1396 fprintf( pAbc->Err,
"\t reads the network in PLA\n" );
1397 fprintf( pAbc->Err,
"\t-z : toggle reading on-set and off-set [default = %s]\n", fZeros?
"off-set":
"on-set" );
1398 fprintf( pAbc->Err,
"\t-b : toggle reading both on-set and off-set as on-set [default = %s]\n", fBoth?
"off-set":
"on-set" );
1399 fprintf( pAbc->Err,
"\t-d : toggle reading both on-set and dc-set as on-set [default = %s]\n", fOnDc?
"off-set":
"on-set" );
1400 fprintf( pAbc->Err,
"\t-x : toggle reading Exclusive SOP rather than SOP [default = %s]\n", fSkipPrepro?
"yes":
"no" );
1401 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
1402 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1403 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n\n" );
1404 fprintf( pAbc->Err,
"\t Please note that the PLA parser is somewhat slow for large SOPs.\n" );
1405 fprintf( pAbc->Err,
"\t On the other hand, BLIF parser reads a 3M SOP and converts it into a 7.5K AIG in 1 sec:\n" );
1406 fprintf( pAbc->Err,
"\t abc 16> read test.blif; ps; bdd -s; ps; muxes; strash; ps\n" );
1407 fprintf( pAbc->Err,
"\t test : i/o = 25/ 1 lat = 0 nd = 1 edge = 25 cube = 2910537 lev = 1\n" );
1408 fprintf( pAbc->Err,
"\t test : i/o = 25/ 1 lat = 0 nd = 1 edge = 25 bdd = 2937 lev = 1\n" );
1409 fprintf( pAbc->Err,
"\t test : i/o = 25/ 1 lat = 0 and = 7514 lev = 48\n" );
1410 fprintf( pAbc->Err,
"\t abc 19> time\n" );
1411 fprintf( pAbc->Err,
"\t elapse: 1.05 seconds, total: 1.05 seconds\n" );
1426int IoCommandReadPlaMo(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1430 int c, fMerge = 0, fVerbose = 0;
1460 fprintf( pAbc->Err,
"usage: read_plamo [-mvh] <file>\n" );
1461 fprintf( pAbc->Err,
"\t reads the network in multi-output PLA\n" );
1462 fprintf( pAbc->Err,
"\t-m : toggle dist-1 merge for cubes with identical outputs [default = %s]\n", fMerge?
"yes":
"no" );
1463 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1464 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1465 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1480int IoCommandReadTruth(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1513 if ( pFile == NULL )
1532 if ( Vec_PtrSize(vSops) == 0 )
1534 Vec_PtrFreeFree( vSops );
1535 fprintf( pAbc->Err,
"Reading truth table has failed.\n" );
1540 Vec_PtrFreeFree( vSops );
1543 fprintf( pAbc->Err,
"Deriving the network has failed.\n" );
1552 fprintf( pAbc->Err,
"usage: read_truth [-xfh] <truth> <file>\n" );
1553 fprintf( pAbc->Err,
"\t creates network with node(s) having given truth table(s)\n" );
1554 fprintf( pAbc->Err,
"\t-x : toggles between bin and hex notation [default = %s]\n", fHex?
"hex":
"bin" );
1555 fprintf( pAbc->Err,
"\t-f : toggles reading truth table(s) from file [default = %s]\n", fFile?
"yes":
"no" );
1556 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1557 fprintf( pAbc->Err,
"\ttruth : truth table with most significant bit first (e.g. 1000 for AND(a,b))\n" );
1558 fprintf( pAbc->Err,
"\tfile : file name with the truth table\n" );
1573int IoCommandReadCnf(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1601 if ( pFile == NULL )
1609 if ( Vec_PtrSize(vSops) == 0 )
1611 Vec_PtrFreeFree( vSops );
1612 fprintf( pAbc->Err,
"Reading CNF file has failed.\n" );
1616 Vec_PtrFreeFree( vSops );
1619 fprintf( pAbc->Err,
"Deriving the network has failed.\n" );
1628 fprintf( pAbc->Err,
"usage: read_cnf [-mh] <file>\n" );
1629 fprintf( pAbc->Err,
"\t creates network with one node\n" );
1630 fprintf( pAbc->Err,
"\t-m : toggles generating multi-output network [default = %s]\n", fMulti?
"yes":
"no" );
1631 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1632 fprintf( pAbc->Err,
"\tfile : file name with the truth table\n" );
1647int IoCommandReadVerilog(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1651 int fCheck, fBarBufs;
1691 fprintf( pAbc->Err,
"usage: read_verilog [-mcbh] <file>\n" );
1692 fprintf( pAbc->Err,
"\t reads the network in Verilog (IWLS 2002/2005 subset)\n" );
1693 fprintf( pAbc->Err,
"\t-m : toggle reading mapped Verilog [default = %s]\n",
glo_fMapped?
"yes":
"no" );
1694 fprintf( pAbc->Err,
"\t-c : toggle network check after reading [default = %s]\n", fCheck?
"yes":
"no" );
1695 fprintf( pAbc->Err,
"\t-b : toggle reading barrier buffers [default = %s]\n", fBarBufs?
"yes":
"no" );
1696 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1697 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1712int IoCommandReadStatus(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1737 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
1739 fprintf( pAbc->Err,
"Cannot open input file \"%s\". \n", pFileName );
1750 fprintf( pAbc->Err,
"usage: read_status [-ch] <file>\n" );
1751 fprintf( pAbc->Err,
"\t reads verification log file\n" );
1752 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1753 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1768int IoCommandReadGig(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1794 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
1796 fprintf( pAbc->Err,
"Cannot open input file \"%s\". \n", pFileName );
1807 fprintf( pAbc->Err,
"usage: &read_gig [-h] <file>\n" );
1808 fprintf( pAbc->Err,
"\t reads design in GIG format\n" );
1809 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1810 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1825int IoCommandReadJson(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1852 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
1854 fprintf( pAbc->Err,
"Cannot open input file \"%s\". \n", pFileName );
1861 if ( vObjs == NULL )
1868 fprintf( pAbc->Err,
"usage: read_json [-h] <file>\n" );
1869 fprintf( pAbc->Err,
"\t reads file in JSON format\n" );
1870 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1871 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1886int IoCommandReadSF(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1892 char * pFileName, * pFileTemp =
"_temp_sf_.pla";
1913 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
1915 fprintf( pAbc->Err,
"Cannot open input file \"%s\". \n", pFileName );
1921 unlink( pFileTemp );
1927 pNtk->
pSpec = Abc_UtilStrsav( pFileName );
1935 fprintf( pAbc->Err,
"usage: read_sf [-h] <file>\n" );
1936 fprintf( pAbc->Err,
"\t reads file in SF format\n" );
1937 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
1938 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
1954int IoCommandReadRom(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1960 char * pFileName, * pFileTemp =
"_temp_rom_.pla";
1981 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
1983 fprintf( pAbc->Err,
"Cannot open input file \"%s\". \n", pFileName );
1995 pNtk->
pSpec = Abc_UtilStrsav( pFileName );
2003 fprintf( pAbc->Err,
"usage: read_rom [-h] <file>\n" );
2004 fprintf( pAbc->Err,
"\t reads ROM file\n" );
2005 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
2006 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
2021int IoCommandReadMM(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
2024 Abc_Ntk_t * pNtk;
char * pFileName;
int c;
2048 fprintf( pAbc->Err,
"usage: read_mm [-h] <file>\n" );
2049 fprintf( pAbc->Err,
"\t reads mapped network from file\n" );
2050 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
2051 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
2066int IoCommandReadMMGia(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
2069 Abc_Ntk_t * pNtk;
char * pFileName;
int c;
2096 fprintf( pAbc->Err,
"usage: &read_mm [-h] <file>\n" );
2097 fprintf( pAbc->Err,
"\t reads mapped network from file\n" );
2098 fprintf( pAbc->Err,
"\t-h : prints the command summary\n" );
2099 fprintf( pAbc->Err,
"\tfile : the name of a file to read\n" );
2114int IoCommandWrite(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2139 sprintf( Command,
"write_genlib %s", pFileName );
2141 sprintf( Command,
"write_lib %s", pFileName );
2143 sprintf( Command,
"dsd_save %s", pFileName );
2149 if ( pAbc->pNtkCur == NULL )
2151 fprintf( pAbc->Out,
"Empty network.\n" );
2159 fprintf( pAbc->Err,
"usage: write [-h] <file>\n" );
2160 fprintf( pAbc->Err,
"\t writes the current network into <file> by calling\n" );
2161 fprintf( pAbc->Err,
"\t the writer that matches the extension of <file>\n" );
2162 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2163 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2178int IoCommandWriteHie(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2180 char * pBaseName, * pFileName;
2198 if ( pAbc->pNtkCur == NULL )
2200 fprintf( pAbc->Out,
"Empty network.\n" );
2210 Io_WriteHie( pAbc->pNtkCur, pBaseName, pFileName );
2214 fprintf( pAbc->Err,
"usage: write_hie [-h] <orig> <file>\n" );
2215 fprintf( pAbc->Err,
"\t writes the current network into <file> by calling\n" );
2216 fprintf( pAbc->Err,
"\t the hierarchical writer that matches the extension of <file>\n" );
2217 fprintf( pAbc->Err,
"\t-m : toggle reading mapped Verilog for <orig> [default = %s]\n",
glo_fMapped?
"yes":
"no" );
2218 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2219 fprintf( pAbc->Err,
"\torig : the name of the original file with the hierarchical design\n" );
2220 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2235int IoCommandWriteAiger(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2271 if ( pAbc->pNtkCur == NULL )
2273 fprintf( pAbc->Out,
"Empty network.\n" );
2281 if ( !Abc_NtkIsStrash(pAbc->pNtkCur) )
2283 fprintf( stdout,
"Writing this format is only possible for structurally hashed AIGs.\n" );
2295 Io_WriteAiger( pTemp, pFileName, fWriteSymbols, fCompact, fUnique );
2299 Io_WriteAiger( pAbc->pNtkCur, pFileName, fWriteSymbols, fCompact, fUnique );
2303 fprintf( pAbc->Err,
"usage: write_aiger [-scuvh] <file>\n" );
2304 fprintf( pAbc->Err,
"\t writes the network in the AIGER format (http://fmv.jku.at/aiger)\n" );
2305 fprintf( pAbc->Err,
"\t-s : toggle saving I/O names [default = %s]\n", fWriteSymbols?
"yes" :
"no" );
2306 fprintf( pAbc->Err,
"\t-c : toggle writing more compactly [default = %s]\n", fCompact?
"yes" :
"no" );
2307 fprintf( pAbc->Err,
"\t-u : toggle writing canonical AIG structure [default = %s]\n", fUnique?
"yes" :
"no" );
2308 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes" :
"no" );
2309 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2310 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .aig)\n" );
2325int IoCommandWriteAigerCex(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2340 if ( pAbc->pCex == NULL )
2342 fprintf( pAbc->Out,
"There is no current CEX.\n" );
2353 fprintf( pAbc->Err,
"usage: write_aiger_cex [-h] <file>\n" );
2354 fprintf( pAbc->Err,
"\t writes the current CEX in the AIGER format (http://fmv.jku.at/aiger)\n" );
2355 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2356 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2371int IoCommandWriteBaf(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2387 if ( pAbc->pNtkCur == NULL )
2389 fprintf( pAbc->Out,
"Empty network.\n" );
2401 fprintf( pAbc->Err,
"usage: write_baf [-h] <file>\n" );
2402 fprintf( pAbc->Err,
"\t writes the network into a BLIF file\n" );
2403 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2404 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .baf)\n" );
2419int IoCommandWriteBblif(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2435 if ( pAbc->pNtkCur == NULL )
2437 fprintf( pAbc->Out,
"Empty network.\n" );
2449 fprintf( pAbc->Err,
"usage: write_bblif [-h] <file>\n" );
2450 fprintf( pAbc->Err,
"\t writes the network into a binary BLIF file\n" );
2451 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2452 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .bblif)\n" );
2467int IoCommandWriteBlif(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2470 char * pLutStruct = NULL;
2471 int c, fSpecial = 0;
2482 Abc_Print( -1,
"Command line switch \"-S\" should be followed by string.\n" );
2487 if (
strlen(pLutStruct) != 2 &&
strlen(pLutStruct) != 3 )
2489 Abc_Print( -1,
"Command line switch \"-S\" should be followed by a 2- or 3-char string (e.g. \"44\" or \"555\").\n" );
2505 if ( pAbc->pNtkCur == NULL )
2507 fprintf( pAbc->Out,
"Empty network.\n" );
2515 if ( fSpecial || pLutStruct )
2522 fprintf( pAbc->Err,
"usage: write_blif [-S str] [-jah] <file>\n" );
2523 fprintf( pAbc->Err,
"\t writes the network into a BLIF file\n" );
2524 fprintf( pAbc->Err,
"\t-S str : string representing the LUT structure [default = %s]\n", pLutStruct ? pLutStruct :
"not used" );
2525 fprintf( pAbc->Err,
"\t-j : enables special BLIF writing [default = %s]\n", fSpecial?
"yes" :
"no" );;
2526 fprintf( pAbc->Err,
"\t-a : enables hierarchical BLIF writing for LUT structures [default = %s]\n", fUseHie?
"yes" :
"no" );;
2527 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2528 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .blif)\n" );
2543int IoCommandWriteBlifMv(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2559 if ( pAbc->pNtkCur == NULL )
2561 fprintf( pAbc->Out,
"Empty network.\n" );
2573 fprintf( pAbc->Err,
"usage: write_blif_mv [-h] <file>\n" );
2574 fprintf( pAbc->Err,
"\t writes the network into a BLIF-MV file\n" );
2575 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2576 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .mv)\n" );
2591int IoCommandWriteBench(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2612 if ( pAbc->pNtkCur == NULL )
2614 fprintf( pAbc->Out,
"Empty network.\n" );
2624 else if ( pAbc->pNtkCur )
2633 printf(
"There is no current network.\n" );
2637 fprintf( pAbc->Err,
"usage: write_bench [-lh] <file>\n" );
2638 fprintf( pAbc->Err,
"\t writes the network in BENCH format\n" );
2639 fprintf( pAbc->Err,
"\t-l : toggle using LUTs in the output [default = %s]\n", fUseLuts?
"yes" :
"no" );
2640 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2641 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .bench)\n" );
2656int IoCommandWriteBook(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2680 fprintf( pAbc->Err,
"usage: write_book [-h] <file> [-options]\n" );
2681 fprintf( pAbc->Err,
"\t-h : prints the help massage\n" );
2682 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .aux, .nodes, .nets)\n" );
2683 fprintf( pAbc->Err,
"\t\n" );
2684 fprintf( pAbc->Err,
"\tThis command is developed by Myungchul Kim (University of Michigan).\n" );
2699int IoCommandWriteCellNet(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2717 if ( pAbc->pNtkCur == NULL )
2719 fprintf( pAbc->Out,
"Empty network.\n" );
2724 pNtk = pAbc->pNtkCur;
2728 if ( !Abc_NtkIsLogic(pNtk) )
2730 fprintf( pAbc->Out,
"The network should be a logic network (if it an AIG, use command \"logic\")\n" );
2737 fprintf( pAbc->Err,
"usage: write_cellnet [-h] <file>\n" );
2738 fprintf( pAbc->Err,
"\t writes the network is the cellnet format\n" );
2739 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2740 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2755int IoCommandWriteCnf(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2797 if ( pAbc->pNtkCur == NULL )
2799 fprintf( pAbc->Out,
"Empty network.\n" );
2807 if ( Abc_NtkIsStrash(pAbc->pNtkCur) && fAllPrimes )
2810 printf(
"Warning: Selected option to write all primes has no effect when deriving CNF from AIG.\n" );
2815 else if ( fNewAlgo )
2817 else if ( fAllPrimes )
2824 fprintf( pAbc->Err,
"usage: write_cnf [-nfpcvh] <file>\n" );
2825 fprintf( pAbc->Err,
"\t generates CNF for the miter (see also \"&write_cnf\")\n" );
2826 fprintf( pAbc->Err,
"\t-n : toggle using new algorithm [default = %s]\n", fNewAlgo?
"yes" :
"no" );
2827 fprintf( pAbc->Err,
"\t-f : toggle using fast algorithm [default = %s]\n", fFastAlgo?
"yes" :
"no" );
2828 fprintf( pAbc->Err,
"\t-p : toggle using all primes to enhance implicativity [default = %s]\n", fAllPrimes?
"yes" :
"no" );
2829 fprintf( pAbc->Err,
"\t-c : toggle adjasting polarity of internal variables [default = %s]\n", fChangePol?
"yes" :
"no" );
2830 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes" :
"no" );
2831 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2832 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2847int IoCommandWriteCnf2(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2850 extern void Mf_ManDumpCnf(
Gia_Man_t *
p,
char * pFileName,
int nLutSize,
int fCnfObjIds,
int fAddOrCla,
int fVerbose );
2857 int c, fVerbose = 0;
2866 Abc_Print( -1,
"Command line switch \"-K\" should be followed by an integer.\n" );
2890 if ( pAbc->pGia == NULL )
2892 Abc_Print( -1,
"IoCommandWriteCnf2(): There is no AIG.\n" );
2895 if ( Gia_ManRegNum(pAbc->pGia) > 0 )
2897 Abc_Print( -1,
"IoCommandWriteCnf2(): Works only for combinational miters.\n" );
2900 if ( nLutSize < 3 || nLutSize > 8 )
2902 Abc_Print( -1,
"IoCommandWriteCnf2(): Invalid LUT size (%d).\n", nLutSize );
2907 Abc_Print( -1,
"IoCommandWriteCnf2(): Cannot input precomputed DSD information.\n" );
2914 pFile = fopen( pFileName,
"wb" );
2915 if ( pFile == NULL )
2917 printf(
"Cannot open file \"%s\" for writing.\n", pFileName );
2922 Mf_ManDumpCnf( pAbc->pGia, pFileName, nLutSize, fCnfObjIds, fAddOrCla, fVerbose );
2928 fprintf( pAbc->Err,
"usage: &write_cnf [-Kaiovh] <file>\n" );
2929 fprintf( pAbc->Err,
"\t writes CNF produced by a new generator\n" );
2930 fprintf( pAbc->Err,
"\t-K <num> : the LUT size (3 <= num <= 8) [default = %d]\n", nLutSize );
2931 fprintf( pAbc->Err,
"\t-a : toggle using new algorithm [default = %s]\n", fNewAlgo?
"yes" :
"no" );
2932 fprintf( pAbc->Err,
"\t-i : toggle using AIG object IDs as CNF variables [default = %s]\n", fCnfObjIds?
"yes" :
"no" );
2933 fprintf( pAbc->Err,
"\t-o : toggle adding OR clause for the outputs [default = %s]\n", fAddOrCla?
"yes" :
"no" );
2934 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes" :
"no" );
2935 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2936 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
2937 fprintf( pAbc->Err,
"\n" );
2938 fprintf( pAbc->Err,
"\t CNF variable mapping rules:\n" );
2939 fprintf( pAbc->Err,
"\n" );
2940 fprintf( pAbc->Err,
"\t Assume CNF has N variables, with variable IDs running from 0 to N-1.\n" );
2941 fprintf( pAbc->Err,
"\t Variable number 0 is not used in the CNF.\n" );
2942 fprintf( pAbc->Err,
"\t Variables 1, 2, 3,... <nPOs> represent POs in their natural order.\n" );
2943 fprintf( pAbc->Err,
"\t Variables N-<nPIs>, N-<nPIs>+1, N-<nPIs>+2, ... N-1, represent PIs in their natural order.\n" );
2944 fprintf( pAbc->Err,
"\t The internal variables are ordered in a reverse topological order from outputs to inputs.\n" );
2945 fprintf( pAbc->Err,
"\t That is, smaller variable IDs tend to be closer to the outputs, while larger\n" );
2946 fprintf( pAbc->Err,
"\t variable IDs tend to be closer to the inputs. It was found that this ordering\n" );
2947 fprintf( pAbc->Err,
"\t leads to faster SAT solving for hard UNSAT CEC problems.\n" );
2963int IoCommandWriteDot(
Abc_Frame_t * pAbc,
int argc,
char **argv )
2979 if ( pAbc->pNtkCur == NULL )
2981 fprintf( pAbc->Out,
"Empty network.\n" );
2993 fprintf( pAbc->Err,
"usage: write_dot [-h] <file>\n" );
2994 fprintf( pAbc->Err,
"\t writes the current network into a DOT file\n" );
2995 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
2996 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
3037 printf(
"Counter-example minimization has failed.\n" );
3042 fprintf( pFile,
"CEX: %s@0=%c\n",
Abc_ObjName(Abc_ObjFanout0(pObj)),
'0'+!Abc_LatchIsInit0(pObj) );
3044 for ( f = 0; f <= pCex->iFrame; f++ )
3046 if ( !pCare || Abc_InfoHasBit(pCare->pData, pCare->nRegs+pCare->nPis*f + i) )
3047 fprintf( pFile,
"CEX: %s@%d=%c\n",
Abc_ObjName(pObj), f,
'0'+Abc_InfoHasBit(pCex->pData, pCex->nRegs+pCex->nPis*f + i) );
3057 int fPrintFull,
int fNames,
int fUseFfNames,
int fMinimize,
int fUseOldMin,
int fCexInfo,
3058 int fCheckCex,
int fUseSatBased,
int fHighEffort,
int fAiger,
int fVerbose,
int fExtended )
3070 assert( pCexFull->nBits == Abc_NtkCiNum(pNtk) * (pCex->iFrame + 1) );
3071 for ( f = 0; f <= pCex->iFrame; f++ )
3073 fprintf( pFile,
"%s@%d=%c ",
Abc_ObjName(pObj), f,
'0'+Abc_InfoHasBit(pCexFull->pData, Abc_NtkCiNum(pNtk)*f + i) );
3080 fprintf( pFile,
"# FALSIFYING OUTPUTS:");
3081 fprintf( pFile,
" %s",
Abc_ObjName(Abc_NtkCo(pNtk, pCex->iPo)) );
3093 else if ( fUseSatBased )
3095 if ( Abc_NtkPoNum( pNtk ) == 1 )
3098 printf(
"SAT-based CEX minimization requires having a single PO.\n" );
3100 else if ( fCexInfo )
3109 printf(
"Counter-example care-set verification has failed.\n" );
3117 printf(
"Counter-example min-set verification has failed.\n" );
3127 printf(
"Counter-example minimization has failed.\n" );
3131 fprintf( pFile,
"\n");
3132 fprintf( pFile,
"# COUNTEREXAMPLE LENGTH: %u\n", pCex->iFrame+1);
3137 int nXValues = 0, iFlop = 0, iPivotPi = -1;
3141 if ( iPivotPi == Abc_NtkPiNum(pNtk) )
3143 fprintf( stdout,
"IoCommandWriteCex(): Cannot find special PI required by switch \"-z\".\n" );
3147 for ( i = iPivotPi+1; i < Abc_NtkPiNum(pNtk); i++ )
3151 pValues =
ABC_FALLOC(
int, Abc_NtkPiNum(pNtk) );
3152 for ( i = iPivotPi+1; i < Abc_NtkPiNum(pNtk); i++ )
3154 pValues[i] = iPivotPi - nXValues + iFlop++;
3155 assert( iFlop == nXValues );
3157 for ( i = iPivotPi+1; i < Abc_NtkPiNum(pNtk); i++ )
3158 if ( pValues[i] == -1 )
3160 else if ( Abc_InfoHasBit(pCare->pData, pCare->nRegs + pValues[i]) )
3161 fprintf( pFile,
"%s@0=%c\n",
Abc_ObjName(Abc_NtkPi(pNtk, i))+1,
'0'+Abc_InfoHasBit(pCex->pData, pCex->nRegs + pValues[i]) );
3164 for ( f = 0; f <= pCex->iFrame; f++ )
3167 if ( i == iPivotPi - nXValues )
break;
3168 if ( !pCare || Abc_InfoHasBit(pCare->pData, pCare->nRegs+pCare->nPis*f + i) )
3169 fprintf( pFile,
"%s@%d=%c\n",
Abc_ObjName(pObj), f,
'0'+Abc_InfoHasBit(pCex->pData, pCex->nRegs+pCex->nPis*f + i) );
3174 if (fExtended && fAiger && !fNames) {
3175 fprintf( pFile,
"1\n");
3176 fprintf( pFile,
"b%d\n", pCex->iPo);
3181 fprintf( pFile,
"%s@0=%c\n",
Abc_ObjName(Abc_ObjFanout0(pObj)),
'0'+!Abc_LatchIsInit0(pObj) );
3183 fprintf( pFile,
"%c",
'0'+!Abc_LatchIsInit0(pObj) );
3184 if ( !fNames && fAiger)
3185 fprintf( pFile,
"\n");
3187 for ( f = 0; f <= pCex->iFrame; f++ ) {
3189 if ( !pCare || Abc_InfoHasBit(pCare->pData, pCare->nRegs+pCare->nPis*f + i) )
3191 fprintf( pFile,
"%s@%d=%c\n",
Abc_ObjName(pObj), f,
'0'+Abc_InfoHasBit(pCex->pData, pCex->nRegs+pCex->nPis*f + i) );
3193 fprintf( pFile,
"%c",
'0'+Abc_InfoHasBit(pCex->pData, pCex->nRegs+pCex->nPis*f + i) );
3195 fprintf( pFile,
"x");
3196 if ( !fNames && fAiger)
3197 fprintf( pFile,
"\n");
3199 if (fExtended && fAiger && !fNames)
3200 fprintf( pFile,
".\n");
3217int IoCommandWriteCex(
Abc_Frame_t * pAbc,
int argc,
char **argv )
3223 int fUseSatBased = 0;
3224 int fHighEffort = 0;
3230 int fUseFfNames = 0;
3285 pNtk = pAbc->pNtkCur;
3288 fprintf( pAbc->Out,
"Empty network.\n" );
3291 if ( pNtk->
pModel == NULL && pAbc->pCex == NULL && pAbc->vCexVec == NULL )
3293 fprintf( pAbc->Out,
"Counter-example is not available.\n" );
3298 printf(
"File name is missing on the command line.\n" );
3305 if ( pAbc->pCex || pAbc->vCexVec )
3308 FILE * pFile;
int i;
3318 pFile = fopen( pFileName,
"w" );
3319 if ( pFile == NULL )
3321 fprintf( stdout,
"IoCommandWriteCex(): Cannot open the output file \"%s\".\n", pFileName );
3327 fPrintFull, fNames, fUseFfNames, fMinimize, fUseOldMin, fCexInfo,
3328 fCheckCex, fUseSatBased, fHighEffort, fAiger, fVerbose, fExtended );
3330 else if ( pAbc->vCexVec )
3336 fprintf( pFile,
"#\n#\n# CEX for output %d\n#\n", i );
3338 fPrintFull, fNames, fUseFfNames, fMinimize, fUseOldMin, fCexInfo,
3339 fCheckCex, fUseSatBased, fHighEffort, fAiger, fVerbose, fExtended );
3342 fprintf( pFile,
"# DONE\n" );
3348 FILE * pFile = fopen( pFileName,
"w" );
3350 if ( pFile == NULL )
3352 fprintf( stdout,
"IoCommandWriteCex(): Cannot open the output file \"%s\".\n", pFileName );
3357 const char *cycle_ctr = forceSeq?
"@0":
"";
3360 fprintf( pFile,
"%s%s=%c\n",
Abc_ObjName(pObj), cycle_ctr,
'0'+(pNtk->
pModel[i]==1) );
3365 fprintf( pFile,
"%c",
'0'+(pNtk->
pModel[i]==1) );
3367 fprintf( pFile,
"\n" );
3374 fprintf( pAbc->Err,
"usage: write_cex [-snmueocfzvh] <file>\n" );
3375 fprintf( pAbc->Err,
"\t saves counter-example (CEX) derived by \"sat\", \"iprove\", \"dprove\", etc\n" );
3376 fprintf( pAbc->Err,
"\t the output file <file> contains values for each PI in natural order\n" );
3377 fprintf( pAbc->Err,
"\t-s : always report a sequential CEX (cycle 0 for comb) [default = %s]\n", forceSeq?
"yes":
"no" );
3378 fprintf( pAbc->Err,
"\t-n : write input names into the file [default = %s]\n", fNames?
"yes":
"no" );
3379 fprintf( pAbc->Err,
"\t-m : minimize CEX by dropping don't-care values [default = %s]\n", fMinimize?
"yes":
"no" );
3380 fprintf( pAbc->Err,
"\t-u : use fast SAT-based CEX minimization [default = %s]\n", fUseSatBased?
"yes":
"no" );
3381 fprintf( pAbc->Err,
"\t-e : use high-effort SAT-based CEX minimization [default = %s]\n", fHighEffort?
"yes":
"no" );
3382 fprintf( pAbc->Err,
"\t-o : use old CEX minimization algorithm [default = %s]\n", fUseOldMin?
"yes":
"no" );
3383 fprintf( pAbc->Err,
"\t-x : minimize using algorithm from cexinfo command [default = %s]\n", fCexInfo?
"yes":
"no" );
3384 fprintf( pAbc->Err,
"\t-c : check generated CEX using ternary simulation [default = %s]\n", fCheckCex?
"yes":
"no" );
3385 fprintf( pAbc->Err,
"\t-a : print cex in AIGER 1.9 format [default = %s]\n", fAiger?
"yes":
"no" );
3386 fprintf( pAbc->Err,
"\t-t : extended header info when cex in AIGER 1.9 format [default = %s]\n", fAiger?
"yes":
"no" );
3387 fprintf( pAbc->Err,
"\t-f : enable printing flop values in each timeframe [default = %s]\n", fPrintFull?
"yes":
"no" );
3388 fprintf( pAbc->Err,
"\t-z : toggle using saved flop names [default = %s]\n", fUseFfNames?
"yes":
"no" );
3389 fprintf( pAbc->Err,
"\t-v : enable verbose output [default = %s]\n", fVerbose?
"yes":
"no" );
3390 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
3391 fprintf( pAbc->Err,
"\t<file> : the name of the file to write\n" );
3406int IoCommandWriteEqn(
Abc_Frame_t * pAbc,
int argc,
char **argv )
3422 if ( pAbc->pNtkCur == NULL )
3424 fprintf( pAbc->Out,
"Empty network.\n" );
3436 fprintf( pAbc->Err,
"usage: write_eqn [-h] <file>\n" );
3437 fprintf( pAbc->Err,
"\t writes the current network in the equation format\n" );
3438 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
3439 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
3454int IoCommandWriteEdgelist(
Abc_Frame_t * pAbc,
int argc,
char **argv )
3457 int c, fSpecial = 0;
3478 if ( pAbc->pNtkCur == NULL )
3480 fprintf( pAbc->Out,
"Empty network.\n" );
3495 fprintf( pAbc->Err,
"usage: write_edgelist [-N] <file>\n" );
3496 fprintf( pAbc->Err,
"\t writes the network into edgelist file\n" );
3497 fprintf( pAbc->Err,
"\t part of Verilog-2-PyG (PyTorch Geometric). more details https://github.com/ycunxi/Verilog-to-PyG \n" );
3498 fprintf( pAbc->Err,
"\t-N : toggle keeping original naming of the netlist in edgelist (default=False)\n");
3499 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
3500 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .el)\n" );
3516int IoCommandWriteHMetis(
Abc_Frame_t * pAbc,
int argc,
char **argv )
3547 if ( pAbc->pNtkCur == NULL )
3549 fprintf( pAbc->Out,
"Empty network.\n" );
3557 if ( !Abc_NtkIsStrash(pAbc->pNtkCur) )
3559 fprintf( stdout,
"Writing this format is only possible for structurally hashed AIGs.\n" );
3562 Io_WriteHMetis( pAbc->pNtkCur, pFileName, fSkipPo, fWeightEdges, fVerbose );
3566 fprintf( pAbc->Err,
"usage: write_hmetis <file>\n" );
3567 fprintf( pAbc->Err,
"\t writes the network in the hMetis format (https://karypis.github.io/glaros/files/sw/hmetis/manual.pdf)\n" );
3568 fprintf( pAbc->Err,
"\t-s : skip PO as sink explictly [default = %s]\n", fSkipPo?
"yes" :
"no" );
3569 fprintf( pAbc->Err,
"\t-w : simulate weight on hyperedges [default = %s]\n", fWeightEdges?
"yes" :
"no" );
3570 fprintf( pAbc->Err,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes" :
"no" );
3571 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
3572 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
3589int IoCommandWriteGml(
Abc_Frame_t * pAbc,
int argc,
char **argv )
3605 if ( pAbc->pNtkCur == NULL )
3607 fprintf( pAbc->Out,
"Empty network.\n" );
3619 fprintf( pAbc->Err,
"usage: write_gml [-h] <file>\n" );
3620 fprintf( pAbc->Err,
"\t writes network using graph representation formal GML\n" );
3621 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
3622 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
3637int IoCommandWriteList(
Abc_Frame_t * pAbc,
int argc,
char **argv )
3643 printf(
"This command currently does not work.\n" );
3661 if ( pAbc->pNtkCur == NULL )
3663 fprintf( pAbc->Out,
"Empty network.\n" );
3682 fprintf( pAbc->Err,
"usage: write_list [-nh] <file>\n" );
3683 fprintf( pAbc->Err,
"\t writes network using graph representation formal GML\n" );
3684 fprintf( pAbc->Err,
"\t-n : toggle writing host node [default = %s]\n", fUseHost?
"yes":
"no" );
3685 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
3686 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
3701int IoCommandWritePla(
Abc_Frame_t * pAbc,
int argc,
char **argv )
3705 int c, fUseMoPla = 0, nMints = 0;
3715 Abc_Print( -1,
"Command line switch \"-M\" should be followed by an integer.\n" );
3730 if ( pAbc->pNtkCur == NULL )
3732 fprintf( pAbc->Out,
"Empty network.\n" );
3742 if ( Abc_NtkIsBddLogic(pAbc->pNtkCur) )
3756 fprintf( pAbc->Err,
"usage: write_pla [-M <num>] [-mh] <file>\n" );
3757 fprintf( pAbc->Err,
"\t writes the collapsed network into a PLA file\n" );
3758 fprintf( pAbc->Err,
"\t-M <num> : the number of on-set minterms to write [default = %d]\n", nMints );
3759 fprintf( pAbc->Err,
"\t-m : toggle writing multi-output PLA [default = %s]\n", fUseMoPla?
"yes":
"no" );
3760 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
3761 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
3776int IoCommandWriteVerilog(
Abc_Frame_t * pAbc,
int argc,
char **argv )
3778 extern void Io_WriteVerilogLut(
Abc_Ntk_t * pNtk,
char * pFileName,
int nLutSize,
int fFixed,
int fNoModules,
int fNewInterface );
3780 int c, fFixed = 0, fOnlyAnds = 0, fNoModules = 0, fNewInterface = 0;
3791 Abc_Print( -1,
"Command line switch \"-K\" should be followed by an integer.\n" );
3796 if ( nLutSize < 2 || nLutSize > 6 )
3817 if ( pAbc->pNtkCur == NULL )
3819 fprintf( pAbc->Out,
"Empty network.\n" );
3829 if ( nLutSize >= 2 && nLutSize <= 6 )
3830 Io_WriteVerilogLut( pAbc->pNtkCur, pFileName, nLutSize, fFixed, fNoModules, fNewInterface );
3834 if ( !Abc_NtkHasAig(pNtkTemp) && !Abc_NtkHasMapping(pNtkTemp) )
3842 fprintf( pAbc->Err,
"usage: write_verilog [-K num] [-famnh] <file>\n" );
3843 fprintf( pAbc->Err,
"\t writes the current network in Verilog format\n" );
3844 fprintf( pAbc->Err,
"\t-K num : write the network using instances of K-LUTs (2 <= K <= 6) [default = not used]\n" );
3845 fprintf( pAbc->Err,
"\t-f : toggle using fixed format [default = %s]\n", fFixed?
"yes":
"no" );
3846 fprintf( pAbc->Err,
"\t-a : toggle writing expressions with only ANDs (without XORs and MUXes) [default = %s]\n", fOnlyAnds?
"yes":
"no" );
3847 fprintf( pAbc->Err,
"\t-m : toggle writing additional modules [default = %s]\n", !fNoModules?
"yes":
"no" );
3848 fprintf( pAbc->Err,
"\t-n : toggle writing generic PO names and assign-statements [default = %s]\n", fNewInterface?
"yes":
"no" );
3849 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
3850 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
3865int IoCommandWriteSortCnf(
Abc_Frame_t * pAbc,
int argc,
char **argv )
3881 fprintf( stdout,
"Command line switch \"-N\" should be followed by an integer.\n" );
3892 fprintf( stdout,
"Command line switch \"-Q\" should be followed by an integer.\n" );
3915 fprintf( pAbc->Err,
"usage: write_sorter_cnf [-N <num>] [-Q <num>] <file>\n" );
3916 fprintf( pAbc->Err,
"\t writes CNF for the sorter\n" );
3917 fprintf( pAbc->Err,
"\t-N num : the number of sorter bits [default = %d]\n", nVars );
3918 fprintf( pAbc->Err,
"\t-Q num : the number of bits to be asserted to 1 [default = %d]\n", nQueens );
3919 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
3920 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
3935int IoCommandWriteTruth(
Abc_Frame_t * pAbc,
int argc,
char **argv )
3964 if ( pAbc->pNtkCur == NULL )
3966 printf(
"Current network is not available.\n" );
3969 if ( !Abc_NtkIsLogic(pNtk) )
3971 printf(
"Current network should not an AIG. Run \"logic\".\n" );
3974 if ( Abc_NtkPoNum(pNtk) != 1 )
3976 printf(
"Current network should have exactly one primary output.\n" );
3979 if ( Abc_NtkNodeNum(pNtk) != 1 )
3981 printf(
"Current network should have exactly one node.\n" );
3984 pNode = Abc_ObjFanin0( Abc_NtkPo(pNtk, 0) );
3985 if ( Abc_ObjFaninNum(pNode) == 0 )
3987 printf(
"Can only write logic function with 0 inputs.\n" );
3990 if ( Abc_ObjFaninNum(pNode) > 16 )
3992 printf(
"Can only write logic function with no more than 16 inputs.\n" );
4001 vTruth = Vec_IntAlloc( 0 );
4003 pFile = fopen( pFileName,
"w" );
4004 if ( pFile == NULL )
4006 Vec_IntFree( vTruth );
4007 printf(
"Cannot open file \"%s\" for writing.\n", pFileName );
4015 Vec_IntFree( vTruth );
4019 fprintf( pAbc->Err,
"usage: write_truth [-xrh] <file>\n" );
4020 fprintf( pAbc->Err,
"\t writes truth table into a file\n" );
4021 fprintf( pAbc->Err,
"\t-x : toggles between bin and hex representation [default = %s]\n", fHex?
"hex":
"bin" );
4022 fprintf( pAbc->Err,
"\t-r : toggle reversing bits in the truth table [default = %s]\n", fReverse?
"yes":
"no" );
4023 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
4024 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
4040int IoCommandWriteTruths(
Abc_Frame_t * pAbc,
int argc,
char **argv )
4049 int fBinaryFile = 0;
4072 if ( pAbc->pGia == NULL )
4074 Abc_Print( -1,
"IoCommandWriteTruths(): There is no AIG.\n" );
4077 if ( Gia_ManPiNum(pAbc->pGia) > 16 )
4079 Abc_Print( -1,
"IoCommandWriteTruths(): Can write truth tables up to 16 inputs.\n" );
4082 if ( Gia_ManPiNum(pAbc->pGia) < 3 )
4084 Abc_Print( -1,
"IoCommandWriteTruths(): Can write truth tables for 3 inputs or more.\n" );
4092 pFile = fopen( pFileName,
"wb" );
4093 if ( pFile == NULL )
4095 printf(
"Cannot open file \"%s\" for writing.\n", pFileName );
4098 nBytes = 8 * Abc_Truth6WordNum( Gia_ManPiNum(pAbc->pGia) );
4103 fwrite( pTruth, nBytes, 1, pFile );
4105 Extra_PrintHex( pFile, (
unsigned *)pTruth, Gia_ManPiNum(pAbc->pGia) ), fprintf( pFile,
"\n" );
4107 Extra_PrintBinary( pFile, (
unsigned *)pTruth, 1 << Gia_ManPiNum(pAbc->pGia) ), fprintf( pFile,
"\n" );
4113 fprintf( pAbc->Err,
"usage: &write_truth [-rxbh] <file>\n" );
4114 fprintf( pAbc->Err,
"\t writes truth tables of each PO of GIA manager into a file\n" );
4115 fprintf( pAbc->Err,
"\t-r : toggle reversing bits in the truth table [default = %s]\n", fReverse?
"yes":
"no" );
4116 fprintf( pAbc->Err,
"\t-x : toggle writing in the hex notation [default = %s]\n", fHex?
"yes":
"no" );
4117 fprintf( pAbc->Err,
"\t-b : toggle using binary file format [default = %s]\n", fBinaryFile?
"yes":
"no" );
4118 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
4119 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
4135int IoCommandWriteStatus(
Abc_Frame_t * pAbc,
int argc,
char **argv )
4160 fprintf( pAbc->Err,
"usage: write_status [-h] <file>\n" );
4161 fprintf( pAbc->Err,
"\t writes verification log file\n" );
4162 fprintf( pAbc->Err,
"\t-h : print the help massage\n" );
4163 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
4178int IoCommandWriteSmv(
Abc_Frame_t * pAbc,
int argc,
char **argv )
4194 if ( pAbc->pNtkCur == NULL )
4196 fprintf( pAbc->Out,
"Empty network.\n" );
4208 fprintf( pAbc->Err,
"usage: write_smv [-h] <file>\n" );
4209 fprintf( pAbc->Err,
"\t write the network in SMV format\n" );
4210 fprintf( pAbc->Err,
"\t-h : print the help message\n" );
4211 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .smv)\n" );
4226int IoCommandWriteJson(
Abc_Frame_t * pAbc,
int argc,
char **argv )
4230 int c, fExtract = 0;
4249 fprintf( pAbc->Out,
"No JSON info is available.\n" );
4262 fprintf( pAbc->Err,
"usage: write_json [-ch] <file>\n" );
4263 fprintf( pAbc->Err,
"\t write the network in JSON format\n" );
4264 fprintf( pAbc->Err,
"\t-c : output extracted version\n" );
4265 fprintf( pAbc->Err,
"\t-h : print the help message\n" );
4266 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .json)\n" );
4281int IoCommandWriteResub(
Abc_Frame_t * pAbc,
int argc,
char **argv )
4300 if ( pAbc->pGia == NULL )
4302 Abc_Print( -1,
"IoCommandWriteResub(): There is no AIG.\n" );
4305 if ( Gia_ManCiNum(pAbc->pGia) > 20 )
4307 Abc_Print( -1,
"IoCommandWriteResub(): The number of inputs is wrong.\n" );
4314 fprintf( pAbc->Err,
"usage: &write_resub [-ch] <file>\n" );
4315 fprintf( pAbc->Err,
"\t write the network in resub format\n" );
4316 fprintf( pAbc->Err,
"\t-h : print the help message\n" );
4317 fprintf( pAbc->Err,
"\tfile : the name of the file to write (extension .json)\n" );
4332int IoCommandWriteMM(
Abc_Frame_t * pAbc,
int argc,
char **argv )
4336 char * pFileName = NULL;
int c;
4353 Abc_Print( -1,
"IoCommandWriteMM(): There is no current network.\n" );
4356 if ( !Abc_NtkIsMappedLogic(pNtk) )
4358 Abc_Print( -1,
"IoCommandWriteMM(): The current network is not mapped.\n" );
4365 fprintf( pAbc->Err,
"usage: write_mm [-h] <file>\n" );
4366 fprintf( pAbc->Err,
"\t write mapped network into a file\n" );
4367 fprintf( pAbc->Err,
"\t-h : print the help message\n" );
4368 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
4383int IoCommandWriteMMGia(
Abc_Frame_t * pAbc,
int argc,
char **argv )
4388 char * pFileName = NULL;
int c;
4403 if ( pAbc->pGia == NULL )
4405 Abc_Print( -1,
"IoCommandWriteMMGia(): There is no current AIG.\n" );
4408 if ( !Gia_ManHasCellMapping(pAbc->pGia) )
4410 Abc_Print( -1,
"IoCommandWriteMMGia(): Current AIG is not mapped.\n" );
4419 fprintf( pAbc->Err,
"usage: &write_mm [-h] <file>\n" );
4420 fprintf( pAbc->Err,
"\t write cell mapped current AIG into a file\n" );
4421 fprintf( pAbc->Err,
"\t-h : print the help message\n" );
4422 fprintf( pAbc->Err,
"\tfile : the name of the file to write\n" );
Abc_Ntk_t * Abc_NtkFromCellMappedGia(Gia_Man_t *p, int fUseBuffs)
Abc_Ntk_t * Abc_NtkDarToCnf(Abc_Ntk_t *pNtk, char *pFileName, int fFastAlgo, int fChangePol, int fVerbose)
Vec_Int_t * Io_ReadFins(Abc_Ntk_t *pNtk, char *pFileName, int fVerbose)
int Abc_NtkReadLogFile(char *pFileName, Abc_Cex_t **ppCex, int *pnFrames)
int Abc_NtkWriteToFile(char *pFileName, Abc_Ntk_t *pNtk)
Abc_Ntk_t * Abc_NtkReadFromFile(char *pFileName)
void Abc_NtkWriteSorterCnf(char *pFileName, int nVars, int nQueens)
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
void Abc_FrameReplaceCex(Abc_Frame_t *pAbc, Abc_Cex_t **ppCex)
FUNCTION DEFINITIONS ///.
struct Abc_Obj_t_ Abc_Obj_t
ABC_DLL void Abc_NtkWriteLogFile(char *pFileName, Abc_Cex_t *pSeqCex, int Status, int nFrames, char *pCommand)
DECLARATIONS ///.
ABC_DLL Abc_Ntk_t * Abc_NtkToLogic(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
ABC_DLL Vec_Ptr_t * Abc_SopFromTruthsBin(char *pTruth)
#define Abc_NtkForEachLatch(pNtk, pObj, i)
ABC_DLL Gia_Man_t * Abc_NtkAigToGia(Abc_Ntk_t *p, int fGiaSimple)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL Gia_Man_t * Abc_NtkFlattenHierarchyGia(Abc_Ntk_t *pNtk, Vec_Ptr_t **pvBuffers, int fVerbose)
ABC_DLL Abc_Ntk_t * Abc_NtkToNetlist(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_NtkTransferNameIds(Abc_Ntk_t *p, Abc_Ntk_t *pNew)
#define Abc_NtkForEachPi(pNtk, pPi, i)
ABC_DLL Abc_Ntk_t * Abc_NtkStrash(Abc_Ntk_t *pNtk, int fAllNodes, int fCleanup, int fRecord)
ABC_DLL Vec_Ptr_t * Abc_SopFromTruthsHex(char *pTruth)
#define Abc_NtkForEachCi(pNtk, pCi, i)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_NtkStartNameIds(Abc_Ntk_t *p)
ABC_DLL Abc_Ntk_t * Abc_NtkCreateWithNodes(Vec_Ptr_t *vSops)
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
#define ABC_FALLOC(type, num)
#define ABC_ALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
Abc_Cex_t * Saig_ManCbaFindCexCareBits(Aig_Man_t *pAig, Abc_Cex_t *pCex, int nInputs, int fVerbose)
void Aig_ManStop(Aig_Man_t *p)
typedefABC_NAMESPACE_HEADER_START struct Aig_Man_t_ Aig_Man_t
INCLUDES ///.
ABC_DLL void Abc_FrameClearVerifStatus(Abc_Frame_t *p)
ABC_DLL Abc_Nam_t * Abc_FrameReadJsonStrs(Abc_Frame_t *p)
ABC_DLL void Abc_FrameSetJsonObjs(Vec_Wec_t *vObjs)
ABC_DLL Abc_Frame_t * Abc_FrameReadGlobalFrame()
ABC_DLL void * Abc_FrameReadLibGen()
ABC_DLL void Abc_FrameSetJsonStrs(Abc_Nam_t *pStrs)
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
ABC_DLL FILE * Abc_FrameReadErr(Abc_Frame_t *p)
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
ABC_DLL FILE * Abc_FrameReadOut(Abc_Frame_t *p)
ABC_DLL Vec_Wec_t * Abc_FrameReadJsonObjs(Abc_Frame_t *p)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Abc_Cex_t * Bmc_CexCareMinimize(Aig_Man_t *p, int nRealPis, Abc_Cex_t *pCex, int nTryCexes, int fCheck, int fVerbose)
int Bmc_CexCareVerifyAnyPo(Aig_Man_t *p, Abc_Cex_t *pCex, Abc_Cex_t *pCexMin, int fVerbose)
Abc_Cex_t * Bmc_CexCareSatBasedMinimize(Aig_Man_t *p, int nRealPis, Abc_Cex_t *pCex, int fHighEffort, int fCheck, int fVerbose)
int Bmc_CexVerify(Gia_Man_t *p, Abc_Cex_t *pCex, Abc_Cex_t *pCexCare)
int Bmc_CexCareVerify(Aig_Man_t *p, Abc_Cex_t *pCex, Abc_Cex_t *pCexMin, int fVerbose)
void Cmd_CommandAdd(Abc_Frame_t *pAbc, const char *sGroup, const char *sName, Cmd_CommandFuncType pFunc, int fChanges)
ABC_DLL int Cmd_CommandExecute(Abc_Frame_t *pAbc, const char *sCommand)
Gia_Man_t * Gia_ManFromAigSimple(Aig_Man_t *p)
Gia_Man_t * Gia_ManReadGig(char *pFileName)
void Jf_ManDumpCnf(Gia_Man_t *p, char *pFileName, int fVerbose)
void Mf_ManDumpCnf(Gia_Man_t *p, char *pFileName, int nLutSize, int fCnfObjIds, int fAddOrCla, int fVerbose)
ABC_NAMESPACE_IMPL_START Abc_Ntk_t * Abc_NtkFromAigPhase(Aig_Man_t *pMan)
DECLARATIONS ///.
void Extra_PrintHex(FILE *pFile, unsigned *pTruth, int nVars)
Aig_Man_t * Abc_NtkToDar(Abc_Ntk_t *pNtk, int fExors, int fRegisters)
void Gia_ManWriteResub(Gia_Man_t *p, char *pFileName)
struct Gia_Obj_t_ Gia_Obj_t
struct Gia_Man_t_ Gia_Man_t
#define Gia_ManForEachCo(p, pObj, i)
word * Gia_ObjComputeTruthTable(Gia_Man_t *p, Gia_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
unsigned * Hop_ManConvertAigToTruth(Hop_Man_t *p, Hop_Obj_t *pRoot, int nVars, Vec_Int_t *vTruth, int fMsbFirst)
struct Hop_Obj_t_ Hop_Obj_t
void Extra_PrintBinary(FILE *pFile, unsigned Sign[], int nBits)
void Io_WriteBlifSpecial(Abc_Ntk_t *pNtk, char *FileName, char *pLutStruct, int fUseHie)
void Io_WriteHie(Abc_Ntk_t *pNtk, char *pBaseName, char *pFileName)
void Io_WriteAigerCex(Abc_Cex_t *pCex, Abc_Ntk_t *pNtk, void *pG, char *pFileName)
void Io_WriteVerilog(Abc_Ntk_t *pNtk, char *FileName, int fOnlyAnds, int fNewInterface)
FUNCTION DEFINITIONS ///.
Abc_Ntk_t * Io_ReadBlif(char *pFileName, int fCheck)
FUNCTION DEFINITIONS ///.
void Io_WriteAiger(Abc_Ntk_t *pNtk, char *pFileName, int fWriteSymbols, int fCompact, int fUnique)
void Io_ReadBenchInit(Abc_Ntk_t *pNtk, char *pFileName)
void Io_WriteHMetis(Abc_Ntk_t *pNtk, char *pFileName, int fSkipPo, int fWeightEdges, int fVerbose)
int Io_WriteBenchLut(Abc_Ntk_t *pNtk, char *FileName)
Abc_Ntk_t * Io_ReadNetlist(char *pFileName, Io_FileType_t FileType, int fCheck)
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
void Io_Write(Abc_Ntk_t *pNtk, char *pFileName, Io_FileType_t FileType)
void Io_WriteList(Abc_Ntk_t *pNtk, char *pFileName, int fUseHost)
FUNCTION DEFINITIONS ///.
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
void Io_WriteEdgelist(Abc_Ntk_t *pNtk, char *pFileName, int fWriteLatches, int fBb2Wb, int fSeq, int fName)
FUNCTION DEFINITIONS ///.
Abc_Ntk_t * Io_ReadPla(char *pFileName, int fZeros, int fBoth, int fOnDc, int fSkipPrepro, int fCheck)
int Io_WriteCnf(Abc_Ntk_t *pNtk, char *FileName, int fAllPrimes)
FUNCTION DEFINITIONS ///.
void Json_Extract(char *pFileName, Abc_Nam_t *pStr, Vec_Wec_t *vObjs)
void Json_Write(char *pFileName, Abc_Nam_t *pStr, Vec_Wec_t *vObjs)
Vec_Wec_t * Json_Read(char *pFileName, Abc_Nam_t **ppStrs)
Abc_Ntk_t * Io_ReadBlifAsAig(char *pFileName, int fCheck)
FUNCTION DEFINITIONS ///.
Abc_Ntk_t * Io_ReadDsd(char *pForm)
Abc_Ntk_t * Mop_ManTest(char *pFileName, int fMerge, int fVerbose)
void Io_TransformSF2PLA(char *pNameIn, char *pNameOut)
Vec_Ptr_t * Io_FileReadCnf(char *pFileName, int fMulti)
void Io_TransformROM2PLA(char *pNameIn, char *pNameOut)
void Io_WriteCellNet(Abc_Ntk_t *pNtk, char *pFileName)
int Io_WriteMoPlaM(Abc_Ntk_t *pNtk, char *pFileName, int nMints)
void Io_WriteVerilogLut(Abc_Ntk_t *pNtk, char *pFileName, int nLutSize, int fFixed, int fNoModules, int fNewInterface)
void Abc_NtkDumpOneCexSpecial(FILE *pFile, Abc_Ntk_t *pNtk, Abc_Cex_t *pCex)
Abc_Cex_t * Bmc_CexCareBits(Gia_Man_t *p, Abc_Cex_t *pCexState, Abc_Cex_t *pCexImpl, Abc_Cex_t *pCexEss, int fFindAll, int fVerbose)
ABC_NAMESPACE_IMPL_END ABC_NAMESPACE_IMPL_START int Abc_NtkCheckSpecialPi(Abc_Ntk_t *pNtk)
void Abc_FrameCopyLTLDataBase(Abc_Frame_t *pAbc, Abc_Ntk_t *pNtk)
Abc_Cex_t * Bmc_CexEssentialBits(Gia_Man_t *p, Abc_Cex_t *pCexState, Abc_Cex_t *pCexCare, int fVerbose)
void Io_End(Abc_Frame_t *pAbc)
void Abc_NtkDumpOneCex(FILE *pFile, Abc_Ntk_t *pNtk, Abc_Cex_t *pCex, int fPrintFull, int fNames, int fUseFfNames, int fMinimize, int fUseOldMin, int fCexInfo, int fCheckCex, int fUseSatBased, int fHighEffort, int fAiger, int fVerbose, int fExtended)
Abc_Cex_t * Bmc_CexInnerStates(Gia_Man_t *p, Abc_Cex_t *pCex, Abc_Cex_t **ppCexImpl, int fVerbose)
int Abc_NtkReadCexFile(char *pFileName, Abc_Ntk_t *pNtk, Abc_Cex_t **ppCex, Abc_Cex_t **ppCexCare, int *pnFrames, int *fOldFormat, int xMode)
void Io_Init(Abc_Frame_t *pAbc)
FUNCTION DEFINITIONS ///.
unsigned __int64 word
DECLARATIONS ///.
Abc_Cex_t * Saig_ManExtendCex(Aig_Man_t *pAig, Abc_Cex_t *p)
Aig_Man_t * Saig_ManDupIsoCanonical(Aig_Man_t *pAig, int fVerbose)
void Abc_CexFreeP(Abc_Cex_t **p)
void Abc_CexFree(Abc_Cex_t *p)
ABC_NAMESPACE_IMPL_START Abc_Cex_t * Abc_CexAlloc(int nRegs, int nRealPis, int nFrames)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Abc_Cex_t_ Abc_Cex_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Abc_Nam_t_ Abc_Nam_t
INCLUDES ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.