@@ -333,6 +333,32 @@ float Gia_ManDelayTraceLut( Gia_Man_t * p )
333333 Gia_ObjSetTimeArrival ( p , i , tArrival );
334334 }
335335
336+ // update levels of box output CIs to reflect box structure
337+ // (Gia_ManLevelNum assigns level 0 to all CIs, but box output CIs
338+ // need higher levels so that Gia_ManOrderReverse processes them
339+ // before box input COs during the backward required-time pass)
340+ if ( p -> pManTime )
341+ {
342+ Tim_Man_t * pManTime = (Tim_Man_t * )p -> pManTime ;
343+ int iBox , nBoxes = Tim_ManBoxNum ( pManTime );
344+ for ( iBox = 0 ; iBox < nBoxes ; iBox ++ )
345+ {
346+ int nIns = Tim_ManBoxInputNum ( pManTime , iBox );
347+ int nOuts = Tim_ManBoxOutputNum ( pManTime , iBox );
348+ int iCoFirst = Tim_ManBoxInputFirst ( pManTime , iBox );
349+ int iCiFirst = Tim_ManBoxOutputFirst ( pManTime , iBox );
350+ int j , maxLevel = 0 ;
351+ for ( j = 0 ; j < nIns ; j ++ )
352+ {
353+ int coLevel = Gia_ObjLevel ( p , Gia_ManCo (p , iCoFirst + j ) );
354+ if ( coLevel > maxLevel )
355+ maxLevel = coLevel ;
356+ }
357+ for ( j = 0 ; j < nOuts ; j ++ )
358+ Gia_ObjSetLevel ( p , Gia_ManCi (p , iCiFirst + j ), maxLevel + 1 );
359+ }
360+ }
361+
336362 // get the latest arrival times
337363 tArrival = - TIM_ETERNITY ;
338364 Gia_ManForEachCo ( p , pObj , i )
0 commit comments