From ea5648db3f5cc48a2c370be43d8f313db3683967 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Wed, 16 Feb 2022 15:32:53 -0800 Subject: Improving truth table handling. --- src/base/abc/abcSop.c | 2 +- src/base/abci/abc.c | 17 ++++++++++++++++- src/base/io/io.c | 10 ++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) (limited to 'src') 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]; -- cgit v1.2.3