summaryrefslogtreecommitdiffstats
path: root/src/opt/res
diff options
context:
space:
mode:
Diffstat (limited to 'src/opt/res')
-rw-r--r--src/opt/res/module.make7
-rw-r--r--src/opt/res/res.h112
-rw-r--r--src/opt/res/resCore.c103
-rw-r--r--src/opt/res/resFilter.c53
-rw-r--r--src/opt/res/resSat.c55
-rw-r--r--src/opt/res/resSim.c433
-rw-r--r--src/opt/res/resStrash.c105
-rw-r--r--src/opt/res/resUpdate.c51
-rw-r--r--src/opt/res/resWin.c456
-rw-r--r--src/opt/res/res_.c50
10 files changed, 1425 insertions, 0 deletions
diff --git a/src/opt/res/module.make b/src/opt/res/module.make
new file mode 100644
index 00000000..9d632385
--- /dev/null
+++ b/src/opt/res/module.make
@@ -0,0 +1,7 @@
+SRC += src/opt/res/resCore.c \
+ src/opt/res/resFilter.c \
+ src/opt/res/resSat.c \
+ src/opt/res/resSim.c \
+ src/opt/res/resStrash.c \
+ src/opt/res/resUpdate.c \
+ src/opt/res/resWin.c
diff --git a/src/opt/res/res.h b/src/opt/res/res.h
new file mode 100644
index 00000000..ab5dede1
--- /dev/null
+++ b/src/opt/res/res.h
@@ -0,0 +1,112 @@
+/**CFile****************************************************************
+
+ FileName [res.h]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Resynthesis package.]
+
+ Synopsis [External declarations.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - January 15, 2007.]
+
+ Revision [$Id: res.h,v 1.00 2007/01/15 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#ifndef __RES_H__
+#define __RES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+////////////////////////////////////////////////////////////////////////
+/// INCLUDES ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// PARAMETERS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// BASIC TYPES ///
+////////////////////////////////////////////////////////////////////////
+
+typedef struct Res_Win_t_ Res_Win_t;
+struct Res_Win_t_
+{
+ // the general data
+ int nWinTfiMax; // the fanin levels
+ int nWinTfoMax; // the fanout levels
+ int nLevDivMax; // the maximum divisor level
+ int nLevLeaves; // the level where leaves begin
+ Abc_Obj_t * pNode; // the node in the center
+ // the window data
+ Vec_Vec_t * vLevels; // nodes by level
+ Vec_Ptr_t * vLeaves; // leaves of the window
+ Vec_Ptr_t * vRoots; // roots of the window
+ Vec_Ptr_t * vDivs; // the candidate divisors of the node
+};
+
+typedef struct Res_Sim_t_ Res_Sim_t;
+struct Res_Sim_t_
+{
+ Abc_Ntk_t * pAig; // AIG for simulation
+ // simulation parameters
+ int nWords; // the number of simulation words
+ int nPats; // the number of patterns
+ int nWordsOut; // the number of simulation words in the output patterns
+ int nPatsOut; // the number of patterns in the output patterns
+ // simulation info
+ Vec_Ptr_t * vPats; // input simulation patterns
+ Vec_Ptr_t * vPats0; // input simulation patterns
+ Vec_Ptr_t * vPats1; // input simulation patterns
+ Vec_Ptr_t * vOuts; // output simulation info
+ int nPats0; // the number of 0-patterns accumulated
+ int nPats1; // the number of 1-patterns accumulated
+ // resub candidates
+ Vec_Vec_t * vCands; // resubstitution candidates
+};
+
+////////////////////////////////////////////////////////////////////////
+/// MACRO DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/*=== resFilter.c ==========================================================*/
+extern Vec_Ptr_t * Res_FilterCandidates( Res_Win_t * pWin, Res_Sim_t * pSim );
+/*=== resSat.c ==========================================================*/
+extern Hop_Obj_t * Res_SatFindFunction( Hop_Man_t * pMan, Res_Win_t * pWin, Vec_Ptr_t * vFanins, Abc_Ntk_t * pAig );
+/*=== resSim.c ==========================================================*/
+extern Res_Sim_t * Res_SimAlloc( int nWords );
+extern void Res_SimFree( Res_Sim_t * p );
+extern int Res_SimPrepare( Res_Sim_t * p, Abc_Ntk_t * pAig );
+/*=== resStrash.c ==========================================================*/
+extern Abc_Ntk_t * Res_WndStrash( Res_Win_t * p );
+/*=== resWnd.c ==========================================================*/
+extern void Res_UpdateNetwork( Abc_Obj_t * pObj, Vec_Ptr_t * vFanins, Hop_Obj_t * pFunc );
+/*=== resWnd.c ==========================================================*/
+extern Res_Win_t * Res_WinAlloc();
+extern void Res_WinFree( Res_Win_t * p );
+extern int Res_WinCompute( Abc_Obj_t * pNode, int nWinTfiMax, int nWinTfoMax, int nLevDivMax, Res_Win_t * p );
+extern void Res_WinVisitNodeTfo( Res_Win_t * p );
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
diff --git a/src/opt/res/resCore.c b/src/opt/res/resCore.c
new file mode 100644
index 00000000..2ef547e3
--- /dev/null
+++ b/src/opt/res/resCore.c
@@ -0,0 +1,103 @@
+/**CFile****************************************************************
+
+ FileName [resCore.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Resynthesis package.]
+
+ Synopsis [Top-level resynthesis procedure.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - June 20, 2005.]
+
+ Revision [$Id: resCore.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "res.h"
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis [Entrace into the resynthesis package.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkResynthesize( Abc_Ntk_t * pNtk, int nWindow, int nSimWords, int fVerbose, int fVeryVerbose )
+{
+ Res_Win_t * pWin;
+ Res_Sim_t * pSim;
+ Abc_Ntk_t * pAig;
+ Abc_Obj_t * pObj;
+ Hop_Obj_t * pFunc;
+ Vec_Ptr_t * vFanins;
+ int i, nNodesOld;
+ assert( Abc_NtkHasAig(pNtk) );
+ assert( nWindow > 0 && nWindow < 100 );
+ // start the window
+ pWin = Res_WinAlloc();
+ pSim = Res_SimAlloc( nSimWords );
+ // set the number of levels
+ Abc_NtkLevel( pNtk );
+ // try resynthesizing nodes in the topological order
+ nNodesOld = Abc_NtkObjNumMax(pNtk);
+ Abc_NtkForEachObj( pNtk, pObj, i )
+ {
+ if ( !Abc_ObjIsNode(pObj) )
+ continue;
+ if ( pObj->Id > nNodesOld )
+ break;
+ // create the window for this node
+ if ( !Res_WinCompute(pObj, nWindow/10, nWindow%10, pObj->Level - 1, pWin) )
+ continue;
+ // create the AIG for the window
+ pAig = Res_WndStrash( pWin );
+ // prepare simulation info
+ if ( !Res_SimPrepare( pSim, pAig ) )
+ {
+ Abc_NtkDelete( pAig );
+ continue;
+ }
+ // find resub candidates for the node
+ vFanins = Res_FilterCandidates( pWin, pSim );
+ // check using SAT
+ pFunc = Res_SatFindFunction( pNtk->pManFunc, pWin, vFanins, pAig );
+ Abc_NtkDelete( pAig );
+ if ( pFunc == NULL )
+ continue;
+ // update the network
+ Res_UpdateNetwork( pObj, vFanins, pFunc );
+ }
+ Res_WinFree( pWin );
+ Res_SimFree( pSim );
+ // check the resulting network
+ if ( !Abc_NtkCheck( pNtk ) )
+ {
+ fprintf( stdout, "Abc_NtkResynthesize(): Network check has failed.\n" );
+ return 0;
+ }
+ return 1;
+}
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
diff --git a/src/opt/res/resFilter.c b/src/opt/res/resFilter.c
new file mode 100644
index 00000000..c9615c1e
--- /dev/null
+++ b/src/opt/res/resFilter.c
@@ -0,0 +1,53 @@
+/**CFile****************************************************************
+
+ FileName [resFilter.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Resynthesis package.]
+
+ Synopsis []
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - January 15, 2007.]
+
+ Revision [$Id: resFilter.c,v 1.00 2007/01/15 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "res.h"
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Vec_Ptr_t * Res_FilterCandidates( Res_Win_t * pWin, Res_Sim_t * pSim )
+{
+ return NULL;
+}
+
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
diff --git a/src/opt/res/resSat.c b/src/opt/res/resSat.c
new file mode 100644
index 00000000..39ca9ad6
--- /dev/null
+++ b/src/opt/res/resSat.c
@@ -0,0 +1,55 @@
+/**CFile****************************************************************
+
+ FileName [resSat.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Resynthesis package.]
+
+ Synopsis [Interface with the SAT solver.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - January 15, 2007.]
+
+ Revision [$Id: resSat.c,v 1.00 2007/01/15 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "res.h"
+#include "hop.h"
+//#include "bf.h"
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Hop_Obj_t * Res_SatFindFunction( Hop_Man_t * pMan, Res_Win_t * pWin, Vec_Ptr_t * vFanins, Abc_Ntk_t * pAig )
+{
+ return NULL;
+}
+
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
diff --git a/src/opt/res/resSim.c b/src/opt/res/resSim.c
new file mode 100644
index 00000000..091c376d
--- /dev/null
+++ b/src/opt/res/resSim.c
@@ -0,0 +1,433 @@
+/**CFile****************************************************************
+
+ FileName [resSim.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Resynthesis package.]
+
+ Synopsis [Simulation engine.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - January 15, 2007.]
+
+ Revision [$Id: resSim.c,v 1.00 2007/01/15 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "res.h"
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+// generating random unsigned (#define RAND_MAX 0x7fff)
+#define SIM_RANDOM_UNSIGNED ((((unsigned)rand()) << 24) ^ (((unsigned)rand()) << 12) ^ ((unsigned)rand()))
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis [Allocate simulation engine.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Res_Sim_t * Res_SimAlloc( int nWords )
+{
+ Res_Sim_t * p;
+ p = ALLOC( Res_Sim_t, 1 );
+ memset( p, 0, sizeof(Res_Sim_t) );
+ // simulation info
+ p->nWords = nWords;
+ p->nPats = 8 * sizeof(unsigned) * p->nWords;
+ p->nWordsOut = p->nPats * p->nWords;
+ p->nPatsOut = p->nPats * p->nPats;
+ // resub candidates
+ p->vPats = Vec_PtrAllocSimInfo( 1024, p->nWords );
+ p->vPats0 = Vec_PtrAllocSimInfo( 128, p->nWords );
+ p->vPats1 = Vec_PtrAllocSimInfo( 128, p->nWords );
+ p->vOuts = Vec_PtrAllocSimInfo( 128, p->nWordsOut );
+ p->vCands = Vec_VecStart( 16 );
+ // set siminfo for the constant node
+ memset( Vec_PtrEntry(p->vPats,0), 0xff, sizeof(unsigned) * p->nWords );
+ return p;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Allocate simulation engine.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_SimAdjust( Res_Sim_t * p, Abc_Ntk_t * pAig )
+{
+ assert( Abc_NtkIsStrash(pAig) );
+ p->pAig = pAig;
+ if ( Vec_PtrSize(p->vPats) < Abc_NtkObjNumMax(pAig)+1 )
+ {
+ Vec_PtrFree( p->vPats );
+ p->vPats = Vec_PtrAllocSimInfo( Abc_NtkObjNumMax(pAig)+1, p->nWords );
+ }
+ if ( Vec_PtrSize(p->vPats0) < Abc_NtkPiNum(pAig) )
+ {
+ Vec_PtrFree( p->vPats0 );
+ p->vPats0 = Vec_PtrAllocSimInfo( Abc_NtkPiNum(pAig), p->nWords );
+ }
+ if ( Vec_PtrSize(p->vPats1) < Abc_NtkPiNum(pAig) )
+ {
+ Vec_PtrFree( p->vPats1 );
+ p->vPats1 = Vec_PtrAllocSimInfo( Abc_NtkPiNum(pAig), p->nWords );
+ }
+ if ( Vec_PtrSize(p->vOuts) < Abc_NtkPoNum(pAig) )
+ {
+ Vec_PtrFree( p->vOuts );
+ p->vOuts = Vec_PtrAllocSimInfo( Abc_NtkPoNum(pAig), p->nWordsOut );
+ }
+ // clean storage info for patterns
+ memset( Vec_PtrEntry(p->vPats0,0), 0, sizeof(unsigned) * p->nWords * Abc_NtkPiNum(pAig) );
+ memset( Vec_PtrEntry(p->vPats1,0), 0, sizeof(unsigned) * p->nWords * Abc_NtkPiNum(pAig) );
+ p->nPats0 = 0;
+ p->nPats1 = 0;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Free simulation engine.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_SimFree( Res_Sim_t * p )
+{
+ Vec_PtrFree( p->vPats );
+ Vec_PtrFree( p->vPats0 );
+ Vec_PtrFree( p->vPats1 );
+ Vec_PtrFree( p->vOuts );
+ Vec_VecFree( p->vCands );
+ free( p );
+}
+
+
+/**Function*************************************************************
+
+ Synopsis [Sets random PI simulation info.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_SimSetRandom( Res_Sim_t * p )
+{
+ Abc_Obj_t * pObj;
+ unsigned * pInfo;
+ int i, w;
+ Abc_NtkForEachPi( p->pAig, pObj, i )
+ {
+ pInfo = Vec_PtrEntry( p->vPats, pObj->Id );
+ for ( w = 0; w < p->nWords; w++ )
+ pInfo[w] = SIM_RANDOM_UNSIGNED;
+ }
+}
+
+/**Function*************************************************************
+
+ Synopsis [Sets given PI simulation info.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_SimSetGiven( Res_Sim_t * p, Vec_Ptr_t * vInfo )
+{
+ Abc_Obj_t * pObj;
+ unsigned * pInfo, * pInfo2;
+ int i, w;
+ Abc_NtkForEachPi( p->pAig, pObj, i )
+ {
+ pInfo = Vec_PtrEntry( p->vPats, pObj->Id );
+ pInfo2 = Vec_PtrEntry( vInfo, i );
+ for ( w = 0; w < p->nWords; w++ )
+ pInfo[w] = pInfo2[w];
+ }
+}
+
+/**Function*************************************************************
+
+ Synopsis [Simulates one node.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_SimPerformOne( Abc_Obj_t * pNode, Vec_Ptr_t * vSimInfo, int nSimWords )
+{
+ unsigned * pInfo, * pInfo1, * pInfo2;
+ int k, fComp1, fComp2;
+ // simulate the internal nodes
+ assert( Abc_ObjIsNode(pNode) );
+ pInfo = Vec_PtrEntry(vSimInfo, pNode->Id);
+ pInfo1 = Vec_PtrEntry(vSimInfo, Abc_ObjFaninId0(pNode));
+ pInfo2 = Vec_PtrEntry(vSimInfo, Abc_ObjFaninId1(pNode));
+ fComp1 = Abc_ObjFaninC0(pNode);
+ fComp2 = Abc_ObjFaninC1(pNode);
+ if ( fComp1 && fComp2 )
+ for ( k = 0; k < nSimWords; k++ )
+ pInfo[k] = ~pInfo1[k] & ~pInfo2[k];
+ else if ( fComp1 && !fComp2 )
+ for ( k = 0; k < nSimWords; k++ )
+ pInfo[k] = ~pInfo1[k] & pInfo2[k];
+ else if ( !fComp1 && fComp2 )
+ for ( k = 0; k < nSimWords; k++ )
+ pInfo[k] = pInfo1[k] & ~pInfo2[k];
+ else // if ( fComp1 && fComp2 )
+ for ( k = 0; k < nSimWords; k++ )
+ pInfo[k] = pInfo1[k] & pInfo2[k];
+}
+
+/**Function*************************************************************
+
+ Synopsis [Simulates one PO node.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_SimTransferOne( Abc_Obj_t * pNode, Vec_Ptr_t * vSimInfo, int nSimWords )
+{
+ unsigned * pInfo, * pInfo1;
+ int k, fComp1;
+ // simulate the internal nodes
+ assert( Abc_ObjIsCo(pNode) );
+ pInfo = Vec_PtrEntry(vSimInfo, pNode->Id);
+ pInfo1 = Vec_PtrEntry(vSimInfo, Abc_ObjFaninId0(pNode));
+ fComp1 = Abc_ObjFaninC0(pNode);
+ if ( fComp1 )
+ for ( k = 0; k < nSimWords; k++ )
+ pInfo[k] = ~pInfo1[k];
+ else
+ for ( k = 0; k < nSimWords; k++ )
+ pInfo[k] = pInfo1[k];
+}
+
+/**Function*************************************************************
+
+ Synopsis [Performs one round of simulation.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_SimPerformRound( Res_Sim_t * p )
+{
+ Abc_Obj_t * pObj;
+ int i;
+ Abc_AigForEachAnd( p->pAig, pObj, i )
+ Res_SimPerformOne( pObj, p->vPats, p->nWords );
+ Abc_NtkForEachPo( p->pAig, pObj, i )
+ Res_SimTransferOne( pObj, p->vPats, p->nWords );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Processes simulation patterns.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_SimProcessPats( Res_Sim_t * p )
+{
+ Abc_Obj_t * pCare, * pNode, * pObj;
+ unsigned * pInfoCare, * pInfoNode;
+ int i, j;
+ pCare = Abc_NtkPo( p->pAig, 0 );
+ pNode = Abc_NtkPo( p->pAig, 0 );
+ pInfoCare = Vec_PtrEntry( p->vPats, pCare->Id );
+ pInfoNode = Vec_PtrEntry( p->vPats, pNode->Id );
+ for ( i = 0; i < p->nPats; i++ )
+ {
+ if ( !Abc_InfoHasBit(pInfoCare, i) )
+ continue;
+ if ( !Abc_InfoHasBit(pInfoNode, i) )
+ {
+ if ( p->nPats0 < p->nPats )
+ {
+ Abc_NtkForEachPi( p->pAig, pObj, j )
+ if ( Abc_InfoHasBit( Vec_PtrEntry(p->vPats, pObj->Id), i ) )
+ Abc_InfoSetBit( Vec_PtrEntry(p->vPats0, j), p->nPats0 );
+ p->nPats0++;
+ }
+ }
+ else
+ {
+ if ( p->nPats1 < p->nPats )
+ {
+ Abc_NtkForEachPi( p->pAig, pObj, j )
+ if ( Abc_InfoHasBit( Vec_PtrEntry(p->vPats, pObj->Id), i ) )
+ Abc_InfoSetBit( Vec_PtrEntry(p->vPats1, j), p->nPats1 );
+ p->nPats1++;
+ }
+ }
+ }
+}
+
+/**Function*************************************************************
+
+ Synopsis [Duplicates the simulation info to fill the space.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_SimPadSimInfo( Vec_Ptr_t * vPats, int nPats, int nWords )
+{
+ unsigned * pInfo;
+ int i, w, iWords;
+ iWords = nPats / (8 * sizeof(unsigned));
+ if ( iWords == nWords )
+ return;
+ Vec_PtrForEachEntry( vPats, pInfo, i )
+ for ( w = iWords; w < nWords; i++ )
+ pInfo[w] = pInfo[0];
+}
+
+/**Function*************************************************************
+
+ Synopsis [Duplicates the simulation info to fill the space.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_SimDeriveInfoDuplicate( Res_Sim_t * p )
+{
+ unsigned * pInfo, * pInfo2;
+ Abc_Obj_t * pObj;
+ int i, j, w;
+ Abc_NtkForEachPo( p->pAig, pObj, i )
+ {
+ pInfo = Vec_PtrEntry( p->vPats, pObj->Id );
+ pInfo2 = Vec_PtrEntry( p->vOuts, i );
+ for ( j = 0; j < p->nPats; j++ )
+ for ( w = 0; w < p->nWords; w++ )
+ *pInfo2++ = pInfo[w];
+ }
+}
+
+/**Function*************************************************************
+
+ Synopsis [Complement the simulation info if necessary.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_SimDeriveInfoComplement( Res_Sim_t * p )
+{
+ unsigned * pInfo, * pInfo2;
+ Abc_Obj_t * pObj;
+ int i, j, w;
+ Abc_NtkForEachPo( p->pAig, pObj, i )
+ {
+ pInfo = Vec_PtrEntry( p->vPats, pObj->Id );
+ pInfo2 = Vec_PtrEntry( p->vOuts, i );
+ for ( j = 0; j < p->nPats; j++, pInfo2 += p->nWords )
+ if ( Abc_InfoHasBit( pInfo, j ) )
+ for ( w = 0; w < p->nWords; w++ )
+ pInfo2[w] = ~pInfo2[w];
+ }
+}
+
+/**Function*************************************************************
+
+ Synopsis [Prepares simulation info for candidate filtering.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Res_SimPrepare( Res_Sim_t * p, Abc_Ntk_t * pAig )
+{
+ int Limit = 20;
+ // prepare the manager
+ Res_SimAdjust( p, pAig );
+ // collect 0/1 simulation info
+ while ( p->nPats0 < p->nPats || p->nPats1 < p->nPats || Limit-- == 0 )
+ {
+ Res_SimSetRandom( p );
+ Res_SimPerformRound( p );
+ Res_SimProcessPats( p );
+ }
+ if ( p->nPats0 < 32 || p->nPats1 < 32 )
+ return 0;
+ // create bit-matrix info
+ if ( p->nPats0 < p->nPats )
+ Res_SimPadSimInfo( p->vPats0, p->nPats0, p->nWords );
+ if ( p->nPats1 < p->nPats )
+ Res_SimPadSimInfo( p->vPats1, p->nPats1, p->nWords );
+ // resimulate 0-patterns
+ Res_SimSetGiven( p, p->vPats0 );
+ Res_SimPerformRound( p );
+ Res_SimDeriveInfoDuplicate( p );
+ // resimulate 1-patterns
+ Res_SimSetGiven( p, p->vPats1 );
+ Res_SimPerformRound( p );
+ Res_SimDeriveInfoComplement( p );
+ return 1;
+}
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
diff --git a/src/opt/res/resStrash.c b/src/opt/res/resStrash.c
new file mode 100644
index 00000000..22244df3
--- /dev/null
+++ b/src/opt/res/resStrash.c
@@ -0,0 +1,105 @@
+/**CFile****************************************************************
+
+ FileName [resStrash.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Resynthesis package.]
+
+ Synopsis [Strashes 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 $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "res.h"
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+extern Abc_Obj_t * Abc_ConvertAigToAig( Abc_Ntk_t * pAig, Abc_Obj_t * pObjOld );
+
+////////////////////////////////////////////////////////////////////////
+/// 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 []
+
+***********************************************************************/
+Abc_Ntk_t * Res_WndStrash( Res_Win_t * p )
+{
+ Vec_Ptr_t * vPairs;
+ Abc_Ntk_t * pAig;
+ Abc_Obj_t * pObj, * pMiter;
+ int i, k;
+ assert( Abc_NtkHasAig(p->pNode->pNtk) );
+ // create the network
+ pAig = Abc_NtkAlloc( ABC_NTK_STRASH, ABC_FUNC_AIG, 1 );
+ // duplicate the name and the spec
+ pAig->pName = Extra_UtilStrsav( "window" );
+ // create the inputs
+ Vec_PtrForEachEntry( p->vLeaves, pObj, i )
+ pObj->pCopy = Abc_NtkCreatePi( pAig );
+ // go through the nodes in the topological order
+ Vec_VecForEachEntryStartStop( p->vLevels, pObj, i, k, p->nLevLeaves + 1, (int)p->pNode->Level + p->nWinTfoMax )
+ {
+ pObj->pCopy = Abc_ConvertAigToAig( pAig, pObj );
+ pObj->pCopy = Abc_ObjNotCond( pObj->pCopy, pObj == p->pNode );
+ }
+ // collect the PO outputs
+ vPairs = Vec_PtrAlloc( 2 * Vec_PtrSize(p->vRoots) );
+ Vec_PtrForEachEntry( p->vRoots, pObj, i )
+ {
+ Vec_PtrPush( vPairs, pObj->pCopy );
+ Vec_PtrPush( vPairs, NULL );
+ }
+ // mark the TFO of the node
+ Res_WinVisitNodeTfo( p );
+ // redo strashing in the TFO
+ p->pNode->pCopy = Abc_ObjNot( p->pNode->pCopy );
+ Vec_VecForEachEntryStartStop( p->vLevels, pObj, i, k, p->pNode->Level + 1, (int)p->pNode->Level + p->nWinTfoMax )
+ {
+ if ( Abc_NodeIsTravIdCurrent(pObj) )
+ pObj->pCopy = Abc_ConvertAigToAig( pAig, pObj );
+ }
+ // collect the PO outputs
+ Vec_PtrForEachEntry( p->vRoots, pObj, i )
+ Vec_PtrWriteEntry( vPairs, 2 * i + 1, pObj->pCopy );
+ // add the miter
+ pMiter = Abc_AigMiter( pAig->pManFunc, vPairs );
+ Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), pMiter );
+ Vec_PtrFree( vPairs );
+ // add the node
+ Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), p->pNode->pCopy );
+ // add the divisors
+ Vec_PtrForEachEntry( p->vDivs, pObj, i )
+ Abc_ObjAddFanin( Abc_NtkCreatePo(pAig), pObj->pCopy );
+ // check the resulting network
+ if ( !Abc_NtkCheck( pAig ) )
+ fprintf( stdout, "Res_WndStrash(): Network check has failed.\n" );
+ return pAig;
+}
+
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
diff --git a/src/opt/res/resUpdate.c b/src/opt/res/resUpdate.c
new file mode 100644
index 00000000..cb76e01a
--- /dev/null
+++ b/src/opt/res/resUpdate.c
@@ -0,0 +1,51 @@
+/**CFile****************************************************************
+
+ FileName [resUpdate.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Resynthesis package.]
+
+ Synopsis [Updates the network after changes.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - January 15, 2007.]
+
+ Revision [$Id: resUpdate.c,v 1.00 2007/01/15 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "res.h"
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_UpdateNetwork( Abc_Obj_t * pObj, Vec_Ptr_t * vFanins, Hop_Obj_t * pFunc )
+{
+}
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
diff --git a/src/opt/res/resWin.c b/src/opt/res/resWin.c
new file mode 100644
index 00000000..b50d3274
--- /dev/null
+++ b/src/opt/res/resWin.c
@@ -0,0 +1,456 @@
+/**CFile****************************************************************
+
+ FileName [resWin.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Resynthesis package.]
+
+ Synopsis [Windowing algorithm.]
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - January 15, 2007.]
+
+ Revision [$Id: resWin.c,v 1.00 2007/01/15 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "res.h"
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis [Allocates the window.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+Res_Win_t * Res_WinAlloc()
+{
+ Res_Win_t * p;
+ p = ALLOC( Res_Win_t, 1 );
+ memset( p, 0, sizeof(Res_Win_t) );
+ p->vLevels = Vec_VecStart( 128 );
+ p->vLeaves = Vec_PtrAlloc( 512 );
+ p->vRoots = Vec_PtrAlloc( 512 );
+ p->vDivs = Vec_PtrAlloc( 512 );
+ return p;
+}
+
+/**Function*************************************************************
+
+ Synopsis [Frees the window.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_WinFree( Res_Win_t * p )
+{
+ Vec_VecFree( p->vLevels );
+ Vec_PtrFree( p->vLeaves );
+ Vec_PtrFree( p->vRoots );
+ Vec_PtrFree( p->vDivs );
+ free( p );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Adds one node to the window.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline void Res_WinAddNode( Res_Win_t * p, Abc_Obj_t * pObj )
+{
+ assert( !pObj->fMarkA );
+ pObj->fMarkA = 1;
+ Vec_VecPush( p->vLevels, pObj->Level, pObj );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Expands the frontier by one level.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_WinCollectTfiOne( Res_Win_t * p, int Level )
+{
+ Vec_Ptr_t * vFront;
+ Abc_Obj_t * pObj, * pFanin;
+ int i, k;
+ assert( Level > 0 );
+ vFront = Vec_VecEntry( p->vLevels, Level );
+ Vec_PtrForEachEntry( vFront, pObj, i )
+ {
+ Abc_ObjForEachFanin( pObj, pFanin, k )
+ {
+ if ( !pFanin->fMarkA )
+ Res_WinAddNode( p, pFanin );
+ }
+ }
+}
+
+/**Function*************************************************************
+
+ Synopsis [Collects nodes in the limited TFI of the node.]
+
+ Description [Marks the collected nodes with the current trav ID.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_WinCollectTfi( Res_Win_t * p )
+{
+ int i;
+ // expand storage for levels
+ if ( Vec_VecSize( p->vLevels ) <= (int)p->pNode->Level + p->nWinTfoMax )
+ Vec_VecExpand( p->vLevels, (int)p->pNode->Level + p->nWinTfoMax );
+ // start the frontier
+ Vec_VecClear( p->vLevels );
+ Res_WinAddNode( p, p->pNode );
+ // add one level at a time
+ for ( i = p->pNode->Level; i > p->nLevLeaves; i-- )
+ Res_WinCollectTfiOne( p, i );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Marks the TFO of the collected nodes up to the given level.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_WinSweepTfo_rec( Abc_Obj_t * pObj, int nLevelLimit, Abc_Obj_t * pNode )
+{
+ Abc_Obj_t * pFanout;
+ int i;
+ if ( Abc_ObjIsCo(pObj) || (int)pObj->Level > nLevelLimit || pObj == pNode )
+ return;
+ if ( Abc_NodeIsTravIdCurrent(pObj) )
+ return;
+ Abc_NodeSetTravIdCurrent( pObj );
+ Abc_ObjForEachFanout( pObj, pFanout, i )
+ Res_WinSweepTfo_rec( pFanout, nLevelLimit, pNode );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Marks the TFO of the collected nodes up to the given level.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_WinSweepTfo( Res_Win_t * p )
+{
+ Abc_Obj_t * pObj;
+ int i, k;
+ Abc_NtkIncrementTravId( p->pNode->pNtk );
+ Vec_VecForEachEntryStartStop( p->vLevels, pObj, i, k, 0, p->nLevLeaves )
+ Res_WinSweepTfo_rec( pObj, p->pNode->Level + p->nWinTfoMax, p->pNode );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Recursively collects the roots.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_WinCollectRoots_rec( Abc_Obj_t * pObj, Vec_Ptr_t * vRoots )
+{
+ Abc_Obj_t * pFanout;
+ int i;
+ assert( Abc_ObjIsNode(pObj) );
+ assert( Abc_NodeIsTravIdCurrent(pObj) );
+ // check if the node has all fanouts marked
+ Abc_ObjForEachFanout( pObj, pFanout, i )
+ if ( !Abc_NodeIsTravIdCurrent(pObj) )
+ break;
+ // if some of the fanouts are unmarked, add the node to the root
+ if ( i < Abc_ObjFanoutNum(pObj) )
+ {
+ Vec_PtrPush( vRoots, pObj );
+ return;
+ }
+ // otherwise, call recursively
+ Abc_ObjForEachFanout( pObj, pFanout, i )
+ Res_WinCollectRoots_rec( pFanout, vRoots );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Collects the roots of the window.]
+
+ Description [Roots of the window are the nodes that have at least
+ one fanout that it not in the TFO of the leaves.]
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_WinCollectRoots( Res_Win_t * p )
+{
+ Vec_PtrClear( p->vRoots );
+ Res_WinCollectRoots_rec( p->pNode, p->vRoots );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Recursively augments the window.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_WinAddMissing_rec( Res_Win_t * p, Abc_Obj_t * pObj )
+{
+ Abc_Obj_t * pFanin;
+ int i;
+ if ( !Abc_NodeIsTravIdCurrent(pObj) )
+ return;
+ if ( pObj->fMarkA )
+ return;
+ Res_WinAddNode( p, pObj );
+ // visit the fanins of the node
+ Abc_ObjForEachFanin( pObj, pFanin, i )
+ Res_WinAddMissing_rec( p, pObj );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Adds to the window visited nodes in the TFI of the roots.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_WinAddMissing( Res_Win_t * p )
+{
+ Abc_Obj_t * pObj;
+ int i;
+ Vec_PtrForEachEntry( p->vRoots, pObj, i )
+ Res_WinAddMissing_rec( p, pObj );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Collect all the nodes that fanin into the window nodes.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_WinCollectLeaves( Res_Win_t * p )
+{
+ Abc_Obj_t * pObj, * pFanin;
+ int i, k, f;
+ // add the leaves
+ Vec_PtrClear( p->vLeaves );
+ // collect the nodes below the given level
+ Vec_VecForEachEntryStartStop( p->vLevels, pObj, i, k, 0, p->nLevLeaves )
+ Vec_PtrPush( p->vLeaves, pObj );
+ // add to leaves the fanins of the nodes above the given level
+ Vec_VecForEachEntryStart( p->vLevels, pObj, i, k, p->nLevLeaves + 1 )
+ {
+ Abc_ObjForEachFanin( pObj, pFanin, f )
+ {
+ if ( !pFanin->fMarkA )
+ {
+ pFanin->fMarkA = 1;
+ Vec_PtrPush( p->vLeaves, pFanin );
+ }
+ }
+ }
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_WinVisitNodeTfo( Res_Win_t * p )
+{
+ // mark the TFO of the node
+ Abc_NtkIncrementTravId( p->pNode->pNtk );
+ Res_WinSweepTfo_rec( p->pNode, p->nLevDivMax, NULL );
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_WinCollectDivisors( Res_Win_t * p )
+{
+ Abc_Obj_t * pObj, * pFanout, * pFanin;
+ int i, k, f, m;
+ // mark the TFO of the node
+ Res_WinVisitNodeTfo( p );
+ // go through all the legal levels and check if their fanouts can be divisors
+ Vec_VecForEachEntryStartStop( p->vLevels, pObj, i, k, 0, p->nLevDivMax - 1 )
+ {
+ Abc_ObjForEachFanout( pObj, pFanout, f )
+ {
+ // skip COs
+ if ( !Abc_ObjIsNode(pFanout) )
+ continue;
+ // skip nodes in the TFO of node
+ if ( Abc_NodeIsTravIdCurrent(pFanout) )
+ continue;
+ // skip nodes that are already added
+ if ( pFanout->fMarkA )
+ continue;
+ // skip nodes with large level
+ if ( (int)pFanout->Level > p->nLevDivMax )
+ continue;
+ // skip nodes whose fanins are not in the cone
+ Abc_ObjForEachFanin( pFanout, pFanin, m )
+ if ( !pFanin->fMarkA )
+ break;
+ if ( m < Abc_ObjFaninNum(pFanin) )
+ continue;
+ // add the node
+ Res_WinAddNode( p, pFanout );
+ }
+ }
+ // collect the divisors below the line
+ Vec_PtrClear( p->vDivs );
+ Vec_VecForEachEntryStartStop( p->vLevels, pObj, i, k, 0, p->nLevDivMax )
+ Vec_PtrPush( p->vDivs, pObj );
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Res_WinUnmark( Res_Win_t * p )
+{
+ Vec_Ptr_t * vLevel;
+ Abc_Obj_t * pObj;
+ int i, k;
+ Vec_VecForEachEntry( p->vLevels, pObj, i, k )
+ pObj->fMarkA = 0;
+ Vec_PtrForEachEntry( p->vLeaves, pObj, i )
+ pObj->fMarkA = 0;
+ // remove leaves from the set
+ Vec_VecForEachLevelStartStop( p->vLevels, vLevel, i, 0, p->nLevLeaves )
+ Vec_PtrClear( vLevel );
+}
+
+/**Function*************************************************************
+
+ Synopsis [Computes the window.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Res_WinCompute( Abc_Obj_t * pNode, int nWinTfiMax, int nWinTfoMax, int nLevDivMax, Res_Win_t * p )
+{
+ assert( Abc_ObjIsNode(pNode) );
+ assert( nWinTfiMax > 0 && nWinTfoMax > 0 );
+ // initialize the window
+ p->pNode = pNode;
+ p->nWinTfiMax = nWinTfiMax;
+ p->nWinTfoMax = nWinTfoMax;
+ p->nLevDivMax = nLevDivMax;
+ p->nLevLeaves = ABC_MAX( 0, p->pNode->Level - p->nWinTfiMax - 1 );
+ // collect the nodes in TFI cone of pNode down to the given level (nWinTfiMax)
+ Res_WinCollectTfi( p );
+ // mark the TFO of the collected nodes up to the given level (nWinTfoMax)
+ Res_WinSweepTfo( p );
+ // find the roots of the window
+ Res_WinCollectRoots( p );
+ // add the nodes in the TFI of the roots that are not yet in the window
+ Res_WinAddMissing( p );
+ // find the leaves of the window
+ Res_WinCollectLeaves( p );
+ // collect the divisors up to the given maximum divisor level (nLevDivMax)
+ if ( nLevDivMax >= 0 )
+ Res_WinCollectDivisors( p );
+ else
+ Vec_PtrClear( p->vDivs );
+ // unmark window nodes
+ Res_WinUnmark( p );
+ return 1;
+}
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+
diff --git a/src/opt/res/res_.c b/src/opt/res/res_.c
new file mode 100644
index 00000000..a50affd7
--- /dev/null
+++ b/src/opt/res/res_.c
@@ -0,0 +1,50 @@
+/**CFile****************************************************************
+
+ FileName [res_.c]
+
+ SystemName [ABC: Logic synthesis and verification system.]
+
+ PackageName [Resynthesis package.]
+
+ Synopsis []
+
+ Author [Alan Mishchenko]
+
+ Affiliation [UC Berkeley]
+
+ Date [Ver. 1.0. Started - January 15, 2007.]
+
+ Revision [$Id: res_.c,v 1.00 2007/01/15 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "abc.h"
+#include "res.h"
+
+////////////////////////////////////////////////////////////////////////
+/// DECLARATIONS ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+/// FUNCTION DEFINITIONS ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+
+
+
+////////////////////////////////////////////////////////////////////////
+/// END OF FILE ///
+////////////////////////////////////////////////////////////////////////
+
+