From ff1fd41a474849af69fafb66fe1cac2cce7bb61b Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sun, 15 Feb 2015 21:57:42 -0800 Subject: Modifications to read SMTLIB file from stdin. --- src/base/wlc/wlcNtk.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'src/base/wlc/wlcNtk.c') diff --git a/src/base/wlc/wlcNtk.c b/src/base/wlc/wlcNtk.c index 48171c35..1576ef45 100644 --- a/src/base/wlc/wlcNtk.c +++ b/src/base/wlc/wlcNtk.c @@ -209,6 +209,7 @@ void Wlc_NtkFree( Wlc_Ntk_t * p ) Vec_IntFreeP( &p->vInits ); ABC_FREE( p->vTravIds.pArray ); ABC_FREE( p->vNameIds.pArray ); + ABC_FREE( p->vValues.pArray ); ABC_FREE( p->vCopies.pArray ); ABC_FREE( p->pInits ); ABC_FREE( p->pObjs ); @@ -496,6 +497,52 @@ void Wlc_NtkTransferNames( Wlc_Ntk_t * pNew, Wlc_Ntk_t * p ) pNew->vTables = p->vTables; p->vTables = NULL; } +/**Function************************************************************* + + Synopsis [Report results.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Wlc_NtkReport( Wlc_Ntk_t * p, Vec_Int_t * vAssign ) +{ + //sat +//((s0 #x12000000070000000000c0000085006b)) +//((s1 #x0e008f00ff0000000000ff0000ed0040)) +//((s2 #x96008f00ff0000000000ff0000ed0040)) + + int i, Name, Start, nBits, k; + Vec_Str_t * vNum = Vec_StrAlloc( 100 ); +// Vec_IntForEachEntryTriple( &p->vValues, Name, Start, nBits, i ) +// printf( "Variable %s : %d %d\n", Abc_NamStr(p->pManName, Name), Start, nBits ); + printf( "sat\n" ); + Vec_IntForEachEntryTriple( &p->vValues, Name, Start, nBits, i ) + { + Vec_StrClear( vNum ); + for ( k = Start; k < Start + nBits; ) + { + int j, Digit = 0; + for ( j = 0; j < 4 && k < Start + nBits; j++, k++ ) + Digit += (1 << j) * Vec_IntEntry(vAssign, k); + assert( Digit >= 0 && Digit < 16 ); + if ( Digit >= 0 && Digit <= 9 ) + Vec_StrPush( vNum, (char)('0' + Digit) ); + else + Vec_StrPush( vNum, (char)('a' + Digit - 10) ); + } + Vec_StrPush( vNum, 'x' ); + Vec_StrPush( vNum, '#' ); + Vec_StrReverseOrder( vNum ); + Vec_StrPush( vNum, '\0' ); + printf( "((%s %s))\n", Abc_NamStr(p->pManName, Name), Vec_StrArray(vNum) ); + } + Vec_StrFree( vNum ); +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// -- cgit v1.2.3