49 if ( pFileName == NULL )
54 if ( !
strcmp( pExt,
"aig" ) )
56 if ( !
strcmp( pExt,
"baf" ) )
58 if ( !
strcmp( pExt,
"bblif" ) )
60 if ( !
strcmp( pExt,
"blif" ) )
62 if ( !
strcmp( pExt,
"bench" ) )
64 if ( !
strcmp( pExt,
"cnf" ) )
66 if ( !
strcmp( pExt,
"dot" ) )
68 if ( !
strcmp( pExt,
"edif" ) )
70 if ( !
strcmp( pExt,
"eqn" ) )
72 if ( !
strcmp( pExt,
"gml" ) )
74 if ( !
strcmp( pExt,
"list" ) )
76 if ( !
strcmp( pExt,
"mv" ) )
78 if ( !
strcmp( pExt,
"pla" ) )
80 if ( !
strcmp( pExt,
"smv" ) )
82 if ( !
strcmp( pExt,
"v" ) )
104 fprintf( stdout,
"Generic file reader requires a known file extension to open \"%s\".\n", pFileName );
108 pFile = fopen( pFileName,
"r" );
111 fprintf( stdout,
"Cannot open input file \"%s\". ", pFileName );
113 fprintf( stdout,
"Did you mean \"%s\"?", pFileName );
114 fprintf( stdout,
"\n" );
129 fprintf( stdout,
"Reading AIG from file has failed.\n" );
152 fprintf( stderr,
"Unknown file format.\n" );
157 fprintf( stdout,
"Reading network from file has failed.\n" );
164 fprintf( stdout,
"Warning: The network contains hierarchy.\n" );
222 assert( tempLtlStore != NULL );
265 fprintf( stdout,
"Flattening logic hierarchy has failed.\n" );
272 printf(
"Hierarchy reader converted %d instances of blackboxes.\n",
Abc_NtkBlackboxNum(pNtk) );
277 fprintf( stdout,
"Converting blackboxes has failed.\n" );
288 fprintf( stdout,
"Converting BLIF-MV to AIG has failed.\n" );
300 fprintf( stdout,
"Converting netlist to logic network after reading has failed.\n" );
323 fprintf( stdout,
"Empty network.\n" );
329 fprintf( stdout,
"The generic file writer requires a known file extension.\n" );
337 fprintf( stdout,
"Writing this format is only possible for structurally hashed AIGs.\n" );
366 fprintf( stdout,
"Writing Binary BLIF is only possible for logic networks.\n" );
386 fprintf( stdout,
"PLA writing is available for collapsed networks.\n" );
393 fprintf( stdout,
"Latches are writen into the PLA file at PI/PO pairs.\n" );
406 fprintf( stdout,
"Writing traditional BENCH is available for AIGs only (use \"write_bench\").\n" );
415 fprintf( stdout,
"Writing traditional SMV is available for AIGs only.\n" );
423 if ( pNtkTemp == NULL )
425 fprintf( stdout,
"Converting to netlist has failed.\n" );
462 fprintf( stderr,
"Unknown file format.\n" );
479 Abc_Ntk_t * pNtkTemp, * pNtkResult, * pNtkBase = NULL;
484 fprintf( stdout,
"Empty network.\n" );
497 fprintf( stderr,
"Unknown input file format.\n" );
498 if ( pNtkBase == NULL )
506 if ( pNtkBase == NULL )
518 printf(
"Hierarchy writer replaced %d barbufs by hierarchy boundaries.\n", pNtk->
nBarBufs );
524 printf(
"Hierarchy writer does not support BLIF-MV with blackboxes.\n" );
547 printf(
"Hierarchy writer reintroduced %d instances of blackboxes.\n",
Abc_NtkBlackboxNum(pNtkBase) );
551 printf(
"Warning: The output network does not contain blackboxes.\n" );
555 if ( pNtkResult == NULL )
594 fprintf( stderr,
"Unknown output file format.\n" );
616 printf(
"Warning: PI \"%s\" appears twice in the list.\n", pName );
641 printf(
"Warning: PO \"%s\" appears twice in the list.\n", pName );
732 for ( i = 0; i < nInputs; i++ )
819 FILE *
Io_FileOpen(
const char * FileName,
const char * PathVar,
const char * Mode,
int fVerbose )
821 char * t = 0, * c = 0, * i;
825 return fopen( FileName, Mode );
831 char ActualFileName[4096];
834 for (i =
strtok( t,
":" ); i != 0; i =
strtok( 0,
":") )
837 _snprintf ( ActualFileName, 4096,
"%s/%s", i, FileName );
839 snprintf ( ActualFileName, 4096,
"%s/%s", i, FileName );
841 if ( ( fp = fopen ( ActualFileName, Mode ) ) )
844 fprintf ( stdout,
"Using file %s\n", ActualFileName );
854 return fopen( FileName, Mode );
Abc_Ntk_t * Io_ReadAiger(char *pFileName, int fCheck)
FUNCTION DECLARATIONS ///.
static int Abc_NtkIsStrash(Abc_Ntk_t *pNtk)
Abc_Ntk_t * Io_ReadBlifMv(char *pFileName, int fBlifMv, int fCheck)
FUNCTION DEFINITIONS ///.
void Io_WriteEqn(Abc_Ntk_t *pNtk, char *pFileName)
FUNCTION DEFINITIONS ///.
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
Vec_Ptr_t * vLtlProperties
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Abc_Obj_t * Io_ReadCreateBuf(Abc_Ntk_t *pNtk, char *pNameIn, char *pNameOut)
static int Abc_NtkIsComb(Abc_Ntk_t *pNtk)
ABC_DLL void Abc_NtkMakeComb(Abc_Ntk_t *pNtk, int fRemoveLatches)
Abc_Ntk_t * Io_ReadBblif(char *pFileName, int fCheck)
Abc_Ntk_t * Io_Read(char *pFileName, Io_FileType_t FileType, int fCheck, int fBarBufs)
static int Abc_NtkHasSop(Abc_Ntk_t *pNtk)
Vec_Ptr_t * temporaryLtlStore(Abc_Ntk_t *pNtk)
Io_FileType_t
INCLUDES ///.
static int Abc_NtkIsNetlist(Abc_Ntk_t *pNtk)
void Io_WriteVerilog(Abc_Ntk_t *pNtk, char *FileName)
FUNCTION DEFINITIONS ///.
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
void updateLtlStoreOfNtk(Abc_Ntk_t *pNtk, Vec_Ptr_t *tempLtlStore)
static int Abc_NtkHasMapping(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst1(Abc_Ntk_t *pNtk)
Abc_Ntk_t * Io_ReadEdif(char *pFileName, int fCheck)
FUNCTION DEFINITIONS ///.
ABC_DLL Abc_Ntk_t * Abc_NtkDup(Abc_Ntk_t *pNtk)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
ABC_NAMESPACE_IMPL_START Io_FileType_t Io_ReadFileType(char *pFileName)
DECLARATIONS ///.
ABC_DLL Abc_Ntk_t * Abc_NtkFlattenLogicHierarchy(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Ntk_t * Abc_NtkToNetlist(Abc_Ntk_t *pNtk)
Abc_Obj_t * Io_ReadCreateInv(Abc_Ntk_t *pNtk, char *pNameIn, char *pNameOut)
void Io_WriteBlif(Abc_Ntk_t *pNtk, char *pFileName, int fWriteLatches, int fBb2Wb, int fSeq)
ABC_DLL Abc_Ntk_t * Abc_NtkToNetlistBench(Abc_Ntk_t *pNtk)
ABC_DLL char * Abc_ObjAssignName(Abc_Obj_t *pObj, char *pName, char *pSuffix)
static int Abc_NtkWhiteboxNum(Abc_Ntk_t *pNtk)
static int Vec_PtrSize(Vec_Ptr_t *p)
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
ABC_DLL int Abc_NtkConvertToBlifMv(Abc_Ntk_t *pNtk)
FILE * Io_FileOpen(const char *FileName, const char *PathVar, const char *Mode, int fVerbose)
ABC_DLL void Abc_NtkDelete(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Ntk_t * Abc_NtkInsertBlifMv(Abc_Ntk_t *pNtkBase, Abc_Ntk_t *pNtkLogic)
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
int Io_WriteSmv(Abc_Ntk_t *pNtk, char *FileName)
ABC_DLL int Abc_NtkIsAcyclicWithBoxes(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Ntk_t * Abc_NtkToLogic(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
static Abc_Obj_t * Abc_NtkCreateBo(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Ntk_t * Abc_NtkStrashBlifMv(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Ntk_t * Abc_NtkFromBarBufs(Abc_Ntk_t *pNtkBase, Abc_Ntk_t *pNtk)
Abc_Obj_t * Io_ReadCreateLatch(Abc_Ntk_t *pNtk, char *pNetLI, char *pNetLO)
Abc_Obj_t * Io_ReadCreateConst(Abc_Ntk_t *pNtk, char *pName, int fConst1)
Abc_Obj_t * Io_ReadCreateNode(Abc_Ntk_t *pNtk, char *pNameOut, char *pNamesIn[], int nInputs)
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeInv(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
ABC_DLL int Abc_NtkToSop(Abc_Ntk_t *pNtk, int fDirect)
void Io_WriteBook(Abc_Ntk_t *pNtk, char *FileName)
void Io_WriteGml(Abc_Ntk_t *pNtk, char *pFileName)
DECLARATIONS ///.
Abc_Ntk_t * Io_ReadBench(char *pFileName, int fCheck)
FUNCTION DEFINITIONS ///.
#define ABC_NAMESPACE_IMPL_END
ABC_DLL Abc_Obj_t * Abc_NtkFindNet(Abc_Ntk_t *pNtk, char *pName)
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeBuf(Abc_Ntk_t *pNtk, Abc_Obj_t *pFanin)
void Io_WriteHie(Abc_Ntk_t *pNtk, char *pBaseName, char *pFileName)
int Io_WritePla(Abc_Ntk_t *pNtk, char *FileName)
FUNCTION DEFINITIONS ///.
static Abc_Obj_t * Abc_NtkCreateLatch(Abc_Ntk_t *pNtk)
Abc_Ntk_t * Io_ReadEqn(char *pFileName, int fCheck)
FUNCTION DEFINITIONS ///.
void Io_Write(Abc_Ntk_t *pNtk, char *pFileName, Io_FileType_t FileType)
static Abc_Obj_t * Abc_NtkCreatePi(Abc_Ntk_t *pNtk)
Abc_Obj_t * Io_ReadCreatePi(Abc_Ntk_t *pNtk, char *pName)
ABC_DLL Abc_Obj_t * Abc_NtkFindOrCreateNet(Abc_Ntk_t *pNtk, char *pName)
ABC_DLL Abc_Ntk_t * Abc_NtkConvertBlackboxes(Abc_Ntk_t *pNtk)
Abc_Ntk_t * Io_ReadVerilog(char *pFileName, int fCheck)
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_START
Abc_Ntk_t * Io_ReadPla(char *pFileName, int fZeros, int fCheck)
FUNCTION DEFINITIONS ///.
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
ABC_DLL Abc_Obj_t * Abc_NtkCreateNodeConst0(Abc_Ntk_t *pNtk)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
void Io_WriteBaf(Abc_Ntk_t *pNtk, char *pFileName)
DECLARATIONS ///.
void Io_WriteBlifMv(Abc_Ntk_t *pNtk, char *FileName)
FUNCTION DEFINITIONS ///.
static Abc_Obj_t * Abc_NtkCreateNode(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
void Io_WriteBblif(Abc_Ntk_t *pNtk, char *pFileName)
ABC_DLL Abc_Ntk_t * Abc_NtkToBarBufs(Abc_Ntk_t *pNtk)
static int Abc_NtkHasAig(Abc_Ntk_t *pNtk)
ABC_DLL char * Abc_FrameReadFlag(char *pFlag)
int Io_WriteCnf(Abc_Ntk_t *pNtk, char *FileName, int fAllPrimes)
FUNCTION DEFINITIONS ///.
static int Abc_NtkBlackboxNum(Abc_Ntk_t *pNtk)
static Abc_Obj_t * Abc_NtkCreateBi(Abc_Ntk_t *pNtk)
int Io_WriteBench(Abc_Ntk_t *pNtk, const char *FileName)
FUNCTION DEFINITIONS ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Abc_Ntk_t * Io_ReadBaf(char *pFileName, int fCheck)
DECLARATIONS ///.
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
ABC_DLL Abc_Ntk_t * Abc_NtkInsertNewLogic(Abc_Ntk_t *pNtkH, Abc_Ntk_t *pNtkL)
static void Abc_LatchSetInit0(Abc_Obj_t *pLatch)
static Abc_Obj_t * Abc_NtkCreatePo(Abc_Ntk_t *pNtk)
void Io_WriteAiger(Abc_Ntk_t *pNtk, char *pFileName, int fWriteSymbols, int fCompact, int fUnique)
void Io_WriteDot(Abc_Ntk_t *pNtk, char *FileName)
FUNCTION DEFINITIONS ///.
static Abc_Obj_t * Abc_NtkCreateNet(Abc_Ntk_t *pNtk)
Abc_Obj_t * Io_ReadCreatePo(Abc_Ntk_t *pNtk, char *pName)
Abc_Ntk_t * Io_ReadNetlist(char *pFileName, Io_FileType_t FileType, int fCheck)
Abc_Obj_t * Io_ReadCreateResetLatch(Abc_Ntk_t *pNtk, int fBlifMv)