summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2022-02-16 15:32:53 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2022-02-16 15:32:53 -0800
commitea5648db3f5cc48a2c370be43d8f313db3683967 (patch)
tree82c35b975abc6bb1bb7782b9182ff5e3b4e67972 /src
parent6345832dba505bc60f78e5d165ca29d3842cbbd6 (diff)
downloadabc-ea5648db3f5cc48a2c370be43d8f313db3683967.tar.gz
abc-ea5648db3f5cc48a2c370be43d8f313db3683967.tar.bz2
abc-ea5648db3f5cc48a2c370be43d8f313db3683967.zip
Improving truth table handling.
Diffstat (limited to 'src')
-rw-r--r--src/base/abc/abcSop.c2
-rw-r--r--src/base/abci/abc.c17
-rw-r--r--src/base/io/io.c10
3 files changed, 27 insertions, 2 deletions
diff --git a/src/base/abc/abcSop.c b/src/base/abc/abcSop.c
index a560a249..8250102a 100644
--- a/src/base/abc/abcSop.c
+++ b/src/base/abc/abcSop.c
@@ -924,7 +924,7 @@ int Abc_SopCheckReadTruth( Vec_Ptr_t * vRes, char * pToken, int fHex )
int Log2 = Abc_Base2Log( strlen(pToken) );
if ( (1 << Log2) != (int)strlen(pToken) )
{
- printf( "The truth table length (%d) is not power-of-2.\n", strlen(pToken) );
+ printf( "The truth table length (%d) is not power-of-2.\n", (int)strlen(pToken) );
Vec_PtrFreeData( vRes );
Vec_PtrShrink( vRes, 0 );
return 0;
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 1d97f5e4..c92917ac 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -37868,7 +37868,22 @@ int Abc_CommandAbc9Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
}
}
// compute the miter
- pMiter = Gia_ManMiter( pGias[0], pGias[1], 0, !fUseNew, 0, 0, pPars->fVerbose );
+ if ( Gia_ManCiNum(pGias[0]) < 6 )
+ {
+ Gia_Man_t * pGias0 = Gia_ManDup( pGias[0] );
+ Gia_Man_t * pGias1 = Gia_ManDup( pGias[1] );
+ for ( c = Gia_ManCiNum(pGias[0]); c < 6; c++ )
+ {
+ Gia_ManAppendCi(pGias0);
+ Gia_ManAppendCi(pGias1);
+ }
+ pMiter = Gia_ManMiter( pGias0, pGias1, 0, !fUseNew, 0, 0, pPars->fVerbose );
+ Gia_ManStop( pGias0 );
+ Gia_ManStop( pGias1 );
+ }
+ else
+ pMiter = Gia_ManMiter( pGias[0], pGias[1], 0, !fUseNew, 0, 0, pPars->fVerbose );
+
if ( pMiter )
{
if ( fDumpMiter )
diff --git a/src/base/io/io.c b/src/base/io/io.c
index 72fd25bf..26bfb1f4 100644
--- a/src/base/io/io.c
+++ b/src/base/io/io.c
@@ -1142,7 +1142,17 @@ int IoCommandReadTruth( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
if ( fFile )
+ {
+ FILE * pFile = fopen( argv[globalUtilOptind], "rb" );
+ if ( pFile == NULL )
+ {
+ printf( "The file \"%s\" cannot be found.\n", argv[globalUtilOptind] );
+ return 1;
+ }
+ else
+ fclose( pFile );
pStr = Extra_FileReadContents( argv[globalUtilOptind] );
+ }
else
pStr = argv[globalUtilOptind];