src/opt/res/resStrash.c File Reference

#include "abc.h"
#include "resInt.h"
Include dependency graph for resStrash.c:

Go to the source code of this file.

Functions

Abc_Obj_tAbc_ConvertAigToAig (Abc_Ntk_t *pAig, Abc_Obj_t *pObjOld)
Abc_Ntk_tRes_WndStrash (Res_Win_t *p)

Function Documentation

Abc_Obj_t* Abc_ConvertAigToAig ( Abc_Ntk_t pNtkAig,
Abc_Obj_t pObjOld 
)

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

] DECLARATIONS ///

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

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

Description []

SideEffects []

SeeAlso []

Definition at line 976 of file abcFunc.c.

00977 {
00978     Hop_Man_t * pHopMan;
00979     Hop_Obj_t * pRoot;
00980     Abc_Obj_t * pFanin;
00981     int i;
00982     // get the local AIG
00983     pHopMan = pObjOld->pNtk->pManFunc;
00984     pRoot = pObjOld->pData;
00985     // check the case of a constant
00986     if ( Hop_ObjIsConst1( Hop_Regular(pRoot) ) )
00987         return Abc_ObjNotCond( Abc_AigConst1(pNtkAig), Hop_IsComplement(pRoot) );
00988     // assign the fanin nodes
00989     Abc_ObjForEachFanin( pObjOld, pFanin, i )
00990     {
00991         assert( pFanin->pCopy != NULL );
00992         Hop_ManPi(pHopMan, i)->pData = pFanin->pCopy;
00993     }
00994     // construct the AIG
00995     Abc_ConvertAigToAig_rec( pNtkAig, Hop_Regular(pRoot) );
00996     Hop_ConeUnmark_rec( Hop_Regular(pRoot) );
00997     // return the result
00998     return Abc_ObjNotCond( Hop_Regular(pRoot)->pData, Hop_IsComplement(pRoot) );  
00999 }

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 46 of file resStrash.c.

00047 {
00048     Vec_Ptr_t * vPairs;
00049     Abc_Ntk_t * pAig;
00050     Abc_Obj_t * pObj, * pMiter;
00051     int i;
00052     assert( Abc_NtkHasAig(p->pNode->pNtk) );
00053 //    Abc_NtkCleanCopy( p->pNode->pNtk );
00054     // create the network
00055     pAig = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
00056     pAig->pName = Extra_UtilStrsav( "window" );
00057     // create the inputs
00058     Vec_PtrForEachEntry( p->vLeaves, pObj, i )
00059         pObj->pCopy = Abc_NtkCreatePi( pAig );
00060     Vec_PtrForEachEntry( p->vBranches, pObj, i )
00061         pObj->pCopy = Abc_NtkCreatePi( pAig );
00062     // go through the nodes in the topological order
00063     Vec_PtrForEachEntry( p->vNodes, pObj, i )
00064     {
00065         pObj->pCopy = Abc_ConvertAigToAig( pAig, pObj );
00066         if ( pObj == p->pNode )
00067             pObj->pCopy = Abc_ObjNot( pObj->pCopy );
00068     }
00069     // collect the POs
00070     vPairs = Vec_PtrAlloc( 2 * Vec_PtrSize(p->vRoots) );
00071     Vec_PtrForEachEntry( p->vRoots, pObj, i )
00072     {
00073         Vec_PtrPush( vPairs, pObj->pCopy );
00074         Vec_PtrPush( vPairs, NULL );
00075     }
00076     // mark the TFO of the node
00077     Abc_NtkIncrementTravId( p->pNode->pNtk );
00078     Res_WinSweepLeafTfo_rec( p->pNode, (int)p->pNode->Level + p->nWinTfoMax );
00079     // update strashing of the node
00080     p->pNode->pCopy = Abc_ObjNot( p->pNode->pCopy );
00081     Abc_NodeSetTravIdPrevious( p->pNode );
00082     // redo strashing in the TFO
00083     Vec_PtrForEachEntry( p->vNodes, pObj, i )
00084     {
00085         if ( Abc_NodeIsTravIdCurrent(pObj) )
00086             pObj->pCopy = Abc_ConvertAigToAig( pAig, pObj );
00087     }
00088     // collect the POs
00089     Vec_PtrForEachEntry( p->vRoots, pObj, i )
00090         Vec_PtrWriteEntry( vPairs, 2 * i + 1, pObj->pCopy );
00091     // add the miter
00092     pMiter = Abc_AigMiter( pAig->pManFunc, vPairs );
00093     Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), pMiter );
00094     Vec_PtrFree( vPairs );
00095     // add the node
00096     Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), p->pNode->pCopy );
00097     // add the fanins
00098     Abc_ObjForEachFanin( p->pNode, pObj, i )
00099         Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), pObj->pCopy );
00100     // add the divisors
00101     Vec_PtrForEachEntry( p->vDivs, pObj, i )
00102         Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), pObj->pCopy );
00103     // add the names
00104     Abc_NtkAddDummyPiNames( pAig );
00105     Abc_NtkAddDummyPoNames( pAig );
00106     // check the resulting network
00107     if ( !Abc_NtkCheck( pAig ) )
00108         fprintf( stdout, "Res_WndStrash(): Network check has failed.\n" );
00109     return pAig;
00110 }


Generated on Tue Jan 5 12:19:31 2010 for abc70930 by  doxygen 1.6.1