mirror of https://github.com/YosysHQ/abc.git
Merge pull request #177 from mmicko/fix_large_liberty
Enable loading of large liberty files
This commit is contained in:
commit
0e88e2739f
|
|
@ -70,7 +70,7 @@ struct Scl_Tree_t_
|
||||||
{
|
{
|
||||||
char * pFileName; // input Liberty file name
|
char * pFileName; // input Liberty file name
|
||||||
char * pContents; // file contents
|
char * pContents; // file contents
|
||||||
int nContents; // file size
|
long nContents; // file size
|
||||||
int nLines; // line counter
|
int nLines; // line counter
|
||||||
int nItems; // number of items
|
int nItems; // number of items
|
||||||
int nItermAlloc; // number of items allocated
|
int nItermAlloc; // number of items allocated
|
||||||
|
|
@ -521,10 +521,10 @@ void Scl_LibertyFixFileName( char * pFileName )
|
||||||
if ( *pHead == '>' )
|
if ( *pHead == '>' )
|
||||||
*pHead = '\\';
|
*pHead = '\\';
|
||||||
}
|
}
|
||||||
int Scl_LibertyFileSize( char * pFileName )
|
long Scl_LibertyFileSize( char * pFileName )
|
||||||
{
|
{
|
||||||
FILE * pFile;
|
FILE * pFile;
|
||||||
int nFileSize;
|
long nFileSize;
|
||||||
pFile = fopen( pFileName, "rb" );
|
pFile = fopen( pFileName, "rb" );
|
||||||
if ( pFile == NULL )
|
if ( pFile == NULL )
|
||||||
{
|
{
|
||||||
|
|
@ -536,7 +536,7 @@ int Scl_LibertyFileSize( char * pFileName )
|
||||||
fclose( pFile );
|
fclose( pFile );
|
||||||
return nFileSize;
|
return nFileSize;
|
||||||
}
|
}
|
||||||
char * Scl_LibertyFileContents( char * pFileName, int nContents )
|
char * Scl_LibertyFileContents( char * pFileName, long nContents )
|
||||||
{
|
{
|
||||||
FILE * pFile = fopen( pFileName, "rb" );
|
FILE * pFile = fopen( pFileName, "rb" );
|
||||||
char * pContents = ABC_ALLOC( char, nContents+1 );
|
char * pContents = ABC_ALLOC( char, nContents+1 );
|
||||||
|
|
@ -573,7 +573,7 @@ void Scl_LibertyStringDump( char * pFileName, Vec_Str_t * vStr )
|
||||||
Scl_Tree_t * Scl_LibertyStart( char * pFileName )
|
Scl_Tree_t * Scl_LibertyStart( char * pFileName )
|
||||||
{
|
{
|
||||||
Scl_Tree_t * p;
|
Scl_Tree_t * p;
|
||||||
int RetValue;
|
long RetValue;
|
||||||
// read the file into the buffer
|
// read the file into the buffer
|
||||||
Scl_LibertyFixFileName( pFileName );
|
Scl_LibertyFixFileName( pFileName );
|
||||||
RetValue = Scl_LibertyFileSize( pFileName );
|
RetValue = Scl_LibertyFileSize( pFileName );
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue