diff options
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/util/utilTruth.h | 6 | ||||
-rw-r--r-- | src/misc/vec/vecMem.h | 24 |
2 files changed, 23 insertions, 7 deletions
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h index 0072a808..65b646fa 100644 --- a/src/misc/util/utilTruth.h +++ b/src/misc/util/utilTruth.h @@ -128,6 +128,12 @@ static inline void Abc_TtFill( word * pOut, int nWords ) for ( w = 0; w < nWords; w++ ) pOut[w] = ~(word)0; } +static inline void Abc_TtUnit( word * pOut, int nWords ) +{ + int w; + for ( w = 0; w < nWords; w++ ) + pOut[w] = s_Truths6[0]; +} static inline void Abc_TtNot( word * pOut, int nWords ) { int w; diff --git a/src/misc/vec/vecMem.h b/src/misc/vec/vecMem.h index eaa9481f..cba76a59 100644 --- a/src/misc/vec/vecMem.h +++ b/src/misc/vec/vecMem.h @@ -268,16 +268,26 @@ static inline void Vec_MemShrink( Vec_Mem_t * p, int nEntriesNew ) SeeAlso [] ***********************************************************************/ -static inline void Vec_MemPrint( Vec_Mem_t * p ) +static inline void Vec_MemDumpDigit( FILE * pFile, int HexDigit ) +{ + assert( HexDigit >= 0 && HexDigit < 16 ); + if ( HexDigit < 10 ) + fprintf( pFile, "%d", HexDigit ); + else + fprintf( pFile, "%c", 'A' + HexDigit-10 ); +} +static inline void Vec_MemDump( FILE * pFile, Vec_Mem_t * pVec ) { word * pEntry; - int i; - printf( "Memory vector has %d entries: ", Vec_MemEntryNum(p) ); - Vec_MemForEachEntry( p, pEntry, i ) + int i, w, d; + if ( pFile == stdout ) + printf( "Memory vector has %d entries: ", Vec_MemEntryNum(pVec) ); + Vec_MemForEachEntry( pVec, pEntry, i ) { - printf( "%3d : ", i ); - // add printout here - printf( "\n" ); + for ( w = pVec->nEntrySize - 1; w >= 0; w-- ) + for ( d = 15; d >= 0; d-- ) + Vec_MemDumpDigit( pFile, (int)(pEntry[w] >> (d<<2)) & 15 ); + fprintf( pFile, "\n" ); } } |