ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
super.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ABC_NAMESPACE_HEADER_START void Super2_Precompute (int nInputs, int nLevels, int fVerbose)
 INCLUDES ///.
 
Vec_Str_tSuper_PrecomputeStr (Mio_Library_t *pLibGen, int nVarsMax, int nLevels, int nGatesMax, float tDelayMax, float tAreaMax, int TimeLimit, int fSkipInv, int fVerbose)
 
void Super_Precompute (Mio_Library_t *pLibGen, int nVarsMax, int nLevels, int nGatesMax, float tDelayMax, float tAreaMax, int TimeLimit, int fSkipInv, int fVerbose, char *pFileName)
 FUNCTION DEFINITIONS ///.
 

Function Documentation

◆ Super2_Precompute()

ABC_NAMESPACE_HEADER_START void Super2_Precompute ( int nInputs,
int nLevels,
int fVerbose )
extern

INCLUDES ///.

CFile****************************************************************

FileName [super.h]

PackageName [MVSIS 2.0: Multi-valued logic synthesis system.]

Synopsis [Pre-computation of supergates (delay-limited gate combinations).]

Author [MVSIS Group]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - September 8, 2003.]

Revision [

Id
super.h,v 1.3 2004/06/28 14:20:25 alanmi Exp

] PARAMETERS /// STRUCTURE DEFINITIONS /// GLOBAL VARIABLES /// MACRO DEFINITIONS /// FUNCTION DEFINITIONS ///

INCLUDES ///.

Function*************************************************************

Synopsis [Precomputes the library of AND2 gates.]

Description []

SideEffects []

SeeAlso []

Definition at line 113 of file superAnd.c.

114{
115 Super2_Man_t * pMan;
116 Super2_Lib_t * pLibCur, * pLibNext;
117 int Level;
118 abctime clk;
119
120 assert( nInputs < 6 );
121
122 // start the manager
123 pMan = Super2_ManStart();
124
125 // get the starting supergates
126 pLibCur = Super2_LibFirst( pMan, nInputs );
127
128 // perform the computation of supergates
129printf( "Computing supergates for %d inputs and %d levels:\n", nInputs, nLevels );
130 for ( Level = 1; Level <= nLevels; Level++ )
131 {
132clk = Abc_Clock();
133 pLibNext = Super2_LibCompute( pMan, pLibCur );
134 pLibNext->nLevels = Level;
135 Super2_LibStop( pLibCur );
136 pLibCur = pLibNext;
137printf( "Level %d: Tried = %7d. Computed = %7d. ", Level, pMan->nTried, pLibCur->nGates );
138ABC_PRT( "Runtime", Abc_Clock() - clk );
139fflush( stdout );
140 }
141
142printf( "Writing the output file...\n" );
143fflush( stdout );
144 // write them into a file
145 Super2_LibWrite( pLibCur );
146 Super2_LibStop( pLibCur );
147
148 // stop the manager
149 Super2_ManStop( pMan );
150}
ABC_INT64_T abctime
Definition abc_global.h:332
#define ABC_PRT(a, t)
Definition abc_global.h:255
struct Super2_ManStruct_t_ Super2_Man_t
Definition superAnd.c:33
struct Super2_LibStruct_t_ Super2_Lib_t
Definition superAnd.c:34
#define assert(ex)
Definition util_old.h:213

◆ Super_Precompute()

void Super_Precompute ( Mio_Library_t * pLibGen,
int nVarsMax,
int nLevels,
int nGatesMax,
float tDelayMax,
float tAreaMax,
int TimeLimit,
int fSkipInv,
int fVerbose,
char * pFileName )
extern

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Precomputes the library of supergates.]

Description []

SideEffects []

SeeAlso []

Definition at line 140 of file superGate.c.

141{
142 Vec_Str_t * vStr;
143 FILE * pFile = fopen( pFileName, "wb" );
144 if ( pFile == NULL )
145 {
146 printf( "Cannot open output file \"%s\".\n", pFileName );
147 return;
148 }
149 vStr = Super_PrecomputeStr( pLibGen, nVarsMax, nLevels, nGatesMax, tDelayMax, tAreaMax, TimeLimit, fSkipInv, fVerbose );
150 if ( vStr )
151 {
152 fwrite( Vec_StrArray(vStr), 1, Vec_StrSize(vStr), pFile );
153 Vec_StrFree( vStr );
154 }
155 fclose( pFile );
156 // report the result of writing
157 if ( fVerbose )
158 {
159 printf( "The supergates are written using new format \"%s\" ", pFileName );
160 printf( "(%0.3f MB).\n", ((double)Extra_FileSize(pFileName))/(1<<20) );
161 }
162}
struct Vec_Str_t_ Vec_Str_t
Definition bblif.c:46
int Extra_FileSize(char *pFileName)
Vec_Str_t * Super_PrecomputeStr(Mio_Library_t *pLibGen, int nVarsMax, int nLevels, int nGatesMax, float tDelayMax, float tAreaMax, int TimeLimit, int fSkipInv, int fVerbose)
Definition superGate.c:175
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Super_PrecomputeStr()

Vec_Str_t * Super_PrecomputeStr ( Mio_Library_t * pLibGen,
int nVarsMax,
int nLevels,
int nGatesMax,
float tDelayMax,
float tAreaMax,
int TimeLimit,
int fSkipInv,
int fVerbose )
extern

Function*************************************************************

Synopsis [Precomputes the library of supergates.]

Description []

SideEffects []

SeeAlso []

Definition at line 175 of file superGate.c.

176{
177 Vec_Str_t * vStr;
178 Super_Man_t * pMan;
179 Mio_Gate_t ** ppGates;
180 int nGates, Level;
181 abctime clk, clockStart;
182
183 assert( nVarsMax < 7 );
184 if ( nGatesMax && nGatesMax < nVarsMax )
185 {
186 fprintf( stderr, "Erro! The number of supergates requested (%d) in less than the number of variables (%d).\n", nGatesMax, nVarsMax );
187 fprintf( stderr, "The library cannot be computed.\n" );
188 return NULL;
189 }
190
191 // get the root gates
192 ppGates = Mio_CollectRoots( pLibGen, nVarsMax, tDelayMax, 0, &nGates, fVerbose );
193 if ( nGatesMax && nGates >= nGatesMax )
194 {
195 fprintf( stdout, "Warning! Genlib library contains more gates than can be computed.\n");
196 fprintf( stdout, "Only one-gate supergates are included in the supergate library.\n" );
197 }
198
199 // start the manager
200 pMan = Super_ManStart();
201 pMan->pName = Mio_LibraryReadName(pLibGen);
202 pMan->nGatesMax = nGatesMax;
203 pMan->fSkipInv = fSkipInv;
204 pMan->tDelayMax = tDelayMax;
205 pMan->tAreaMax = tAreaMax;
206 pMan->TimeLimit = TimeLimit; // in seconds
207 pMan->TimeStop = TimeLimit ? TimeLimit * CLOCKS_PER_SEC + Abc_Clock() : 0; // in CPU ticks
208 pMan->fVerbose = fVerbose;
209
210 if ( nGates == 0 )
211 {
212 fprintf( stderr, "Error: No genlib gates satisfy the limits criteria. Stop.\n");
213 fprintf( stderr, "Limits: max delay = %.2f, max area = %.2f, time limit = %d sec.\n",
214 pMan->tDelayMax, pMan->tAreaMax, pMan->TimeLimit );
215
216 // stop the manager
217 Super_ManStop( pMan );
218 ABC_FREE( ppGates );
219
220 return NULL;
221 }
222
223 // get the starting supergates
224 Super_First( pMan, nVarsMax );
225
226 // perform the computation of supergates
227 clockStart = Abc_Clock();
228if ( fVerbose )
229{
230 printf( "Computing supergates with %d inputs, %d levels, and %d max gates.\n",
231 pMan->nVarsMax, nLevels, nGatesMax );
232 printf( "Limits: max delay = %.2f, max area = %.2f, time limit = %d sec.\n",
233 pMan->tDelayMax, pMan->tAreaMax, pMan->TimeLimit );
234}
235
236 for ( Level = 1; Level <= nLevels; Level++ )
237 {
238 if ( pMan->TimeStop && Abc_Clock() > pMan->TimeStop )
239 break;
240clk = Abc_Clock();
241 Super_Compute( pMan, ppGates, nGates, nGatesMax, fSkipInv );
242 pMan->nLevels = Level;
243if ( fVerbose )
244{
245 printf( "Lev %d: Try =%12d. Add =%6d. Rem =%5d. Save =%6d. Lookups =%12d. Aliases =%12d. ",
246 Level, pMan->nTried, pMan->nAdded, pMan->nRemoved, pMan->nAdded - pMan->nRemoved, pMan->nLookups, pMan->nAliases );
247ABC_PRT( "Time", Abc_Clock() - clk );
248fflush( stdout );
249}
250 }
251 pMan->Time = Abc_Clock() - clockStart;
252
253if ( fVerbose )
254{
255printf( "Writing the output file...\n" );
256fflush( stdout );
257}
258 // write them into a file
259 vStr = Super_Write( pMan );
260
261 // stop the manager
262 Super_ManStop( pMan );
263 ABC_FREE( ppGates );
264 return vStr;
265}
#define ABC_FREE(obj)
Definition abc_global.h:267
Mio_Gate_t ** Mio_CollectRoots(Mio_Library_t *pLib, int nInputs, float tDelay, int fSkipInv, int *pnGates, int fVerbose)
Definition mioUtils.c:515
char * Mio_LibraryReadName(Mio_Library_t *pLib)
DECLARATIONS ///.
Definition mioApi.c:43
struct Mio_GateStruct_t_ Mio_Gate_t
Definition mio.h:43
struct Super_ManStruct_t_ Super_Man_t
Definition superGate.c:36
Here is the call graph for this function:
Here is the caller graph for this function: