31static int Cba_CommandRead (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
32static int Cba_CommandWrite (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
33static int Cba_CommandPs (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
34static int Cba_CommandPut (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
35static int Cba_CommandGet (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
36static int Cba_CommandClp (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
37static int Cba_CommandBlast (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
38static int Cba_CommandCec (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
39static int Cba_CommandTest (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
42static inline void Cba_AbcFreeMan(
Abc_Frame_t * pAbc ) {
if ( pAbc->pAbcCba ) Cba_ManFree(Cba_AbcGetMan(pAbc)); }
43static inline void Cba_AbcUpdateMan(
Abc_Frame_t * pAbc,
Cba_Man_t *
p ) { Cba_AbcFreeMan(pAbc); pAbc->pAbcCba =
p; }
62 Cmd_CommandAdd( pAbc,
"New word level",
":read", Cba_CommandRead, 0 );
63 Cmd_CommandAdd( pAbc,
"New word level",
":write", Cba_CommandWrite, 0 );
65 Cmd_CommandAdd( pAbc,
"New word level",
":put", Cba_CommandPut, 0 );
66 Cmd_CommandAdd( pAbc,
"New word level",
":get", Cba_CommandGet, 0 );
67 Cmd_CommandAdd( pAbc,
"New word level",
":clp", Cba_CommandClp, 0 );
68 Cmd_CommandAdd( pAbc,
"New word level",
":blast", Cba_CommandBlast, 0 );
69 Cmd_CommandAdd( pAbc,
"New word level",
":cec", Cba_CommandCec, 0 );
70 Cmd_CommandAdd( pAbc,
"New word level",
":test", Cba_CommandTest, 0 );
86 Cba_AbcFreeMan( pAbc );
101int Cba_CommandRead(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
105 char * pFileName = NULL;
106 int c, fTest = 0, fDfs = 0, fVerbose = 0;
129 printf(
"Cba_CommandRead(): Input file name should be given on the command line.\n" );
134 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
136 Abc_Print( 1,
"Cannot open input file \"%s\". ", pFileName );
138 Abc_Print( 1,
"Did you mean \"%s\"?", pFileName );
139 Abc_Print( 1,
"\n" );
151 printf(
"Unrecognized input file extension.\n" );
164 printf(
"Unrecognized input file extension.\n" );
171 Cba_ManFree( pTemp );
173 Cba_AbcUpdateMan( pAbc,
p );
176 Abc_Print( -2,
"usage: :read [-tdvh] <file_name>\n" );
177 Abc_Print( -2,
"\t reads hierarchical design\n" );
178 Abc_Print( -2,
"\t-t : toggle testing the parser [default = %s]\n", fTest?
"yes":
"no" );
179 Abc_Print( -2,
"\t-d : toggle computing DFS ordering [default = %s]\n", fDfs?
"yes":
"no" );
180 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
181 Abc_Print( -2,
"\t-h : print the command usage\n");
196int Cba_CommandWrite(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
199 char * pFileName = NULL;
200 int fInclineCats = 0;
221 Abc_Print( 1,
"Cba_CommandWrite(): There is no current design.\n" );
230 printf(
"Generated output file name \"%s\".\n", pFileName );
234 printf(
"Output file name should be given on the command line.\n" );
246 printf(
"Unrecognized output file extension.\n" );
251 Abc_Print( -2,
"usage: :write [-cvh]\n" );
252 Abc_Print( -2,
"\t writes the design into a file in BLIF or Verilog\n" );
253 Abc_Print( -2,
"\t-c : toggle inlining input concatenations [default = %s]\n", fInclineCats?
"yes":
"no" );
254 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
255 Abc_Print( -2,
"\t-h : print the command usage\n");
271int Cba_CommandPs(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
287 Abc_Print( -1,
"Command line switch \"-M\" should be followed by an integer.\n" );
315 Abc_Print( 1,
"Cba_CommandPs(): There is no current design.\n" );
320 Cba_ManPrintStats(
p, nModules, fVerbose );
330 Abc_Print( -2,
"usage: :ps [-M num] [-madvh]\n" );
331 Abc_Print( -2,
"\t prints statistics\n" );
332 Abc_Print( -2,
"\t-M num : the number of first modules to report [default = %d]\n", nModules );
333 Abc_Print( -2,
"\t-m : toggle printing multipliers [default = %s]\n", fShowMulti?
"yes":
"no" );
334 Abc_Print( -2,
"\t-a : toggle printing adders [default = %s]\n", fShowAdder?
"yes":
"no" );
335 Abc_Print( -2,
"\t-d : toggle printing distrubition [default = %s]\n", fDistrib?
"yes":
"no" );
336 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
337 Abc_Print( -2,
"\t-h : print the command usage\n");
352int Cba_CommandPut(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
356 int c, fBarBufs = 1, fSeq = 0, fVerbose = 0;
379 Abc_Print( 1,
"Cba_CommandPut(): There is no current design.\n" );
385 Abc_Print( 1,
"Cba_CommandPut(): Conversion to AIG has failed.\n" );
391 Abc_Print( -2,
"usage: :put [-bsvh]\n" );
392 Abc_Print( -2,
"\t extracts AIG from the hierarchical design\n" );
393 Abc_Print( -2,
"\t-b : toggle using barrier buffers [default = %s]\n", fBarBufs?
"yes":
"no" );
394 Abc_Print( -2,
"\t-s : toggle blasting sequential elements [default = %s]\n", fSeq?
"yes":
"no" );
395 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
396 Abc_Print( -2,
"\t-h : print the command usage\n");
411int Cba_CommandGet(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
413 Cba_Man_t * pNew = NULL, *
p = Cba_AbcGetMan(pAbc);
414 int c, fMapped = 0, fVerbose = 0;
434 Abc_Print( 1,
"Cba_CommandGet(): There is no current design.\n" );
440 if ( pAbc->pNtkCur == NULL )
442 Abc_Print( 1,
"Cba_CommandGet(): There is no current mapped design.\n" );
449 if ( pAbc->pGia == NULL )
451 Abc_Print( 1,
"Cba_CommandGet(): There is no current AIG.\n" );
456 Cba_AbcUpdateMan( pAbc, pNew );
459 Abc_Print( -2,
"usage: :get [-mvh]\n" );
460 Abc_Print( -2,
"\t extracts AIG or mapped network into the hierarchical design\n" );
461 Abc_Print( -2,
"\t-m : toggle using mapped network from main-space [default = %s]\n", fMapped?
"yes":
"no" );
462 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
463 Abc_Print( -2,
"\t-h : print the command usage\n");
478int Cba_CommandClp(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
480 Cba_Man_t * pNew = NULL, *
p = Cba_AbcGetMan(pAbc);
498 Abc_Print( 1,
"Cba_CommandGet(): There is no current design.\n" );
502 Cba_AbcUpdateMan( pAbc, pNew );
505 Abc_Print( -2,
"usage: :clp [-vh]\n" );
506 Abc_Print( -2,
"\t collapses the current hierarchical design\n" );
507 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
508 Abc_Print( -2,
"\t-h : print the command usage\n");
523int Cba_CommandBlast(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
527 int c, fSeq = 0, fVerbose = 0;
547 Abc_Print( 1,
"Cba_CommandBlast(): There is no current design.\n" );
553 Abc_Print( 1,
"Cba_CommandBlast(): Bit-blasting has failed.\n" );
559 Abc_Print( -2,
"usage: :blast [-svh]\n" );
560 Abc_Print( -2,
"\t performs bit-blasting of the word-level design\n" );
561 Abc_Print( -2,
"\t-s : toggle blasting sequential elements [default = %s]\n", fSeq?
"yes":
"no" );
562 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
563 Abc_Print( -2,
"\t-h : print the command usage\n");
578int Cba_CommandCec(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
583 char * pFileName, * pStr, ** pArgvNew;
584 int c, nArgcNew, fDumpMiter = 0;
603 Abc_Print( 1,
"Cba_CommandCec(): There is no current design.\n" );
611 if (
p->pSpec == NULL )
613 Abc_Print( -1,
"File name is not given on the command line.\n" );
616 pFileName =
p->pSpec;
619 pFileName = pArgvNew[0];
621 for ( pStr = pFileName; *pStr; pStr++ )
624 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
626 Abc_Print( -1,
"Cannot open input file \"%s\". ", pFileName );
628 Abc_Print( 1,
"Did you mean \"%s\"?", pFileName );
629 Abc_Print( 1,
"\n" );
636 if ( pFirst == NULL )
638 Abc_Print( -1,
"Extracting AIG from the current design has failed.\n" );
651 Cba_ManFree( pTemp );
652 if ( pSecond == NULL )
655 Abc_Print( -1,
"Extracting AIG from the original design has failed.\n" );
664 Abc_Print( 0,
"The verification miter is written into file \"%s\".\n",
"cec_miter.aig" );
675 Abc_Print( -2,
"usage: :cec [-vh]\n" );
676 Abc_Print( -2,
"\t combinational equivalence checking\n" );
677 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", pPars->
fVerbose?
"yes":
"no" );
678 Abc_Print( -2,
"\t-h : print the command usage\n");
693int Cba_CommandTest(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
713 Abc_Print( 1,
"Cba_CommandTest(): There is no current design.\n" );
718 Abc_Print( -2,
"usage: :test [-vh]\n" );
719 Abc_Print( -2,
"\t experiments with word-level networks\n" );
720 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
721 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 ///.
void Cba_Init(Abc_Frame_t *pAbc)
FUNCTION DEFINITIONS ///.
void Cba_End(Abc_Frame_t *pAbc)
void Cba_NtkPrintNodes(Cba_Ntk_t *p, int Type)
void Prs_ManReadVerilogTest(char *pFileName)
Cba_Man_t * Cba_ManReadBlif(char *pFileName)
Cba_Man_t * Cba_ManInsertAbc(Cba_Man_t *p, void *pAbc)
void Prs_ManReadBlifTest(char *pFileName)
Gia_Man_t * Cba_ManBlast(Cba_Man_t *p, int fBarBufs, int fSeq, int fVerbose)
Cba_Man_t * Cba_ManReadCba(char *pFileName)
DECLARATIONS ///.
void Cba_ManWriteVerilog(char *pFileName, Cba_Man_t *p, int fInlineConcat)
void Cba_ManWriteCba(char *pFileName, Cba_Man_t *p)
Cba_Man_t * Cba_ManCollapse(Cba_Man_t *p)
void Cba_NtkPrintStatsFull(Cba_Ntk_t *p, int fDistrib, int fVerbose)
Cba_Man_t * Cba_ManReadVerilog(char *pFileName)
struct Cba_Man_t_ Cba_Man_t
Vec_Int_t * Cba_NtkCollectDfs(Cba_Ntk_t *p)
void Cba_ManWriteBlif(char *pFileName, Cba_Man_t *p)
Cba_Man_t * Cba_ManInsertGia(Cba_Man_t *p, Gia_Man_t *pGia)
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)