mirror of https://github.com/YosysHQ/abc.git
Fix capacitance unit parsing
Fix the liberty parser to handle "capacitive_load_unit (1,fF)". Previously this input would produce a corrupted internal representation for the library as there would be an extra value written on line 944.
This commit is contained in:
parent
279217b73d
commit
3455f423d0
|
|
@ -941,11 +941,16 @@ void Scl_LibertyReadLoadUnit( Scl_Tree_t * p, Vec_Str_t * vOut )
|
|||
char * pHead = Scl_LibertyReadString(p, pItem->Head);
|
||||
float First = atof(strtok(pHead, " \t\n\r\\\","));
|
||||
char * pSecond = strtok(NULL, " \t\n\r\\\",");
|
||||
Vec_StrPutF_( vOut, First );
|
||||
if ( pSecond && !strcmp(pSecond, "pf") )
|
||||
if ( pSecond && (!strcmp(pSecond, "pf") || !strcmp(pSecond, "pF")) )
|
||||
{
|
||||
Vec_StrPutF_( vOut, First );
|
||||
Vec_StrPutI_( vOut, 12 );
|
||||
else if ( pSecond && !strcmp(pSecond, "ff") )
|
||||
}
|
||||
else if ( pSecond && (!strcmp(pSecond, "ff") || !strcmp(pSecond, "fF")) )
|
||||
{
|
||||
Vec_StrPutF_( vOut, First );
|
||||
Vec_StrPutI_( vOut, 15 );
|
||||
}
|
||||
else break;
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue