From b29e8a777bd2b16e891da323485e7473d9843039 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Wed, 13 Apr 2022 18:54:55 +0200 Subject: Make read_cex able to append if some latches are missing --- src/base/io/io.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/base/io/io.c b/src/base/io/io.c index 3874a6cf..03443e95 100644 --- a/src/base/io/io.c +++ b/src/base/io/io.c @@ -705,6 +705,9 @@ int Abc_NtkReadCexFile( char * pFileName, Abc_Ntk_t * pNtk, Abc_Cex_t ** ppCex, nFrames = -1; int status = 0; int i; + int nRegsNtk = 0; + Abc_Obj_t * pObj; + Abc_NtkForEachLatch( pNtk, pObj, i ) nRegsNtk++; Buffer = ABC_ALLOC( char, MaxLine ); while ( fgets( Buffer, MaxLine, pFile ) != NULL ) @@ -766,6 +769,14 @@ int Abc_NtkReadCexFile( char * pFileName, Abc_Ntk_t * pNtk, Abc_Cex_t ** ppCex, } } nRegs = Vec_IntSize(vNums); + if ( nRegs < nRegsNtk ) + { + printf( "WARNING: Register number is smaller then in Ntk. Appending.\n" ); + for (i=0; i Date: Fri, 15 Apr 2022 11:42:56 +0200 Subject: Fix for unhandled aiw file commands --- src/base/io/io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/base/io/io.c b/src/base/io/io.c index 03443e95..27742664 100644 --- a/src/base/io/io.c +++ b/src/base/io/io.c @@ -712,7 +712,7 @@ int Abc_NtkReadCexFile( char * pFileName, Abc_Ntk_t * pNtk, Abc_Cex_t ** ppCex, Buffer = ABC_ALLOC( char, MaxLine ); while ( fgets( Buffer, MaxLine, pFile ) != NULL ) { - if ( Buffer[0] == '#' ) + if ( Buffer[0] == '#' || Buffer[0] == 'c' || Buffer[0] == 'f' || Buffer[0] == 'u' ) continue; Buffer[strlen(Buffer) - 1] = '\0'; if (state==0 && strlen(Buffer)>1) { @@ -722,7 +722,7 @@ int Abc_NtkReadCexFile( char * pFileName, Abc_Ntk_t * pNtk, Abc_Cex_t ** ppCex, iPo = 0; status = 1; } - if (state==1 && Buffer[0]!='b' && Buffer[0]!='c') { + if (state==1 && Buffer[0]!='b' && Buffer[0]!='j') { // old format detected, first line was actually register *fOldFormat = 1; state = 3; -- cgit v1.2.3