abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mvcApi.c File Reference
#include "mvc.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START int Mvc_CoverReadWordNum (Mvc_Cover_t *pCover)
 DECLARATIONS ///. More...
 
int Mvc_CoverReadBitNum (Mvc_Cover_t *pCover)
 
int Mvc_CoverReadCubeNum (Mvc_Cover_t *pCover)
 
Mvc_Cube_tMvc_CoverReadCubeHead (Mvc_Cover_t *pCover)
 
Mvc_Cube_tMvc_CoverReadCubeTail (Mvc_Cover_t *pCover)
 
Mvc_List_tMvc_CoverReadCubeList (Mvc_Cover_t *pCover)
 
int Mvc_ListReadCubeNum (Mvc_List_t *pList)
 
Mvc_Cube_tMvc_ListReadCubeHead (Mvc_List_t *pList)
 
Mvc_Cube_tMvc_ListReadCubeTail (Mvc_List_t *pList)
 
void Mvc_CoverSetCubeNum (Mvc_Cover_t *pCover, int nItems)
 
void Mvc_CoverSetCubeHead (Mvc_Cover_t *pCover, Mvc_Cube_t *pCube)
 
void Mvc_CoverSetCubeTail (Mvc_Cover_t *pCover, Mvc_Cube_t *pCube)
 
void Mvc_CoverSetCubeList (Mvc_Cover_t *pCover, Mvc_List_t *pList)
 
int Mvc_CoverIsEmpty (Mvc_Cover_t *pCover)
 
int Mvc_CoverIsTautology (Mvc_Cover_t *pCover)
 
int Mvc_CoverIsBinaryBuffer (Mvc_Cover_t *pCover)
 
void Mvc_CoverMakeEmpty (Mvc_Cover_t *pCover)
 
void Mvc_CoverMakeTautology (Mvc_Cover_t *pCover)
 
Mvc_Cover_tMvc_CoverCreateEmpty (Mvc_Cover_t *pCover)
 
Mvc_Cover_tMvc_CoverCreateTautology (Mvc_Cover_t *pCover)
 

Function Documentation

Mvc_Cover_t* Mvc_CoverCreateEmpty ( Mvc_Cover_t pCover)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 202 of file mvcApi.c.

203 {
204  Mvc_Cover_t * pCoverNew;
205  pCoverNew = Mvc_CoverAlloc( pCover->pMem, pCover->nBits );
206  return pCoverNew;
207 }
int nBits
Definition: mvc.h:87
Mvc_Cover_t * Mvc_CoverAlloc(Mvc_Manager_t *pMem, int nBits)
DECLARATIONS ///.
Definition: mvcCover.c:43
Mvc_Manager_t * pMem
Definition: mvc.h:93
Mvc_Cover_t* Mvc_CoverCreateTautology ( Mvc_Cover_t pCover)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 220 of file mvcApi.c.

221 {
222  Mvc_Cube_t * pCubeNew;
223  Mvc_Cover_t * pCoverNew;
224  pCoverNew = Mvc_CoverAlloc( pCover->pMem, pCover->nBits );
225  pCubeNew = Mvc_CubeAlloc( pCoverNew );
226  Mvc_CubeBitFill( pCubeNew );
227  Mvc_CoverAddCubeTail( pCoverNew, pCubeNew );
228  return pCoverNew;
229 }
#define Mvc_CoverAddCubeTail(pCover, pCube)
Definition: mvc.h:501
Mvc_Cube_t * Mvc_CubeAlloc(Mvc_Cover_t *pCover)
DECLARATIONS ///.
Definition: mvcCube.c:43
#define Mvc_CubeBitFill(Cube)
Definition: mvc.h:385
int nBits
Definition: mvc.h:87
Mvc_Cover_t * Mvc_CoverAlloc(Mvc_Manager_t *pMem, int nBits)
DECLARATIONS ///.
Definition: mvcCover.c:43
Mvc_Manager_t * pMem
Definition: mvc.h:93
int Mvc_CoverIsBinaryBuffer ( Mvc_Cover_t pCover)

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

Synopsis [Returns 1 if the cover is a binary buffer.]

Description []

SideEffects []

SeeAlso []

Definition at line 135 of file mvcApi.c.

136 {
137  Mvc_Cube_t * pCube;
138  if ( pCover->nBits != 2 )
139  return 0;
140  if ( Mvc_CoverReadCubeNum(pCover) != 1 )
141  return 0;
142  pCube = pCover->lCubes.pHead;
143  if ( Mvc_CubeBitValue(pCube, 0) == 0 && Mvc_CubeBitValue(pCube, 1) == 1 )
144  return 1;
145  return 0;
146 }
int Mvc_CoverReadCubeNum(Mvc_Cover_t *pCover)
Definition: mvcApi.c:45
Mvc_List_t lCubes
Definition: mvc.h:88
Mvc_Cube_t * pHead
Definition: mvc.h:77
#define Mvc_CubeBitValue(Cube, Bit)
Definition: mvc.h:138
int nBits
Definition: mvc.h:87
int Mvc_CoverIsEmpty ( Mvc_Cover_t pCover)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 93 of file mvcApi.c.

94 {
95  return Mvc_CoverReadCubeNum(pCover) == 0;
96 }
int Mvc_CoverReadCubeNum(Mvc_Cover_t *pCover)
Definition: mvcApi.c:45
int Mvc_CoverIsTautology ( Mvc_Cover_t pCover)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 109 of file mvcApi.c.

110 {
111  Mvc_Cube_t * pCube;
112  int iBit, Value;
113 
114  if ( Mvc_CoverReadCubeNum(pCover) != 1 )
115  return 0;
116 
117  pCube = Mvc_CoverReadCubeHead( pCover );
118  Mvc_CubeForEachBit( pCover, pCube, iBit, Value )
119  if ( Value == 0 )
120  return 0;
121  return 1;
122 }
int Mvc_CoverReadCubeNum(Mvc_Cover_t *pCover)
Definition: mvcApi.c:45
if(last==0)
Definition: sparse_int.h:34
#define Mvc_CubeForEachBit(Cover, Cube, iBit, Value)
Definition: mvc.h:553
Mvc_Cube_t * Mvc_CoverReadCubeHead(Mvc_Cover_t *pCover)
Definition: mvcApi.c:46
void Mvc_CoverMakeEmpty ( Mvc_Cover_t pCover)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 160 of file mvcApi.c.

161 {
162  Mvc_Cube_t * pCube, * pCube2;
163  Mvc_CoverForEachCubeSafe( pCover, pCube, pCube2 )
164  Mvc_CubeFree( pCover, pCube );
165  pCover->lCubes.nItems = 0;
166  pCover->lCubes.pHead = NULL;
167  pCover->lCubes.pTail = NULL;
168 }
#define Mvc_CoverForEachCubeSafe(Cover, Cube, Cube2)
Definition: mvc.h:536
void Mvc_CubeFree(Mvc_Cover_t *pCover, Mvc_Cube_t *pCube)
Definition: mvcCube.c:114
void Mvc_CoverMakeTautology ( Mvc_Cover_t pCover)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 181 of file mvcApi.c.

182 {
183  Mvc_Cube_t * pCubeNew;
184  Mvc_CoverMakeEmpty( pCover );
185  pCubeNew = Mvc_CubeAlloc( pCover );
186  Mvc_CubeBitFill( pCubeNew );
187  Mvc_CoverAddCubeTail( pCover, pCubeNew );
188 }
#define Mvc_CoverAddCubeTail(pCover, pCube)
Definition: mvc.h:501
Mvc_Cube_t * Mvc_CubeAlloc(Mvc_Cover_t *pCover)
DECLARATIONS ///.
Definition: mvcCube.c:43
#define Mvc_CubeBitFill(Cube)
Definition: mvc.h:385
void Mvc_CoverMakeEmpty(Mvc_Cover_t *pCover)
Definition: mvcApi.c:160
int Mvc_CoverReadBitNum ( Mvc_Cover_t pCover)

Definition at line 44 of file mvcApi.c.

44 { return pCover->nBits; }
int nBits
Definition: mvc.h:87
Mvc_Cube_t* Mvc_CoverReadCubeHead ( Mvc_Cover_t pCover)

Definition at line 46 of file mvcApi.c.

46 { return pCover->lCubes.pHead; }
Mvc_List_t lCubes
Definition: mvc.h:88
Mvc_Cube_t * pHead
Definition: mvc.h:77
Mvc_List_t* Mvc_CoverReadCubeList ( Mvc_Cover_t pCover)

Definition at line 48 of file mvcApi.c.

48 { return &pCover->lCubes; }
Mvc_List_t lCubes
Definition: mvc.h:88
int Mvc_CoverReadCubeNum ( Mvc_Cover_t pCover)

Definition at line 45 of file mvcApi.c.

45 { return pCover->lCubes.nItems; }
int nItems
Definition: mvc.h:79
Mvc_List_t lCubes
Definition: mvc.h:88
Mvc_Cube_t* Mvc_CoverReadCubeTail ( Mvc_Cover_t pCover)

Definition at line 47 of file mvcApi.c.

47 { return pCover->lCubes.pTail; }
Mvc_List_t lCubes
Definition: mvc.h:88
Mvc_Cube_t * pTail
Definition: mvc.h:78
ABC_NAMESPACE_IMPL_START int Mvc_CoverReadWordNum ( Mvc_Cover_t pCover)

DECLARATIONS ///.

FUNCTION DEFINITIONS ///.

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

FileName [mvcApi.c]

PackageName [MVSIS 2.0: Multi-valued logic synthesis system.]

Synopsis []

Author [MVSIS Group]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - February 1, 2003.]

Revision [

Id:
mvcApi.c,v 1.4 2003/04/03 06:31:48 alanmi Exp

]FUNCTION DEFINITIONS /// Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 43 of file mvcApi.c.

43 { return pCover->nWords; }
int nWords
Definition: mvc.h:85
void Mvc_CoverSetCubeHead ( Mvc_Cover_t pCover,
Mvc_Cube_t pCube 
)

Definition at line 78 of file mvcApi.c.

78 { pCover->lCubes.pHead = pCube; }
Mvc_List_t lCubes
Definition: mvc.h:88
Mvc_Cube_t * pHead
Definition: mvc.h:77
void Mvc_CoverSetCubeList ( Mvc_Cover_t pCover,
Mvc_List_t pList 
)

Definition at line 80 of file mvcApi.c.

80 { pCover->lCubes = *pList; }
Mvc_List_t lCubes
Definition: mvc.h:88
void Mvc_CoverSetCubeNum ( Mvc_Cover_t pCover,
int  nItems 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 77 of file mvcApi.c.

77 { pCover->lCubes.nItems = nItems; }
int nItems
Definition: mvc.h:79
Mvc_List_t lCubes
Definition: mvc.h:88
void Mvc_CoverSetCubeTail ( Mvc_Cover_t pCover,
Mvc_Cube_t pCube 
)

Definition at line 79 of file mvcApi.c.

79 { pCover->lCubes.pTail = pCube; }
Mvc_List_t lCubes
Definition: mvc.h:88
Mvc_Cube_t * pTail
Definition: mvc.h:78
Mvc_Cube_t* Mvc_ListReadCubeHead ( Mvc_List_t pList)

Definition at line 63 of file mvcApi.c.

63 { return pList->pHead; }
Mvc_Cube_t * pHead
Definition: mvc.h:77
int Mvc_ListReadCubeNum ( Mvc_List_t pList)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 62 of file mvcApi.c.

62 { return pList->nItems; }
int nItems
Definition: mvc.h:79
Mvc_Cube_t* Mvc_ListReadCubeTail ( Mvc_List_t pList)

Definition at line 64 of file mvcApi.c.

64 { return pList->pTail; }
Mvc_Cube_t * pTail
Definition: mvc.h:78