Skip to content

Commit

Permalink
Cleaning up AIG output in EQN format.
Browse files Browse the repository at this point in the history
  • Loading branch information
alanminko committed Aug 26, 2023
1 parent 750f8f1 commit 3309cca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/base/abc/abcNetlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ Abc_Ntk_t * Abc_NtkLogicToNetlist( Abc_Ntk_t * pNtk )
if ( pObj->pCopy->pCopy ) // the net of the new object is already created
continue;
// create the new net
sprintf( Buffer, "new_%s_", Abc_ObjName(pObj) );
sprintf( Buffer, "new_%s", Abc_ObjName(pObj) );
//pNet = Abc_NtkFindOrCreateNet( pNtkNew, Abc_ObjName(pObj) ); // here we create net names such as "n48", where 48 is the ID of the node
pNet = Abc_NtkFindOrCreateNet( pNtkNew, Buffer );
Abc_ObjAddFanin( pNet, pObj->pCopy );
Expand Down
2 changes: 1 addition & 1 deletion src/base/abci/abcGen.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ void Abc_GenRandom( char * pFileName, int nPis )
unsigned * pTruth;
int i, b, w, nWords = Abc_TruthWordNum( nPis );
int nDigitsIn;
Aig_ManRandom( 1 );
//Aig_ManRandom( 1 );
pTruth = ABC_ALLOC( unsigned, nWords );
for ( w = 0; w < nWords; w++ )
pTruth[w] = Aig_ManRandom( 0 );
Expand Down
8 changes: 6 additions & 2 deletions src/base/io/ioWriteEqn.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ void Io_WriteEqn( Abc_Ntk_t * pNtk, char * pFileName )
SeeAlso []
***********************************************************************/
char * Io_NamePrepro( char * pName )
{
return strncmp(pName, "new_", 4) ? pName : pName + 4;
}
void Io_NtkWriteEqnOne( FILE * pFile, Abc_Ntk_t * pNtk )
{
Vec_Vec_t * vLevels;
Expand All @@ -108,10 +112,10 @@ void Io_NtkWriteEqnOne( FILE * pFile, Abc_Ntk_t * pNtk )
Abc_NtkForEachNode( pNtk, pNode, i )
{
Extra_ProgressBarUpdate( pProgress, i, NULL );
fprintf( pFile, "%s = ", Abc_ObjName(Abc_ObjFanout0(pNode)) );
fprintf( pFile, "%s = ", Io_NamePrepro( Abc_ObjName(Abc_ObjFanout0(pNode)) ) );
// set the input names
Abc_ObjForEachFanin( pNode, pFanin, k )
Hop_IthVar((Hop_Man_t *)pNtk->pManFunc, k)->pData = Abc_ObjName(pFanin);
Hop_IthVar((Hop_Man_t *)pNtk->pManFunc, k)->pData = Io_NamePrepro( Abc_ObjName(pFanin) );
// write the formula
Hop_ObjPrintEqn( pFile, (Hop_Obj_t *)pNode->pData, vLevels, 0 );
fprintf( pFile, ";\n" );
Expand Down

0 comments on commit 3309cca

Please sign in to comment.