summaryrefslogtreecommitdiffstats
path: root/src/base/io/ioWriteCnf.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-01-21 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2007-01-21 08:01:00 -0800
commit2167d6c148191f7aa65381bb0618b64050bf4de3 (patch)
tree345f5cc859142b50f01d261073688e880e61b631 /src/base/io/ioWriteCnf.c
parent76bcf6b25411e1b0d73e5dff6c8fd3e2f4bab9e1 (diff)
downloadabc-2167d6c148191f7aa65381bb0618b64050bf4de3.tar.gz
abc-2167d6c148191f7aa65381bb0618b64050bf4de3.tar.bz2
abc-2167d6c148191f7aa65381bb0618b64050bf4de3.zip
Version abc70121
Diffstat (limited to 'src/base/io/ioWriteCnf.c')
-rw-r--r--src/base/io/ioWriteCnf.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/base/io/ioWriteCnf.c b/src/base/io/ioWriteCnf.c
index 24612566..f12a1297 100644
--- a/src/base/io/ioWriteCnf.c
+++ b/src/base/io/ioWriteCnf.c
@@ -41,14 +41,13 @@ static Abc_Ntk_t * s_pNtk = NULL;
SeeAlso []
***********************************************************************/
-int Io_WriteCnf( Abc_Ntk_t * pNtk, char * pFileName )
+int Io_WriteCnf( Abc_Ntk_t * pNtk, char * pFileName, int fAllPrimes )
{
solver * pSat;
- if ( !Abc_NtkIsStrash(pNtk) )
- {
- fprintf( stdout, "Io_WriteCnf(): Currently can only process AIGs.\n" );
- return 0;
- }
+ if ( Abc_NtkIsStrash(pNtk) )
+ printf( "Io_WriteCnf() warning: Generating CNF by applying heuristic AIG to CNF conversion.\n" );
+ else
+ printf( "Io_WriteCnf() warning: Generating CNF by convering logic nodes into CNF clauses.\n" );
if ( Abc_NtkPoNum(pNtk) != 1 )
{
fprintf( stdout, "Io_WriteCnf(): Currently can only process the miter (the network with one PO).\n" );
@@ -64,8 +63,11 @@ int Io_WriteCnf( Abc_Ntk_t * pNtk, char * pFileName )
fprintf( stdout, "The network has no logic nodes. No CNF file is generaled.\n" );
return 0;
}
+ // convert to logic BDD network
+ if ( Abc_NtkIsLogic(pNtk) )
+ Abc_NtkLogicToBdd( pNtk );
// create solver with clauses
- pSat = Abc_NtkMiterSatCreate( pNtk, 0 );
+ pSat = Abc_NtkMiterSatCreate( pNtk, 0, fAllPrimes );
if ( pSat == NULL )
{
fprintf( stdout, "The problem is trivially UNSAT. No CNF file is generated.\n" );