diff options
Diffstat (limited to 'src/opt/sfm/sfmNtk.c')
-rw-r--r-- | src/opt/sfm/sfmNtk.c | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/opt/sfm/sfmNtk.c b/src/opt/sfm/sfmNtk.c new file mode 100644 index 00000000..24ca514d --- /dev/null +++ b/src/opt/sfm/sfmNtk.c @@ -0,0 +1,75 @@ +/**CFile**************************************************************** + + FileName [sfmNtk.c] + + SystemName [ABC: Logic synthesis and verification system.] + + PackageName [SAT-based optimization using internal don't-cares.] + + Synopsis [Logic network.] + + Author [Alan Mishchenko] + + Affiliation [UC Berkeley] + + Date [Ver. 1.0. Started - June 20, 2005.] + + Revision [$Id: sfmNtk.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $] + +***********************************************************************/ + +#include "sfmInt.h" + +ABC_NAMESPACE_IMPL_START + + +//////////////////////////////////////////////////////////////////////// +/// DECLARATIONS /// +//////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////// +/// FUNCTION DEFINITIONS /// +//////////////////////////////////////////////////////////////////////// + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Sfm_Ntk_t * Sfm_NtkAlloc( int nPis, int nPos, int nNodes, int nEdges ) +{ + Sfm_Ntk_t * p; + int AddOn = 2; + int nSize = (nPis + nPos + nNodes) * (sizeof(Sfm_Obj_t) / sizeof(int) + AddOn) + 2 * nEdges; + p = ABC_CALLOC( Sfm_Ntk_t, 1 ); + p->pMem = ABC_CALLOC( int, nSize ); + return p; +} +void Sfm_NtkFree( Sfm_Ntk_t * p ) +{ + ABC_FREE( p->pMem ); + ABC_FREE( p->vObjs.pArray ); + ABC_FREE( p->vPis.pArray ); + ABC_FREE( p->vPos.pArray ); + ABC_FREE( p->vMem.pArray ); + ABC_FREE( p->vLevels.pArray ); + ABC_FREE( p->vTravIds.pArray ); + ABC_FREE( p->vSatVars.pArray ); + ABC_FREE( p->vTruths.pArray ); + ABC_FREE( p ); +} + + +//////////////////////////////////////////////////////////////////////// +/// END OF FILE /// +//////////////////////////////////////////////////////////////////////// + + +ABC_NAMESPACE_IMPL_END + |