30static void Io_NtkWriteEqnOne( FILE * pFile,
Abc_Ntk_t * pNtk );
31static void Io_NtkWriteEqnCis( FILE * pFile,
Abc_Ntk_t * pNtk );
32static void Io_NtkWriteEqnCos( FILE * pFile,
Abc_Ntk_t * pNtk );
33static int Io_NtkWriteEqnCheck(
Abc_Ntk_t * pNtk );
54 assert( Abc_NtkIsAigNetlist(pNtk) );
55 if ( Abc_NtkLatchNum(pNtk) > 0 )
56 printf(
"Warning: only combinational portion is being written.\n" );
59 if ( !Io_NtkWriteEqnCheck(pNtk) )
63 pFile = fopen( pFileName,
"w" );
66 fprintf( stdout,
"Io_WriteEqn(): Cannot open the output file \"%s\".\n", pFileName );
69 fprintf( pFile,
"# Equations for \"%s\" written by ABC on %s\n", pNtk->
pName,
Extra_TimeStamp() );
72 Io_NtkWriteEqnOne( pFile, pNtk );
73 fprintf( pFile,
"\n" );
90 return strncmp(pName,
"new_", 4) ? pName : pName + 4;
92void Io_NtkWriteEqnOne( FILE * pFile,
Abc_Ntk_t * pNtk )
100 fprintf( pFile,
"INORDER =" );
101 Io_NtkWriteEqnCis( pFile, pNtk );
102 fprintf( pFile,
";\n" );
105 fprintf( pFile,
"OUTORDER =" );
106 Io_NtkWriteEqnCos( pFile, pNtk );
107 fprintf( pFile,
";\n" );
110 vLevels = Vec_VecAlloc( 10 );
114 Extra_ProgressBarUpdate( pProgress, i, NULL );
121 fprintf( pFile,
";\n" );
124 Vec_VecFree( vLevels );
139void Io_NtkWriteEqnCis( FILE * pFile,
Abc_Ntk_t * pNtk )
152 pNet = Abc_ObjFanout0(pTerm);
157 fprintf( pFile,
" \n" );
163 LineLength += AddedLength;
179void Io_NtkWriteEqnCos( FILE * pFile,
Abc_Ntk_t * pNtk )
192 pNet = Abc_ObjFanin0(pTerm);
197 fprintf( pFile,
" \n" );
203 LineLength += AddedLength;
219int Io_NtkWriteEqnCheck(
Abc_Ntk_t * pNtk )
233 if ( pName[0] ==
'0' || pName[0] ==
'1' )
238 for ( k = 0; k < Length; k++ )
239 if ( pName[k] ==
'(' || pName[k] ==
')' || pName[k] ==
'!' || pName[k] ==
'*' || pName[k] ==
'+' )
249 printf(
"The network cannot be written in the EQN format because object %d has name \"%s\".\n", i, pName );
250 printf(
"Consider renaming the objects using command \"short_names\" and trying again.\n" );
struct Abc_Obj_t_ Abc_Obj_t
#define Abc_NtkForEachCo(pNtk, pCo, i)
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
#define Abc_ObjForEachFanin(pObj, pFanin, i)
ABC_DLL char * Abc_ObjName(Abc_Obj_t *pNode)
DECLARATIONS ///.
struct Abc_Ntk_t_ Abc_Ntk_t
#define Abc_NtkForEachCi(pNtk, pCi, i)
#define Abc_NtkForEachNode(pNtk, pNode, i)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
ABC_NAMESPACE_IMPL_START typedef char ProgressBar
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Hop_Obj_t * Hop_IthVar(Hop_Man_t *p, int i)
FUNCTION DEFINITIONS ///.
void Hop_ObjPrintEqn(FILE *pFile, Hop_Obj_t *pObj, Vec_Vec_t *vLevels, int Level)
struct Hop_Obj_t_ Hop_Obj_t
#define IO_WRITE_LINE_LENGTH
MACRO DEFINITIONS ///.
char * Io_NamePrepro(char *pName)
void Io_WriteEqn(Abc_Ntk_t *pNtk, char *pFileName)
FUNCTION DEFINITIONS ///.
char * Nm_ManFindNameById(Nm_Man_t *p, int ObjId)
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.