summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authorHeinz Riener <heinz.riener@gmail.com>2018-10-17 17:02:43 +0200
committerHeinz Riener <heinz.riener@gmail.com>2018-10-17 17:02:43 +0200
commit95523936e9028f392b80a95c0eebda3a0c731f33 (patch)
tree2ffcb64c2c2e21d826c96567da846e88bbdb3eac /src/base
parent88185a02e2e3cfb23891f14a59bb58d452da1935 (diff)
downloadabc-95523936e9028f392b80a95c0eebda3a0c731f33.tar.gz
abc-95523936e9028f392b80a95c0eebda3a0c731f33.tar.bz2
abc-95523936e9028f392b80a95c0eebda3a0c731f33.zip
&exorcism: read ESOP-PLA from file.
Diffstat (limited to 'src/base')
-rw-r--r--src/base/abci/abc.c16
-rw-r--r--src/base/exor/exor.c2
2 files changed, 15 insertions, 3 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 90ba1bf0..0e527058 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -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;
}
diff --git a/src/base/exor/exor.c b/src/base/exor/exor.c
index 75cd9e3f..6e95b84e 100644
--- a/src/base/exor/exor.c
+++ b/src/base/exor/exor.c
@@ -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 ) );
}
}