Merge pull request #481 from jon-greene/fix-req-time-with-boxes

Fix two bugs causing problems with &trace and boxes.
This commit is contained in:
alanminko 2026-02-21 07:54:20 -08:00 committed by GitHub
commit 2c6089fff5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View File

@ -677,6 +677,14 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fGiaSi
}
pNew->vOutReqs = Vec_FltStart( nOutputs );
memcpy( Vec_FltArray(pNew->vOutReqs), pCur, (size_t)4*nOutputs ); pCur += 4*nOutputs;
// Convert -1.0 back to TIM_ETERNITY for internal use
{
float * pArr = Vec_FltArray(pNew->vOutReqs);
int i;
for ( i = 0; i < nOutputs; i++ )
if ( pArr[i] < 0 )
pArr[i] = TIM_ETERNITY;
}
if ( fVerbose ) printf( "Finished reading extension \"o\".\n" );
}
// read equivalence classes
@ -1562,6 +1570,13 @@ void Gia_AigerWriteS( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, in
{
int nPos = Tim_ManPoNum((Tim_Man_t *)p->pManTime);
int nFlops = Gia_ManRegNum(p);
// Convert TIM_ETERNITY sentinel to -1.0 per XAIG spec
{
int i;
for ( i = 0; i < nPos + nFlops; i++ )
if ( pTimes[i] >= TIM_ETERNITY )
pTimes[i] = -1.0;
}
fprintf( pFile, "o" );
Gia_FileWriteBufferSize( pFile, 4*(nPos + nFlops) );
fwrite( pTimes, 1, 4*(nPos + nFlops), pFile );

View File

@ -350,7 +350,7 @@ float Gia_ManDelayTraceLut( Gia_Man_t * p )
int j, maxLevel = 0;
for ( j = 0; j < nIns; j++ )
{
int coLevel = Gia_ObjLevel( p, Gia_ManCo(p, iCoFirst + j) );
int coLevel = Gia_ObjLevel( p, Gia_ObjFanin0(Gia_ManCo(p, iCoFirst + j)) );
if ( coLevel > maxLevel )
maxLevel = coLevel;
}