summaryrefslogtreecommitdiffstats
path: root/src/map/mapper
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2005-09-05 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2005-09-05 08:01:00 -0700
commit1260d20cc05fe2d21088cc047c460e85ccdb3b14 (patch)
treef10ccc3333f78b6e2e089a88c8cf61a47b2f2dcd /src/map/mapper
parent33012d9530c40817e1fc5230b3e663f7690b2e94 (diff)
downloadabc-1260d20cc05fe2d21088cc047c460e85ccdb3b14.tar.gz
abc-1260d20cc05fe2d21088cc047c460e85ccdb3b14.tar.bz2
abc-1260d20cc05fe2d21088cc047c460e85ccdb3b14.zip
Version abc50905
Diffstat (limited to 'src/map/mapper')
-rw-r--r--src/map/mapper/mapper.c8
-rw-r--r--src/map/mapper/mapperLib.c10
-rw-r--r--src/map/mapper/mapperRefs.c2
-rw-r--r--src/map/mapper/mapperSwitch.c38
4 files changed, 16 insertions, 42 deletions
diff --git a/src/map/mapper/mapper.c b/src/map/mapper/mapper.c
index 546186a2..e59fa4a3 100644
--- a/src/map/mapper/mapper.c
+++ b/src/map/mapper/mapper.c
@@ -149,13 +149,13 @@ int Map_CommandReadLibrary( Abc_Frame_t * pAbc, int argc, char **argv )
// replace the current library
// Map_SuperLibFree( s_pSuperLib );
// s_pSuperLib = pLib;
- Map_SuperLibFree( Abc_FrameReadLibSuper(Abc_FrameGetGlobalFrame()) );
- Abc_FrameSetLibSuper( Abc_FrameGetGlobalFrame(), pLib );
+ Map_SuperLibFree( Abc_FrameReadLibSuper() );
+ Abc_FrameSetLibSuper( pLib );
// replace the current genlib library
// if ( s_pLib ) Mio_LibraryDelete( s_pLib );
// s_pLib = s_pSuperLib->pGenlib;
- Mio_LibraryDelete( Abc_FrameReadLibGen(Abc_FrameGetGlobalFrame()) );
- Abc_FrameSetLibGen( Abc_FrameGetGlobalFrame(), pLib->pGenlib );
+ Mio_LibraryDelete( Abc_FrameReadLibGen() );
+ Abc_FrameSetLibGen( pLib->pGenlib );
return 0;
usage:
diff --git a/src/map/mapper/mapperLib.c b/src/map/mapper/mapperLib.c
index 5fea1f00..a9e9e29b 100644
--- a/src/map/mapper/mapperLib.c
+++ b/src/map/mapper/mapperLib.c
@@ -139,15 +139,9 @@ void Map_SuperLibFree( Map_SuperLib_t * p )
if ( p == NULL ) return;
if ( p->pGenlib )
{
-// if ( s_pLib == p->pGenlib )
-// s_pLib = NULL;
-// if ( Abc_FrameReadLibGen(Abc_FrameGetGlobalFrame()) == p->pGenlib )
-// Abc_FrameSetLibGen(Abc_FrameGetGlobalFrame(), NULL);
-// Mio_LibraryDelete( p->pGenlib );
-
- assert( p->pGenlib == Abc_FrameReadLibGen(Abc_FrameGetGlobalFrame()) );
+ assert( p->pGenlib == Abc_FrameReadLibGen() );
Mio_LibraryDelete( p->pGenlib );
- Abc_FrameSetLibGen(Abc_FrameGetGlobalFrame(), NULL);
+ Abc_FrameSetLibGen( NULL );
}
if ( p->tTableC )
Map_SuperTableFree( p->tTableC );
diff --git a/src/map/mapper/mapperRefs.c b/src/map/mapper/mapperRefs.c
index e4adadae..baaebfa1 100644
--- a/src/map/mapper/mapperRefs.c
+++ b/src/map/mapper/mapperRefs.c
@@ -542,7 +542,7 @@ float Map_MappingGetArea( Map_Man_t * pMan, Map_NodeVec_t * vMapping )
(pNode->pCutBest[1] == NULL && pNode->nRefAct[1] > 0) )
Area += pMan->pSuperLib->AreaInv;
}
- // add buffer for each CO driven by a CI
+ // add buffers for each CO driven by a CI
for ( i = 0; i < pMan->nOutputs; i++ )
if ( Map_NodeIsVar(pMan->pOutputs[i]) && !Map_IsComplement(pMan->pOutputs[i]) )
Area += pMan->pSuperLib->AreaBuf;
diff --git a/src/map/mapper/mapperSwitch.c b/src/map/mapper/mapperSwitch.c
index 02f38396..13168b47 100644
--- a/src/map/mapper/mapperSwitch.c
+++ b/src/map/mapper/mapperSwitch.c
@@ -23,7 +23,6 @@
////////////////////////////////////////////////////////////////////////
static float Map_SwitchCutRefDeref( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhase, int fReference );
-static float Map_CutGetSwitching( Map_Cut_t * pCut );
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFITIONS ///
@@ -100,11 +99,13 @@ float Map_SwitchCutRefDeref( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhase, i
Map_Cut_t * pCutChild;
float aSwitchActivity;
int i, fPhaseChild;
+
+ // start switching activity for the node
+ aSwitchActivity = pNode->Switching;
// consider the elementary variable
if ( pCut->nLeaves == 1 )
- return 0;
- // start the area of this cut
- aSwitchActivity = Map_CutGetSwitching( pCut );
+ return aSwitchActivity;
+
// go through the children
assert( pCut->M[fPhase].pSuperBest );
for ( i = 0; i < pCut->nLeaves; i++ )
@@ -127,7 +128,7 @@ float Map_SwitchCutRefDeref( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhase, i
// inverter should be added if the phase
// (a) has no reference and (b) is implemented using other phase
if ( pNodeChild->nRefAct[fPhaseChild]++ == 0 && pNodeChild->pCutBest[fPhaseChild] == NULL )
- aSwitchActivity += pNodeChild->Switching;
+ aSwitchActivity += pNodeChild->Switching; // inverter switches the same as the node
// if the node is referenced, there is no recursive call
if ( pNodeChild->nRefAct[2]++ > 0 )
continue;
@@ -147,7 +148,7 @@ float Map_SwitchCutRefDeref( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhase, i
// inverter should be added if the phase
// (a) has no reference and (b) is implemented using other phase
if ( --pNodeChild->nRefAct[fPhaseChild] == 0 && pNodeChild->pCutBest[fPhaseChild] == NULL )
- aSwitchActivity += pNodeChild->Switching;
+ aSwitchActivity += pNodeChild->Switching; // inverter switches the same as the node
// if the node is referenced, there is no recursive call
if ( --pNodeChild->nRefAct[2] > 0 )
continue;
@@ -169,27 +170,6 @@ float Map_SwitchCutRefDeref( Map_Node_t * pNode, Map_Cut_t * pCut, int fPhase, i
return aSwitchActivity;
}
-/**function*************************************************************
-
- synopsis [Computes the exact area associated with the cut.]
-
- description []
-
- sideeffects []
-
- seealso []
-
-***********************************************************************/
-float Map_CutGetSwitching( Map_Cut_t * pCut )
-{
- float Result;
- int i;
- Result = 0.0;
- for ( i = 0; i < pCut->nLeaves; i++ )
- Result += pCut->ppLeaves[i]->Switching;
- return Result;
-}
-
/**Function*************************************************************
Synopsis [Computes the array of mapping.]
@@ -227,9 +207,9 @@ float Map_MappingGetSwitching( Map_Man_t * pMan, Map_NodeVec_t * vMapping )
// count switching of the interver if we need to implement one phase with another phase
if ( (pNode->pCutBest[0] == NULL && pNode->nRefAct[0] > 0) ||
(pNode->pCutBest[1] == NULL && pNode->nRefAct[1] > 0) )
- Switch += pNode->Switching;
+ Switch += pNode->Switching; // inverter switches the same as the node
}
- // add buffer for each CO driven by a CI
+ // add buffers for each CO driven by a CI
for ( i = 0; i < pMan->nOutputs; i++ )
if ( Map_NodeIsVar(pMan->pOutputs[i]) && !Map_IsComplement(pMan->pOutputs[i]) )
Switch += pMan->pOutputs[i]->Switching;