Abc_Print(1,"Error in the LUT library string.\n");
ABC_FREE(p->pName);
ABC_FREE(p);
ABC_FREE(pStrMem);
Vec_PtrFree(vStrs);
returnNULL;
}
// read area
pToken=strtok(NULL," \t\n");
p->pLutAreas[i]=(float)atof(pToken);
// read delays
k=0;
while((pToken=strtok(NULL," \t\n")))
p->pLutDelays[i][k++]=(float)atof(pToken);
// check for out-of-bound
if(k>i)
{
Abc_Print(1,"LUT %d has too many pins (%d). Max allowed is %d.\n",i,k,i);
ABC_FREE(p->pName);
ABC_FREE(p);
ABC_FREE(pStrMem);
Vec_PtrFree(vStrs);
returnNULL;
}
// check if var delays are specified
if(k>1)
p->fVarPinDelays=1;
if(i==IF_MAX_LUTSIZE)
{
Abc_Print(1,"Skipping LUTs of size more than %d.\n",i);
ABC_FREE(p->pName);
ABC_FREE(p);
ABC_FREE(pStrMem);
Vec_PtrFree(vStrs);
returnNULL;
}
i++;
}
p->LutMax=i-1;
// check the library
if(p->fVarPinDelays)
{
for(i=1;i<=p->LutMax;i++)
for(k=0;k<i;k++)
{
if(p->pLutDelays[i][k]<=0.0)
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",
k,i,p->pLutDelays[i][k]);
if(k&&p->pLutDelays[i][k-1]>p->pLutDelays[i][k])
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",
k-1,i,p->pLutDelays[i][k-1],
k,i,p->pLutDelays[i][k]);
}
}
else
{
for(i=1;i<=p->LutMax;i++)
{
if(p->pLutDelays[i][0]<=0.0)
Abc_Print(0,"LUT %d has delay %f. Pin delays should be non-negative numbers. Technology mapping may not work correctly.\n",