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

Go to the source code of this file.

Functions

float Map_SwitchCutGetDerefed (Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
 FUNCTION DEFINITIONS ///.
 
float Map_SwitchCutRef (Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
 
float Map_SwitchCutDeref (Map_Node_t *pNode, Map_Cut_t *pCut, int fPhase)
 
float Map_MappingGetSwitching (Map_Man_t *pMan)
 

Function Documentation

◆ Map_MappingGetSwitching()

float Map_MappingGetSwitching ( Map_Man_t * pMan)

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

Synopsis [Computes the array of mapping.]

Description []

SideEffects []

SeeAlso []

Definition at line 187 of file mapperSwitch.c.

188{
189 Map_Node_t * pNode;
190 float Switch = 0.0;
191 int i;
192 for ( i = 0; i < pMan->vMapObjs->nSize; i++ )
193 {
194 pNode = pMan->vMapObjs->pArray[i];
195 if ( pNode->nRefAct[2] == 0 )
196 continue;
197 // at least one phase has the best cut assigned
198 assert( pNode->pCutBest[0] != NULL || pNode->pCutBest[1] != NULL );
199 // at least one phase is used in the mapping
200 assert( pNode->nRefAct[0] > 0 || pNode->nRefAct[1] > 0 );
201 // compute the array due to the supergate
202 if ( Map_NodeIsAnd(pNode) )
203 {
204 // count switching of the negative phase
205 if ( pNode->pCutBest[0] && (pNode->nRefAct[0] > 0 || pNode->pCutBest[1] == NULL) )
206 Switch += pNode->Switching;
207 // count switching of the positive phase
208 if ( pNode->pCutBest[1] && (pNode->nRefAct[1] > 0 || pNode->pCutBest[0] == NULL) )
209 Switch += pNode->Switching;
210 }
211 // count switching of the interver if we need to implement one phase with another phase
212 if ( (pNode->pCutBest[0] == NULL && pNode->nRefAct[0] > 0) ||
213 (pNode->pCutBest[1] == NULL && pNode->nRefAct[1] > 0) )
214 Switch += pNode->Switching; // inverter switches the same as the node
215 }
216 // add buffers for each CO driven by a CI
217 for ( i = 0; i < pMan->nOutputs; i++ )
218 if ( Map_NodeIsVar(pMan->pOutputs[i]) && !Map_IsComplement(pMan->pOutputs[i]) )
219 Switch += pMan->pOutputs[i]->Switching;
220 return Switch;
221}
int Map_NodeIsVar(Map_Node_t *p)
int Map_NodeIsAnd(Map_Node_t *p)
#define Map_IsComplement(p)
GLOBAL VARIABLES ///.
Definition mapper.h:67
struct Map_NodeStruct_t_ Map_Node_t
Definition mapper.h:41
Map_Cut_t * pCutBest[2]
Definition mapperInt.h:243
#define assert(ex)
Definition util_old.h:213
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Map_SwitchCutDeref()

float Map_SwitchCutDeref ( Map_Node_t * pNode,
Map_Cut_t * pCut,
int fPhase )

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

synopsis [References the cut.]

description []

sideeffects []

seealso []

Definition at line 82 of file mapperSwitch.c.

83{
84 return Map_SwitchCutRefDeref( pNode, pCut, fPhase, 0 ); // dereference
85}
Here is the caller graph for this function:

◆ Map_SwitchCutGetDerefed()

float Map_SwitchCutGetDerefed ( Map_Node_t * pNode,
Map_Cut_t * pCut,
int fPhase )

FUNCTION DEFINITIONS ///.

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

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

description []

sideeffects []

seealso []

Definition at line 45 of file mapperSwitch.c.

46{
47 float aResult, aResult2;
48// assert( pNode->Switching > 0 );
49 aResult2 = Map_SwitchCutRefDeref( pNode, pCut, fPhase, 1 ); // reference
50 aResult = Map_SwitchCutRefDeref( pNode, pCut, fPhase, 0 ); // dereference
51// assert( aResult == aResult2 );
52 return aResult;
53}
Here is the caller graph for this function:

◆ Map_SwitchCutRef()

float Map_SwitchCutRef ( Map_Node_t * pNode,
Map_Cut_t * pCut,
int fPhase )

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

synopsis [References the cut.]

description []

sideeffects []

seealso []

Definition at line 66 of file mapperSwitch.c.

67{
68 return Map_SwitchCutRefDeref( pNode, pCut, fPhase, 1 ); // reference
69}
Here is the caller graph for this function: