ivyResyn.c 5.85 KB
Newer Older
Alan Mishchenko committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/**CFile****************************************************************

  FileName    [ivyResyn.c]

  SystemName  [ABC: Logic synthesis and verification system.]

  PackageName [And-Inverter Graph package.]

  Synopsis    [AIG rewriting script.]

  Author      [Alan Mishchenko]
  
  Affiliation [UC Berkeley]

  Date        [Ver. 1.0. Started - May 11, 2006.]

  Revision    [$Id: ivyResyn.c,v 1.00 2006/05/11 00:00:00 alanmi Exp $]

***********************************************************************/

#include "ivy.h"

23 24 25
ABC_NAMESPACE_IMPL_START


Alan Mishchenko committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
////////////////////////////////////////////////////////////////////////
///                        DECLARATIONS                              ///
////////////////////////////////////////////////////////////////////////

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

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

  Synopsis    [Performs several passes of rewriting on the AIG.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Ivy_Man_t * Ivy_ManResyn0( Ivy_Man_t * pMan, int fUpdateLevel, int fVerbose )
{
47
    clock_t clk;
Alan Mishchenko committed
48 49 50 51 52 53 54 55
    Ivy_Man_t * pTemp;

if ( fVerbose ) { printf( "Original:\n" ); }
if ( fVerbose ) Ivy_ManPrintStats( pMan );

clk = clock();
    pMan = Ivy_ManBalance( pMan, fUpdateLevel );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
56
if ( fVerbose ) { ABC_PRT( "Balance", clock() - clk ); }
Alan Mishchenko committed
57 58 59 60 61 62
if ( fVerbose ) Ivy_ManPrintStats( pMan );

//    Ivy_ManRewriteAlg( pMan, fUpdateLevel, 0 );
clk = clock();
    Ivy_ManRewritePre( pMan, fUpdateLevel, 0, 0 );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
63
if ( fVerbose ) { ABC_PRT( "Rewrite", clock() - clk ); }
Alan Mishchenko committed
64 65 66 67 68 69
if ( fVerbose ) Ivy_ManPrintStats( pMan );

clk = clock();
    pMan = Ivy_ManBalance( pTemp = pMan, fUpdateLevel );
    Ivy_ManStop( pTemp );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
70
if ( fVerbose ) { ABC_PRT( "Balance", clock() - clk ); }
Alan Mishchenko committed
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
if ( fVerbose ) Ivy_ManPrintStats( pMan );
    return pMan;
}

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

  Synopsis    [Performs several passes of rewriting on the AIG.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Ivy_Man_t * Ivy_ManResyn( Ivy_Man_t * pMan, int fUpdateLevel, int fVerbose )
{
88
    clock_t clk;
Alan Mishchenko committed
89 90 91 92 93 94 95 96
    Ivy_Man_t * pTemp;

if ( fVerbose ) { printf( "Original:\n" ); }
if ( fVerbose ) Ivy_ManPrintStats( pMan );

clk = clock();
    pMan = Ivy_ManBalance( pMan, fUpdateLevel );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
97
if ( fVerbose ) { ABC_PRT( "Balance", clock() - clk ); }
Alan Mishchenko committed
98 99 100 101 102 103
if ( fVerbose ) Ivy_ManPrintStats( pMan );

//    Ivy_ManRewriteAlg( pMan, fUpdateLevel, 0 );
clk = clock();
    Ivy_ManRewritePre( pMan, fUpdateLevel, 0, 0 );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
104
if ( fVerbose ) { ABC_PRT( "Rewrite", clock() - clk ); }
Alan Mishchenko committed
105 106 107 108 109 110
if ( fVerbose ) Ivy_ManPrintStats( pMan );

clk = clock();
    pMan = Ivy_ManBalance( pTemp = pMan, fUpdateLevel );
    Ivy_ManStop( pTemp );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
111
if ( fVerbose ) { ABC_PRT( "Balance", clock() - clk ); }
Alan Mishchenko committed
112 113 114 115 116 117
if ( fVerbose ) Ivy_ManPrintStats( pMan );

//    Ivy_ManRewriteAlg( pMan, fUpdateLevel, 1 );
clk = clock();
    Ivy_ManRewritePre( pMan, fUpdateLevel, 1, 0 );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
118
if ( fVerbose ) { ABC_PRT( "Rewrite", clock() - clk ); }
Alan Mishchenko committed
119 120 121 122 123 124
if ( fVerbose ) Ivy_ManPrintStats( pMan );

clk = clock();
    pMan = Ivy_ManBalance( pTemp = pMan, fUpdateLevel );
    Ivy_ManStop( pTemp );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
125
if ( fVerbose ) { ABC_PRT( "Balance", clock() - clk ); }
Alan Mishchenko committed
126 127 128 129 130 131
if ( fVerbose ) Ivy_ManPrintStats( pMan );

//    Ivy_ManRewriteAlg( pMan, fUpdateLevel, 1 );
clk = clock();
    Ivy_ManRewritePre( pMan, fUpdateLevel, 1, 0 );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
132
if ( fVerbose ) { ABC_PRT( "Rewrite", clock() - clk ); }
Alan Mishchenko committed
133 134 135 136 137 138
if ( fVerbose ) Ivy_ManPrintStats( pMan );

clk = clock();
    pMan = Ivy_ManBalance( pTemp = pMan, fUpdateLevel );
    Ivy_ManStop( pTemp );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
139
if ( fVerbose ) { ABC_PRT( "Balance", clock() - clk ); }
Alan Mishchenko committed
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
if ( fVerbose ) Ivy_ManPrintStats( pMan );
    return pMan;
}

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

  Synopsis    [Performs several passes of rewriting on the AIG.]

  Description []
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Ivy_Man_t * Ivy_ManRwsat( Ivy_Man_t * pMan, int fVerbose )
{
157
    clock_t clk;
Alan Mishchenko committed
158 159 160 161 162 163 164 165
    Ivy_Man_t * pTemp;

if ( fVerbose ) { printf( "Original:\n" ); }
if ( fVerbose ) Ivy_ManPrintStats( pMan );

clk = clock();
    Ivy_ManRewritePre( pMan, 0, 0, 0 );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
166
if ( fVerbose ) { ABC_PRT( "Rewrite", clock() - clk ); }
Alan Mishchenko committed
167 168 169 170 171 172 173
if ( fVerbose ) Ivy_ManPrintStats( pMan );

clk = clock();
    pMan = Ivy_ManBalance( pTemp = pMan, 0 );
//    pMan = Ivy_ManDup( pTemp = pMan );
    Ivy_ManStop( pTemp );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
174
if ( fVerbose ) { ABC_PRT( "Balance", clock() - clk ); }
Alan Mishchenko committed
175 176 177 178 179 180
if ( fVerbose ) Ivy_ManPrintStats( pMan );

/*
clk = clock();
    Ivy_ManRewritePre( pMan, 0, 0, 0 );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
181
if ( fVerbose ) { ABC_PRT( "Rewrite", clock() - clk ); }
Alan Mishchenko committed
182 183 184 185 186 187
if ( fVerbose ) Ivy_ManPrintStats( pMan );

clk = clock();
    pMan = Ivy_ManBalance( pTemp = pMan, 0 );
    Ivy_ManStop( pTemp );
if ( fVerbose ) { printf( "\n" ); }
Alan Mishchenko committed
188
if ( fVerbose ) { ABC_PRT( "Balance", clock() - clk ); }
Alan Mishchenko committed
189 190 191 192 193 194 195 196 197 198 199
if ( fVerbose ) Ivy_ManPrintStats( pMan );
*/
    return pMan;
}


////////////////////////////////////////////////////////////////////////
///                       END OF FILE                                ///
////////////////////////////////////////////////////////////////////////


200 201
ABC_NAMESPACE_IMPL_END