summaryrefslogtreecommitdiffstats
path: root/src/aig/gia/giaSimBase.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2020-09-13 19:17:16 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2020-09-13 19:17:16 -0700
commit07bf95f48019dd5472ffffbd32587879e1bcbb9f (patch)
tree4d3b7257499d4b3c017f1f15dfda9ddbfad87ce2 /src/aig/gia/giaSimBase.c
parenta2c3c21031d0e83f15c8182924a908f54bbb5ab7 (diff)
downloadabc-07bf95f48019dd5472ffffbd32587879e1bcbb9f.tar.gz
abc-07bf95f48019dd5472ffffbd32587879e1bcbb9f.tar.bz2
abc-07bf95f48019dd5472ffffbd32587879e1bcbb9f.zip
Experiments with iterative synthesis.
Diffstat (limited to 'src/aig/gia/giaSimBase.c')
-rw-r--r--src/aig/gia/giaSimBase.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/aig/gia/giaSimBase.c b/src/aig/gia/giaSimBase.c
index efa4c187..f12cc83f 100644
--- a/src/aig/gia/giaSimBase.c
+++ b/src/aig/gia/giaSimBase.c
@@ -113,7 +113,13 @@ static inline void Gia_ManSimPatSimPo( Gia_Man_t * p, int i, Gia_Obj_t * pObj, i
word * pSims0 = pSims + nWords*Gia_ObjFaninId0(pObj, i);
word * pSims2 = pSims + nWords*i; int w;
for ( w = 0; w < nWords; w++ )
- pSims2[w] = (pSims0[w] ^ Diff0);
+ pSims2[w] = (pSims0[w] ^ Diff0);
+}
+static inline void Gia_ManSimPatSimNot( Gia_Man_t * p, int i, Gia_Obj_t * pObj, int nWords, Vec_Wrd_t * vSims )
+{
+ word * pSims = Vec_WrdArray(vSims) + nWords*i; int w;
+ for ( w = 0; w < nWords; w++ )
+ pSims[w] = ~pSims[w];
}
Vec_Wrd_t * Gia_ManSimPatSim( Gia_Man_t * pGia )
{
@@ -128,6 +134,20 @@ Vec_Wrd_t * Gia_ManSimPatSim( Gia_Man_t * pGia )
Gia_ManSimPatSimPo( pGia, Gia_ObjId(pGia, pObj), pObj, nWords, vSims );
return vSims;
}
+void Gia_ManSimPatResim( Gia_Man_t * pGia, Vec_Int_t * vObjs, int nWords, Vec_Wrd_t * vSims )
+{
+ Gia_Obj_t * pObj; int i;
+ Gia_ManForEachObjVec( vObjs, pGia, pObj, i )
+ if ( i == 0 )
+ Gia_ManSimPatSimNot( pGia, Gia_ObjId(pGia, pObj), pObj, nWords, vSims );
+ else if ( Gia_ObjIsAnd(pObj) )
+ Gia_ManSimPatSimAnd( pGia, Gia_ObjId(pGia, pObj), pObj, nWords, vSims );
+ else if ( !Gia_ObjIsCo(pObj) ) assert(0);
+}
+void Gia_ManSimPatWrite( char * pFileName, Vec_Wrd_t * vSimsIn, int nWords )
+{
+ Vec_WrdDumpHex( pFileName, vSimsIn, nWords, 0 );
+}
/**Function*************************************************************