Commit 81086552 by Alan Mishchenko

Integrating new MFS package with GIA manager.

parent 90a88462
......@@ -3591,6 +3591,10 @@ SOURCE=.\src\aig\gia\giaMem.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaMfs.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\gia\giaMini.c
# End Source File
# Begin Source File
......
......@@ -1112,6 +1112,7 @@ extern int Gia_ManVerifyWithBoxes( Gia_Man_t * pGia, void * pPar
extern void * Gia_ManUpdateTimMan( Gia_Man_t * p, Vec_Int_t * vBoxPres );
extern Gia_Man_t * Gia_ManUpdateExtraAig( void * pTime, Gia_Man_t * pAig, Vec_Int_t * vBoxPres );
/*=== giaTruth.c ===========================================================*/
extern word Gia_ObjComputeTruthTable6Lut( Gia_Man_t * p, int iObj, Vec_Wrd_t * vTemp );
extern word Gia_ObjComputeTruthTable6( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Int_t * vSupp, Vec_Wrd_t * vTruths );
extern int Gia_ObjCollectInternal( Gia_Man_t * p, Gia_Obj_t * pObj );
extern word * Gia_ObjComputeTruthTable( Gia_Man_t * p, Gia_Obj_t * pObj );
......
......@@ -27,6 +27,15 @@ ABC_NAMESPACE_IMPL_START
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
static word s_Truth6[6] = {
ABC_CONST(0xAAAAAAAAAAAAAAAA),
ABC_CONST(0xCCCCCCCCCCCCCCCC),
ABC_CONST(0xF0F0F0F0F0F0F0F0),
ABC_CONST(0xFF00FF00FF00FF00),
ABC_CONST(0xFFFF0000FFFF0000),
ABC_CONST(0xFFFFFFFF00000000)
};
static inline word * Gla_ObjTruthElem( Gia_Man_t * p, int i ) { return (word *)Vec_PtrEntry( p->vTtInputs, i ); }
static inline word * Gla_ObjTruthNode( Gia_Man_t * p, Gia_Obj_t * pObj ) { return Vec_WrdArray(p->vTtMemory) + p->nTtWords * Gia_ObjNum(p, pObj); }
static inline word * Gla_ObjTruthFree1( Gia_Man_t * p ) { return Vec_WrdArray(p->vTtMemory) + p->nTtWords * 254; }
......@@ -40,6 +49,44 @@ static inline word * Gla_ObjTruthDup( Gia_Man_t * p, word * pDst, word * pSrc, i
/**Function*************************************************************
Synopsis [Computes truth table of a 6-LUT.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Gia_ObjComputeTruthTable6Lut_rec( Gia_Man_t * p, int iObj, Vec_Wrd_t * vTemp )
{
word uTruth0, uTruth1;
Gia_Obj_t * pObj = Gia_ManObj( p, iObj );
if ( !Gia_ObjIsAnd(pObj) )
return;
Gia_ObjComputeTruthTable6Lut_rec( p, Gia_ObjFaninId0p(p, pObj), vTemp );
Gia_ObjComputeTruthTable6Lut_rec( p, Gia_ObjFaninId1p(p, pObj), vTemp );
uTruth0 = Vec_WrdEntry( vTemp, Gia_ObjFanin0(pObj)->Value );
uTruth0 = Gia_ObjFaninC0(pObj) ? ~uTruth0 : uTruth0;
uTruth1 = Vec_WrdEntry( vTemp, Gia_ObjFanin1(pObj)->Value );
uTruth1 = Gia_ObjFaninC1(pObj) ? ~uTruth1 : uTruth1;
Vec_WrdWriteEntry( vTemp, iObj, uTruth0 & uTruth1 );
}
word Gia_ObjComputeTruthTable6Lut( Gia_Man_t * p, int iObj, Vec_Wrd_t * vTemp )
{
Gia_Obj_t * pObj = Gia_ManObj( p, iObj );
int i, Fanin;
assert( Vec_WrdSize(vTemp) == Gia_ManObjNum(p) );
assert( Gia_ObjIsLut(p, iObj) );
Gia_LutForEachFanin( p, iObj, Fanin, i )
Vec_WrdWriteEntry( vTemp, Fanin, s_Truth6[i] );
assert( i <= 6 );
Gia_ObjComputeTruthTable6Lut_rec( p, iObj, vTemp );
return Vec_WrdEntry( vTemp, iObj );
}
/**Function*************************************************************
Synopsis [Computes truth table up to 6 inputs.]
Description []
......@@ -68,14 +115,6 @@ void Gia_ObjComputeTruthTable6_rec( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Wrd_t *
}
word Gia_ObjComputeTruthTable6( Gia_Man_t * p, Gia_Obj_t * pObj, Vec_Int_t * vSupp, Vec_Wrd_t * vTruths )
{
static word s_Truth6[6] = {
ABC_CONST(0xAAAAAAAAAAAAAAAA),
ABC_CONST(0xCCCCCCCCCCCCCCCC),
ABC_CONST(0xF0F0F0F0F0F0F0F0),
ABC_CONST(0xFF00FF00FF00FF00),
ABC_CONST(0xFFFF0000FFFF0000),
ABC_CONST(0xFFFFFFFF00000000)
};
Gia_Obj_t * pLeaf;
int i;
assert( Vec_IntSize(vSupp) <= 6 );
......
......@@ -28,6 +28,7 @@ SRC += src/aig/gia/giaAig.c \
src/aig/gia/giaIso2.c \
src/aig/gia/giaMan.c \
src/aig/gia/giaMem.c \
src/aig/gia/giaMfs.c \
src/aig/gia/giaMini.c \
src/aig/gia/giaMuxes.c \
src/aig/gia/giaPat.c \
......
......@@ -75,7 +75,8 @@ extern Vec_Int_t * Sfm_NodeReadFanins( Sfm_Ntk_t * p, int i );
extern word * Sfm_NodeReadTruth( Sfm_Ntk_t * p, int i );
extern int Sfm_NodeReadFixed( Sfm_Ntk_t * p, int i );
extern int Sfm_NodeReadUsed( Sfm_Ntk_t * p, int i );
/*=== sfmSat.c ==========================================================*/
/*=== sfmWin.c ==========================================================*/
extern Vec_Int_t * Sfm_NtkDfs( Sfm_Ntk_t * p );
ABC_NAMESPACE_HEADER_END
......
......@@ -162,6 +162,8 @@ extern void Kit_DsdPrintFromTruth( unsigned * pTruth, int nVars );
/// MACRO DEFINITIONS ///
////////////////////////////////////////////////////////////////////////
#define Sfm_NtkForEachPi( p, i ) for ( i = 0; i < p->nPis; i++ )
#define Sfm_NtkForEachPo( p, i ) for ( i = p->nObjs - p->nPos; i < p->nObjs; i++ )
#define Sfm_NtkForEachNode( p, i ) for ( i = p->nPis; i + p->nPos < p->nObjs; i++ )
#define Sfm_NtkForEachNodeReverse( p, i ) for ( i = p->nObjs - p->nPos - 1; i >= p->nPis; i-- )
#define Sfm_ObjForEachFanin( p, Node, Fan, i ) for ( i = 0; i < Sfm_ObjFaninNum(p, Node) && ((Fan = Sfm_ObjFanin(p, Node, i)), 1); i++ )
......
......@@ -123,6 +123,40 @@ static inline int Sfm_ObjIsTravIdCurrent2( Sfm_Ntk_t * p, int Id ) { return
/**Function*************************************************************
Synopsis [Collects used internal nodes in a topological order.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Sfm_NtkDfs_rec( Sfm_Ntk_t * p, int iNode, Vec_Int_t * vNodes )
{
int i, iFanin;
if ( Sfm_ObjIsPi(p, iNode) )
return;
if ( Sfm_ObjIsTravIdCurrent(p, iNode) )
return;
Sfm_ObjSetTravIdCurrent(p, iNode);
Sfm_ObjForEachFanin( p, iNode, iFanin, i )
Sfm_NtkDfs_rec( p, iFanin, vNodes );
Vec_IntPush( vNodes, iNode );
}
Vec_Int_t * Sfm_NtkDfs( Sfm_Ntk_t * p )
{
Vec_Int_t * vNodes;
int i;
vNodes = Vec_IntAlloc( p->nObjs );
Sfm_NtkIncrementTravId( p );
Sfm_NtkForEachPo( p, i )
Sfm_NtkDfs_rec( p, Sfm_ObjFanin(p, i, 0), vNodes );
return vNodes;
}
/**Function*************************************************************
Synopsis [Check if this fanout overlaps with TFI cone of the node.]
Description []
......
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