Added/moved several APIs.

This commit is contained in:
Alan Mishchenko 2012-04-10 00:28:36 -07:00
parent f380bb5ac1
commit f16457aaf5
4 changed files with 20 additions and 13 deletions

View File

@ -28,10 +28,6 @@ ABC_NAMESPACE_IMPL_START
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
static inline int Bdc_FunObjCopy( Bdc_Fun_t * pObj ) { return Abc_LitNotCond( Bdc_FuncCopyInt(Bdc_Regular(pObj)), Bdc_IsComplement(pObj) ); }
static inline int Bdc_FunFanin0Copy( Bdc_Fun_t * pObj ) { return Bdc_FunObjCopy( Bdc_FuncFanin0(pObj) ); }
static inline int Bdc_FunFanin1Copy( Bdc_Fun_t * pObj ) { return Bdc_FunObjCopy( Bdc_FuncFanin1(pObj) ); }
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
////////////////////////////////////////////////////////////////////////

View File

@ -78,6 +78,10 @@ extern int Bdc_FuncCopyInt( Bdc_Fun_t * p );
extern void Bdc_FuncSetCopy( Bdc_Fun_t * p, void * pCopy );
extern void Bdc_FuncSetCopyInt( Bdc_Fun_t * p, int iCopy );
/*=== working with saved copies ==========================================*/
static inline int Bdc_FunObjCopy( Bdc_Fun_t * pObj ) { return Abc_LitNotCond( Bdc_FuncCopyInt(Bdc_Regular(pObj)), Bdc_IsComplement(pObj) ); }
static inline int Bdc_FunFanin0Copy( Bdc_Fun_t * pObj ) { return Bdc_FunObjCopy( Bdc_FuncFanin0(pObj) ); }
static inline int Bdc_FunFanin1Copy( Bdc_Fun_t * pObj ) { return Bdc_FunObjCopy( Bdc_FuncFanin1(pObj) ); }
ABC_NAMESPACE_HEADER_END

View File

@ -115,6 +115,7 @@ extern char * Extra_TimeStamp();
extern char * Extra_StringAppend( char * pStrGiven, char * pStrAdd );
extern unsigned Extra_ReadBinary( char * Buffer );
extern void Extra_PrintBinary( FILE * pFile, unsigned Sign[], int nBits );
extern int Extra_ReadHex( unsigned Sign[], char * pString, int nDigits );
extern int Extra_ReadHexadecimal( unsigned Sign[], char * pString, int nVars );
extern void Extra_PrintHexadecimal( FILE * pFile, unsigned Sign[], int nVars );
extern void Extra_PrintHexadecimalString( char * pString, unsigned Sign[], int nVars );

View File

@ -446,16 +446,9 @@ void Extra_PrintBinary( FILE * pFile, unsigned Sign[], int nBits )
SeeAlso []
***********************************************************************/
int Extra_ReadHexadecimal( unsigned Sign[], char * pString, int nVars )
int Extra_ReadHex( unsigned Sign[], char * pString, int nDigits )
{
int nWords, nDigits, Digit, k, c;
nWords = Extra_TruthWordNum( nVars );
for ( k = 0; k < nWords; k++ )
Sign[k] = 0;
// read the number from the string
nDigits = (1 << nVars) / 4;
if ( nDigits == 0 )
nDigits = 1;
int Digit, k, c;
for ( k = 0; k < nDigits; k++ )
{
c = nDigits-1-k;
@ -470,6 +463,19 @@ int Extra_ReadHexadecimal( unsigned Sign[], char * pString, int nVars )
}
return 1;
}
int Extra_ReadHexadecimal( unsigned Sign[], char * pString, int nVars )
{
int nWords, nDigits, k;
nWords = Extra_TruthWordNum( nVars );
for ( k = 0; k < nWords; k++ )
Sign[k] = 0;
// read the number from the string
nDigits = (1 << nVars) / 4;
if ( nDigits == 0 )
nDigits = 1;
Extra_ReadHex( Sign, pString, nDigits );
return 1;
}
/**Function*************************************************************