src/misc/mvc/mvcApi.c File Reference

#include "mvc.h"
Include dependency graph for mvcApi.c:

Go to the source code of this file.

Functions

int Mvc_CoverReadWordNum (Mvc_Cover_t *pCover)
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 199 of file mvcApi.c.

00200 {
00201     Mvc_Cover_t * pCoverNew;
00202     pCoverNew = Mvc_CoverAlloc( pCover->pMem, pCover->nBits );
00203     return pCoverNew;
00204 }

Mvc_Cover_t* Mvc_CoverCreateTautology ( Mvc_Cover_t pCover  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 217 of file mvcApi.c.

00218 {
00219     Mvc_Cube_t * pCubeNew;
00220     Mvc_Cover_t * pCoverNew;
00221     pCoverNew = Mvc_CoverAlloc( pCover->pMem, pCover->nBits );
00222     pCubeNew = Mvc_CubeAlloc( pCoverNew );
00223     Mvc_CubeBitFill( pCubeNew );
00224     Mvc_CoverAddCubeTail( pCoverNew, pCubeNew );
00225     return pCoverNew;
00226 }

int Mvc_CoverIsBinaryBuffer ( Mvc_Cover_t pCover  ) 

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

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

Description []

SideEffects []

SeeAlso []

Definition at line 132 of file mvcApi.c.

00133 {
00134     Mvc_Cube_t * pCube;
00135     if ( pCover->nBits != 2 )
00136         return 0;
00137     if ( Mvc_CoverReadCubeNum(pCover) != 1 )
00138         return 0;
00139     pCube = pCover->lCubes.pHead;
00140     if ( Mvc_CubeBitValue(pCube, 0) == 0 && Mvc_CubeBitValue(pCube, 1) == 1 )
00141         return 1;
00142     return 0;
00143 }

int Mvc_CoverIsEmpty ( Mvc_Cover_t pCover  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 90 of file mvcApi.c.

00091 {
00092     return Mvc_CoverReadCubeNum(pCover) == 0;
00093 }

int Mvc_CoverIsTautology ( Mvc_Cover_t pCover  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 106 of file mvcApi.c.

00107 {
00108     Mvc_Cube_t * pCube;
00109     int iBit, Value;
00110 
00111     if ( Mvc_CoverReadCubeNum(pCover) != 1 )
00112         return 0;
00113 
00114     pCube = Mvc_CoverReadCubeHead( pCover );
00115     Mvc_CubeForEachBit( pCover, pCube, iBit, Value )
00116         if ( Value == 0 )
00117             return 0;
00118     return 1;
00119 }

void Mvc_CoverMakeEmpty ( Mvc_Cover_t pCover  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 157 of file mvcApi.c.

00158 {
00159     Mvc_Cube_t * pCube, * pCube2;
00160     Mvc_CoverForEachCubeSafe( pCover, pCube, pCube2 )
00161         Mvc_CubeFree( pCover, pCube );
00162     pCover->lCubes.nItems = 0;
00163     pCover->lCubes.pHead = NULL;
00164     pCover->lCubes.pTail = NULL;
00165 }

void Mvc_CoverMakeTautology ( Mvc_Cover_t pCover  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 178 of file mvcApi.c.

00179 {
00180     Mvc_Cube_t * pCubeNew;
00181     Mvc_CoverMakeEmpty( pCover );
00182     pCubeNew = Mvc_CubeAlloc( pCover );
00183     Mvc_CubeBitFill( pCubeNew );
00184     Mvc_CoverAddCubeTail( pCover, pCubeNew );
00185 }

int Mvc_CoverReadBitNum ( Mvc_Cover_t pCover  ) 

Definition at line 41 of file mvcApi.c.

00041 { return pCover->nBits;          }

Mvc_Cube_t* Mvc_CoverReadCubeHead ( Mvc_Cover_t pCover  ) 

Definition at line 43 of file mvcApi.c.

00043 { return pCover->lCubes.pHead;  }

Mvc_List_t* Mvc_CoverReadCubeList ( Mvc_Cover_t pCover  ) 

Definition at line 45 of file mvcApi.c.

00045 { return &pCover->lCubes;        }

int Mvc_CoverReadCubeNum ( Mvc_Cover_t pCover  ) 

Definition at line 42 of file mvcApi.c.

00042 { return pCover->lCubes.nItems; }

Mvc_Cube_t* Mvc_CoverReadCubeTail ( Mvc_Cover_t pCover  ) 

Definition at line 44 of file mvcApi.c.

00044 { return pCover->lCubes.pTail;  }

int Mvc_CoverReadWordNum ( Mvc_Cover_t pCover  ) 

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

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 40 of file mvcApi.c.

00040 { return pCover->nWords;         }

void Mvc_CoverSetCubeHead ( Mvc_Cover_t pCover,
Mvc_Cube_t pCube 
)

Definition at line 75 of file mvcApi.c.

00075 { pCover->lCubes.pHead = pCube;   }

void Mvc_CoverSetCubeList ( Mvc_Cover_t pCover,
Mvc_List_t pList 
)

Definition at line 77 of file mvcApi.c.

00077 { pCover->lCubes = *pList;        }

void Mvc_CoverSetCubeNum ( Mvc_Cover_t pCover,
int  nItems 
)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 74 of file mvcApi.c.

00074 { pCover->lCubes.nItems = nItems; }

void Mvc_CoverSetCubeTail ( Mvc_Cover_t pCover,
Mvc_Cube_t pCube 
)

Definition at line 76 of file mvcApi.c.

00076 { pCover->lCubes.pTail = pCube;   }

Mvc_Cube_t* Mvc_ListReadCubeHead ( Mvc_List_t pList  ) 

Definition at line 60 of file mvcApi.c.

00060 { return pList->pHead;  }

int Mvc_ListReadCubeNum ( Mvc_List_t pList  ) 

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 59 of file mvcApi.c.

00059 { return pList->nItems; }

Mvc_Cube_t* Mvc_ListReadCubeTail ( Mvc_List_t pList  ) 

Definition at line 61 of file mvcApi.c.

00061 { return pList->pTail;  }


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