Commit f16457aa by Alan Mishchenko

Added/moved several APIs.

parent f380bb5a
...@@ -28,10 +28,6 @@ ABC_NAMESPACE_IMPL_START ...@@ -28,10 +28,6 @@ ABC_NAMESPACE_IMPL_START
/// DECLARATIONS /// /// 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 /// /// FUNCTION DEFINITIONS ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
......
...@@ -78,6 +78,10 @@ extern int Bdc_FuncCopyInt( Bdc_Fun_t * p ); ...@@ -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_FuncSetCopy( Bdc_Fun_t * p, void * pCopy );
extern void Bdc_FuncSetCopyInt( Bdc_Fun_t * p, int iCopy ); 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 ABC_NAMESPACE_HEADER_END
......
...@@ -115,6 +115,7 @@ extern char * Extra_TimeStamp(); ...@@ -115,6 +115,7 @@ extern char * Extra_TimeStamp();
extern char * Extra_StringAppend( char * pStrGiven, char * pStrAdd ); extern char * Extra_StringAppend( char * pStrGiven, char * pStrAdd );
extern unsigned Extra_ReadBinary( char * Buffer ); extern unsigned Extra_ReadBinary( char * Buffer );
extern void Extra_PrintBinary( FILE * pFile, unsigned Sign[], int nBits ); 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 int Extra_ReadHexadecimal( unsigned Sign[], char * pString, int nVars );
extern void Extra_PrintHexadecimal( FILE * pFile, unsigned Sign[], int nVars ); extern void Extra_PrintHexadecimal( FILE * pFile, unsigned Sign[], int nVars );
extern void Extra_PrintHexadecimalString( char * pString, unsigned Sign[], int nVars ); extern void Extra_PrintHexadecimalString( char * pString, unsigned Sign[], int nVars );
......
...@@ -446,16 +446,9 @@ void Extra_PrintBinary( FILE * pFile, unsigned Sign[], int nBits ) ...@@ -446,16 +446,9 @@ void Extra_PrintBinary( FILE * pFile, unsigned Sign[], int nBits )
SeeAlso [] 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; int 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;
for ( k = 0; k < nDigits; k++ ) for ( k = 0; k < nDigits; k++ )
{ {
c = nDigits-1-k; c = nDigits-1-k;
...@@ -470,6 +463,19 @@ int Extra_ReadHexadecimal( unsigned Sign[], char * pString, int nVars ) ...@@ -470,6 +463,19 @@ int Extra_ReadHexadecimal( unsigned Sign[], char * pString, int nVars )
} }
return 1; 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************************************************************* /**Function*************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment