diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2020-03-01 19:03:39 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2020-03-01 19:03:39 -0800 |
commit | 73496629ec64f409cf504a805410b22164f59032 (patch) | |
tree | d2cc0b3938a7e1fca99182438c52320c0f401a7b | |
parent | e87869b737880dab9c35fccd810f66ca1aee10b1 (diff) | |
download | abc-73496629ec64f409cf504a805410b22164f59032.tar.gz abc-73496629ec64f409cf504a805410b22164f59032.tar.bz2 abc-73496629ec64f409cf504a805410b22164f59032.zip |
Several misc changes.
-rw-r--r-- | src/aig/gia/giaGen.c | 9 | ||||
-rw-r--r-- | src/aig/gia/giaSimBase.c | 4 | ||||
-rw-r--r-- | src/base/acb/acbUtil.c | 9 |
3 files changed, 17 insertions, 5 deletions
diff --git a/src/aig/gia/giaGen.c b/src/aig/gia/giaGen.c index 09a859ad..0b1ad7b5 100644 --- a/src/aig/gia/giaGen.c +++ b/src/aig/gia/giaGen.c @@ -241,8 +241,8 @@ void Gia_ManDumpPlaFiles( Gia_Man_t * p, int nCexesT, int nCexesV, int Seed, cha char pFileNameOutT[100]; char pFileNameOutV[100]; - sprintf( pFileNameOutT, "train_%s_%d.pla", pFileName ? pFileName : Gia_ManName(p), nSize[0], Gia_ManCiNum(p) ); - sprintf( pFileNameOutV, "test_%s_%d.pla", pFileName ? pFileName : Gia_ManName(p), nSize[1], Gia_ManCiNum(p) ); + sprintf( pFileNameOutT, "train_%s_%d.pla", pFileName ? pFileName : Gia_ManName(p), nSize[0] ); + sprintf( pFileNameOutV, "test_%s_%d.pla", pFileName ? pFileName : Gia_ManName(p), nSize[1] ); Gia_ManRandomW( 1 ); for ( n = 0; n < Seed; n++ ) @@ -409,6 +409,11 @@ void Gia_ManTestOneFile( Gia_Man_t * p, char * pFileName ) int nIns, nWords; if ( !Gia_ManSimParamRead( pFileName, &nIns, &nWords ) ) return; + if ( nIns != Gia_ManCiNum(p) ) + { + printf( "The number of inputs in the file \"%s\" (%d) does not match the AIG (%d).\n", pFileName, nIns, Gia_ManCiNum(p) ); + return; + } vSimsIn = Vec_WrdStart( nIns * nWords ); vValues = Vec_IntAlloc( nWords * 64 ); Gia_ManSimFileRead( pFileName, nIns, nWords, vSimsIn, vValues ); diff --git a/src/aig/gia/giaSimBase.c b/src/aig/gia/giaSimBase.c index db8008e7..ff658eff 100644 --- a/src/aig/gia/giaSimBase.c +++ b/src/aig/gia/giaSimBase.c @@ -857,7 +857,7 @@ Vec_Int_t * Gia_ManSimPatStart( int nItems ) } void Gia_ManSimRelTest( Gia_Man_t * p ) { - int nWords = Vec_WrdSize(p->vSimsPi) / Gia_ManCiNum(p); + //int nWords = Vec_WrdSize(p->vSimsPi) / Gia_ManCiNum(p); Vec_Int_t * vObjs = Gia_ManSimPatStart( 4 ); // can be CI/AND/CO Vec_Wrd_t * vVals = Gia_ManSimPatValues( p ); Vec_Wrd_t * vRel = Gia_ManSimRel( p, vObjs, vVals ); @@ -1075,7 +1075,7 @@ void Gia_SimAbsSolve( Gia_SimAbsMan_t * p ) Vec_IntForEachEntry( p->vResub, iPat, i ) printf( "%4d ", iPat ); for ( ; i < 16; i++ ) - printf( " ", iPat ); + printf( " " ); printf( " " ); Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); } diff --git a/src/base/acb/acbUtil.c b/src/base/acb/acbUtil.c index da0880f0..9e5c9457 100644 --- a/src/base/acb/acbUtil.c +++ b/src/base/acb/acbUtil.c @@ -680,7 +680,7 @@ int Acb_NtkExtract( char * pFileName0, char * pFileName1, int fVerbose, ***********************************************************************/ Vec_Int_t * Acb_NtkPlaces( char * pFileName, Vec_Ptr_t * vNames ) { - Vec_Int_t * vPlaces; int First = 1, Pos = -1; + Vec_Int_t * vPlaces; int First = 1, Pos = -1, fComment = 0; char * pTemp, * pBuffer = Extra_FileReadContents( pFileName ); char * pLimit = pBuffer + strlen(pBuffer); if ( pBuffer == NULL ) @@ -689,6 +689,13 @@ Vec_Int_t * Acb_NtkPlaces( char * pFileName, Vec_Ptr_t * vNames ) for ( pTemp = pBuffer; *pTemp; pTemp++ ) { if ( *pTemp == '\n' ) + fComment = 0; + if ( *pTemp == '/' && *(pTemp + 1) == '/' ) + fComment = 1; + if ( fComment ) + continue; + + if ( *pTemp == '\n' ) Pos = pTemp - pBuffer + 1; else if ( *pTemp == '(' ) { |