abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
covMinMan.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [covMinMan.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [Mapping into network of SOPs/ESOPs.]
8 
9  Synopsis [SOP manipulation.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - June 20, 2005.]
16 
17  Revision [$Id: covMinMan.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "covInt.h"
22 
24 
25 
26 ////////////////////////////////////////////////////////////////////////
27 /// DECLARATIONS ///
28 ////////////////////////////////////////////////////////////////////////
29 
30 ////////////////////////////////////////////////////////////////////////
31 /// FUNCTION DEFINITIONS ///
32 ////////////////////////////////////////////////////////////////////////
33 
34 /**Function*************************************************************
35 
36  Synopsis [Starts the minimization manager.]
37 
38  Description []
39 
40  SideEffects []
41 
42  SeeAlso []
43 
44 ***********************************************************************/
45 Min_Man_t * Min_ManAlloc( int nVars )
46 {
47  Min_Man_t * pMan;
48  // start the manager
49  pMan = ABC_ALLOC( Min_Man_t, 1 );
50  memset( pMan, 0, sizeof(Min_Man_t) );
51  pMan->nVars = nVars;
52  pMan->nWords = Abc_BitWordNum( nVars * 2 );
53  pMan->pMemMan = Extra_MmFixedStart( sizeof(Min_Cube_t) + sizeof(unsigned) * (pMan->nWords - 1) );
54  // allocate storage for the temporary cover
55  pMan->ppStore = ABC_ALLOC( Min_Cube_t *, pMan->nVars + 1 );
56  // create tautology cubes
57  Min_ManClean( pMan, nVars );
58  pMan->pOne0 = Min_CubeAlloc( pMan );
59  pMan->pOne1 = Min_CubeAlloc( pMan );
60  pMan->pTemp = Min_CubeAlloc( pMan );
61  pMan->pBubble = Min_CubeAlloc( pMan ); pMan->pBubble->uData[0] = 0;
62  // create trivial cubes
63  Min_ManClean( pMan, 1 );
64  pMan->pTriv0[0] = Min_CubeAllocVar( pMan, 0, 0 );
65  pMan->pTriv0[1] = Min_CubeAllocVar( pMan, 0, 1 );
66  pMan->pTriv1[0] = Min_CubeAllocVar( pMan, 0, 0 );
67  pMan->pTriv1[1] = Min_CubeAllocVar( pMan, 0, 1 );
68  Min_ManClean( pMan, nVars );
69  return pMan;
70 }
71 
72 /**Function*************************************************************
73 
74  Synopsis [Cleans the minimization manager.]
75 
76  Description []
77 
78  SideEffects []
79 
80  SeeAlso []
81 
82 ***********************************************************************/
83 void Min_ManClean( Min_Man_t * p, int nSupp )
84 {
85  // set the size of the cube manager
86  p->nVars = nSupp;
87  p->nWords = Abc_BitWordNum(2*nSupp);
88  // clean the storage
89  memset( p->ppStore, 0, sizeof(Min_Cube_t *) * (nSupp + 1) );
90  p->nCubes = 0;
91 }
92 
93 /**Function*************************************************************
94 
95  Synopsis [Stops the minimization manager.]
96 
97  Description []
98 
99  SideEffects []
100 
101  SeeAlso []
102 
103 ***********************************************************************/
105 {
106  Extra_MmFixedStop( p->pMemMan );
107  ABC_FREE( p->ppStore );
108  ABC_FREE( p );
109 }
110 
111 
112 ////////////////////////////////////////////////////////////////////////
113 /// END OF FILE ///
114 ////////////////////////////////////////////////////////////////////////
115 
116 
118 
char * memset()
unsigned nVars
Definition: covInt.h:57
void Min_ManClean(Min_Man_t *p, int nSupp)
Definition: covMinMan.c:83
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Min_Cube_t * Min_CubeAllocVar(Min_Man_t *p, int iVar, int fCompl)
Definition: covInt.h:149
void Extra_MmFixedStop(Extra_MmFixed_t *p)
ABC_NAMESPACE_IMPL_START Min_Man_t * Min_ManAlloc(int nVars)
DECLARATIONS ///.
Definition: covMinMan.c:45
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
Extra_MmFixed_t * Extra_MmFixedStart(int nEntrySize)
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
void Min_ManFree(Min_Man_t *p)
Definition: covMinMan.c:104
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
#define ABC_FREE(obj)
Definition: abc_global.h:232
static Min_Cube_t * Min_CubeAlloc(Min_Man_t *p)
FUNCTION DEFINITIONS ///.
Definition: covInt.h:126
static int Abc_BitWordNum(int nBits)
Definition: abc_global.h:255
typedefABC_NAMESPACE_HEADER_START struct Min_Man_t_ Min_Man_t
DECLARATIONS ///.
Definition: covInt.h:34