Skip to content

Commit c85f007

Browse files
committed
Convert buffers to .short lines in BLIF.
1 parent 490bb92 commit c85f007

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/base/io/ioReadBlifMv.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,35 @@ static char * Io_MvLoadFile( char * pFileName )
696696
return pContents;
697697
}
698698

699+
/**Function*************************************************************
700+
701+
Synopsis []
702+
703+
Description []
704+
705+
SideEffects []
706+
707+
SeeAlso []
708+
709+
***********************************************************************/
710+
void Io_MvReplaceBuffersByShorts( char * p )
711+
{
712+
if ( !strstr(p, ".gate") )
713+
return;
714+
char * q, * pNext, * pShort = (char *)".short"; int i;
715+
for ( q = p; *q && (pNext = strstr(q, ".names")); q = pNext ) {
716+
for ( i = 0; i < 6; i++ )
717+
pNext[i] = pShort[i];
718+
while ( *pNext && *pNext++ != '\n' );
719+
if ( *pNext == 0 )
720+
return;
721+
while ( *pNext && *pNext != '\n' )
722+
*pNext++ = ' ';
723+
if ( *pNext == 0 )
724+
return;
725+
}
726+
}
727+
699728
/**Function*************************************************************
700729
701730
Synopsis [Prepares the parsing.]
@@ -717,6 +746,8 @@ static void Io_MvReadPreparse( Io_MvMan_t * p )
717746
{
718747
char * pCur, * pPrev;
719748
int i, fComment = 0;
749+
Io_MvReplaceBuffersByShorts( p->pBuffer );
750+
720751
// parse the buffer into lines and remove comments
721752
Vec_PtrPush( p->vLines, p->pBuffer );
722753
for ( pCur = p->pBuffer; *pCur; pCur++ )

0 commit comments

Comments
 (0)