49 char pBuffer[1000], * pToken;
54 pFile = fopen( FileName,
"r" );
57 Abc_Print( -1,
"Cannot open LUT library file \"%s\".\n", FileName );
66 while ( fgets( pBuffer, 1000, pFile ) != NULL )
68 pToken =
strtok( pBuffer,
" \t\n" );
71 if ( pToken[0] ==
'#' )
73 if ( i != atoi(pToken) )
75 Abc_Print( 1,
"Error in the LUT library file \"%s\".\n", FileName );
82 pToken =
strtok( NULL,
" \t\n" );
87 while ( (pToken =
strtok( NULL,
" \t\n" )) )
95 Abc_Print( 1,
"LUT %d has too many pins (%d). Max allowed is %d.\n", i, k, i );
107 Abc_Print( 1,
"Skipping LUTs of size more than %d.\n", i );
117 for ( i = 1; i <= p->
LutMax; i++ )
118 for ( k = 0; k < i; k++ )
121 Abc_Print( 0,
"Pin %d of LUT %d has delay %f. Pin delays should be non-negative numbers. Technology mapping may not work correctly.\n",
124 Abc_Print( 0,
"Pin %d of LUT %d has delay %f. Pin %d of LUT %d has delay %f. Pin delays should be in non-decreasing order. Technology mapping may not work correctly.\n",
131 for ( i = 1; i <= p->
LutMax; i++ )
134 Abc_Print( 0,
"LUT %d has delay %f. Pin delays should be non-negative numbers. Technology mapping may not work correctly.\n",
175 if ( pLutLib == NULL )
196 Abc_Print( 1,
"# The area/delay of k-variable LUTs:\n" );
200 for ( i = 1; i <= pLutLib->
LutMax; i++ )
203 for ( k = 0; k < i; k++ )
209 for ( i = 1; i <= pLutLib->
LutMax; i++ )
228 for ( i = 1; i <= pLutLib->
LutMax; i++ )
231 if ( ((
float)((
int)Delay)) != Delay )
254 for ( i = 2; i <= pLutLib->
LutMax; i++ )
255 for ( k = 0; k < i; k++ )
261 for ( i = 2; i <= pLutLib->
LutMax; i++ )
281 If_LibLut_t s_LutLib10= {
"lutlib",10, 0, {0,1,1,1,1,1,1,1,1,1,1}, {{0},{1},{1},{1},{1},{1},{1},{1},{1},{1},{1}} };
282 If_LibLut_t s_LutLib9 = {
"lutlib", 9, 0, {0,1,1,1,1,1,1,1,1,1}, {{0},{1},{1},{1},{1},{1},{1},{1},{1},{1}} };
283 If_LibLut_t s_LutLib8 = {
"lutlib", 8, 0, {0,1,1,1,1,1,1,1,1}, {{0},{1},{1},{1},{1},{1},{1},{1},{1}} };
284 If_LibLut_t s_LutLib7 = {
"lutlib", 7, 0, {0,1,1,1,1,1,1,1}, {{0},{1},{1},{1},{1},{1},{1},{1}} };
285 If_LibLut_t s_LutLib6 = {
"lutlib", 6, 0, {0,1,1,1,1,1,1}, {{0},{1},{1},{1},{1},{1},{1}} };
286 If_LibLut_t s_LutLib5 = {
"lutlib", 5, 0, {0,1,1,1,1,1}, {{0},{1},{1},{1},{1},{1}} };
287 If_LibLut_t s_LutLib4 = {
"lutlib", 4, 0, {0,1,1,1,1}, {{0},{1},{1},{1},{1}} };
288 If_LibLut_t s_LutLib3 = {
"lutlib", 3, 0, {0,1,1,1}, {{0},{1},{1},{1}} };
290 assert( nLutSize >= 3 && nLutSize <= 10 );
293 case 3: pLutLib = &s_LutLib3;
break;
294 case 4: pLutLib = &s_LutLib4;
break;
295 case 5: pLutLib = &s_LutLib5;
break;
296 case 6: pLutLib = &s_LutLib6;
break;
297 case 7: pLutLib = &s_LutLib7;
break;
298 case 8: pLutLib = &s_LutLib8;
break;
299 case 9: pLutLib = &s_LutLib9;
break;
300 case 10: pLutLib = &s_LutLib10;
break;
301 default: pLutLib = NULL;
break;
303 if ( pLutLib == NULL )
float If_LibLutFastestPinDelay(If_LibLut_t *p)
float If_LibLutSlowestPinDelay(If_LibLut_t *p)
void If_LibLutFree(If_LibLut_t *pLutLib)
float pLutDelays[IF_MAX_LUTSIZE+1][IF_MAX_LUTSIZE+1]
int If_LibLutDelaysAreDifferent(If_LibLut_t *pLutLib)
#define ABC_ALLOC(type, num)
If_LibLut_t * If_LibLutDup(If_LibLut_t *p)
If_LibLut_t * If_LibLutRead(char *FileName)
FUNCTION DEFINITIONS ///.
#define IF_MAX_LUTSIZE
INCLUDES ///.
If_LibLut_t * If_LibLutSetSimple(int nLutSize)
#define ABC_NAMESPACE_IMPL_END
static void Abc_Print(int level, const char *format,...)
int If_LibLutDelaysAreDiscrete(If_LibLut_t *pLutLib)
#define ABC_NAMESPACE_IMPL_START
float pLutAreas[IF_MAX_LUTSIZE+1]
static ABC_NAMESPACE_IMPL_START char * If_UtilStrsav(char *s)
DECLARATIONS ///.
void If_LibLutPrint(If_LibLut_t *pLutLib)