mirror of https://github.com/YosysHQ/abc.git
Cleaning up AIG output in EQN format.
This commit is contained in:
parent
750f8f174e
commit
3309ccabd4
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
@ -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" );
|
||||
|
|
|
|||
Loading…
Reference in New Issue