abc/src/aig/gia/giaSweeper.c
/**Function*************************************************************

  Synopsis    [Procedure to perform conditional fraig sweeping on separate logic cones.]

  Description [The procedure takes GIA with the sweeper defined. The sweeper
  is assumed to have some conditions currently pushed, which will be used
  as constraints for fraig sweeping. The second argument (vProbes) contains
  the array of probe IDs pointing to the user's logic cones to be SAT swept.
  Finally, the optional command line (pCommLine) is an ABC command line
  to be applied to the resulting GIA after SAT sweeping before it is 
  grafted back into the original GIA manager. The return value is the status
  (success/failure) and the array of original probes possibly pointing to the
  new literals in the original GIA manager, corresponding to the user's
  logic cones after sweeping, synthesis and grafting.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Procedure to perform conditional fraig sweeping on separate logic cones.]

Description [The procedure takes GIA with the sweeper defined. The sweeper
is assumed to have some conditions currently pushed, which will be used
as constraints for fraig sweeping. The second argument (vProbes) contains
the array of probe IDs pointing to the user's logic cones to be SAT swept.
Finally, the optional command line (pCommLine) is an ABC command line
to be applied to the resulting GIA after SAT sweeping before it is
grafted back into the original GIA manager. The return value is the status
(success/failure) and the array of original probes possibly pointing to the
new literals in the original GIA manager, corresponding to the user's
logic cones after sweeping, synthesis and grafting.]




Function Synopsis [ Procedure to perform conditional fraig sweeping on separate logic cones . ] Description [ The procedure takes GIA with the sweeper defined . The sweeper is assumed to have some conditions currently pushed which will be used as constraints for fraig sweeping . The second argument ( vProbes ) contains the array of probe IDs pointing to the user ' s logic cones to be SAT swept . Finally the optional command line ( pCommLine ) is an ABC command line to be applied to the resulting GIA after SAT sweeping before it is grafted back into the original GIA manager . The return value is the status ( success / failure ) and the array of original probes possibly pointing to the new literals in the original GIA manager corresponding to the user ' s logic cones after sweeping synthesis and grafting . ]
int Gia_SweeperFraig( Gia_Man_t * p, Vec_Int_t * vProbeIds, char * pCommLime, int nWords, int nConfs, int fVerify, int fVerbose )
{
    Gia_Man_t * pNew;
    Vec_Int_t * vLits;
    int ProbeId, i;
    assert( Gia_SweeperIsRunning(p) );
    pNew = Gia_SweeperSweep( p, vProbeIds, nWords, nConfs, fVerify, fVerbose );
    if ( pNew == NULL )
        return 0;
    if ( pCommLime )
    {
        Abc_FrameUpdateGia( Abc_FrameGetGlobalFrame(), pNew );
         pCommLine using Abc_CmdCommandExecute()
        Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), pCommLime );
        pNew = Abc_FrameGetGia( Abc_FrameGetGlobalFrame() );
    }
    vLits = Gia_SweeperGraft( p, NULL, pNew );
    Gia_ManStop( pNew );
    Vec_IntForEachEntry( vProbeIds, ProbeId, i )
        Gia_SweeperProbeUpdate( p, ProbeId, Vec_IntEntry(vLits, i) );
    Vec_IntFree( vLits );        
    return 1;
}
int Gia_SweeperFraig ( Gia_Man_t * p , Vec_Int_t * vProbeIds , char * pCommLime , int nWords , int nConfs , int fVerify , int fVerbose ) { Gia_Man_t * pNew ; Vec_Int_t * vLits ; int ProbeId , i ; assert ( Gia_SweeperIsRunning ( p ) ) ; pNew = Gia_SweeperSweep ( p , vProbeIds , nWords , nConfs , fVerify , fVerbose ) ; if ( pNew == NULL ) return 0 ; if ( pCommLime ) { Abc_FrameUpdateGia ( Abc_FrameGetGlobalFrame ( ) , pNew ) ; Cmd_CommandExecute ( Abc_FrameGetGlobalFrame ( ) , pCommLime ) ; pNew = Abc_FrameGetGia ( Abc_FrameGetGlobalFrame ( ) ) ; } vLits = Gia_SweeperGraft ( p , NULL , pNew ) ; Gia_ManStop ( pNew ) ; Vec_IntForEachEntry ( vProbeIds , ProbeId , i ) Gia_SweeperProbeUpdate ( p , ProbeId , Vec_IntEntry ( vLits , i ) ) ; Vec_IntFree ( vLits ) ; return 1 ; }
Function
Synopsis    [Procedure to perform conditional fraig sweeping on separate logic cones.]
Function Synopsis [ Procedure to perform conditional fraig sweeping on separate logic cones . ]
// sweeper is running // sweep the logic // execute command line // set pNew to be current GIA in ABC // execute command line pCommLine using Abc_CmdCommandExecute() // get pNew to be current GIA in ABC      // return logic back into the main manager // update the array of probes