ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
mapperCutUtils.c File Reference
#include "mapperInt.h"
Include dependency graph for mapperCutUtils.c:

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START Map_Cut_tMap_CutAlloc (Map_Man_t *p)
 DECLARATIONS ///.
 
void Map_CutFree (Map_Man_t *p, Map_Cut_t *pCut)
 
void Map_CutPrint (Map_Man_t *p, Map_Node_t *pRoot, Map_Cut_t *pCut, int fPhase)
 
float Map_CutGetRootArea (Map_Cut_t *pCut, int fPhase)
 
int Map_CutGetLeafPhase (Map_Cut_t *pCut, int fPhase, int iLeaf)
 
int Map_NodeGetLeafPhase (Map_Node_t *pNode, int fPhase, int iLeaf)
 
Map_Cut_tMap_CutListAppend (Map_Cut_t *pSetAll, Map_Cut_t *pSets)
 
void Map_CutListRecycle (Map_Man_t *p, Map_Cut_t *pSetList, Map_Cut_t *pSave)
 
int Map_CutListCount (Map_Cut_t *pSets)
 
void Map_CutInternalNodes_rec (Map_Node_t *pObj, Vec_Ptr_t *vAnds)
 
Vec_Ptr_tMap_CutInternalNodes (Map_Node_t *pObj, Map_Cut_t *pCut)
 

Function Documentation

◆ Map_CutAlloc()

DECLARATIONS ///.

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

FileName [mapperCutUtils.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 [

Id
mapperCutUtils.h,v 1.0 2003/09/08 00:00:00 alanmi Exp

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

Synopsis [Allocates the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 43 of file mapperCutUtils.c.

44{
45 Map_Cut_t * pCut;
46 Map_Match_t * pMatch;
47 pCut = (Map_Cut_t *)Extra_MmFixedEntryFetch( p->mmCuts );
48 memset( pCut, 0, sizeof(Map_Cut_t) );
49
50 pMatch = pCut->M;
51 pMatch->AreaFlow = MAP_FLOAT_LARGE; // unassigned
52 pMatch->tArrive.Rise = MAP_FLOAT_LARGE; // unassigned
53 pMatch->tArrive.Fall = MAP_FLOAT_LARGE; // unassigned
54 pMatch->tArrive.Worst = MAP_FLOAT_LARGE; // unassigned
55
56 pMatch = pCut->M + 1;
57 pMatch->AreaFlow = MAP_FLOAT_LARGE; // unassigned
58 pMatch->tArrive.Rise = MAP_FLOAT_LARGE; // unassigned
59 pMatch->tArrive.Fall = MAP_FLOAT_LARGE; // unassigned
60 pMatch->tArrive.Worst = MAP_FLOAT_LARGE; // unassigned
61 return pCut;
62}
Cube * p
Definition exorList.c:222
char * Extra_MmFixedEntryFetch(Extra_MmFixed_t *p)
#define MAP_FLOAT_LARGE
Definition mapperInt.h:61
struct Map_MatchStruct_t_ Map_Match_t
Definition mapper.h:44
struct Map_CutStruct_t_ Map_Cut_t
Definition mapper.h:43
Map_Match_t M[2]
Definition mapperInt.h:275
Map_Time_t tArrive
Definition mapperInt.h:259
char * memset()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_CutFree()

void Map_CutFree ( Map_Man_t * p,
Map_Cut_t * pCut )

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

Synopsis [Deallocates the cut.]

Description []

SideEffects []

SeeAlso []

Definition at line 75 of file mapperCutUtils.c.

76{
77 if ( pCut )
78 Extra_MmFixedEntryRecycle( p->mmCuts, (char *)pCut );
79}
void Extra_MmFixedEntryRecycle(Extra_MmFixed_t *p, char *pEntry)
Here is the call graph for this function:

◆ Map_CutGetLeafPhase()

int Map_CutGetLeafPhase ( Map_Cut_t * pCut,
int fPhase,
int iLeaf )

function*************************************************************

synopsis [Computes the exact area associated with the cut.]

description []

sideeffects []

seealso []

Definition at line 131 of file mapperCutUtils.c.

132{
133 assert( pCut->M[fPhase].pSuperBest );
134 return (( pCut->M[fPhase].uPhaseBest & (1<<iLeaf) ) == 0);
135}
Map_Super_t * pSuperBest
Definition mapperInt.h:257
unsigned uPhaseBest
Definition mapperInt.h:256
#define assert(ex)
Definition util_old.h:213
Here is the caller graph for this function:

◆ Map_CutGetRootArea()

float Map_CutGetRootArea ( Map_Cut_t * pCut,
int fPhase )

function*************************************************************

synopsis [Computes the exact area associated with the cut.]

description []

sideeffects []

seealso []

Definition at line 114 of file mapperCutUtils.c.

115{
116 assert( pCut->M[fPhase].pSuperBest );
117 return pCut->M[fPhase].pSuperBest->Area;
118}
Here is the caller graph for this function:

◆ Map_CutInternalNodes()

Vec_Ptr_t * Map_CutInternalNodes ( Map_Node_t * pObj,
Map_Cut_t * pCut )

Definition at line 242 of file mapperCutUtils.c.

243{
244 Vec_Ptr_t * vAnds = Vec_PtrAlloc( 4 );
245 Map_Node_t * pTemp; int i;
246 pObj->p->nTravIds++;
247 for ( i = 0; i < pCut->nLeaves; i++ )
248 pCut->ppLeaves[i]->TravId = pObj->p->nTravIds;
249 Map_CutInternalNodes_rec( pObj, vAnds );
250 if ( 0 )
251 {
252 printf( "Leaves:\n" );
253 for ( i = 0; i < pCut->nLeaves; i++ )
254 printf( " %d", pCut->ppLeaves[i]->Num );
255 printf( "\n" );
256 printf( "Nodes:\n" );
257 Vec_PtrForEachEntry( Map_Node_t *, vAnds, pTemp, i )
258 printf( "%d = %s%d & %s%d\n", pTemp->Num,
259 Map_IsComplement(pTemp->p1) ? "~" : " ", Map_Regular(pTemp->p1)->Num,
260 Map_IsComplement(pTemp->p2) ? "~" : " ", Map_Regular(pTemp->p2)->Num );
261 printf( "\n" );
262 }
263 return vAnds;
264}
void Map_CutInternalNodes_rec(Map_Node_t *pObj, Vec_Ptr_t *vAnds)
#define Map_Regular(p)
Definition mapper.h:68
#define Map_IsComplement(p)
GLOBAL VARIABLES ///.
Definition mapper.h:67
struct Map_NodeStruct_t_ Map_Node_t
Definition mapper.h:41
Map_Node_t * ppLeaves[6]
Definition mapperInt.h:269
Map_Man_t * p
Definition mapperInt.h:208
Map_Node_t * p2
Definition mapperInt.h:226
Map_Node_t * p1
Definition mapperInt.h:225
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition vecPtr.h:42
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
Definition vecPtr.h:55
Here is the call graph for this function:

◆ Map_CutInternalNodes_rec()

void Map_CutInternalNodes_rec ( Map_Node_t * pObj,
Vec_Ptr_t * vAnds )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 233 of file mapperCutUtils.c.

234{
235 if ( pObj->TravId == pObj->p->nTravIds )
236 return;
237 pObj->TravId = pObj->p->nTravIds;
238 Map_CutInternalNodes_rec( Map_Regular(pObj->p1), vAnds );
239 Map_CutInternalNodes_rec( Map_Regular(pObj->p2), vAnds );
240 Vec_PtrPush( vAnds, pObj );
241}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_CutListAppend()

Map_Cut_t * Map_CutListAppend ( Map_Cut_t * pSetAll,
Map_Cut_t * pSets )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 165 of file mapperCutUtils.c.

166{
167 Map_Cut_t * pPrev = NULL; // Suppress "might be used uninitialized"
168 Map_Cut_t * pTemp;
169 if ( pSetAll == NULL )
170 return pSets;
171 if ( pSets == NULL )
172 return pSetAll;
173 // find the last one
174 for ( pTemp = pSets; pTemp; pTemp = pTemp->pNext )
175 pPrev = pTemp;
176 // append all the end of the current set
177 assert( pPrev->pNext == NULL );
178 pPrev->pNext = pSetAll;
179 return pSets;
180}
Map_Cut_t * pNext
Definition mapperInt.h:266

◆ Map_CutListCount()

int Map_CutListCount ( Map_Cut_t * pSets)

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 214 of file mapperCutUtils.c.

215{
216 Map_Cut_t * pTemp;
217 int i;
218 for ( i = 0, pTemp = pSets; pTemp; pTemp = pTemp->pNext, i++ );
219 return i;
220}

◆ Map_CutListRecycle()

void Map_CutListRecycle ( Map_Man_t * p,
Map_Cut_t * pSetList,
Map_Cut_t * pSave )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 193 of file mapperCutUtils.c.

194{
195 Map_Cut_t * pNext, * pTemp;
196 for ( pTemp = pSetList, pNext = pTemp? pTemp->pNext : NULL;
197 pTemp;
198 pTemp = pNext, pNext = pNext? pNext->pNext : NULL )
199 if ( pTemp != pSave )
200 Extra_MmFixedEntryRecycle( p->mmCuts, (char *)pTemp );
201}
Here is the call graph for this function:

◆ Map_CutPrint()

void Map_CutPrint ( Map_Man_t * p,
Map_Node_t * pRoot,
Map_Cut_t * pCut,
int fPhase )

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 92 of file mapperCutUtils.c.

93{
94 int i;
95 printf( "CUT: Delay = (%4.2f, %4.2f). Area = %4.2f. Nodes = %d -> {",
96 pCut->M[fPhase].tArrive.Rise, pCut->M[fPhase].tArrive.Fall, pCut->M[fPhase].AreaFlow, pRoot->Num );
97 for ( i = 0; i < pCut->nLeaves; i++ )
98 printf( " %d", pCut->ppLeaves[i]->Num );
99 printf( " } \n" );
100}

◆ Map_NodeGetLeafPhase()

int Map_NodeGetLeafPhase ( Map_Node_t * pNode,
int fPhase,
int iLeaf )

function*************************************************************

synopsis [Computes the exact area associated with the cut.]

description []

sideeffects []

seealso []

Definition at line 148 of file mapperCutUtils.c.

149{
150 assert( pNode->pCutBest[fPhase]->M[fPhase].pSuperBest );
151 return (( pNode->pCutBest[fPhase]->M[fPhase].uPhaseBest & (1<<iLeaf) ) == 0);
152}
Map_Cut_t * pCutBest[2]
Definition mapperInt.h:243