diff options
| author | Alan Mishchenko <alanmi@berkeley.edu> | 2021-06-08 11:39:42 -0700 | 
|---|---|---|
| committer | Alan Mishchenko <alanmi@berkeley.edu> | 2021-06-08 11:39:42 -0700 | 
| commit | db3f5b6d0bac98b9123681a1189acf738cae83d6 (patch) | |
| tree | ada84874f727495112edaecdc8c8a2ec2bc1fdd4 | |
| parent | 7d18d6b7aad526ba73b761f3c2f9292f7546b611 (diff) | |
| download | abc-db3f5b6d0bac98b9123681a1189acf738cae83d6.tar.gz abc-db3f5b6d0bac98b9123681a1189acf738cae83d6.tar.bz2 abc-db3f5b6d0bac98b9123681a1189acf738cae83d6.zip  | |
Experiments with cut computation.
| -rw-r--r-- | src/aig/gia/giaCut.c | 4 | ||||
| -rw-r--r-- | src/aig/gia/giaResub2.c | 42 | 
2 files changed, 44 insertions, 2 deletions
diff --git a/src/aig/gia/giaCut.c b/src/aig/gia/giaCut.c index fc5396c9..7ee795b6 100644 --- a/src/aig/gia/giaCut.c +++ b/src/aig/gia/giaCut.c @@ -767,7 +767,9 @@ void Gia_ManPrintWinStats( Vec_Wec_t * vCuts )  }  void Gia_ManExtractTest( Gia_Man_t * pGia )  { -    Vec_Wec_t * vCutsSel = Gia_ManExtractCuts( pGia, 8, 10000, 1 ); +    extern Vec_Wec_t * Gia_ManExtractCuts2( Gia_Man_t * p, int nCutSize, int nCuts, int fVerbose ); +    Vec_Wec_t * vCutsSel = Gia_ManExtractCuts2( pGia, 8, 10000, 1 ); +    //Vec_Wec_t * vCutsSel = Gia_ManExtractCuts( pGia, 8, 10000, 1 );      abctime clk = Abc_Clock();      Gia_ManCreateWins( pGia, vCutsSel );      //Gia_ManPrintWins( vCutsSel ); diff --git a/src/aig/gia/giaResub2.c b/src/aig/gia/giaResub2.c index 89ddaf33..be527d4f 100644 --- a/src/aig/gia/giaResub2.c +++ b/src/aig/gia/giaResub2.c @@ -1498,10 +1498,50 @@ void Gia_RsbTestArray()      Vec_IntFree( vArray );  } +/**Function************************************************************* + +  Synopsis    [Computing cuts of the nodes.] + +  Description [] +                +  SideEffects [] + +  SeeAlso     [] + +***********************************************************************/ +Vec_Wec_t * Gia_ManExtractCuts2( Gia_Man_t * p, int nCutSize, int nCuts, int fVerbose ) +{ +    int c, nLevelMax = 8; +    abctime clk = Abc_Clock(); +    Vec_Wec_t * vCuts = Vec_WecStart( nCuts ); +    Vec_Int_t * vPaths = Vec_IntStart( Gia_ManObjNum(p) ); +    srand( time(NULL) ); +    for ( c = 0; c < nCuts; ) +    { +        Vec_Int_t * vCut, * vWin = NULL; +        while ( vWin == NULL ) +        { +            int iPivot = 1 + Gia_ManCiNum(p) + rand() % Gia_ManAndNum(p); +            assert( Gia_ObjIsAnd(Gia_ManObj(p, iPivot)) ); +            vWin = Gia_RsbWindowInit( p, vPaths, iPivot, nLevelMax ); +        } +        vCut = Gia_RsbCreateWindowInputs( p, vWin ); +        if ( Vec_IntSize(vCut) >= nCutSize - 2 && Vec_IntSize(vCut) <= nCutSize ) +        { +            Vec_IntPush( Vec_WecEntry(vCuts, c), Vec_IntSize(vCut) ); +            Vec_IntAppend( Vec_WecEntry(vCuts, c++), vCut ); +        } +        Vec_IntFree( vCut ); +        Vec_IntFree( vWin ); +    } +    Vec_IntFree( vPaths ); +    Abc_PrintTime( 0, "Computing cuts  ", Abc_Clock() - clk ); +    return vCuts; +} +  ////////////////////////////////////////////////////////////////////////  ///                       END OF FILE                                ///  //////////////////////////////////////////////////////////////////////// -  ABC_NAMESPACE_IMPL_END  | 
