ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
resStrash.c File Reference
#include "base/abc/abc.h"
#include "resInt.h"
Include dependency graph for resStrash.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Abc_Obj_tAbc_ConvertAigToAig (Abc_Ntk_t *pAig, Abc_Obj_t *pObjOld)
 DECLARATIONS ///.
 
Abc_Ntk_tRes_WndStrash (Res_Win_t *p)
 FUNCTION DEFINITIONS ///.
 

Function Documentation

◆ Abc_ConvertAigToAig()

ABC_NAMESPACE_IMPL_START Abc_Obj_t * Abc_ConvertAigToAig ( Abc_Ntk_t * pNtkAig,
Abc_Obj_t * pObjOld )
extern

DECLARATIONS ///.

CFile****************************************************************

FileName [resStrash.c]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Resynthesis package.]

Synopsis [Structural hashing of the nodes in the window.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - January 15, 2007.]

Revision [

Id
resStrash.c,v 1.00 2007/01/15 00:00:00 alanmi Exp

]

Function*************************************************************

Synopsis [Converts the network from AIG to BDD representation.]

Description []

SideEffects []

SeeAlso []

Definition at line 1157 of file abcFunc.c.

1158{
1159 Hop_Man_t * pHopMan;
1160 Hop_Obj_t * pRoot;
1161 Abc_Obj_t * pFanin;
1162 int i;
1163 // get the local AIG
1164 pHopMan = (Hop_Man_t *)pObjOld->pNtk->pManFunc;
1165 pRoot = (Hop_Obj_t *)pObjOld->pData;
1166 // check the case of a constant
1167 if ( Hop_ObjIsConst1( Hop_Regular(pRoot) ) )
1168 return Abc_ObjNotCond( Abc_AigConst1(pNtkAig), Hop_IsComplement(pRoot) );
1169 // assign the fanin nodes
1170 Abc_ObjForEachFanin( pObjOld, pFanin, i )
1171 {
1172 assert( pFanin->pCopy != NULL );
1173 Hop_ManPi(pHopMan, i)->pData = pFanin->pCopy;
1174 }
1175 // construct the AIG
1176 Abc_ConvertAigToAig_rec( pNtkAig, Hop_Regular(pRoot) );
1177 Hop_ConeUnmark_rec( Hop_Regular(pRoot) );
1178 // return the result
1179 return Abc_ObjNotCond( (Abc_Obj_t *)Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );
1180}
void Abc_ConvertAigToAig_rec(Abc_Ntk_t *pNtkAig, Hop_Obj_t *pObj)
Definition abcFunc.c:1134
struct Abc_Obj_t_ Abc_Obj_t
Definition abc.h:116
#define Abc_ObjForEachFanin(pObj, pFanin, i)
Definition abc.h:527
ABC_DLL Abc_Obj_t * Abc_AigConst1(Abc_Ntk_t *pNtk)
Definition abcAig.c:683
void Hop_ConeUnmark_rec(Hop_Obj_t *pObj)
Definition hopDfs.c:257
typedefABC_NAMESPACE_HEADER_START struct Hop_Man_t_ Hop_Man_t
INCLUDES ///.
Definition hop.h:49
struct Hop_Obj_t_ Hop_Obj_t
Definition hop.h:50
void * pManFunc
Definition abc.h:191
void * pData
Definition abc.h:145
Abc_Ntk_t * pNtk
Definition abc.h:130
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Res_WndStrash()

Abc_Ntk_t * Res_WndStrash ( Res_Win_t * p)

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Structurally hashes the given window.]

Description [The first PO is the observability condition. The second is the node's function. The remaining POs are the candidate divisors.]

SideEffects []

SeeAlso []

Definition at line 49 of file resStrash.c.

50{
51 Vec_Ptr_t * vPairs;
52 Abc_Ntk_t * pAig;
53 Abc_Obj_t * pObj, * pMiter;
54 int i;
55 assert( Abc_NtkHasAig(p->pNode->pNtk) );
56// Abc_NtkCleanCopy( p->pNode->pNtk );
57 // create the network
59 pAig->pName = Extra_UtilStrsav( "window" );
60 // create the inputs
61 Vec_PtrForEachEntry( Abc_Obj_t *, p->vLeaves, pObj, i )
62 pObj->pCopy = Abc_NtkCreatePi( pAig );
63 Vec_PtrForEachEntry( Abc_Obj_t *, p->vBranches, pObj, i )
64 pObj->pCopy = Abc_NtkCreatePi( pAig );
65 // go through the nodes in the topological order
66 Vec_PtrForEachEntry( Abc_Obj_t *, p->vNodes, pObj, i )
67 {
68 pObj->pCopy = Abc_ConvertAigToAig( pAig, pObj );
69 if ( pObj == p->pNode )
70 pObj->pCopy = Abc_ObjNot( pObj->pCopy );
71 }
72 // collect the POs
73 vPairs = Vec_PtrAlloc( 2 * Vec_PtrSize(p->vRoots) );
74 Vec_PtrForEachEntry( Abc_Obj_t *, p->vRoots, pObj, i )
75 {
76 Vec_PtrPush( vPairs, pObj->pCopy );
77 Vec_PtrPush( vPairs, NULL );
78 }
79 // mark the TFO of the node
80 Abc_NtkIncrementTravId( p->pNode->pNtk );
81 Res_WinSweepLeafTfo_rec( p->pNode, (int)p->pNode->Level + p->nWinTfoMax );
82 // update strashing of the node
83 p->pNode->pCopy = Abc_ObjNot( p->pNode->pCopy );
84 Abc_NodeSetTravIdPrevious( p->pNode );
85 // redo strashing in the TFO
86 Vec_PtrForEachEntry( Abc_Obj_t *, p->vNodes, pObj, i )
87 {
88 if ( Abc_NodeIsTravIdCurrent(pObj) )
89 pObj->pCopy = Abc_ConvertAigToAig( pAig, pObj );
90 }
91 // collect the POs
92 Vec_PtrForEachEntry( Abc_Obj_t *, p->vRoots, pObj, i )
93 Vec_PtrWriteEntry( vPairs, 2 * i + 1, pObj->pCopy );
94 // add the miter
95 pMiter = Abc_AigMiter( (Abc_Aig_t *)pAig->pManFunc, vPairs, 0 );
96 Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), pMiter );
97 Vec_PtrFree( vPairs );
98 // add the node
99 Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), p->pNode->pCopy );
100 // add the fanins
101 Abc_ObjForEachFanin( p->pNode, pObj, i )
102 Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), pObj->pCopy );
103 // add the divisors
104 Vec_PtrForEachEntry( Abc_Obj_t *, p->vDivs, pObj, i )
105 Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), pObj->pCopy );
106 // add the names
109 // check the resulting network
110 if ( !Abc_NtkCheck( pAig ) )
111 fprintf( stdout, "Res_WndStrash(): Network check has failed.\n" );
112 return pAig;
113}
ABC_DLL Abc_Ntk_t * Abc_NtkAlloc(Abc_NtkType_t Type, Abc_NtkFunc_t Func, int fUseMemMan)
DECLARATIONS ///.
Definition abcNtk.c:53
ABC_DLL void Abc_ObjAddFanin(Abc_Obj_t *pObj, Abc_Obj_t *pFanin)
Definition abcFanio.c:84
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
Definition abcCheck.c:64
struct Abc_Aig_t_ Abc_Aig_t
Definition abc.h:117
struct Abc_Ntk_t_ Abc_Ntk_t
Definition abc.h:115
@ ABC_NTK_STRASH
Definition abc.h:58
ABC_DLL void Abc_NtkAddDummyPoNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:521
ABC_DLL Abc_Obj_t * Abc_AigMiter(Abc_Aig_t *pMan, Vec_Ptr_t *vPairs, int fImplic)
Definition abcAig.c:789
@ ABC_FUNC_AIG
Definition abc.h:67
ABC_DLL void Abc_NtkAddDummyPiNames(Abc_Ntk_t *pNtk)
Definition abcNames.c:495
Cube * p
Definition exorList.c:222
char * Extra_UtilStrsav(const char *s)
void Res_WinSweepLeafTfo_rec(Abc_Obj_t *pObj, int nLevelLimit)
Definition resDivs.c:196
ABC_NAMESPACE_IMPL_START Abc_Obj_t * Abc_ConvertAigToAig(Abc_Ntk_t *pAig, Abc_Obj_t *pObjOld)
DECLARATIONS ///.
Definition abcFunc.c:1157
char * pName
Definition abc.h:158
Abc_Obj_t * pCopy
Definition abc.h:148
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:
Here is the caller graph for this function: