summaryrefslogtreecommitdiffstats
path: root/src/aig/gia
diff options
context:
space:
mode:
Diffstat (limited to 'src/aig/gia')
-rw-r--r--src/aig/gia/gia.h9
-rw-r--r--src/aig/gia/giaDup.c5
-rw-r--r--src/aig/gia/giaMan.c1
-rw-r--r--src/aig/gia/giaSimBase.c27
4 files changed, 23 insertions, 19 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h
index 0e281b7c..f75d873c 100644
--- a/src/aig/gia/gia.h
+++ b/src/aig/gia/gia.h
@@ -238,6 +238,7 @@ struct Gia_Man_t_
Gia_Man_t * pUserAig;
Vec_Ptr_t * vUserNames;
Vec_Wec_t * vUserNodes;
+ Vec_Wec_t * vUserSupps;
Vec_Int_t * vUserArray;
};
@@ -726,8 +727,8 @@ static inline int Gia_ManAppendXorReal( Gia_Man_t * p, int iLit0, int iLit1 )
assert( iLit0 >= 0 && Abc_Lit2Var(iLit0) < Gia_ManObjNum(p) );
assert( iLit1 >= 0 && Abc_Lit2Var(iLit1) < Gia_ManObjNum(p) );
assert( Abc_Lit2Var(iLit0) != Abc_Lit2Var(iLit1) );
- assert( !Abc_LitIsCompl(iLit0) );
- assert( !Abc_LitIsCompl(iLit1) );
+ //assert( !Abc_LitIsCompl(iLit0) );
+ //assert( !Abc_LitIsCompl(iLit1) );
if ( Abc_Lit2Var(iLit0) > Abc_Lit2Var(iLit1) )
{
pObj->iDiff0 = (unsigned)(Gia_ObjId(p, pObj) - Abc_Lit2Var(iLit0));
@@ -860,7 +861,6 @@ static inline int Gia_ManAppendXor2( Gia_Man_t * p, int iLit0, int iLit1 )
static inline int Gia_ManAppendXorReal2( Gia_Man_t * p, int iLit0, int iLit1 )
{
- int fCompl;
if ( !p->fGiaSimple )
{
if ( iLit0 < 2 )
@@ -872,8 +872,7 @@ static inline int Gia_ManAppendXorReal2( Gia_Man_t * p, int iLit0, int iLit1 )
if ( iLit0 == Abc_LitNot(iLit1) )
return 1;
}
- fCompl = Abc_LitIsCompl(iLit0) ^ Abc_LitIsCompl(iLit1);
- return Abc_LitNotCond( Gia_ManAppendXorReal( p, Abc_LitRegular(iLit0), Abc_LitRegular(iLit1) ), fCompl );
+ return Gia_ManAppendXorReal( p, iLit0, iLit1 );
}
static inline void Gia_ManPatchCoDriver( Gia_Man_t * p, int iCoIndex, int iLit0 )
diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c
index e05380d5..a1aaadf3 100644
--- a/src/aig/gia/giaDup.c
+++ b/src/aig/gia/giaDup.c
@@ -3471,7 +3471,10 @@ Gia_Man_t * Gia_ManDupCones( Gia_Man_t * p, int * pPos, int nPos, int fTrimPis )
Gia_ObjRiToRo(p, pObj)->Value = Gia_ManAppendCi( pNew );
// create internal nodes
Vec_PtrForEachEntry( Gia_Obj_t *, vNodes, pObj, i )
- pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
+ if ( Gia_ObjIsXor(pObj) )
+ pObj->Value = Gia_ManAppendXor( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
+ else
+ pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
// create COs
Vec_PtrForEachEntry( Gia_Obj_t *, vRoots, pObj, i )
Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
diff --git a/src/aig/gia/giaMan.c b/src/aig/gia/giaMan.c
index 2c10bedf..bb8851ec 100644
--- a/src/aig/gia/giaMan.c
+++ b/src/aig/gia/giaMan.c
@@ -93,6 +93,7 @@ void Gia_ManStop( Gia_Man_t * p )
Gia_ManStopP( &p->pUserAig );
Vec_PtrFreeFree( p->vUserNames );
Vec_WecFreeP( &p->vUserNodes );
+ Vec_WecFreeP( &p->vUserSupps );
Vec_IntFreeP( &p->vUserArray );
Vec_IntFreeP( &p->vSwitching );
Vec_IntFreeP( &p->vSuper );
diff --git a/src/aig/gia/giaSimBase.c b/src/aig/gia/giaSimBase.c
index ff658eff..95508d70 100644
--- a/src/aig/gia/giaSimBase.c
+++ b/src/aig/gia/giaSimBase.c
@@ -78,13 +78,6 @@ struct Gia_SimAbsMan_t_
SeeAlso []
***********************************************************************/
-Vec_Wrd_t * Gia_ManSimPatGenRandom( int nWords )
-{
- Vec_Wrd_t * vSims = Vec_WrdAlloc( nWords ); int i;
- for ( i = 0; i < nWords; i++ )
- Vec_WrdPush( vSims, Gia_ManRandomW(0) );
- return vSims;
-}
void Gia_ManSimPatAssignInputs( Gia_Man_t * p, int nWords, Vec_Wrd_t * vSims, Vec_Wrd_t * vSimsIn )
{
int i, Id;
@@ -102,8 +95,12 @@ static inline void Gia_ManSimPatSimAnd( Gia_Man_t * p, int i, Gia_Obj_t * pObj,
word * pSims0 = pSims + nWords*Gia_ObjFaninId0(pObj, i);
word * pSims1 = pSims + nWords*Gia_ObjFaninId1(pObj, i);
word * pSims2 = pSims + nWords*i; int w;
- for ( w = 0; w < nWords; w++ )
- pSims2[w] = (pSims0[w] ^ Diff0) & (pSims1[w] ^ Diff1);
+ if ( Gia_ObjIsXor(pObj) )
+ for ( w = 0; w < nWords; w++ )
+ pSims2[w] = (pSims0[w] ^ Diff0) ^ (pSims1[w] ^ Diff1);
+ else
+ for ( w = 0; w < nWords; w++ )
+ pSims2[w] = (pSims0[w] ^ Diff0) & (pSims1[w] ^ Diff1);
}
static inline void Gia_ManSimPatSimPo( Gia_Man_t * p, int i, Gia_Obj_t * pObj, int nWords, Vec_Wrd_t * vSims )
{
@@ -173,7 +170,7 @@ Vec_Wrd_t * Gia_ManSimPatValues( Gia_Man_t * p )
SeeAlso []
-***********************************************************************/\
+***********************************************************************/
Vec_Wrd_t * Gia_ManSimCombine( int nInputs, Vec_Wrd_t * vBase, Vec_Wrd_t * vAddOn, int nWordsUse )
{
int nWordsBase = Vec_WrdSize(vBase) / nInputs;
@@ -226,7 +223,7 @@ Vec_Wrd_t * Gia_ManSimBitPacking( Gia_Man_t * p, Vec_Int_t * vCexStore, int nCex
{
int c, iCur = 0, iPat = 0;
int nWordsMax = Abc_Bit6WordNum( nCexes );
- Vec_Wrd_t * vSimsIn = Gia_ManSimPatGenRandom( Gia_ManCiNum(p) * nWordsMax );
+ Vec_Wrd_t * vSimsIn = Vec_WrdStartRandom( Gia_ManCiNum(p) * nWordsMax );
Vec_Wrd_t * vSimsCare = Vec_WrdStart( Gia_ManCiNum(p) * nWordsMax );
Vec_Wrd_t * vSimsRes = NULL;
for ( c = 0; c < nCexes; c++ )
@@ -586,8 +583,12 @@ static inline void Gia_SimRsbSimAndCareSet( Gia_Man_t * p, int i, Gia_Obj_t * pO
word * pSims0 = Vec_WrdEntryP( vSims0, nWords*Gia_ObjFaninId0(pObj, i) );
word * pSims1 = Vec_WrdEntryP( vSims1, nWords*Gia_ObjFaninId1(pObj, i) );
word * pSims2 = Vec_WrdEntryP( vSims2, nWords*i ); int w;
- for ( w = 0; w < nWords; w++ )
- pSims2[w] = (pSims0[w] ^ Diff0) & (pSims1[w] ^ Diff1);
+ if ( Gia_ObjIsXor(pObj) )
+ for ( w = 0; w < nWords; w++ )
+ pSims2[w] = (pSims0[w] ^ Diff0) ^ (pSims1[w] ^ Diff1);
+ else
+ for ( w = 0; w < nWords; w++ )
+ pSims2[w] = (pSims0[w] ^ Diff0) & (pSims1[w] ^ Diff1);
}
word * Gia_SimRsbCareSet( Gia_SimRsbMan_t * p, int iObj, Vec_Int_t * vTfo )
{