31 #define SIM_READ_SYMMS(pNode) ((Vec_Int_t *)pNode->pCopy)
32 #define SIM_SET_SYMMS(pNode,vVect) (pNode->pCopy = (Abc_Obj_t *)(vVect))
118 Vec_Ptr_t * vNodes, * vNodesPi0, * vNodesPi1, * vNodesOther;
141 for ( i = 0; i < vNodesOther->nSize; i++ )
230 if ( vNodesPi->nSize == 0 )
234 for ( i = 0; i < vNodesPi->nSize; i++ )
235 for ( k = i+1; k < vNodesPi->nSize; k++ )
240 assert( pMap[pNode1->
Id] != pMap[pNode2->
Id] );
244 if ( pMap[pNode1->
Id] < pMap[pNode2->
Id] )
245 uSymm = ((pMap[pNode1->
Id] << 16) | pMap[pNode2->
Id]);
247 uSymm = ((pMap[pNode2->
Id] << 16) | pMap[pNode1->
Id]);
271 if ( vSymms0->nSize == 0 )
275 for ( i = 0; i < vSymms0->nSize; i++ )
277 uSymm = (unsigned)vSymms0->pArray[i];
301 int i, s, Ind1, Ind2, fIsVar1, fIsVar2;
303 if ( vNodesOther->nSize == 0 )
307 Ind1 = (uSymm & 0xffff);
308 Ind2 = (uSymm >> 16);
314 for ( i = 0; i < vNodesOther->nSize; i++ )
320 if ( !fIsVar1 && !fIsVar2 )
322 if ( fIsVar1 ^ fIsVar2 )
327 for ( s = 0; s < vSymmsNode->nSize; s++ )
328 if ( uSymm == (
unsigned)vSymmsNode->pArray[s] )
330 if ( s == vSymmsNode->nSize )
350 int i, Ind1, Ind2, fHasVar1, fHasVar2;
352 if ( vNodesPi->nSize == 0 )
356 Ind1 = (uSymm & 0xffff);
357 Ind2 = (uSymm >> 16);
360 fHasVar1 = fHasVar2 = 0;
361 for ( i = 0; i < vNodesPi->nSize; i++ )
364 if ( pMap[pNode->
Id] == Ind1 )
366 else if ( pMap[pNode->
Id] == Ind2 )
369 return fHasVar1 == fHasVar2;
387 unsigned uSymm, uSymma, uSymmr;
393 for ( i = 0; i < vSymms->nSize; i++ )
395 uSymm = (unsigned)vSymms->pArray[i];
396 Ind1 = (uSymm & 0xffff);
397 Ind2 = (uSymm >> 16);
399 for ( k = i+1; k < vSymms->nSize; k++ )
401 uSymma = (unsigned)vSymms->pArray[k];
402 if ( uSymma == uSymm )
404 Ind1a = (uSymma & 0xffff);
405 Ind2a = (uSymma >> 16);
410 uSymmr = ((Ind2 << 16) | Ind2a);
412 uSymmr = ((Ind2a << 16) | Ind2);
413 for ( j = 0; j < vSymms->nSize; j++ )
414 if ( uSymmr == (
unsigned)vSymms->pArray[j] )
416 if ( j == vSymms->nSize )
422 printf(
"Trans = %d.\n", nTrans );
439 int i, Ind1, Ind2, nInputs;
443 for ( i = 0; i < nInputs; i++ )
446 for ( i = 0; i < vSymms->nSize; i++ )
448 uSymm = (unsigned)vSymms->pArray[i];
449 Ind1 = (uSymm & 0xffff);
450 Ind2 = (uSymm >> 16);
static int Sim_SymmsIsCompatibleWithNodes(Abc_Ntk_t *pNtk, unsigned uSymm, Vec_Ptr_t *vNodesOther, int *pMap)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static int Abc_ObjIsCi(Abc_Obj_t *pObj)
static int Abc_NtkObjNumMax(Abc_Ntk_t *pNtk)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Vec_PtrPushUnique(Vec_Ptr_t *p, void *Entry)
#define SIM_SET_SYMMS(pNode, vVect)
static void Sim_SymmsStructComputeOne(Abc_Ntk_t *pNtk, Abc_Obj_t *pNode, int *pMap)
static void Sim_SymmsBalanceCollect_rec(Abc_Obj_t *pNode, Vec_Ptr_t *vNodes)
#define SIM_READ_SYMMS(pNode)
DECLARATIONS ///.
static int Abc_AigNodeIsConst(Abc_Obj_t *pNode)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
static int Abc_NtkCiNum(Abc_Ntk_t *pNtk)
#define ABC_ALLOC(type, num)
#define Abc_NtkForEachCo(pNtk, pCo, i)
static void Sim_SymmsTransferToMatrix(Extra_BitMat_t *pMatSymm, Vec_Int_t *vSymms, unsigned *pSupport)
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
static void Sim_SymmsAppendFromNode(Abc_Ntk_t *pNtk, Vec_Int_t *vSymms0, Vec_Ptr_t *vNodesOther, Vec_Ptr_t *vNodesPi0, Vec_Ptr_t *vNodesPi1, Vec_Int_t *vSymms, int *pMap)
Vec_Ptr_t * Sim_ComputeStrSupp(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
static void Sim_SymmsPartitionNodes(Vec_Ptr_t *vNodes, Vec_Ptr_t *vNodesPis0, Vec_Ptr_t *vNodesPis1, Vec_Ptr_t *vNodesOther)
static void Sim_SymmsPrint(Vec_Int_t *vSymms)
static Abc_Obj_t * Abc_ObjChild0(Abc_Obj_t *pObj)
void Sim_UtilInfoFree(Vec_Ptr_t *p)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define ABC_NAMESPACE_IMPL_END
void Sim_SymmsStructCompute(Abc_Ntk_t *pNtk, Vec_Ptr_t *vMatrs, Vec_Ptr_t *vSuppFun)
FUNCTION DEFINITIONS ///.
#define Sim_SuppStrHasVar(vSupps, pNode, v)
static void Sim_SymmsTrans(Vec_Int_t *vSymms)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static Abc_Obj_t * Abc_ObjRegular(Abc_Obj_t *p)
#define Abc_NtkForEachCi(pNtk, pCi, i)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void Sim_SymmsAppendFromGroup(Abc_Ntk_t *pNtk, Vec_Ptr_t *vNodesPi, Vec_Ptr_t *vNodesOther, Vec_Int_t *vSymms, int *pMap)
static int * Sim_SymmsCreateMap(Abc_Ntk_t *pNtk)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
static int Vec_IntPushUnique(Vec_Int_t *p, int Entry)
static int Abc_ObjIsComplement(Abc_Obj_t *p)
static Abc_Obj_t * Abc_ObjChild1(Abc_Obj_t *pObj)
static int Sim_SymmsIsCompatibleWithGroup(unsigned uSymm, Vec_Ptr_t *vNodesPi, int *pMap)
static void Vec_PtrFree(Vec_Ptr_t *p)