32static int Bac_CommandRead (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
33static int Bac_CommandWrite (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
34static int Bac_CommandPs (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
35static int Bac_CommandPut (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
36static int Bac_CommandGet (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
37static int Bac_CommandClp (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
38static int Bac_CommandCec (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
39static int Bac_CommandTest (
Abc_Frame_t * pAbc,
int argc,
char ** argv );
42static inline void Bac_AbcFreeMan(
Abc_Frame_t * pAbc ) {
if ( pAbc->pAbcBac ) Bac_ManFree(Bac_AbcGetMan(pAbc)); }
43static inline void Bac_AbcUpdateMan(
Abc_Frame_t * pAbc,
Bac_Man_t *
p ) { Bac_AbcFreeMan(pAbc); pAbc->pAbcBac =
p; }
65 printf(
"ABC framework is not started.\n" );
70 printf(
"Converting from Ptr failed.\n" );
79 printf(
"ABC framework is not started.\n" );
84 printf(
"There is no CBA design present.\n" );
87 printf(
"Converting to Ptr has failed.\n" );
104 Cmd_CommandAdd( pAbc,
"New word level",
"@_read", Bac_CommandRead, 0 );
105 Cmd_CommandAdd( pAbc,
"New word level",
"@_write", Bac_CommandWrite, 0 );
106 Cmd_CommandAdd( pAbc,
"New word level",
"@_ps", Bac_CommandPs, 0 );
107 Cmd_CommandAdd( pAbc,
"New word level",
"@_put", Bac_CommandPut, 0 );
108 Cmd_CommandAdd( pAbc,
"New word level",
"@_get", Bac_CommandGet, 0 );
109 Cmd_CommandAdd( pAbc,
"New word level",
"@_clp", Bac_CommandClp, 0 );
110 Cmd_CommandAdd( pAbc,
"New word level",
"@_cec", Bac_CommandCec, 0 );
111 Cmd_CommandAdd( pAbc,
"New word level",
"@_test", Bac_CommandTest, 0 );
127 Bac_AbcFreeMan( pAbc );
142int Bac_CommandRead(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
147 char * pFileName = NULL;
148 int c, fUseAbc = 0, fUsePtr = 0, fVerbose = 0;
171 printf(
"Bac_CommandRead(): Input file name should be given on the command line.\n" );
176 if ( (pFile = fopen( pFileName,
"r" )) == NULL )
178 Abc_Print( 1,
"Cannot open input file \"%s\". ", pFileName );
180 Abc_Print( 1,
"Did you mean \"%s\"?", pFileName );
181 Abc_Print( 1,
"\n" );
186 if ( fUseAbc || fUsePtr )
196 p->pSpec = Abc_UtilStrsav( pAbcNtk->
pSpec );
203 if ( vDes && Vec_PtrSize(vDes) )
206 Psr_ManVecFree( vDes );
211 if ( vDes && Vec_PtrSize(vDes) )
214 Psr_ManVecFree( vDes );
219 if ( vDes && Vec_PtrSize(vDes) )
222 Psr_ManVecFree( vDes );
230 printf(
"Unrecognized input file extension.\n" );
233 Bac_AbcUpdateMan( pAbc,
p );
236 Abc_Print( -2,
"usage: @_read [-apvh] <file_name>\n" );
237 Abc_Print( -2,
"\t reads hierarchical design in BLIF or Verilog\n" );
238 Abc_Print( -2,
"\t-a : toggle using old ABC parser [default = %s]\n", fUseAbc?
"yes":
"no" );
239 Abc_Print( -2,
"\t-p : toggle using Ptr construction [default = %s]\n", fUsePtr?
"yes":
"no" );
240 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
241 Abc_Print( -2,
"\t-h : print the command usage\n");
256int Bac_CommandWrite(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
259 char * pFileName = NULL;
285 Abc_Print( 1,
"Bac_CommandWrite(): There is no current design.\n" );
294 printf(
"Output file name should be given on the command line.\n" );
306 printf(
"Converting to Ptr has failed.\n" );
320 printf(
"Unrecognized output file extension.\n" );
325 Abc_Print( -2,
"usage: @_write [-apvh]\n" );
326 Abc_Print( -2,
"\t writes the design into a file in BLIF or Verilog\n" );
327 Abc_Print( -2,
"\t-a : toggle using assign-statement for primitives [default = %s]\n", fUseAssign?
"yes":
"no" );
328 Abc_Print( -2,
"\t-p : toggle using Ptr construction (mapped Verilog only) [default = %s]\n", fUsePtr?
"yes":
"no" );
329 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
330 Abc_Print( -2,
"\t-h : print the command usage\n");
346int Bac_CommandPs(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
349 int c, nModules = 0, fVerbose = 0;
358 Abc_Print( -1,
"Command line switch \"-M\" should be followed by an integer.\n" );
377 Abc_Print( 1,
"Bac_CommandPs(): There is no current design.\n" );
380 Bac_ManPrintStats(
p, nModules, fVerbose );
383 Abc_Print( -2,
"usage: @_ps [-M num] [-vh]\n" );
384 Abc_Print( -2,
"\t prints statistics\n" );
385 Abc_Print( -2,
"\t-M num : the number of first modules to report [default = %d]\n", nModules );
386 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
387 Abc_Print( -2,
"\t-h : print the command usage\n");
402int Bac_CommandPut(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
406 int c, fBarBufs = 1, fVerbose = 0;
426 Abc_Print( 1,
"Bac_CommandPut(): There is no current design.\n" );
432 Abc_Print( 1,
"Bac_CommandPut(): Conversion to AIG has failed.\n" );
438 Abc_Print( -2,
"usage: @_put [-bvh]\n" );
439 Abc_Print( -2,
"\t extracts AIG from the hierarchical design\n" );
440 Abc_Print( -2,
"\t-b : toggle using barrier buffers [default = %s]\n", fBarBufs?
"yes":
"no" );
441 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
442 Abc_Print( -2,
"\t-h : print the command usage\n");
457int Bac_CommandGet(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
459 Bac_Man_t * pNew = NULL, *
p = Bac_AbcGetMan(pAbc);
460 int c, fMapped = 0, fVerbose = 0;
480 Abc_Print( 1,
"Bac_CommandGet(): There is no current design.\n" );
485 if ( pAbc->pNtkCur == NULL )
487 Abc_Print( 1,
"Bac_CommandGet(): There is no current mapped design.\n" );
494 if ( pAbc->pGia == NULL )
496 Abc_Print( 1,
"Bac_CommandGet(): There is no current AIG.\n" );
501 Bac_AbcUpdateMan( pAbc, pNew );
504 Abc_Print( -2,
"usage: @_get [-mvh]\n" );
505 Abc_Print( -2,
"\t inserts AIG or mapped network into the hierarchical design\n" );
506 Abc_Print( -2,
"\t-m : toggle using mapped network from main-space [default = %s]\n", fMapped?
"yes":
"no" );
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 Bac_CommandClp(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
525 Bac_Man_t * pNew = NULL, *
p = Bac_AbcGetMan(pAbc);
543 Abc_Print( 1,
"Bac_CommandGet(): There is no current design.\n" );
547 Bac_AbcUpdateMan( pAbc, pNew );
550 Abc_Print( -2,
"usage: @_clp [-vh]\n" );
551 Abc_Print( -2,
"\t collapses the current hierarchical design\n" );
552 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
553 Abc_Print( -2,
"\t-h : print the command usage\n");
568int Bac_CommandCec(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
574 char * FileName, * pStr, ** pArgvNew;
575 int c, nArgcNew, fDumpMiter = 0;
594 Abc_Print( 1,
"Bac_CommandCec(): There is no current design.\n" );
601 if (
p->pSpec == NULL )
603 Abc_Print( -1,
"File name is not given on the command line.\n" );
609 FileName = pArgvNew[0];
611 for ( pStr = FileName; *pStr; pStr++ )
614 if ( (pFile = fopen( FileName,
"r" )) == NULL )
616 Abc_Print( -1,
"Cannot open input file \"%s\". ", FileName );
618 Abc_Print( 1,
"Did you mean \"%s\"?", FileName );
619 Abc_Print( 1,
"\n" );
626 if ( pFirst == NULL )
628 Abc_Print( -1,
"Extracting AIG from the current design has failed.\n" );
638 Psr_ManVecFree( vDes );
641 if ( pSecond == NULL )
644 Abc_Print( -1,
"Extracting AIG from the original design has failed.\n" );
653 Abc_Print( 0,
"The verification miter is written into file \"%s\".\n",
"cec_miter.aig" );
664 Abc_Print( -2,
"usage: @_cec [-vh]\n" );
665 Abc_Print( -2,
"\t combinational equivalence checking\n" );
666 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", pPars->
fVerbose?
"yes":
"no" );
667 Abc_Print( -2,
"\t-h : print the command usage\n");
682int Bac_CommandTest(
Abc_Frame_t * pAbc,
int argc,
char ** argv )
686 extern void Psr_SmtReadSmtTest();
715 Abc_Print( -2,
"usage: @_test [-vh]\n" );
716 Abc_Print( -2,
"\t experiments with word-level networks\n" );
717 Abc_Print( -2,
"\t-v : toggle printing verbose information [default = %s]\n", fVerbose?
"yes":
"no" );
718 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
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
typedefABC_NAMESPACE_HEADER_START struct Abc_Frame_t_ Abc_Frame_t
INCLUDES ///.
ABC_DLL Abc_Frame_t * Abc_FrameGetGlobalFrame()
void Bac_Init(Abc_Frame_t *pAbc)
void Abc_FrameImportPtr(Vec_Ptr_t *vPtr)
FUNCTION DEFINITIONS ///.
Vec_Ptr_t * Abc_FrameExportPtr()
void Bac_End(Abc_Frame_t *pAbc)
Vec_Ptr_t * Ptr_AbcDeriveDes(Abc_Ntk_t *pNtk)
void Psr_ManReadBlifTest()
void Psr_ManReadVerilogTest(char *pFileName)
void Bac_PtrFree(Vec_Ptr_t *vDes)
struct Bac_Man_t_ Bac_Man_t
Gia_Man_t * Bac_ManExtract(Bac_Man_t *p, int fBuffers, int fVerbose)
Bac_Man_t * Bac_ManCollapse(Bac_Man_t *p)
Bac_Man_t * Bac_ManInsertGia(Bac_Man_t *p, Gia_Man_t *pGia)
void Bac_ManWriteBac(char *pFileName, Bac_Man_t *p)
void Bac_ManWriteBlif(char *pFileName, Bac_Man_t *p)
Bac_Man_t * Bac_ManReadBac(char *pFileName)
Vec_Ptr_t * Psr_ManReadVerilog(char *pFileName)
void Bac_PtrDumpVerilog(char *pFileName, Vec_Ptr_t *vDes)
Bac_Man_t * Bac_PtrTransformToCba(Vec_Ptr_t *vDes)
Bac_Man_t * Psr_ManBuildCba(char *pFileName, Vec_Ptr_t *vDes)
void * Bac_ManInsertAbc(Bac_Man_t *p, void *pAbc)
Vec_Ptr_t * Psr_ManReadBlif(char *pFileName)
void Bac_ManWriteVerilog(char *pFileName, Bac_Man_t *p, int fUseAssign)
Vec_Ptr_t * Bac_PtrDeriveFromCba(Bac_Man_t *p)
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)
Abc_Ntk_t * Io_ReadNetlist(char *pFileName, Io_FileType_t FileType, int fCheck)
Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.