From 8888e8e82e189a599a340e83ac8094bdef1ceb51 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Thu, 23 Jun 2022 07:48:10 -0700 Subject: Experiments with the mapper. --- src/proof/acec/acecXor.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src/proof') diff --git a/src/proof/acec/acecXor.c b/src/proof/acec/acecXor.c index 71e0b7b3..963ea15b 100644 --- a/src/proof/acec/acecXor.c +++ b/src/proof/acec/acecXor.c @@ -21,6 +21,7 @@ #include "acecInt.h" #include "misc/vec/vecWec.h" #include "misc/extra/extra.h" +#include "misc/util/utilTruth.h" ABC_NAMESPACE_IMPL_START @@ -425,6 +426,48 @@ Acec_Box_t * Acec_ProduceBox( Gia_Man_t * p, int fVerbose ) } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Gia_ManTestXor( Gia_Man_t * p ) +{ + Vec_Wrd_t * vSimsPi = Vec_WrdStartTruthTables( Gia_ManCiNum(p) ); + Vec_Wrd_t * vSims = Gia_ManSimPatSimOut( p, vSimsPi, 1 ); + int n, i, nWords = Vec_WrdSize(vSimsPi) / Gia_ManCiNum(p); + Gia_Obj_t * pObj; Vec_Wrd_t * vSims2; + Gia_ManForEachAnd( p, pObj, i ) + { + Gia_Obj_t Obj = *pObj; + for ( n = 0; n < 2; n++ ) + { + if ( n ) + { + pObj->iDiff1 = pObj->iDiff0; + pObj->fCompl1 = pObj->fCompl0; + } + else + { + pObj->iDiff0 = pObj->iDiff1; + pObj->fCompl0 = pObj->fCompl1; + } + vSims2 = Gia_ManSimPatSimOut( p, vSimsPi, 1 ); + printf( "%2d %2d : %5d\n", i, n, Abc_TtCountOnesVecXor(Vec_WrdArray(vSims), Vec_WrdArray(vSims2), Vec_WrdSize(vSims2)) ); + Vec_WrdFree( vSims2 ); + *pObj = Obj; + } + } + Vec_WrdFree( vSimsPi ); + Vec_WrdFree( vSims ); +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// -- cgit v1.2.3