abc/src/map/mapper/mapperUtils.c
/**Function*************************************************************

  Synopsis    [Reports statistics on choice nodes.]

  Description [The number of choice nodes is the number of primary nodes,
  which has pNextE set to a pointer. The number of choices is the number
  of entries in the equivalent-node lists of the primary nodes.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Reports statistics on choice nodes.]

Description [The number of choice nodes is the number of primary nodes,
which has pNextE set to a pointer. The number of choices is the number
of entries in the equivalent-node lists of the primary nodes.]




Function Synopsis [ Reports statistics on choice nodes . ] Description [ The number of choice nodes is the number of primary nodes which has pNextE set to a pointer . The number of choices is the number of entries in the equivalent - node lists of the primary nodes . ]
void Map_MappingReportChoices( Map_Man_t * pMan )
{
    Map_Node_t * pNode, * pTemp;
    int nChoiceNodes, nChoices;
    int i, LevelMax1, LevelMax2;
    LevelMax1 = Map_MappingGetMaxLevel( pMan );
    pMan->nTravIds++;
    for ( i = 0; i < pMan->nOutputs; i++ )
        Map_MappingUpdateLevel_rec( pMan, Map_Regular(pMan->pOutputs[i]), 0 );
    LevelMax2 = Map_MappingGetMaxLevel( pMan );
    nChoiceNodes = nChoices = 0;
    for ( i = 0; i < pMan->vMapObjs->nSize; i++ )
    {
        pNode = pMan->vMapObjs->pArray[i];
        if ( pNode->pRepr == NULL && pNode->pNextE != NULL )
        { 
            nChoiceNodes++;
            for ( pTemp = pNode; pTemp; pTemp = pTemp->pNextE )
                nChoices++;
        }
    }
    printf( "Maximum level: Original = %d. Reduced due to choices = %d.\n", LevelMax1, LevelMax2 );
    printf( "Choice stats:  Choice nodes = %d. Total choices = %d.\n", nChoiceNodes, nChoices );
}
void Map_MappingReportChoices ( Map_Man_t * pMan ) { Map_Node_t * pNode , * pTemp ; int nChoiceNodes , nChoices ; int i , LevelMax1 , LevelMax2 ; LevelMax1 = Map_MappingGetMaxLevel ( pMan ) ; pMan -> nTravIds ++ ; for ( i = 0 ; i < pMan -> nOutputs ; i ++ ) Map_MappingUpdateLevel_rec ( pMan , Map_Regular ( pMan -> pOutputs [ i ] ) , 0 ) ; LevelMax2 = Map_MappingGetMaxLevel ( pMan ) ; nChoiceNodes = nChoices = 0 ; for ( i = 0 ; i < pMan -> vMapObjs -> nSize ; i ++ ) { pNode = pMan -> vMapObjs -> pArray [ i ] ; if ( pNode -> pRepr == NULL && pNode -> pNextE != NULL ) { nChoiceNodes ++ ; for ( pTemp = pNode ; pTemp ; pTemp = pTemp -> pNextE ) nChoices ++ ; } } printf ( " \n " , LevelMax1 , LevelMax2 ) ; printf ( " \n " , nChoiceNodes , nChoices ) ; }
Function
Synopsis    [Reports statistics on choice nodes.]
Function Synopsis [ Reports statistics on choice nodes . ]
// report the number of levels // report statistics about choices // this is a choice node = the primary node that has equivalent nodes