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

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START
Map_Cut_t
Map_CutAlloc (Map_Man_t *p)
 DECLARATIONS ///. More...
 
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)
 

Function Documentation

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 }
char * memset()
#define MAP_FLOAT_LARGE
Definition: mapperInt.h:60
static Llb_Mgr_t * p
Definition: llb3Image.c:950
char * Extra_MmFixedEntryFetch(Extra_MmFixed_t *p)
Map_Time_t tArrive
Definition: mapperInt.h:255
Map_Match_t M[2]
Definition: mapperInt.h:271
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 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void Extra_MmFixedEntryRecycle(Extra_MmFixed_t *p, char *pEntry)
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 }
unsigned uPhaseBest
Definition: mapperInt.h:252
Map_Super_t * pSuperBest
Definition: mapperInt.h:253
#define assert(ex)
Definition: util_old.h:213
Map_Match_t M[2]
Definition: mapperInt.h:271
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 }
Map_Super_t * pSuperBest
Definition: mapperInt.h:253
#define assert(ex)
Definition: util_old.h:213
Map_Match_t M[2]
Definition: mapperInt.h:271
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:262
#define assert(ex)
Definition: util_old.h:213
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_Cut_t * pNext
Definition: mapperInt.h:262
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 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
Map_Cut_t * pNext
Definition: mapperInt.h:262
void Extra_MmFixedEntryRecycle(Extra_MmFixed_t *p, char *pEntry)
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_Time_t tArrive
Definition: mapperInt.h:255
Map_Match_t M[2]
Definition: mapperInt.h:271
Map_Node_t * ppLeaves[6]
Definition: mapperInt.h:265
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:239
unsigned uPhaseBest
Definition: mapperInt.h:252
Map_Super_t * pSuperBest
Definition: mapperInt.h:253
#define assert(ex)
Definition: util_old.h:213
Map_Match_t M[2]
Definition: mapperInt.h:271