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

  Synopsis    [Looks up an entry in the library.]

  Description [This function looks up the function, given by its truth table,
  and return two things: (1) the linked list of supergates, which can implement
  the functions of this N-class; (2) the phase, which should be applied to the
  given function, in order to derive the canonical form of this N-class.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Looks up an entry in the library.]

Description [This function looks up the function, given by its truth table,
and return two things: (1) the linked list of supergates, which can implement
the functions of this N-class; (2) the phase, which should be applied to the
given function, in order to derive the canonical form of this N-class.]




Function Synopsis [ Looks up an entry in the library . ] Description [ This function looks up the function given by its truth table and return two things : ( 1 ) the linked list of supergates which can implement the functions of this N - class ; ( 2 ) the phase which should be applied to the given function in order to derive the canonical form of this N - class . ]
Map_Super_t * Map_SuperTableLookup( Map_HashTable_t * p, unsigned uTruth[], unsigned * puPhase )
{
    Map_HashEntry_t * pEnt;
    unsigned Key;
    Key = MAP_TABLE_HASH( uTruth[0], uTruth[1], p->nBins );
    for ( pEnt = p->pBins[Key]; pEnt; pEnt = pEnt->pNext )
        if ( pEnt->uTruth[0] == uTruth[0] && pEnt->uTruth[1] == uTruth[1] )
        {
            *puPhase = pEnt->uPhase;
            return pEnt->pGates;
        }
    return NULL;
}
Map_Super_t * Map_SuperTableLookup ( Map_HashTable_t * p , unsigned uTruth [ ] , unsigned * puPhase ) { Map_HashEntry_t * pEnt ; unsigned Key ; Key = MAP_TABLE_HASH ( uTruth [ 0 ] , uTruth [ 1 ] , p -> nBins ) ; for ( pEnt = p -> pBins [ Key ] ; pEnt ; pEnt = pEnt -> pNext ) if ( pEnt -> uTruth [ 0 ] == uTruth [ 0 ] && pEnt -> uTruth [ 1 ] == uTruth [ 1 ] ) { * puPhase = pEnt -> uPhase ; return pEnt -> pGates ; } return NULL ; }
Function
Synopsis    [Looks up an entry in the library.]
Function Synopsis [ Looks up an entry in the library . ]