33static int Abc_CommandReadWlc (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
34static int Abc_CommandWriteWlc (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
35static int Abc_CommandPs (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
36static int Abc_CommandCone (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
37static int Abc_CommandAbs (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
38static int Abc_CommandPdrAbs (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
39static int Abc_CommandAbs2 (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
40static int Abc_CommandMemAbs (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
41static int Abc_CommandMemAbs2 (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
42static int Abc_CommandBlast (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
43static int Abc_CommandBlastMem (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
44static int Abc_CommandGraft (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
45static int Abc_CommandRetime (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
46static int Abc_CommandProfile (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
47static int Abc_CommandShortNames (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
48static int Abc_CommandShow (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
49static int Abc_CommandInvPs (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
50static int Abc_CommandInvPrint (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
51static int Abc_CommandInvCheck (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
52static int Abc_CommandInvGet (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
53static int Abc_CommandInvPut (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
54static int Abc_CommandInvMin (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
55static int Abc_CommandTest (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
58static inline void Wlc_AbcFreeNtk(
Abc_Frame_t * pAbc ) {
if ( pAbc->pAbcWlc )
Wlc_NtkFree(Wlc_AbcGetNtk(pAbc)); }
59static inline void Wlc_AbcUpdateNtk(
Abc_Frame_t * pAbc,
Wlc_Ntk_t * pNtk ) { Wlc_AbcFreeNtk(pAbc); pAbc->pAbcWlc = pNtk; }
80 Cmd_CommandAdd( pAbc,
"Word level",
"%read", Abc_CommandReadWlc, 0 );
81 Cmd_CommandAdd( pAbc,
"Word level",
"%write", Abc_CommandWriteWlc, 0 );
85 Cmd_CommandAdd( pAbc,
"Word level",
"%pdra", Abc_CommandPdrAbs, 0 );
87 Cmd_CommandAdd( pAbc,
"Word level",
"%memabs", Abc_CommandMemAbs, 0 );
88 Cmd_CommandAdd( pAbc,
"Word level",
"%memabs2", Abc_CommandMemAbs2, 0 );
89 Cmd_CommandAdd( pAbc,
"Word level",
"%blast", Abc_CommandBlast, 0 );
90 Cmd_CommandAdd( pAbc,
"Word level",
"%blastmem", Abc_CommandBlastMem, 0 );
92 Cmd_CommandAdd( pAbc,
"Word level",
"%retime", Abc_CommandRetime, 0 );
93 Cmd_CommandAdd( pAbc,
"Word level",
"%profile", Abc_CommandProfile, 0 );
94 Cmd_CommandAdd( pAbc,
"Word level",
"%short_names", Abc_CommandShortNames, 0 );
98 Cmd_CommandAdd( pAbc,
"Word level",
"inv_ps", Abc_CommandInvPs, 0 );
99 Cmd_CommandAdd( pAbc,
"Word level",
"inv_print", Abc_CommandInvPrint, 0 );
100 Cmd_CommandAdd( pAbc,
"Word level",
"inv_check", Abc_CommandInvCheck, 0 );
101 Cmd_CommandAdd( pAbc,
"Word level",
"inv_get", Abc_CommandInvGet, 0 );
102 Cmd_CommandAdd( pAbc,
"Word level",
"inv_put", Abc_CommandInvPut, 0 );
103 Cmd_CommandAdd( pAbc,
"Word level",
"inv_min", Abc_CommandInvMin, 0 );
119 Wlc_AbcFreeNtk( pAbc );
135 Wlc_AbcUpdateNtk( pAbc, pNtk );
150int Abc_CommandReadWlc(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
155 char * pFileName = NULL;
185 printf(
"Abc_CommandReadWlc(): Input file name should be given on the command line.\n" );
190 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
192 Abc_Print( 1,
"Cannot open input file \"%s\". ", pFileName );
194 Abc_Print( 1,
"Did you mean \"%s\"?", pFileName );
195 Abc_Print( 1,
"\n" );
204 if ( fInter && pAbc->pGia )
208 pNtk =
Wlc_ReadSmt( pFileName, fOldParser, fPrintTree );
213 printf(
"Abc_CommandReadWlc(): Unknown file extension.\n" );
216 Wlc_AbcUpdateNtk( pAbc, pNtk );
219 Abc_Print( -2,
"usage: %%read [-opivh] <file_name>\n" );
220 Abc_Print( -2,
"\t reads word-level design from Verilog file\n" );
221 Abc_Print( -2,
"\t-o : toggle using old SMT-LIB parser [default = %s]\n", fOldParser?
"yes":
"no" );
222 Abc_Print( -2,
"\t-p : toggle printing parse SMT-LIB tree [default = %s]\n", fPrintTree?
"yes":
"no" );
223 Abc_Print( -2,
"\t-i : toggle reading interface only [default = %s]\n", fInter?
"yes":
"no" );
224 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
225 Abc_Print( -2,
"\t-h : print the command usage\n");
240int Abc_CommandWriteWlc(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
243 char * pFileName = NULL;
273 Abc_Print( 1,
"Abc_CommandWriteWlc(): There is no current design.\n" );
282 printf(
"Output file name should be given on the command line.\n" );
287 else if ( fSplitNodes )
298 Abc_Print( -2,
"usage: %%write [-anfvh]\n" );
299 Abc_Print( -2,
"\t writes the design into a file\n" );
300 Abc_Print( -2,
"\t-a : toggle adding a CO for each node [default = %s]\n", fAddCos?
"yes":
"no" );
301 Abc_Print( -2,
"\t-n : toggle splitting into individual nodes [default = %s]\n", fSplitNodes?
"yes":
"no" );
302 Abc_Print( -2,
"\t-f : toggle skipping flops when writing file [default = %s]\n",fNoFlops?
"yes":
"no" );
303 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
304 Abc_Print( -2,
"\t-h : print the command usage\n");
319int Abc_CommandPs(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
367 Abc_Print( 1,
"Abc_CommandPs(): There is no current design.\n" );
383 Abc_Print( -2,
"usage: %%ps [-cbamdtovh]\n" );
384 Abc_Print( -2,
"\t prints statistics\n" );
385 Abc_Print( -2,
"\t-c : toggle printing cones [default = %s]\n", fShowCones?
"yes":
"no" );
386 Abc_Print( -2,
"\t-b : toggle printing multipliers [default = %s]\n", fShowMulti?
"yes":
"no" );
387 Abc_Print( -2,
"\t-a : toggle printing adders [default = %s]\n", fShowAdder?
"yes":
"no" );
388 Abc_Print( -2,
"\t-m : toggle printing memories [default = %s]\n", fShowMem?
"yes":
"no" );
389 Abc_Print( -2,
"\t-d : toggle printing distrubition [default = %s]\n", fDistrib?
"yes":
"no" );
390 Abc_Print( -2,
"\t-t : toggle printing stats for LHS and RHS [default = %s]\n", fTwoSides?
"yes":
"no" );
391 Abc_Print( -2,
"\t-o : toggle printing all objects [default = %s]\n", fAllObjects?
"yes":
"no" );
392 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
393 Abc_Print( -2,
"\t-h : print the command usage\n");
408int Abc_CommandCone(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
411 int c, iOutput = -1, Range = 1, fAllPis = 0, fSeq = 0, fVerbose = 0;
421 Abc_Print( -1,
"Command line switch \"-O\" should be followed by an integer.\n" );
432 Abc_Print( -1,
"Command line switch \"-R\" should be followed by an integer.\n" );
457 Abc_Print( 1,
"Abc_CommandCone(): There is no current design.\n" );
460 if ( iOutput < 0 || iOutput >= Wlc_NtkCoNum(pNtk) )
462 Abc_Print( 1,
"Abc_CommandCone(): Illegal output index (%d) (should be 0 <= num < %d).\n", iOutput, Wlc_NtkCoNum(pNtk) );
465 printf(
"Extracting output %d as a %s word-level network.\n", iOutput, fSeq ?
"sequential" :
"combinational" );
470 pNtk->
pName = Abc_UtilStrsav( pName );
471 Wlc_AbcUpdateNtk( pAbc, pNtk );
474 Abc_Print( -2,
"usage: %%cone [-OR num] [-isvh]\n" );
475 Abc_Print( -2,
"\t extracts logic cone of one or more word-level outputs\n" );
476 Abc_Print( -2,
"\t-O num : zero-based index of the first word-level output to extract [default = %d]\n", iOutput );
477 Abc_Print( -2,
"\t-R num : total number of word-level outputs to extract [default = %d]\n", Range );
478 Abc_Print( -2,
"\t-i : toggle using support composed of all primary inputs [default = %s]\n", fAllPis?
"yes":
"no" );
479 Abc_Print( -2,
"\t-s : toggle performing extracting sequential cones [default = %s]\n", fSeq?
"yes":
"no" );
480 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
481 Abc_Print( -2,
"\t-h : print the command usage\n");
496int Abc_CommandPdrAbs(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
503 while ( ( c =
Extra_UtilGetopt( argc, argv,
"AMXFILabrcdilpqmstuxvwh" ) ) != EOF )
510 Abc_Print( -1,
"Command line switch \"-A\" should be followed by an integer.\n" );
521 Abc_Print( -1,
"Command line switch \"-M\" should be followed by an integer.\n" );
532 Abc_Print( -1,
"Command line switch \"-X\" should be followed by an integer.\n" );
543 Abc_Print( -1,
"Command line switch \"-F\" should be followed by an integer.\n" );
554 Abc_Print( -1,
"Command line switch \"-I\" should be followed by an integer.\n" );
565 Abc_Print( -1,
"Command line switch \"-L\" should be followed by an integer.\n" );
629 Abc_Print( 1,
"Abc_CommandCone(): There is no current design.\n" );
635 Abc_Print( -2,
"usage: %%pdra [-AMXFIL num] [-abrcdilpqmxstuvwh]\n" );
636 Abc_Print( -2,
"\t abstraction for word-level networks\n" );
637 Abc_Print( -2,
"\t-A num : minimum bit-width of an adder/subtractor to abstract [default = %d]\n", pPars->
nBitsAdd );
638 Abc_Print( -2,
"\t-M num : minimum bit-width of a multiplier to abstract [default = %d]\n", pPars->
nBitsMul );
639 Abc_Print( -2,
"\t-X num : minimum bit-width of a MUX operator to abstract [default = %d]\n", pPars->
nBitsMux );
640 Abc_Print( -2,
"\t-F num : minimum bit-width of a flip-flop to abstract [default = %d]\n", pPars->
nBitsFlop );
641 Abc_Print( -2,
"\t-I num : maximum number of CEGAR iterations [default = %d]\n", pPars->
nIterMax );
642 Abc_Print( -2,
"\t-L num : maximum number of each type of signals [default = %d]\n", pPars->
nLimit );
643 Abc_Print( -2,
"\t-x : toggle XORing outputs of word-level miter [default = %s]\n", pPars->
fXorOutput?
"yes":
"no" );
644 Abc_Print( -2,
"\t-a : toggle running pdr with -nct [default = %s]\n", pPars->
fPdra?
"yes":
"no" );
645 Abc_Print( -2,
"\t-b : toggle using proof-based refinement [default = %s]\n", pPars->
fProofRefine?
"yes":
"no" );
646 Abc_Print( -2,
"\t-r : toggle using both cex-based and proof-based refinement [default = %s]\n", pPars->
fHybrid?
"yes":
"no" );
647 Abc_Print( -2,
"\t-c : toggle checking clauses in the reloaded trace [default = %s]\n", pPars->
fCheckClauses?
"yes":
"no" );
648 Abc_Print( -2,
"\t-d : toggle using another way of creating abstractions [default = %s]\n", pPars->
fAbs2?
"yes":
"no" );
649 Abc_Print( -2,
"\t-i : toggle using PPI values in proof-based refinement [default = %s]\n", pPars->
fProofUsePPI?
"yes":
"no" );
650 Abc_Print( -2,
"\t-l : toggle loading previous PDR traces [default = %s]\n", pPars->
fLoadTrace?
"yes":
"no" );
651 Abc_Print( -2,
"\t-s : toggle shrinking abstractions with BMC [default = %s]\n", pPars->
fShrinkAbs?
"yes":
"no" );
652 Abc_Print( -2,
"\t-t : toggle restarting pdr from scratch after shrinking abstractions with BMC [default = %s]\n", pPars->
fShrinkScratch?
"yes":
"no" );
653 Abc_Print( -2,
"\t-u : toggle checking combinationally unsat [default = %s]\n", pPars->
fCheckCombUnsat?
"yes":
"no" );
654 Abc_Print( -2,
"\t-p : toggle pushing clauses in the reloaded trace [default = %s]\n", pPars->
fPushClauses?
"yes":
"no" );
655 Abc_Print( -2,
"\t-q : toggle running bmc3 in parallel for CEX [default = %s]\n", pPars->
fUseBmc3?
"yes":
"no" );
656 Abc_Print( -2,
"\t-m : toggle refining the whole MFFC of a PPI [default = %s]\n", pPars->
fMFFC?
"yes":
"no" );
657 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", pPars->
fVerbose?
"yes":
"no" );
658 Abc_Print( -2,
"\t-w : toggle printing verbose PDR output [default = %s]\n", pPars->
fPdrVerbose?
"yes":
"no" );
659 Abc_Print( -2,
"\t-h : print the command usage\n");
675int Abc_CommandAbs(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
689 Abc_Print( -1,
"Command line switch \"-A\" should be followed by an integer.\n" );
700 Abc_Print( -1,
"Command line switch \"-M\" should be followed by an integer.\n" );
711 Abc_Print( -1,
"Command line switch \"-X\" should be followed by an integer.\n" );
722 Abc_Print( -1,
"Command line switch \"-F\" should be followed by an integer.\n" );
733 Abc_Print( -1,
"Command line switch \"-I\" should be followed by an integer.\n" );
744 Abc_Print( -1,
"Command line switch \"-L\" should be followed by an integer.\n" );
772 Abc_Print( 1,
"Abc_CommandCone(): There is no current design.\n" );
778 Abc_Print( -2,
"usage: %%abs [-AMXFIL num] [-dxvwh]\n" );
779 Abc_Print( -2,
"\t abstraction for word-level networks\n" );
780 Abc_Print( -2,
"\t-A num : minimum bit-width of an adder/subtractor to abstract [default = %d]\n", pPars->
nBitsAdd );
781 Abc_Print( -2,
"\t-M num : minimum bit-width of a multiplier to abstract [default = %d]\n", pPars->
nBitsMul );
782 Abc_Print( -2,
"\t-X num : minimum bit-width of a MUX operator to abstract [default = %d]\n", pPars->
nBitsMux );
783 Abc_Print( -2,
"\t-F num : minimum bit-width of a flip-flop to abstract [default = %d]\n", pPars->
nBitsFlop );
784 Abc_Print( -2,
"\t-I num : maximum number of CEGAR iterations [default = %d]\n", pPars->
nIterMax );
785 Abc_Print( -2,
"\t-L num : maximum number of each type of signals [default = %d]\n", pPars->
nLimit );
786 Abc_Print( -2,
"\t-d : toggle using another way of creating abstractions [default = %s]\n", pPars->
fAbs2?
"yes":
"no" );
787 Abc_Print( -2,
"\t-x : toggle XORing outputs of word-level miter [default = %s]\n", pPars->
fXorOutput?
"yes":
"no" );
788 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", pPars->
fVerbose?
"yes":
"no" );
789 Abc_Print( -2,
"\t-w : toggle printing verbose PDR output [default = %s]\n", pPars->
fPdrVerbose?
"yes":
"no" );
790 Abc_Print( -2,
"\t-h : print the command usage\n");
805int Abc_CommandAbs2(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
819 Abc_Print( -1,
"Command line switch \"-A\" should be followed by an integer.\n" );
830 Abc_Print( -1,
"Command line switch \"-M\" should be followed by an integer.\n" );
841 Abc_Print( -1,
"Command line switch \"-X\" should be followed by an integer.\n" );
852 Abc_Print( -1,
"Command line switch \"-F\" should be followed by an integer.\n" );
863 Abc_Print( -1,
"Command line switch \"-I\" should be followed by an integer.\n" );
888 Abc_Print( 1,
"Abc_CommandCone(): There is no current design.\n" );
894 Abc_Print( -2,
"usage: %%abs2 [-AMXFI num] [-xvwh]\n" );
895 Abc_Print( -2,
"\t abstraction for word-level networks\n" );
896 Abc_Print( -2,
"\t-A num : minimum bit-width of an adder/subtractor to abstract [default = %d]\n", pPars->
nBitsAdd );
897 Abc_Print( -2,
"\t-M num : minimum bit-width of a multiplier to abstract [default = %d]\n", pPars->
nBitsMul );
898 Abc_Print( -2,
"\t-X num : minimum bit-width of a MUX operator to abstract [default = %d]\n", pPars->
nBitsMux );
899 Abc_Print( -2,
"\t-F num : minimum bit-width of a flip-flop to abstract [default = %d]\n", pPars->
nBitsFlop );
900 Abc_Print( -2,
"\t-I num : maximum number of CEGAR iterations [default = %d]\n", pPars->
nIterMax );
901 Abc_Print( -2,
"\t-x : toggle XORing outputs of word-level miter [default = %s]\n", pPars->
fXorOutput?
"yes":
"no" );
902 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", pPars->
fVerbose?
"yes":
"no" );
903 Abc_Print( -2,
"\t-w : toggle printing verbose PDR output [default = %s]\n", pPars->
fPdrVerbose?
"yes":
"no" );
904 Abc_Print( -2,
"\t-h : print the command usage\n");
919int Abc_CommandMemAbs(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
922 int c, nIterMax = 1000, fDumpAbs = 0, fPdrVerbose = 0, fVerbose = 0;
931 Abc_Print( -1,
"Command line switch \"-I\" should be followed by an integer.\n" );
956 Abc_Print( 1,
"Abc_CommandMemAbs(): There is no current design.\n" );
962 Abc_Print( -2,
"usage: %%memabs [-I num] [-dwvh]\n" );
963 Abc_Print( -2,
"\t memory abstraction for word-level networks\n" );
964 Abc_Print( -2,
"\t-I num : maximum number of CEGAR iterations [default = %d]\n", nIterMax );
965 Abc_Print( -2,
"\t-d : toggle dumping abstraction as an AIG [default = %s]\n",fDumpAbs?
"yes":
"no" );
966 Abc_Print( -2,
"\t-w : toggle printing verbose PDR output [default = %s]\n", fPdrVerbose?
"yes":
"no" );
967 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
968 Abc_Print( -2,
"\t-h : print the command usage\n");
983int Abc_CommandMemAbs2(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
986 int c, nFrames = 0, fVerbose = 0;
995 Abc_Print( -1,
"Command line switch \"-I\" should be followed by an integer.\n" );
1014 Abc_Print( 1,
"Abc_CommandMemAbs2(): There is no current design.\n" );
1018 Wlc_AbcUpdateNtk( pAbc, pNtk );
1021 Abc_Print( -2,
"usage: %%memabs2 [-F num] [-vh]\n" );
1022 Abc_Print( -2,
"\t memory abstraction for word-level networks\n" );
1023 Abc_Print( -2,
"\t-F num : the number of timeframes [default = %d]\n", nFrames );
1024 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1025 Abc_Print( -2,
"\t-h : print the command usage\n");
1040int Abc_CommandBlast(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1044 Gia_Man_t * pNew = NULL;
int c, fMiter = 0, fDumpNames = 0, fPrintInputInfo = 0, fReorder = 0;
1046 Wlc_BstParDefault( pPar );
1049 while ( ( c =
Extra_UtilGetopt( argc, argv,
"ORAMcombqaydestrfnizvh" ) ) != EOF )
1056 Abc_Print( -1,
"Command line switch \"-O\" should be followed by an integer.\n" );
1067 Abc_Print( -1,
"Command line switch \"-R\" should be followed by an integer.\n" );
1078 Abc_Print( -1,
"Command line switch \"-A\" should be followed by an integer.\n" );
1089 Abc_Print( -1,
"Command line switch \"-M\" should be followed by an integer.\n" );
1141 fPrintInputInfo ^= 1;
1157 Abc_Print( 1,
"Abc_CommandBlast(): There is no current design.\n" );
1162 Abc_Print( 1,
"Abc_CommandBlast(): Trying to bit-blast network with asynchronous reset.\n" );
1165 if ( fPrintInputInfo )
1171 Abc_Print( 1,
"Warning: There is no multipliers in the design.\n" );
1178 Abc_Print( 1,
"Warning: There is no adders and multipliers that will not be blasted.\n" );
1180 Abc_Print( 1,
"Warning: %d adders and %d multipliers will not be blasted.\n", CountA, CountM );
1184 Abc_Print( 1,
"Abc_CommandBlast(): The output range [%d:%d] is incorrect.\n", pPar->
iOutput, pPar->
iOutput + pPar->
nOutputRange - 1 );
1189 Vec_IntFreeP( &pPar->
vBoxIds );
1192 Abc_Print( 1,
"Abc_CommandBlast(): Bit-blasting has failed.\n" );
1201 Abc_Print( 1,
"Bit-blasting created a traditional multi-output miter by XORing POs pair-wise.\n" );
1204 int i;
char * pName;
1205 FILE * pFile = fopen(
"pio_name_map.txt",
"wb" );
1208 fprintf( pFile,
"i%d %s\n", i, pName );
1211 fprintf( pFile,
"o%d %s\n", i, pName );
1213 Abc_Print( 1,
"Finished dumping file \"pio_name_map.txt\" containing PI/PO name mapping.\n" );
1221 Vec_IntFree( vPiPerm );
1228 Abc_Print( -2,
"usage: %%blast [-ORAM num] [-combqaydestrfnizvh]\n" );
1229 Abc_Print( -2,
"\t performs bit-blasting of the word-level design\n" );
1230 Abc_Print( -2,
"\t-O num : zero-based index of the first word-level PO to bit-blast [default = %d]\n", pPar->
iOutput );
1231 Abc_Print( -2,
"\t-R num : the total number of word-level POs to bit-blast [default = %d]\n", pPar->
nOutputRange );
1232 Abc_Print( -2,
"\t-A num : blast adders smaller than this (0 = unused) [default = %d]\n", pPar->
nAdderLimit );
1233 Abc_Print( -2,
"\t-M num : blast multipliers smaller than this (0 = unused) [default = %d]\n", pPar->
nMultLimit );
1234 Abc_Print( -2,
"\t-c : toggle using AIG w/o const propagation and strashing [default = %s]\n", pPar->
fGiaSimple?
"yes":
"no" );
1235 Abc_Print( -2,
"\t-o : toggle using additional POs on the word-level boundaries [default = %s]\n", pPar->
fAddOutputs?
"yes":
"no" );
1236 Abc_Print( -2,
"\t-m : toggle creating boxes for all multipliers in the design [default = %s]\n", pPar->
fMulti?
"yes":
"no" );
1237 Abc_Print( -2,
"\t-b : toggle generating radix-4 Booth multipliers [default = %s]\n", pPar->
fBooth?
"yes":
"no" );
1238 Abc_Print( -2,
"\t-q : toggle generating non-restoring square root and divider [default = %s]\n", pPar->
fNonRest?
"yes":
"no" );
1239 Abc_Print( -2,
"\t-a : toggle generating carry-look-ahead adder [default = %s]\n", pPar->
fCla?
"yes":
"no" );
1240 Abc_Print( -2,
"\t-y : toggle creating different divide-by-0 condition [default = %s]\n", pPar->
fDivBy0?
"yes":
"no" );
1241 Abc_Print( -2,
"\t-d : toggle creating dual-output multi-output miter [default = %s]\n", pPar->
fCreateMiter?
"yes":
"no" );
1242 Abc_Print( -2,
"\t-e : toggle creating miter with output word bits combined [default = %s]\n", pPar->
fCreateWordMiter?
"yes":
"no" );
1243 Abc_Print( -2,
"\t-s : toggle creating decoded MUXes [default = %s]\n", pPar->
fDecMuxes?
"yes":
"no" );
1244 Abc_Print( -2,
"\t-t : toggle creating regular multi-output miter [default = %s]\n", fMiter?
"yes":
"no" );
1245 Abc_Print( -2,
"\t-r : toggle using interleaved variable ordering [default = %s]\n", fReorder?
"yes":
"no" );
1246 Abc_Print( -2,
"\t-f : toggle dumping signal names into a text file [default = %s]\n", fDumpNames?
"yes":
"no" );
1247 Abc_Print( -2,
"\t-n : toggle using improved bit-blasting procedures [default = %s]\n", pPar->
fBlastNew?
"yes":
"no" );
1248 Abc_Print( -2,
"\t-i : toggle to print input names after blasting [default = %s]\n", fPrintInputInfo ?
"yes":
"no" );
1249 Abc_Print( -2,
"\t-z : toggle saving flop names after blasting [default = %s]\n", pPar->
fSaveFfNames ?
"yes":
"no" );
1250 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", pPar->
fVerbose?
"yes":
"no" );
1251 Abc_Print( -2,
"\t-h : print the command usage\n");
1266int Abc_CommandBlastMem(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1270 int c, fVerbose = 0;
1287 Abc_Print( 1,
"Abc_CommandBlastMem(): There is no current design.\n" );
1291 Wlc_AbcUpdateNtk( pAbc, pNtk );
1294 Abc_Print( -2,
"usage: %%blastmem [-vh]\n" );
1295 Abc_Print( -2,
"\t performs blasting of memory read/write ports\n" );
1296 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1297 Abc_Print( -2,
"\t-h : print the command usage\n");
1312int Abc_CommandGraft(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1316 int c, fVerbose = 0;
1333 Abc_Print( 1,
"Abc_CommandGraft(): There is no current design.\n" );
1337 Wlc_AbcUpdateNtk( pAbc, pNtk );
1340 Abc_Print( -2,
"usage: %%graft [-vh]\n" );
1341 Abc_Print( -2,
"\t detects multipliers in LHS of the miter and moves them to RHS\n" );
1342 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1343 Abc_Print( -2,
"\t-h : print the command usage\n");
1358int Abc_CommandRetime(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1360 extern void Wln_NtkRetimeTest(
char * pFileName,
int fIgnoreIO,
int fSkipSimple,
int fDump,
int fVerbose );
1362 char * pFileName = NULL;
1364 int fSkipSimple = 0;
1365 int c, fDump = 0, fVerbose = 0;
1396 printf(
"Transforming NDR into internal represnetation has failed.\n" );
1399 vMoves =
Wln_NtkRetime( pNtk, fIgnoreIO, fSkipSimple, fVerbose );
1402 if ( vMoves ) pAbc->pNdrArray = Vec_IntReleaseNewArray( vMoves );
1403 Vec_IntFreeP( &vMoves );
1408 printf(
"Abc_CommandRetime(): Input file name should be given on the command line.\n" );
1413 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
1415 Abc_Print( 1,
"Cannot open input file \"%s\". ", pFileName );
1417 Abc_Print( 1,
"Did you mean \"%s\"?", pFileName );
1418 Abc_Print( 1,
"\n" );
1425 Abc_Print( -2,
"usage: %%retime [-isdvh]\n" );
1426 Abc_Print( -2,
"\t performs retiming for the NDR design\n" );
1427 Abc_Print( -2,
"\t-i : toggle ignoring delays of IO paths [default = %s]\n", fIgnoreIO?
"yes":
"no" );
1428 Abc_Print( -2,
"\t-s : toggle printing simple nodes [default = %s]\n", !fSkipSimple?
"yes":
"no" );
1429 Abc_Print( -2,
"\t-d : toggle dumping the network in Verilog [default = %s]\n", fDump?
"yes":
"no" );
1430 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1431 Abc_Print( -2,
"\t-h : print the command usage\n");
1446int Abc_CommandProfile(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1449 int c, fVerbose = 0;
1466 Abc_Print( 1,
"Abc_CommandProfile(): There is no current design.\n" );
1472 Abc_Print( -2,
"usage: %%profile [-vh]\n" );
1473 Abc_Print( -2,
"\t profiles arithmetic components in the word-level networks\n" );
1474 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1475 Abc_Print( -2,
"\t-h : print the command usage\n");
1490int Abc_CommandShortNames(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1493 int c, fVerbose = 0;
1510 Abc_Print( 1,
"Abc_CommandProfile(): There is no current design.\n" );
1516 Abc_Print( -2,
"usage: %%short_names [-vh]\n" );
1517 Abc_Print( -2,
"\t derives short names for all objects of the network\n" );
1518 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1519 Abc_Print( -2,
"\t-h : print the command usage\n");
1534int Abc_CommandShow(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1538 int c, fMemory = 0, fVerbose = 0;
1557 Abc_Print( -1,
"Empty network.\n" );
1564 Vec_IntFree( vTemp );
1571 Abc_Print( -2,
"usage: %%show [-mh]\n" );
1572 Abc_Print( -2,
" visualizes the network structure using DOT and GSVIEW\n" );
1574 Abc_Print( -2,
" \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
1575 Abc_Print( -2,
" (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
1577 Abc_Print( -2,
"\t-m : toggle showing memory subsystem [default = %s]\n", fMemory?
"yes":
"no" );
1578 Abc_Print( -2,
"\t-h : print the command usage\n");
1593int Abc_CommandInvPs(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1599 int c, fVerbose = 0;
1616 Abc_Print( 1,
"Abc_CommandInvPs(): There is no current design.\n" );
1619 if ( Wlc_AbcGetInv(pAbc) == NULL )
1621 Abc_Print( 1,
"Abc_CommandInvPs(): Invariant is not available.\n" );
1626 Vec_IntFree( vCounts );
1629 Abc_Print( -2,
"usage: inv_ps [-vh]\n" );
1630 Abc_Print( -2,
"\t prints statistics for inductive invariant\n" );
1631 Abc_Print( -2,
"\t (in the case of \'sat\' or \'undecided\', inifity clauses are used)\n" );
1632 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1633 Abc_Print( -2,
"\t-h : print the command usage\n");
1648int Abc_CommandInvPrint(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1651 int c, fVerbose = 0;
1666 if ( Wlc_AbcGetInv(pAbc) == NULL )
1668 Abc_Print( 1,
"Abc_CommandInvPs(): Invariant is not available.\n" );
1674 Abc_Print( -2,
"usage: inv_print [-vh]\n" );
1675 Abc_Print( -2,
"\t prints the current inductive invariant\n" );
1676 Abc_Print( -2,
"\t (in the case of \'sat\' or \'undecided\', inifity clauses are used)\n" );
1677 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1678 Abc_Print( -2,
"\t-h : print the command usage\n");
1693int Abc_CommandInvCheck(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1697 int c, nFailed, fVerbose = 0;
1712 if ( pAbc->pGia == NULL )
1714 Abc_Print( 1,
"Abc_CommandInvMin(): There is no current design.\n" );
1717 if ( Wlc_AbcGetInv(pAbc) == NULL )
1719 Abc_Print( 1,
"Abc_CommandInvMin(): There is no saved invariant.\n" );
1722 if ( Gia_ManRegNum(pAbc->pGia) != Vec_IntEntryLast(Wlc_AbcGetInv(pAbc)) )
1724 Abc_Print( 1,
"Abc_CommandInvMin(): The number of flops in the invariant and in GIA should be the same.\n" );
1727 nFailed =
Pdr_InvCheck( pAbc->pGia, Wlc_AbcGetInv(pAbc), fVerbose );
1729 printf(
"Invariant verification failed for %d clauses (out of %d). ", nFailed, Vec_IntEntry(Wlc_AbcGetInv(pAbc),0) );
1731 printf(
"Invariant verification succeeded. " );
1732 Abc_PrintTime( 1,
"Time", Abc_Clock() - clk );
1735 Abc_Print( -2,
"usage: inv_check [-vh]\n" );
1736 Abc_Print( -2,
"\t checks that the invariant is indeed an inductive invariant\n" );
1737 Abc_Print( -2,
"\t (AIG representing the design should be in the &-space)\n" );
1738 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1739 Abc_Print( -2,
"\t-h : print the command usage\n");
1754int Abc_CommandInvGet(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1759 int c, i, fVerbose = 0, fFlopNamesFromGia = 0;
1767 fFlopNamesFromGia ^= 1;
1778 if ( Wlc_AbcGetInv(pAbc) == NULL )
1780 Abc_Print( 1,
"Abc_CommandInvGet(): Invariant is not available.\n" );
1784 if ( fFlopNamesFromGia )
1786 if ( pAbc->pGia == NULL )
1788 Abc_Print( 1,
"Abc_CommandInvGet(): No network in &-space, cannot copy names.\n" );
1789 fFlopNamesFromGia = 0;
1793 vNamesIn = Vec_PtrStart( Gia_ManRegNum(pAbc->pGia) );
1794 for ( i = 0; i < Gia_ManRegNum(pAbc->pGia); ++i )
1797 Vec_PtrSetEntry( vNamesIn, i,
Extra_UtilStrsav( (
const char*)Vec_PtrEntry( pAbc->pGia->vNamesIn, Gia_ManPiNum(pAbc->pGia)+i ) ) );
1802 pMainNtk =
Wlc_NtkGetInv( pNtk, Wlc_AbcGetInv(pAbc), vNamesIn );
1805 Vec_PtrFree( vNamesIn );
1811 Abc_Print( -2,
"usage: inv_get [-fvh]\n" );
1812 Abc_Print( -2,
"\t places invariant found by PDR as the current network in the main-space\n" );
1813 Abc_Print( -2,
"\t (in the case of \'sat\' or \'undecided\', infinity clauses are used)\n" );
1814 Abc_Print( -2,
"\t-f : toggle reading flop names from the &-space [default = %s]\n", fFlopNamesFromGia?
"yes":
"no" );
1815 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1816 Abc_Print( -2,
"\t-h : print the command usage\n");
1831int Abc_CommandInvPut(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1836 int c, fVerbose = 0;
1853 Abc_Print( 1,
"Abc_CommandInvPut(): There is no current design.\n" );
1856 if ( pAbc->pGia == NULL )
1858 Abc_Print( 1,
"Abc_CommandInvPut(): There is no current AIG.\n" );
1867 Abc_Print( -2,
"usage: inv_put [-vh]\n" );
1868 Abc_Print( -2,
"\t inputs the current network in the main-space as an invariant\n" );
1869 Abc_Print( -2,
"\t (AIG representing the design should be in the &-space)\n" );
1870 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1871 Abc_Print( -2,
"\t-h : print the command usage\n");
1886int Abc_CommandInvMin(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1891 int c, fLits = 0, fVerbose = 0;
1909 if ( pAbc->pGia == NULL )
1911 Abc_Print( 1,
"Abc_CommandInvMin(): There is no current design.\n" );
1914 if ( Wlc_AbcGetInv(pAbc) == NULL )
1916 Abc_Print( 1,
"Abc_CommandInvMin(): Invariant is not available.\n" );
1919 vInv = Wlc_AbcGetInv(pAbc);
1920 if ( Gia_ManRegNum(pAbc->pGia) != Vec_IntEntryLast(vInv) )
1922 Abc_Print( 1,
"Abc_CommandInvMin(): The number of flops in the invariant and in GIA should be the same.\n" );
1933 Abc_Print( -2,
"usage: inv_min [-lvh]\n" );
1934 Abc_Print( -2,
"\t performs minimization of the current invariant\n" );
1935 Abc_Print( -2,
"\t (AIG representing the design should be in the &-space)\n" );
1936 Abc_Print( -2,
"\t-l : toggle minimizing literals rather than clauses [default = %s]\n", fLits?
"yes":
"no" );
1937 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1938 Abc_Print( -2,
"\t-h : print the command usage\n");
1953int Abc_CommandTest(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
1958 int c, fVerbose = 0;
1994 Abc_Print( -2,
"usage: %%test [-vh]\n" );
1995 Abc_Print( -2,
"\t experiments with word-level networks\n" );
1996 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
1997 Abc_Print( -2,
"\t-h : print the command usage\n");
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
struct Abc_Ntk_t_ Abc_Ntk_t
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
ABC_DLL void Abc_FrameSetInv(Vec_Int_t *vInv)
ABC_DLL Abc_Ntk_t * Abc_FrameReadNtk(Abc_Frame_t *p)
ABC_DLL void Abc_FrameReplaceCurrentNetwork(Abc_Frame_t *p, Abc_Ntk_t *pNet)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Cmd_CommandAdd(Abc_Frame_t *pAbc, const char *sGroup, const char *sName, Cmd_CommandFuncType pFunc, int fChanges)
void Gia_ManStop(Gia_Man_t *p)
Gia_Man_t * Gia_ManTransformMiter(Gia_Man_t *p)
Gia_Man_t * Gia_ManDupPerm(Gia_Man_t *p, Vec_Int_t *vPiPerm)
struct Gia_Man_t_ Gia_Man_t
int Pdr_InvCheck(Gia_Man_t *p, Vec_Int_t *vInv, int fVerbose)
void Pdr_InvPrint(Vec_Int_t *vInv, int fVerbose)
Vec_Int_t * Pdr_InvMinimizeLits(Gia_Man_t *p, Vec_Int_t *vInv, int fVerbose)
Vec_Int_t * Pdr_InvCounts(Vec_Int_t *vInv)
Vec_Int_t * Pdr_InvMinimize(Gia_Man_t *p, Vec_Int_t *vInv, int fVerbose)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Vec_Int_t * Wlc_NtkGetPut(Abc_Ntk_t *pNtk, Gia_Man_t *pGia)
Abc_Ntk_t * Wlc_NtkGetInv(Wlc_Ntk_t *pNtk, Vec_Int_t *vInv, Vec_Ptr_t *vNamesIn)
void Wlc_NtkPrintInvStats(Wlc_Ntk_t *pNtk, Vec_Int_t *vCounts, int fVerbose)
ABC_NAMESPACE_IMPL_START void Wlc_NtkPrintInputInfo(Wlc_Ntk_t *pNtk)
DECLARATIONS ///.
void Wlc_TransferPioNames(Wlc_Ntk_t *p, Gia_Man_t *pNew)
Vec_Int_t * Wlc_ComputePerm(Wlc_Ntk_t *pNtk, int nPis)
void Wlc_End(Abc_Frame_t *pAbc)
void Wlc_Init(Abc_Frame_t *pAbc)
FUNCTION DEFINITIONS ///.
void Wlc_SetNtk(Abc_Frame_t *pAbc, Wlc_Ntk_t *pNtk)
Wlc_Ntk_t * Wlc_NtkGraftMulti(Wlc_Ntk_t *p, int fVerbose)
Wlc_Ntk_t * Wlc_NtkMemBlast(Wlc_Ntk_t *p)
void Wlc_NtkExploreMem(Wlc_Ntk_t *p, int nFrames)
void Wlc_NtkShow(Wlc_Ntk_t *p, Vec_Int_t *vBold)
void Wlc_NtkSimulateTest(Wlc_Ntk_t *p)
struct Wlc_Par_t_ Wlc_Par_t
int Wlc_NtkAbsCore2(Wlc_Ntk_t *p, Wlc_Par_t *pPars)
void Wlc_NtkPrintMemory(Wlc_Ntk_t *p)
void Wlc_WriteNdr(Wlc_Ntk_t *pNtk, char *pFileName)
Gia_Man_t * Wlc_NtkBitBlast(Wlc_Ntk_t *p, Wlc_BstPar_t *pPars)
char * Wlc_NtkNewName(Wlc_Ntk_t *p, int iCoId, int fSeq)
int Wlc_NtkPdrAbs(Wlc_Ntk_t *p, Wlc_Par_t *pPars)
void Wlc_ManSetDefaultParams(Wlc_Par_t *pPars)
FUNCTION DEFINITIONS ///.
int Wlc_NtkAbsCore(Wlc_Ntk_t *p, Wlc_Par_t *pPars)
FUNCTION DECLARATIONS ///.
Wlc_Ntk_t * Wlc_NtkDupDfs(Wlc_Ntk_t *p, int fMarked, int fSeq)
void Wlc_NtkFree(Wlc_Ntk_t *p)
void Wlc_NtkShortNames(Wlc_Ntk_t *p)
void Wlc_NtkProfileCones(Wlc_Ntk_t *p)
struct Wlc_Ntk_t_ Wlc_Ntk_t
void Wlc_NtkPrintNodes(Wlc_Ntk_t *p, int Type)
int Wlc_NtkMemAbstract(Wlc_Ntk_t *p, int nIterMax, int fDumpAbs, int fPdrVerbose, int fVerbose)
void Wlc_WinProfileArith(Wlc_Ntk_t *p)
void Wlc_NtkPrintStats(Wlc_Ntk_t *p, int fDistrib, int fTwoSides, int fVerbose)
Vec_Int_t * Wlc_NtkCollectMemory(Wlc_Ntk_t *p, int fClean)
void Wlc_NtkPrintObjects(Wlc_Ntk_t *p)
Wlc_Ntk_t * Wlc_NtkAbstractMem(Wlc_Ntk_t *p, int nFrames, int fVerbose)
void Wlc_NtkMarkCone(Wlc_Ntk_t *p, int iCoId, int Range, int fSeq, int fAllPis)
void Wlc_WriteVer(Wlc_Ntk_t *p, char *pFileName, int fAddCos, int fNoFlops)
Wlc_Ntk_t * Wlc_NtkDupSingleNodes(Wlc_Ntk_t *p)
Vec_Int_t * Wlc_NtkCollectMultipliers(Wlc_Ntk_t *p)
struct Wlc_BstPar_t_ Wlc_BstPar_t
Vec_Int_t * Wlc_NtkCollectAddMult(Wlc_Ntk_t *p, Wlc_BstPar_t *pPar, int *pCountA, int *CountM)
Wlc_Ntk_t * Wlc_ReadNdr(char *pFileName)
Wlc_Ntk_t * Wlc_ReadSmt(char *pFileName, int fOldParser, int fPrintTree)
Wlc_Ntk_t * Wlc_ReadVer(char *pFileName, char *pStr, int fInter)
void Wln_NtkRetimeTest(char *pFileName, int fIgnoreIO, int fSkipSimple, int fDump, int fVerbose)
Wln_Ntk_t * Wln_NtkFromNdr(void *pData, int fDump)
Vec_Int_t * Wln_NtkRetime(Wln_Ntk_t *p, int fIgnoreIO, int fSkipSimple, int fVerbose)
void Wln_NtkFree(Wln_Ntk_t *p)
void Wln_NtkRetimeCreateDelayInfo(Wln_Ntk_t *pNtk)
struct Wln_Ntk_t_ Wln_Ntk_t