abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ivyResyn.c
Go to the documentation of this file.
1 /**CFile****************************************************************
2 
3  FileName [ivyResyn.c]
4 
5  SystemName [ABC: Logic synthesis and verification system.]
6 
7  PackageName [And-Inverter Graph package.]
8 
9  Synopsis [AIG rewriting script.]
10 
11  Author [Alan Mishchenko]
12 
13  Affiliation [UC Berkeley]
14 
15  Date [Ver. 1.0. Started - May 11, 2006.]
16 
17  Revision [$Id: ivyResyn.c,v 1.00 2006/05/11 00:00:00 alanmi Exp $]
18 
19 ***********************************************************************/
20 
21 #include "ivy.h"
22 
24 
25 
26 ////////////////////////////////////////////////////////////////////////
27 /// DECLARATIONS ///
28 ////////////////////////////////////////////////////////////////////////
29 
30 ////////////////////////////////////////////////////////////////////////
31 /// FUNCTION DEFINITIONS ///
32 ////////////////////////////////////////////////////////////////////////
33 
34 /**Function*************************************************************
35 
36  Synopsis [Performs several passes of rewriting on the AIG.]
37 
38  Description []
39 
40  SideEffects []
41 
42  SeeAlso []
43 
44 ***********************************************************************/
45 Ivy_Man_t * Ivy_ManResyn0( Ivy_Man_t * pMan, int fUpdateLevel, int fVerbose )
46 {
47  abctime clk;
48  Ivy_Man_t * pTemp;
49 
50 if ( fVerbose ) { printf( "Original:\n" ); }
51 if ( fVerbose ) Ivy_ManPrintStats( pMan );
52 
53 clk = Abc_Clock();
54  pMan = Ivy_ManBalance( pMan, fUpdateLevel );
55 if ( fVerbose ) { printf( "\n" ); }
56 if ( fVerbose ) { ABC_PRT( "Balance", Abc_Clock() - clk ); }
57 if ( fVerbose ) Ivy_ManPrintStats( pMan );
58 
59 // Ivy_ManRewriteAlg( pMan, fUpdateLevel, 0 );
60 clk = Abc_Clock();
61  Ivy_ManRewritePre( pMan, fUpdateLevel, 0, 0 );
62 if ( fVerbose ) { printf( "\n" ); }
63 if ( fVerbose ) { ABC_PRT( "Rewrite", Abc_Clock() - clk ); }
64 if ( fVerbose ) Ivy_ManPrintStats( pMan );
65 
66 clk = Abc_Clock();
67  pMan = Ivy_ManBalance( pTemp = pMan, fUpdateLevel );
68  Ivy_ManStop( pTemp );
69 if ( fVerbose ) { printf( "\n" ); }
70 if ( fVerbose ) { ABC_PRT( "Balance", Abc_Clock() - clk ); }
71 if ( fVerbose ) Ivy_ManPrintStats( pMan );
72  return pMan;
73 }
74 
75 /**Function*************************************************************
76 
77  Synopsis [Performs several passes of rewriting on the AIG.]
78 
79  Description []
80 
81  SideEffects []
82 
83  SeeAlso []
84 
85 ***********************************************************************/
86 Ivy_Man_t * Ivy_ManResyn( Ivy_Man_t * pMan, int fUpdateLevel, int fVerbose )
87 {
88  abctime clk;
89  Ivy_Man_t * pTemp;
90 
91 if ( fVerbose ) { printf( "Original:\n" ); }
92 if ( fVerbose ) Ivy_ManPrintStats( pMan );
93 
94 clk = Abc_Clock();
95  pMan = Ivy_ManBalance( pMan, fUpdateLevel );
96 if ( fVerbose ) { printf( "\n" ); }
97 if ( fVerbose ) { ABC_PRT( "Balance", Abc_Clock() - clk ); }
98 if ( fVerbose ) Ivy_ManPrintStats( pMan );
99 
100 // Ivy_ManRewriteAlg( pMan, fUpdateLevel, 0 );
101 clk = Abc_Clock();
102  Ivy_ManRewritePre( pMan, fUpdateLevel, 0, 0 );
103 if ( fVerbose ) { printf( "\n" ); }
104 if ( fVerbose ) { ABC_PRT( "Rewrite", Abc_Clock() - clk ); }
105 if ( fVerbose ) Ivy_ManPrintStats( pMan );
106 
107 clk = Abc_Clock();
108  pMan = Ivy_ManBalance( pTemp = pMan, fUpdateLevel );
109  Ivy_ManStop( pTemp );
110 if ( fVerbose ) { printf( "\n" ); }
111 if ( fVerbose ) { ABC_PRT( "Balance", Abc_Clock() - clk ); }
112 if ( fVerbose ) Ivy_ManPrintStats( pMan );
113 
114 // Ivy_ManRewriteAlg( pMan, fUpdateLevel, 1 );
115 clk = Abc_Clock();
116  Ivy_ManRewritePre( pMan, fUpdateLevel, 1, 0 );
117 if ( fVerbose ) { printf( "\n" ); }
118 if ( fVerbose ) { ABC_PRT( "Rewrite", Abc_Clock() - clk ); }
119 if ( fVerbose ) Ivy_ManPrintStats( pMan );
120 
121 clk = Abc_Clock();
122  pMan = Ivy_ManBalance( pTemp = pMan, fUpdateLevel );
123  Ivy_ManStop( pTemp );
124 if ( fVerbose ) { printf( "\n" ); }
125 if ( fVerbose ) { ABC_PRT( "Balance", Abc_Clock() - clk ); }
126 if ( fVerbose ) Ivy_ManPrintStats( pMan );
127 
128 // Ivy_ManRewriteAlg( pMan, fUpdateLevel, 1 );
129 clk = Abc_Clock();
130  Ivy_ManRewritePre( pMan, fUpdateLevel, 1, 0 );
131 if ( fVerbose ) { printf( "\n" ); }
132 if ( fVerbose ) { ABC_PRT( "Rewrite", Abc_Clock() - clk ); }
133 if ( fVerbose ) Ivy_ManPrintStats( pMan );
134 
135 clk = Abc_Clock();
136  pMan = Ivy_ManBalance( pTemp = pMan, fUpdateLevel );
137  Ivy_ManStop( pTemp );
138 if ( fVerbose ) { printf( "\n" ); }
139 if ( fVerbose ) { ABC_PRT( "Balance", Abc_Clock() - clk ); }
140 if ( fVerbose ) Ivy_ManPrintStats( pMan );
141  return pMan;
142 }
143 
144 /**Function*************************************************************
145 
146  Synopsis [Performs several passes of rewriting on the AIG.]
147 
148  Description []
149 
150  SideEffects []
151 
152  SeeAlso []
153 
154 ***********************************************************************/
155 Ivy_Man_t * Ivy_ManRwsat( Ivy_Man_t * pMan, int fVerbose )
156 {
157  abctime clk;
158  Ivy_Man_t * pTemp;
159 
160 if ( fVerbose ) { printf( "Original:\n" ); }
161 if ( fVerbose ) Ivy_ManPrintStats( pMan );
162 
163 clk = Abc_Clock();
164  Ivy_ManRewritePre( pMan, 0, 0, 0 );
165 if ( fVerbose ) { printf( "\n" ); }
166 if ( fVerbose ) { ABC_PRT( "Rewrite", Abc_Clock() - clk ); }
167 if ( fVerbose ) Ivy_ManPrintStats( pMan );
168 
169 clk = Abc_Clock();
170  pMan = Ivy_ManBalance( pTemp = pMan, 0 );
171 // pMan = Ivy_ManDup( pTemp = pMan );
172  Ivy_ManStop( pTemp );
173 if ( fVerbose ) { printf( "\n" ); }
174 if ( fVerbose ) { ABC_PRT( "Balance", Abc_Clock() - clk ); }
175 if ( fVerbose ) Ivy_ManPrintStats( pMan );
176 
177 /*
178 clk = Abc_Clock();
179  Ivy_ManRewritePre( pMan, 0, 0, 0 );
180 if ( fVerbose ) { printf( "\n" ); }
181 if ( fVerbose ) { ABC_PRT( "Rewrite", Abc_Clock() - clk ); }
182 if ( fVerbose ) Ivy_ManPrintStats( pMan );
183 
184 clk = Abc_Clock();
185  pMan = Ivy_ManBalance( pTemp = pMan, 0 );
186  Ivy_ManStop( pTemp );
187 if ( fVerbose ) { printf( "\n" ); }
188 if ( fVerbose ) { ABC_PRT( "Balance", Abc_Clock() - clk ); }
189 if ( fVerbose ) Ivy_ManPrintStats( pMan );
190 */
191  return pMan;
192 }
193 
194 
195 ////////////////////////////////////////////////////////////////////////
196 /// END OF FILE ///
197 ////////////////////////////////////////////////////////////////////////
198 
199 
201 
ABC_NAMESPACE_IMPL_START Ivy_Man_t * Ivy_ManResyn0(Ivy_Man_t *pMan, int fUpdateLevel, int fVerbose)
DECLARATIONS ///.
Definition: ivyResyn.c:45
Ivy_Man_t * Ivy_ManResyn(Ivy_Man_t *pMan, int fUpdateLevel, int fVerbose)
Definition: ivyResyn.c:86
static abctime Abc_Clock()
Definition: abc_global.h:279
void Ivy_ManStop(Ivy_Man_t *p)
Definition: ivyMan.c:238
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
void Ivy_ManPrintStats(Ivy_Man_t *p)
Definition: ivyMan.c:456
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
Definition: ivy.h:46
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
#define ABC_PRT(a, t)
Definition: abc_global.h:220
Ivy_Man_t * Ivy_ManBalance(Ivy_Man_t *p, int fUpdateLevel)
FUNCTION DECLARATIONS ///.
Definition: ivyBalance.c:51
int Ivy_ManRewritePre(Ivy_Man_t *p, int fUpdateLevel, int fUseZeroCost, int fVerbose)
FUNCTION DEFINITIONS ///.
Definition: ivyRwr.c:55
Ivy_Man_t * Ivy_ManRwsat(Ivy_Man_t *pMan, int fVerbose)
Definition: ivyResyn.c:155
ABC_INT64_T abctime
Definition: abc_global.h:278