&exorcism: read ESOP-PLA from file.

This commit is contained in:
Heinz Riener 2018-10-17 17:02:43 +02:00
parent 88185a02e2
commit 95523936e9
2 changed files with 15 additions and 3 deletions

View File

@ -43176,13 +43176,23 @@ int Abc_CommandAbc9Exorcism( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pFileNameIn )
{
pNtk = Io_ReadPla( pFileNameIn, 0, 0, 0, /* no preprocessing = */1, /* check = */1 );
if ( pNtk == NULL )
{
printf( "Reading PLA file has failed.\n" );
return 1;
}
nInputs = Abc_NtkCiNum( pNtk );
nOutputs = Abc_NtkCoNum( pNtk );
vEsop = Abc_ExorcismNtk2Esop( pNtk );
if ( vEsop == NULL )
{
printf( "Converting PLA to ESOP failed.\n" );
return 1;
}
}
else if ( pAbc->pGia )
{
// generate starting cover and run minimization
// generate starting cover
nInputs = Gia_ManCiNum( pAbc->pGia );
nOutputs = Gia_ManCoNum( pAbc->pGia );
Eso_ManCompute( pAbc->pGia, fVerbose, &vEsop );
@ -43190,6 +43200,7 @@ int Abc_CommandAbc9Exorcism( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( vEsop )
{
// run minimization
Abc_ExorcismMain( vEsop, nInputs, nOutputs, pFileNameOut, Quality, Verbosity, nCubesMax, fUseQCost );
Vec_WecFree( vEsop );
}
@ -43204,7 +43215,8 @@ usage:
Abc_Print( -2, " 0 = no output; 1 = outline; 2 = verbose\n");
Abc_Print( -2, " -C N : maximum number of cubes in startign cover [default = %d]\n", nCubesMax );
Abc_Print( -2, " -q : toggle using quantum cost [default = %s]\n", fUseQCost? "yes": "no" );
Abc_Print( -2, " <file> : the output file name in ESOP-PLA format\n");
Abc_Print( -2, " [file_in] : optional input file in ESOP-PLA format (otherwise current AIG is used)\n");
Abc_Print( -2, " <file_out> : output file in ESOP-PLA format\n");
Abc_Print( -2, "\n" );
return 1;
}

View File

@ -1005,7 +1005,7 @@ Vec_Wec_t * Abc_ExorcismNtk2Esop( Abc_Ntk_t * pNtk )
Vec_IntPush( vCubeIn, 2*k );
}
}
Vec_IntPush( vCubeIn, -1 );
Vec_IntPush( vCubeIn, -( i + 1 ) );
}
}