33static int Acb_CommandRead (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
34static int Acb_CommandWrite (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
35static int Acb_CommandPs (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
36static int Acb_CommandPut (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
37static int Acb_CommandGet (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
38static int Acb_CommandClp (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
39static int Acb_CommandBlast (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
40static int Acb_CommandCec (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
41static int Acb_CommandTest (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
44static inline void Acb_AbcFreeMan(
Abc_Frame_t * pAbc ) {
if ( pAbc->pAbcCba ) Acb_ManFree(Acb_AbcGetMan(pAbc)); }
45static inline void Acb_AbcUpdateMan(
Abc_Frame_t * pAbc,
Acb_Man_t *
p ) { Acb_AbcFreeMan(pAbc); pAbc->pAbcCba =
p; }
64 Cmd_CommandAdd( pAbc,
"New word level",
"@read", Acb_CommandRead, 0 );
65 Cmd_CommandAdd( pAbc,
"New word level",
"@write", Acb_CommandWrite, 0 );
67 Cmd_CommandAdd( pAbc,
"New word level",
"@put", Acb_CommandPut, 0 );
68 Cmd_CommandAdd( pAbc,
"New word level",
"@get", Acb_CommandGet, 0 );
69 Cmd_CommandAdd( pAbc,
"New word level",
"@clp", Acb_CommandClp, 0 );
70 Cmd_CommandAdd( pAbc,
"New word level",
"@blast", Acb_CommandBlast, 0 );
71 Cmd_CommandAdd( pAbc,
"New word level",
"@cec", Acb_CommandCec, 0 );
72 Cmd_CommandAdd( pAbc,
"New word level",
"@test", Acb_CommandTest, 0 );
88 Acb_AbcFreeMan( pAbc );
103int Acb_CommandRead(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
107 char * pFileName = NULL;
108 int c, fTest = 0, fDfs = 0, fVerbose = 0;
131 printf(
"Acb_CommandRead(): Input file name should be given on the command line.\n" );
136 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
138 Abc_Print( 1,
"Cannot open input file \"%s\". ", pFileName );
140 Abc_Print( 1,
"Did you mean \"%s\"?", pFileName );
141 Abc_Print( 1,
"\n" );
153 printf(
"Unrecognized input file extension.\n" );
159 p = Acb_ManReadBlif( pFileName );
161 p = Acb_ManReadVerilog( pFileName );
163 p = Acb_ManReadCba( pFileName );
166 printf(
"Unrecognized input file extension.\n" );
172 p = Acb_ManDup( pTemp =
p, Acb_NtkCollectDfs );
173 Acb_ManFree( pTemp );
175 Acb_AbcUpdateMan( pAbc,
p );
178 Abc_Print( -2,
"usage: @read [-tdvh] <file_name>\n" );
179 Abc_Print( -2,
"\t reads hierarchical design\n" );
180 Abc_Print( -2,
"\t-t : toggle testing the parser [default = %s]\n", fTest?
"yes":
"no" );
181 Abc_Print( -2,
"\t-d : toggle computing DFS ordering [default = %s]\n", fDfs?
"yes":
"no" );
182 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
183 Abc_Print( -2,
"\t-h : print the command usage\n");
198int Acb_CommandWrite(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
201 char * pFileName = NULL;
202 int fInclineCats = 0;
223 Abc_Print( 1,
"Acb_CommandWrite(): There is no current design.\n" );
232 printf(
"Generated output file name \"%s\".\n", pFileName );
236 printf(
"Output file name should be given on the command line.\n" );
241 Acb_ManWriteBlif( pFileName,
p );
243 Acb_ManWriteVerilog( pFileName,
p, fInclineCats );
245 Acb_ManWriteCba( pFileName,
p );
248 printf(
"Unrecognized output file extension.\n" );
253 Abc_Print( -2,
"usage: @write [-cvh]\n" );
254 Abc_Print( -2,
"\t writes the design into a file in BLIF or Verilog\n" );
255 Abc_Print( -2,
"\t-c : toggle inlining input concatenations [default = %s]\n", fInclineCats?
"yes":
"no" );
256 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
257 Abc_Print( -2,
"\t-h : print the command usage\n");
273int Acb_CommandPs(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
289 Abc_Print( -1,
"Command line switch \"-M\" should be followed by an integer.\n" );
317 Abc_Print( 1,
"Acb_CommandPs(): There is no current design.\n" );
322 Acb_ManPrintStats(
p, nModules, fVerbose );
325 Acb_NtkPrintStatsFull( Acb_ManRoot(
p), fDistrib, fVerbose );
332 Abc_Print( -2,
"usage: @ps [-M num] [-madvh]\n" );
333 Abc_Print( -2,
"\t prints statistics\n" );
334 Abc_Print( -2,
"\t-M num : the number of first modules to report [default = %d]\n", nModules );
335 Abc_Print( -2,
"\t-m : toggle printing multipliers [default = %s]\n", fShowMulti?
"yes":
"no" );
336 Abc_Print( -2,
"\t-a : toggle printing adders [default = %s]\n", fShowAdder?
"yes":
"no" );
337 Abc_Print( -2,
"\t-d : toggle printing distrubition [default = %s]\n", fDistrib?
"yes":
"no" );
338 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
339 Abc_Print( -2,
"\t-h : print the command usage\n");
354int Acb_CommandPut(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
358 int c, fBarBufs = 1, fSeq = 0, fVerbose = 0;
381 Abc_Print( 1,
"Acb_CommandPut(): There is no current design.\n" );
384 pGia = Acb_ManBlast(
p, fBarBufs, fSeq, fVerbose );
387 Abc_Print( 1,
"Acb_CommandPut(): Conversion to AIG has failed.\n" );
393 Abc_Print( -2,
"usage: @put [-bsvh]\n" );
394 Abc_Print( -2,
"\t extracts AIG from the hierarchical design\n" );
395 Abc_Print( -2,
"\t-b : toggle using barrier buffers [default = %s]\n", fBarBufs?
"yes":
"no" );
396 Abc_Print( -2,
"\t-s : toggle blasting sequential elements [default = %s]\n", fSeq?
"yes":
"no" );
397 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
398 Abc_Print( -2,
"\t-h : print the command usage\n");
413int Acb_CommandGet(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
415 Acb_Man_t * pNew = NULL, *
p = Acb_AbcGetMan(pAbc);
416 int c, fMapped = 0, fVerbose = 0;
436 Abc_Print( 1,
"Acb_CommandGet(): There is no current design.\n" );
442 if ( pAbc->pNtkCur == NULL )
444 Abc_Print( 1,
"Acb_CommandGet(): There is no current mapped design.\n" );
447 pNew = Acb_ManInsertAbc(
p, pAbc->pNtkCur );
451 if ( pAbc->pGia == NULL )
453 Abc_Print( 1,
"Acb_CommandGet(): There is no current AIG.\n" );
456 pNew = Acb_ManInsertGia(
p, pAbc->pGia );
458 Acb_AbcUpdateMan( pAbc, pNew );
461 Abc_Print( -2,
"usage: @get [-mvh]\n" );
462 Abc_Print( -2,
"\t extracts AIG or mapped network into the hierarchical design\n" );
463 Abc_Print( -2,
"\t-m : toggle using mapped network from main-space [default = %s]\n", fMapped?
"yes":
"no" );
464 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
465 Abc_Print( -2,
"\t-h : print the command usage\n");
480int Acb_CommandClp(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
482 Acb_Man_t * pNew = NULL, *
p = Acb_AbcGetMan(pAbc);
500 Abc_Print( 1,
"Acb_CommandGet(): There is no current design.\n" );
503 pNew = Acb_ManCollapse(
p );
504 Acb_AbcUpdateMan( pAbc, pNew );
507 Abc_Print( -2,
"usage: @clp [-vh]\n" );
508 Abc_Print( -2,
"\t collapses the current hierarchical design\n" );
509 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
510 Abc_Print( -2,
"\t-h : print the command usage\n");
525int Acb_CommandBlast(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
529 int c, fSeq = 0, fVerbose = 0;
549 Abc_Print( 1,
"Acb_CommandBlast(): There is no current design.\n" );
552 pNew = Acb_ManBlast(
p, 0, fSeq, fVerbose );
555 Abc_Print( 1,
"Acb_CommandBlast(): Bit-blasting has failed.\n" );
561 Abc_Print( -2,
"usage: @blast [-svh]\n" );
562 Abc_Print( -2,
"\t performs bit-blasting of the word-level design\n" );
563 Abc_Print( -2,
"\t-s : toggle blasting sequential elements [default = %s]\n", fSeq?
"yes":
"no" );
564 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
565 Abc_Print( -2,
"\t-h : print the command usage\n");
580int Acb_CommandCec(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
585 char * pFileName, * pStr, ** pArgvNew;
586 int c, nArgcNew, fDumpMiter = 0;
605 Abc_Print( 1,
"Acb_CommandCec(): There is no current design.\n" );
613 if (
p->pSpec == NULL )
615 Abc_Print( -1,
"File name is not given on the command line.\n" );
618 pFileName =
p->pSpec;
621 pFileName = pArgvNew[0];
623 for ( pStr = pFileName; *pStr; pStr++ )
626 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
628 Abc_Print( -1,
"Cannot open input file \"%s\". ", pFileName );
630 Abc_Print( 1,
"Did you mean \"%s\"?", pFileName );
631 Abc_Print( 1,
"\n" );
637 pFirst = Acb_ManBlast(
p, 0, 0, 0 );
638 if ( pFirst == NULL )
640 Abc_Print( -1,
"Extracting AIG from the current design has failed.\n" );
646 pTemp = Acb_ManReadBlif( pFileName );
648 pTemp = Acb_ManReadVerilog( pFileName );
650 pTemp = Acb_ManReadCba( pFileName );
652 pSecond = Acb_ManBlast( pTemp, 0, 0, 0 );
653 Acb_ManFree( pTemp );
654 if ( pSecond == NULL )
657 Abc_Print( -1,
"Extracting AIG from the original design has failed.\n" );
666 Abc_Print( 0,
"The verification miter is written into file \"%s\".\n",
"cec_miter.aig" );
677 Abc_Print( -2,
"usage: @cec [-vh]\n" );
678 Abc_Print( -2,
"\t combinational equivalence checking\n" );
679 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", pPars->
fVerbose?
"yes":
"no" );
680 Abc_Print( -2,
"\t-h : print the command usage\n");
695int Acb_CommandTest(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
715 Abc_Print( 1,
"Acb_CommandTest(): There is no current design.\n" );
720 Abc_Print( -2,
"usage: @test [-vh]\n" );
721 Abc_Print( -2,
"\t experiments with word-level networks\n" );
722 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
723 Abc_Print( -2,
"\t-h : print the command usage\n");
void Abc_FrameUpdateGia(Abc_Frame_t *pAbc, Gia_Man_t *pNew)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
struct Acb_Man_t_ Acb_Man_t
void Prs_ManReadVerilogTest(char *pFileName)
void Prs_ManReadBlifTest(char *pFileName)
void Cec_ManCecSetDefaultParams(Cec_ParCec_t *p)
struct Cec_ParCec_t_ Cec_ParCec_t
int Cec_ManVerify(Gia_Man_t *p, Cec_ParCec_t *pPars)
MACRO DEFINITIONS ///.
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)
struct Gia_Man_t_ Gia_Man_t
Gia_Man_t * Gia_ManMiter(Gia_Man_t *pAig0, Gia_Man_t *pAig1, int nInsDup, int fDualOut, int fSeq, int fImplic, int fVerbose)
void Gia_AigerWrite(Gia_Man_t *p, char *pFileName, int fWriteSymbols, int fCompact, int fWriteNewLine)