60 char pBuffer[1000], * pToken;
65 pFile = fopen( FileName,
"r" );
68 printf(
"Cannot open LUT library file \"%s\".\n", FileName );
77 while ( fgets( pBuffer, 1000, pFile ) != NULL )
79 pToken =
strtok( pBuffer,
" \t\n" );
82 if ( pToken[0] ==
'#' )
84 if ( i != atoi(pToken) )
86 printf(
"Error in the LUT library file \"%s\".\n", FileName );
92 pToken =
strtok( NULL,
" \t\n" );
97 while ( (pToken =
strtok( NULL,
" \t\n" )) )
103 printf(
"LUT %d has too many pins (%d). Max allowed is %d.\n", i, k, i );
113 printf(
"Skipping LUTs of size more than %d.\n", i );
129 for ( i = 1; i <= p->
LutMax; i++ )
130 for ( k = 0; k < i; k++ )
133 printf(
"Warning: Pin %d of LUT %d has delay %f. Pin delays should be non-negative numbers. Technology mapping may not work correctly.\n",
136 printf(
"Warning: 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",
143 for ( i = 1; i <= p->
LutMax; i++ )
146 printf(
"Warning: LUT %d has delay %f. Pin delays should be non-negative numbers. Technology mapping may not work correctly.\n",
187 if ( pLutLib == NULL )
208 printf(
"# The area/delay of k-variable LUTs:\n" );
209 printf(
"# k area delay\n" );
212 for ( i = 1; i <= pLutLib->
LutMax; i++ )
214 printf(
"%d %7.2f ", i, pLutLib->
pLutAreas[i] );
215 for ( k = 0; k < i; k++ )
216 printf(
" %7.2f", pLutLib->
pLutDelays[i][k] );
221 for ( i = 1; i <= pLutLib->
LutMax; i++ )
240 for ( i = 1; i <= pLutLib->
LutMax; i++ )
243 if ( ((
float)((
int)Delay)) != Delay )
float pLutDelays[FPGA_MAX_LUTSIZE+1][FPGA_MAX_LUTSIZE+1]
float Fpga_LutLibReadLutArea(Fpga_LutLib_t *p, int Size)
#define ABC_ALLOC(type, num)
float pLutAreas[FPGA_MAX_LUTSIZE+1]
void Fpga_LutLibPrint(Fpga_LutLib_t *pLutLib)
#define ABC_NAMESPACE_IMPL_END
Fpga_LutLib_t * Fpga_LutLibRead(char *FileName, int fVerbose)
ABC_NAMESPACE_IMPL_START int Fpga_LutLibReadVarMax(Fpga_LutLib_t *p)
DECLARATIONS ///.
#define FPGA_MAX_LUTSIZE
INCLUDES ///.
#define ABC_NAMESPACE_IMPL_START
float * Fpga_LutLibReadLutAreas(Fpga_LutLib_t *p)
Fpga_LutLib_t * Fpga_LutLibDup(Fpga_LutLib_t *p)
int Fpga_LutLibDelaysAreDiscrete(Fpga_LutLib_t *pLutLib)
void Fpga_LutLibFree(Fpga_LutLib_t *pLutLib)