From 6130e39b18b5f53902e4eab14f6d5cdde5219563 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Mon, 1 Nov 2010 01:35:04 -0700 Subject: initial commit of public abc --- src/aig/bdc/bdc.h | 17 +++++++++++------ src/aig/bdc/bdcCore.c | 11 +++++++++-- src/aig/bdc/bdcDec.c | 5 +++++ src/aig/bdc/bdcInt.h | 20 +++++++++++++------- src/aig/bdc/bdcTable.c | 5 +++++ src/aig/bdc/bdc_.c | 5 +++++ 6 files changed, 48 insertions(+), 15 deletions(-) (limited to 'src/aig/bdc') diff --git a/src/aig/bdc/bdc.h b/src/aig/bdc/bdc.h index 0bdccf2b..8a240b0c 100644 --- a/src/aig/bdc/bdc.h +++ b/src/aig/bdc/bdc.h @@ -21,6 +21,7 @@ #ifndef __BDC_H__ #define __BDC_H__ + //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// @@ -29,9 +30,10 @@ /// PARAMETERS /// //////////////////////////////////////////////////////////////////////// -#ifdef __cplusplus -extern "C" { -#endif + + +ABC_NAMESPACE_HEADER_START + //////////////////////////////////////////////////////////////////////// /// BASIC TYPES /// @@ -72,12 +74,15 @@ extern int Bdc_ManNodeNum( Bdc_Man_t * p ); extern Bdc_Fun_t * Bdc_FuncFanin0( Bdc_Fun_t * p ); extern Bdc_Fun_t * Bdc_FuncFanin1( Bdc_Fun_t * p ); extern void * Bdc_FuncCopy( Bdc_Fun_t * p ); +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 ); + + + +ABC_NAMESPACE_HEADER_END -#ifdef __cplusplus -} -#endif #endif diff --git a/src/aig/bdc/bdcCore.c b/src/aig/bdc/bdcCore.c index fea08115..58324f81 100644 --- a/src/aig/bdc/bdcCore.c +++ b/src/aig/bdc/bdcCore.c @@ -20,6 +20,9 @@ #include "bdcInt.h" +ABC_NAMESPACE_IMPL_START + + //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// @@ -46,7 +49,9 @@ int Bdc_ManNodeNum( Bdc_Man_t * p ) { return p->nNode Bdc_Fun_t * Bdc_FuncFanin0( Bdc_Fun_t * p ) { return p->pFan0; } Bdc_Fun_t * Bdc_FuncFanin1( Bdc_Fun_t * p ) { return p->pFan1; } void * Bdc_FuncCopy( Bdc_Fun_t * p ) { return p->pCopy; } +int Bdc_FuncCopyInt( Bdc_Fun_t * p ) { return p->iCopy; } void Bdc_FuncSetCopy( Bdc_Fun_t * p, void * pCopy ) { p->pCopy = pCopy; } +void Bdc_FuncSetCopyInt( Bdc_Fun_t * p, int iCopy ) { p->iCopy = iCopy; } /**Function************************************************************* @@ -160,13 +165,13 @@ void Bdc_ManPrepare( Bdc_Man_t * p, Vec_Ptr_t * vDivs ) { pNode = Bdc_FunNew( p ); pNode->Type = BDC_TYPE_PI; - pNode->puFunc = Vec_PtrEntry( p->vTruths, i ); + pNode->puFunc = (unsigned *)Vec_PtrEntry( p->vTruths, i ); pNode->uSupp = (1 << i); Bdc_TableAdd( p, pNode ); } // add the divisors if ( vDivs ) - Vec_PtrForEachEntry( vDivs, puTruth, i ) + Vec_PtrForEachEntry( unsigned *, vDivs, puTruth, i ) { pNode = Bdc_FunNew( p ); pNode->Type = BDC_TYPE_PI; @@ -305,3 +310,5 @@ void Bdc_ManDecomposeTest( unsigned uTruth, int nVars ) //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + diff --git a/src/aig/bdc/bdcDec.c b/src/aig/bdc/bdcDec.c index ccf6248f..61f46f17 100644 --- a/src/aig/bdc/bdcDec.c +++ b/src/aig/bdc/bdcDec.c @@ -20,6 +20,9 @@ #include "bdcInt.h" +ABC_NAMESPACE_IMPL_START + + //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// @@ -744,3 +747,5 @@ Extra_PrintBinary( stdout, pIsf->puOff, 1<<4 );printf("\n"); //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + diff --git a/src/aig/bdc/bdcInt.h b/src/aig/bdc/bdcInt.h index 71ad8449..74630664 100644 --- a/src/aig/bdc/bdcInt.h +++ b/src/aig/bdc/bdcInt.h @@ -21,6 +21,7 @@ #ifndef __BDC_INT_H__ #define __BDC_INT_H__ + //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// @@ -32,9 +33,10 @@ /// PARAMETERS /// //////////////////////////////////////////////////////////////////////// -#ifdef __cplusplus -extern "C" { -#endif + + +ABC_NAMESPACE_HEADER_START + #define BDC_SCALE 1000 // value used to compute the cost @@ -62,7 +64,9 @@ struct Bdc_Fun_t_ unsigned uSupp; // bit mask of current support unsigned * puFunc; // the function of the node Bdc_Fun_t * pNext; // next function with same support - void * pCopy; // the copy field + union { int iCopy; // the literal of the node (AIG) + void * pCopy; }; // the function of the node (BDD or AIG) + }; typedef struct Bdc_Isf_t_ Bdc_Isf_t; @@ -147,9 +151,11 @@ extern void Bdc_TableAdd( Bdc_Man_t * p, Bdc_Fun_t * pFunc ); extern void Bdc_TableClear( Bdc_Man_t * p ); extern int Bdc_TableCheckContainment( Bdc_Man_t * p, Bdc_Isf_t * pIsf, unsigned * puTruth ); -#ifdef __cplusplus -} -#endif + + +ABC_NAMESPACE_HEADER_END + + #endif diff --git a/src/aig/bdc/bdcTable.c b/src/aig/bdc/bdcTable.c index 3a6ed126..69f35d88 100644 --- a/src/aig/bdc/bdcTable.c +++ b/src/aig/bdc/bdcTable.c @@ -20,6 +20,9 @@ #include "bdcInt.h" +ABC_NAMESPACE_IMPL_START + + //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// @@ -127,3 +130,5 @@ void Bdc_TableClear( Bdc_Man_t * p ) //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + diff --git a/src/aig/bdc/bdc_.c b/src/aig/bdc/bdc_.c index 9d0a9462..b29d4f5e 100644 --- a/src/aig/bdc/bdc_.c +++ b/src/aig/bdc/bdc_.c @@ -20,6 +20,9 @@ #include "bdcInt.h" +ABC_NAMESPACE_IMPL_START + + //////////////////////////////////////////////////////////////////////// /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// @@ -47,3 +50,5 @@ //////////////////////////////////////////////////////////////////////// +ABC_NAMESPACE_IMPL_END + -- cgit v1.2.3