summaryrefslogtreecommitdiffstats
path: root/src/aig/gia
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-03-28 11:05:12 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-03-28 11:05:12 -0700
commit6cb3817a91d7fd14fc93fb02b80e82b5598e9f79 (patch)
tree40e27af3b53ad9cf3b7a8aff79ceff44b66e5dee /src/aig/gia
parentc6663b04c7bd11482f3beb50ee99ff39c839a6bc (diff)
downloadabc-6cb3817a91d7fd14fc93fb02b80e82b5598e9f79.tar.gz
abc-6cb3817a91d7fd14fc93fb02b80e82b5598e9f79.tar.bz2
abc-6cb3817a91d7fd14fc93fb02b80e82b5598e9f79.zip
Ternary simulation for multi-output miters.
Diffstat (limited to 'src/aig/gia')
-rw-r--r--src/aig/gia/giaUtil.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/aig/gia/giaUtil.c b/src/aig/gia/giaUtil.c
index 56aa2468..872f4086 100644
--- a/src/aig/gia/giaUtil.c
+++ b/src/aig/gia/giaUtil.c
@@ -1820,6 +1820,60 @@ Vec_Int_t * Gia_ManGroupProve( Gia_Man_t * pInit, char * pCommLine, int nGroupSi
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Int_t * Gia_ManPoXSim( Gia_Man_t * p, int nFrames, int fVerbose )
+{
+ Vec_Int_t * vRes;
+ Gia_Obj_t * pObj;
+ int f, k, nLeft = Gia_ManPoNum(p);
+ vRes = Vec_IntAlloc( Gia_ManPoNum(p) );
+ Vec_IntFill( vRes, Gia_ManPoNum(p), nFrames );
+ Gia_ObjTerSimSet0( Gia_ManConst0(p) );
+ Gia_ManForEachRi( p, pObj, k )
+ Gia_ObjTerSimSet0( pObj );
+ for ( f = 0; f < nFrames; f++ )
+ {
+ Gia_ManForEachPi( p, pObj, k )
+ Gia_ObjTerSimSetX( pObj );
+ Gia_ManForEachRo( p, pObj, k )
+ Gia_ObjTerSimRo( p, pObj );
+ Gia_ManForEachAnd( p, pObj, k )
+ Gia_ObjTerSimAnd( pObj );
+ Gia_ManForEachCo( p, pObj, k )
+ Gia_ObjTerSimCo( pObj );
+ if ( fVerbose )
+ {
+ Gia_ManForEachPo( p, pObj, k )
+ Gia_ObjTerSimPrint( pObj );
+ printf( "\n" );
+ }
+ Gia_ManForEachPo( p, pObj, k )
+ if ( Vec_IntEntry(vRes, k) == nFrames && Gia_ObjTerSimGetX(pObj) )
+ Vec_IntWriteEntry(vRes, k, f), nLeft--;
+ if ( nLeft == 0 )
+ break;
+ }
+ if ( fVerbose )
+ {
+ if ( nLeft == 0 )
+ printf( "Simulation converged after %d frames.\n", f+1 );
+ else
+ printf( "Simulation terminated after %d frames.\n", nFrames );
+ }
+// Vec_IntPrint( vRes );
+ return vRes;
+}
+
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////