Exemplo n.º 1
0
ABC_NAMESPACE_IMPL_START

////////////////////////////////////////////////////////////////////////
///                        DECLARATIONS                              ///
////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////
///                     FUNCTION DEFINITIONS                         ///
////////////////////////////////////////////////////////////////////////

/**Function*************************************************************

  Synopsis    [Node type conversions.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
char * Ptr_HopToType( Abc_Obj_t * pObj )
{
    static word uTruth, uTruths6[3] = {
        ABC_CONST(0xAAAAAAAAAAAAAAAA),
        ABC_CONST(0xCCCCCCCCCCCCCCCC),
        ABC_CONST(0xF0F0F0F0F0F0F0F0),
    };
    assert( Abc_ObjIsNode(pObj) );
    uTruth = Hop_ManComputeTruth6( (Hop_Man_t *)Abc_ObjNtk(pObj)->pManFunc, (Hop_Obj_t *)pObj->pData, Abc_ObjFaninNum(pObj) );
/*
    if ( uTruth ==  0 )                           return "BAC_BOX_C0";
    if ( uTruth == ~(word)0 )                     return "BAC_BOX_C1";
    if ( uTruth ==  uTruths6[0] )                 return "BAC_BOX_BUF";
    if ( uTruth == ~uTruths6[0] )                 return "BAC_BOX_INV";
    if ( uTruth == (uTruths6[0] & uTruths6[1]) )  return "BAC_BOX_AND";
    if ( uTruth ==~(uTruths6[0] & uTruths6[1]) )  return "BAC_BOX_NAND";
    if ( uTruth == (uTruths6[0] | uTruths6[1]) )  return "BAC_BOX_OR";
    if ( uTruth ==~(uTruths6[0] | uTruths6[1]) )  return "BAC_BOX_NOR";
    if ( uTruth == (uTruths6[0] ^ uTruths6[1]) )  return "BAC_BOX_XOR";
    if ( uTruth ==~(uTruths6[0] ^ uTruths6[1]) )  return "BAC_BOX_XNOR";
*/
    if ( uTruth ==  0 )                           return "Const0T";
    if ( uTruth == ~(word)0 )                     return "Const1T";
    if ( uTruth ==  uTruths6[0] )                 return "BufT";
    if ( uTruth == ~uTruths6[0] )                 return "InvT";
    if ( uTruth == (uTruths6[0] & uTruths6[1]) )  return "AndT";
    if ( uTruth ==~(uTruths6[0] & uTruths6[1]) )  return "NandT";
    if ( uTruth == (uTruths6[0] | uTruths6[1]) )  return "OrT";
    if ( uTruth ==~(uTruths6[0] | uTruths6[1]) )  return "NorT";
    if ( uTruth == (uTruths6[0] ^ uTruths6[1]) )  return "XorT";
    if ( uTruth ==~(uTruths6[0] ^ uTruths6[1]) )  return "XnorT";
    assert( 0 );
    return NULL;
}
Exemplo n.º 2
0
ABC_NAMESPACE_IMPL_START


////////////////////////////////////////////////////////////////////////
///                        DECLARATIONS                              ///
////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////
///                     FUNCTION DEFINITIONS                         ///
////////////////////////////////////////////////////////////////////////

/**Function*************************************************************

  Synopsis    [Find the array of nodes to be updated.]

  Description []

  SideEffects []

  SeeAlso     []

***********************************************************************/
void Abc_SclFindWindow( Abc_Obj_t * pPivot, Vec_Int_t ** pvNodes, Vec_Int_t ** pvEvals )
{
    Abc_Ntk_t * p = Abc_ObjNtk(pPivot);
    Abc_Obj_t * pObj, * pNext, * pNext2;
    Vec_Int_t * vNodes = *pvNodes;
    Vec_Int_t * vEvals = *pvEvals;
    int i, k;
    assert( Abc_ObjIsNode(pPivot) );
    // collect fanins, node, and fanouts
    Vec_IntClear( vNodes );
    Abc_ObjForEachFanin( pPivot, pNext, i )
//        if ( Abc_ObjIsNode(pNext) && Abc_ObjFaninNum(pNext) > 0 )
    if ( Abc_ObjIsCi(pNext) || Abc_ObjFaninNum(pNext) > 0 )
        Vec_IntPush( vNodes, Abc_ObjId(pNext) );
    Vec_IntPush( vNodes, Abc_ObjId(pPivot) );
    Abc_ObjForEachFanout( pPivot, pNext, i )
    if ( Abc_ObjIsNode(pNext) )
    {
        Vec_IntPush( vNodes, Abc_ObjId(pNext) );
        Abc_ObjForEachFanout( pNext, pNext2, k )
        if ( Abc_ObjIsNode(pNext2) )
            Vec_IntPush( vNodes, Abc_ObjId(pNext2) );
    }
    Vec_IntUniqify( vNodes );
    // label nodes
    Abc_NtkForEachObjVec( vNodes, p, pObj, i )
    {
        assert( pObj->fMarkB == 0 );
        pObj->fMarkB = 1;
    }
Exemplo n.º 3
0
/**Function*************************************************************

  Synopsis    [Prints initial state information.]

  Description [Prints distribution of 0,1,and X initial states.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
static inline int
Abc_FlowRetime_ObjFirstNonLatchBox( Abc_Obj_t * pOrigObj, Abc_Obj_t ** pResult ) {
  int lag = 0;
  Abc_Ntk_t *pNtk;
  *pResult = pOrigObj;
  pNtk = Abc_ObjNtk( pOrigObj );

  Abc_NtkIncrementTravId( pNtk );

  while( Abc_ObjIsBo(*pResult) || Abc_ObjIsLatch(*pResult) || Abc_ObjIsBi(*pResult) ) {
    assert(Abc_ObjFaninNum(*pResult));
    *pResult = Abc_ObjFanin0(*pResult);
    
    if (Abc_NodeIsTravIdCurrent(*pResult))
      return -1;
    Abc_NodeSetTravIdCurrent(*pResult);

    if (Abc_ObjIsLatch(*pResult)) ++lag;
  }

  return lag;
}