#include "mapperInt.h"
Go to the source code of this file.
Functions | |
static int | Map_NodeVecCompareLevels (Map_Node_t **pp1, Map_Node_t **pp2) |
Map_NodeVec_t * | Map_NodeVecAlloc (int nCap) |
void | Map_NodeVecFree (Map_NodeVec_t *p) |
Map_Node_t ** | Map_NodeVecReadArray (Map_NodeVec_t *p) |
int | Map_NodeVecReadSize (Map_NodeVec_t *p) |
void | Map_NodeVecGrow (Map_NodeVec_t *p, int nCapMin) |
void | Map_NodeVecShrink (Map_NodeVec_t *p, int nSizeNew) |
void | Map_NodeVecClear (Map_NodeVec_t *p) |
void | Map_NodeVecPush (Map_NodeVec_t *p, Map_Node_t *Entry) |
int | Map_NodeVecPushUnique (Map_NodeVec_t *p, Map_Node_t *Entry) |
Map_Node_t * | Map_NodeVecPop (Map_NodeVec_t *p) |
void | Map_NodeVecRemove (Map_NodeVec_t *p, Map_Node_t *Entry) |
void | Map_NodeVecWriteEntry (Map_NodeVec_t *p, int i, Map_Node_t *Entry) |
Map_Node_t * | Map_NodeVecReadEntry (Map_NodeVec_t *p, int i) |
void | Map_NodeVecSortByLevel (Map_NodeVec_t *p) |
Map_NodeVec_t* Map_NodeVecAlloc | ( | int | nCap | ) |
FUNCTION DEFINITIONS ///Function*************************************************************
Synopsis [Allocates a vector with the given capacity.]
Description []
SideEffects []
SeeAlso []
Definition at line 42 of file mapperVec.c.
00043 { 00044 Map_NodeVec_t * p; 00045 p = ALLOC( Map_NodeVec_t, 1 ); 00046 if ( nCap > 0 && nCap < 16 ) 00047 nCap = 16; 00048 p->nSize = 0; 00049 p->nCap = nCap; 00050 p->pArray = p->nCap? ALLOC( Map_Node_t *, p->nCap ) : NULL; 00051 return p; 00052 }
void Map_NodeVecClear | ( | Map_NodeVec_t * | p | ) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 150 of file mapperVec.c.
00151 { 00152 p->nSize = 0; 00153 }
int Map_NodeVecCompareLevels | ( | Map_Node_t ** | pp1, | |
Map_Node_t ** | pp2 | |||
) | [static] |
CFile****************************************************************
FileName [mapperVec.c]
PackageName [MVSIS 1.3: Multi-valued logic synthesis system.]
Synopsis [Generic technology mapping engine.]
Author [MVSIS Group]
Affiliation [UC Berkeley]
Date [Ver. 2.0. Started - June 1, 2004.]
Revision [
] DECLARATIONS ///
Function*************************************************************
Synopsis [Comparison procedure for two clauses.]
Description []
SideEffects []
SeeAlso []
Definition at line 300 of file mapperVec.c.
00301 { 00302 int Level1 = Map_Regular(*pp1)->Level; 00303 int Level2 = Map_Regular(*pp2)->Level; 00304 if ( Level1 < Level2 ) 00305 return -1; 00306 if ( Level1 > Level2 ) 00307 return 1; 00308 if ( Map_Regular(*pp1)->Num < Map_Regular(*pp2)->Num ) 00309 return -1; 00310 if ( Map_Regular(*pp1)->Num > Map_Regular(*pp2)->Num ) 00311 return 1; 00312 return 0; 00313 }
void Map_NodeVecFree | ( | Map_NodeVec_t * | p | ) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 65 of file mapperVec.c.
void Map_NodeVecGrow | ( | Map_NodeVec_t * | p, | |
int | nCapMin | |||
) |
Function*************************************************************
Synopsis [Resizes the vector to the given capacity.]
Description []
SideEffects []
SeeAlso []
Definition at line 114 of file mapperVec.c.
Map_Node_t* Map_NodeVecPop | ( | Map_NodeVec_t * | p | ) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 210 of file mapperVec.c.
void Map_NodeVecPush | ( | Map_NodeVec_t * | p, | |
Map_Node_t * | Entry | |||
) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 166 of file mapperVec.c.
00167 { 00168 if ( p->nSize == p->nCap ) 00169 { 00170 if ( p->nCap < 16 ) 00171 Map_NodeVecGrow( p, 16 ); 00172 else 00173 Map_NodeVecGrow( p, 2 * p->nCap ); 00174 } 00175 p->pArray[p->nSize++] = Entry; 00176 }
int Map_NodeVecPushUnique | ( | Map_NodeVec_t * | p, | |
Map_Node_t * | Entry | |||
) |
Function*************************************************************
Synopsis [Add the element while ensuring uniqueness.]
Description [Returns 1 if the element was found, and 0 if it was new. ]
SideEffects []
SeeAlso []
Definition at line 189 of file mapperVec.c.
00190 { 00191 int i; 00192 for ( i = 0; i < p->nSize; i++ ) 00193 if ( p->pArray[i] == Entry ) 00194 return 1; 00195 Map_NodeVecPush( p, Entry ); 00196 return 0; 00197 }
Map_Node_t** Map_NodeVecReadArray | ( | Map_NodeVec_t * | p | ) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 82 of file mapperVec.c.
00083 { 00084 return p->pArray; 00085 }
Map_Node_t* Map_NodeVecReadEntry | ( | Map_NodeVec_t * | p, | |
int | i | |||
) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 266 of file mapperVec.c.
int Map_NodeVecReadSize | ( | Map_NodeVec_t * | p | ) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 98 of file mapperVec.c.
00099 { 00100 return p->nSize; 00101 }
void Map_NodeVecRemove | ( | Map_NodeVec_t * | p, | |
Map_Node_t * | Entry | |||
) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 226 of file mapperVec.c.
void Map_NodeVecShrink | ( | Map_NodeVec_t * | p, | |
int | nSizeNew | |||
) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 133 of file mapperVec.c.
void Map_NodeVecSortByLevel | ( | Map_NodeVec_t * | p | ) |
Function*************************************************************
Synopsis [Sorting the entries by their integer value.]
Description []
SideEffects []
SeeAlso []
Definition at line 283 of file mapperVec.c.
00284 { 00285 qsort( (void *)p->pArray, p->nSize, sizeof(Map_Node_t *), 00286 (int (*)(const void *, const void *)) Map_NodeVecCompareLevels ); 00287 }
void Map_NodeVecWriteEntry | ( | Map_NodeVec_t * | p, | |
int | i, | |||
Map_Node_t * | Entry | |||
) |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 249 of file mapperVec.c.