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" );
93 p->pLutAreas[i] = (float)
atof(pToken);
97 while ( (pToken =
strtok( NULL,
" \t\n" )) )
98 p->pLutDelays[i][k++] = (float)
atof(pToken);
103 printf(
"LUT %d has too many pins (%d). Max allowed is %d.\n", i, k, i );
109 p->fVarPinDelays = 1;
113 printf(
"Skipping LUTs of size more than %d.\n", i );
127 if (
p->fVarPinDelays )
129 for ( i = 1; i <=
p->LutMax; i++ )
130 for ( k = 0; k < i; k++ )
132 if (
p->pLutDelays[i][k] <= 0.0 )
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",
134 k, i,
p->pLutDelays[i][k] );
135 if ( k &&
p->pLutDelays[i][k-1] >
p->pLutDelays[i][k] )
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",
137 k-1, i,
p->pLutDelays[i][k-1],
138 k, i,
p->pLutDelays[i][k] );
143 for ( i = 1; i <=
p->LutMax; i++ )
145 if (
p->pLutDelays[i][0] <= 0.0 )
146 printf(
"Warning: LUT %d has delay %f. Pin delays should be non-negative numbers. Technology mapping may not work correctly.\n",
147 i,
p->pLutDelays[i][0] );
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 )
#define ABC_ALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
void Fpga_LutLibPrint(Fpga_LutLib_t *pLutLib)
int Fpga_LutLibDelaysAreDiscrete(Fpga_LutLib_t *pLutLib)
Fpga_LutLib_t * Fpga_LutLibDup(Fpga_LutLib_t *p)
void Fpga_LutLibFree(Fpga_LutLib_t *pLutLib)
float Fpga_LutLibReadLutArea(Fpga_LutLib_t *p, int Size)
Fpga_LutLib_t * Fpga_LutLibRead(char *FileName, int fVerbose)
float * Fpga_LutLibReadLutAreas(Fpga_LutLib_t *p)
ABC_NAMESPACE_IMPL_START int Fpga_LutLibReadVarMax(Fpga_LutLib_t *p)
DECLARATIONS ///.
#define FPGA_MAX_LUTSIZE
INCLUDES ///.
struct Fpga_LutLibStruct_t_ Fpga_LutLib_t
float pLutAreas[FPGA_MAX_LUTSIZE+1]
float pLutDelays[FPGA_MAX_LUTSIZE+1][FPGA_MAX_LUTSIZE+1]