mirror of https://github.com/YosysHQ/abc.git
Enable arrival/required times in &nf.
This commit is contained in:
parent
05244daba9
commit
8453afcf8b
|
|
@ -2031,6 +2031,11 @@ void Gia_ManTransferPacking( Gia_Man_t * p, Gia_Man_t * pGia )
|
|||
}
|
||||
void Gia_ManTransferTiming( Gia_Man_t * p, Gia_Man_t * pGia )
|
||||
{
|
||||
if ( pGia->vInArrs || pGia->vOutReqs )
|
||||
{
|
||||
p->vInArrs = pGia->vInArrs; pGia->vInArrs = NULL;
|
||||
p->vOutReqs = pGia->vOutReqs; pGia->vOutReqs = NULL;
|
||||
}
|
||||
if ( pGia->pManTime == NULL || p == pGia )
|
||||
return;
|
||||
p->pManTime = pGia->pManTime; pGia->pManTime = NULL;
|
||||
|
|
|
|||
|
|
@ -1250,15 +1250,18 @@ void Nf_ManCutMatchOne( Nf_Man_t * p, int iObj, int * pCut, int * pCutSet )
|
|||
Nf_ManCutMatchPrint( p, iObj, 1, &pBest->M[1][1] );
|
||||
*/
|
||||
}
|
||||
static inline void Nf_ObjPrepareCi( Nf_Man_t * p, int iObj )
|
||||
static inline void Nf_ObjPrepareCi( Nf_Man_t * p, int iObj, float Time )
|
||||
{
|
||||
Nf_Mat_t * pD0 = Nf_ObjMatchD( p, iObj, 0 );
|
||||
Nf_Mat_t * pA0 = Nf_ObjMatchA( p, iObj, 0 );
|
||||
Nf_Mat_t * pD = Nf_ObjMatchD( p, iObj, 1 );
|
||||
Nf_Mat_t * pA = Nf_ObjMatchA( p, iObj, 1 );
|
||||
pD0->D = pA0->D = pD->D = pA->D = Time;
|
||||
pD->fCompl = 1;
|
||||
pD->D = p->InvDelay;
|
||||
pD->D += p->InvDelay;
|
||||
pD->A = p->InvArea;
|
||||
pA->fCompl = 1;
|
||||
pA->D = p->InvDelay;
|
||||
pA->D += p->InvDelay;
|
||||
pA->A = p->InvArea;
|
||||
Nf_ObjMatchD( p, iObj, 0 )->fBest = 1;
|
||||
Nf_ObjMatchD( p, iObj, 1 )->fBest = 1;
|
||||
|
|
@ -1551,6 +1554,13 @@ int Nf_ManSetMapRefs( Nf_Man_t * p )
|
|||
{
|
||||
Required = Nf_ObjMatchD( p, Gia_ObjFaninId0p(p->pGia, pObj), Gia_ObjFaninC0(pObj) )->D;
|
||||
Required = p->pPars->fDoAverage ? Required * (100.0 + p->pPars->nRelaxRatio) / 100.0 : p->pPars->MapDelay;
|
||||
// if external required time can be achieved, use it
|
||||
if ( p->pGia->vOutReqs && Vec_FltEntry(p->pGia->vOutReqs, i) > 0 && Required <= Vec_FltEntry(p->pGia->vOutReqs, i) )
|
||||
Required = Vec_FltEntry(p->pGia->vOutReqs, i);
|
||||
// if external required cannot be achieved, set the earliest possible arrival time
|
||||
// else if ( p->pGia->vOutReqs && Vec_FltEntry(p->pGia->vOutReqs, i) > 0 && Required > Vec_FltEntry(p->pGia->vOutReqs, i) )
|
||||
// ptTime->Rise = ptTime->Fall = ptTime->Worst = Required;
|
||||
// otherwise, set the global required time
|
||||
Nf_ObjUpdateRequired( p, Gia_ObjFaninId0p(p->pGia, pObj), Gia_ObjFaninC0(pObj), Required );
|
||||
Nf_ObjMapRefInc( p, Gia_ObjFaninId0p(p->pGia, pObj), Gia_ObjFaninC0(pObj));
|
||||
}
|
||||
|
|
@ -2111,7 +2121,7 @@ Gia_Man_t * Nf_ManPerformMapping( Gia_Man_t * pGia, Jf_Par_t * pPars )
|
|||
Nf_ManComputeCuts( p );
|
||||
Nf_ManPrintQuit( p );
|
||||
Gia_ManForEachCiId( p->pGia, Id, i )
|
||||
Nf_ObjPrepareCi( p, Id );
|
||||
Nf_ObjPrepareCi( p, Id, p->pGia->vInArrs ? Vec_FltEntry(p->pGia->vInArrs, i) : 0.0 );
|
||||
for ( p->Iter = 0; p->Iter < p->pPars->nRounds; p->Iter++ )
|
||||
{
|
||||
Nf_ManComputeMapping( p );
|
||||
|
|
|
|||
|
|
@ -25884,12 +25884,21 @@ int Abc_CommandAbc9Get( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
pGia = Gia_ManFromAig( pAig );
|
||||
Aig_ManStop( pAig );
|
||||
}
|
||||
// replace
|
||||
// copy names
|
||||
if ( fNames )
|
||||
{
|
||||
pGia->vNamesIn = Abc_NtkCollectCiNames( pAbc->pNtkCur );
|
||||
pGia->vNamesOut = Abc_NtkCollectCoNames( pAbc->pNtkCur );
|
||||
}
|
||||
// copy user timing information
|
||||
if ( pAbc->pNtkCur->pManTime != NULL )
|
||||
{
|
||||
Abc_Ntk_t * pNtk = pAbc->pNtkCur;
|
||||
Vec_FltFreeP( &pGia->vInArrs );
|
||||
Vec_FltFreeP( &pGia->vOutReqs );
|
||||
pGia->vInArrs = Vec_FltAllocArray( Abc_NtkGetCiArrivalFloats(pNtk), Abc_NtkCiNum(pNtk) );
|
||||
pGia->vOutReqs = Vec_FltAllocArray( Abc_NtkGetCiArrivalFloats(pNtk), Abc_NtkCoNum(pNtk) );
|
||||
}
|
||||
Abc_FrameUpdateGia( pAbc, pGia );
|
||||
return 0;
|
||||
|
||||
|
|
@ -26003,6 +26012,19 @@ int Abc_CommandAbc9Put( Abc_Frame_t * pAbc, int argc, char ** argv )
|
|||
}
|
||||
}
|
||||
}
|
||||
// transfer timing information
|
||||
if ( pAbc->pGia->vInArrs || pAbc->pGia->vOutReqs )
|
||||
{
|
||||
Abc_Obj_t * pObj; int i;
|
||||
Abc_NtkTimeInitialize( pNtk, NULL );
|
||||
if ( pAbc->pGia->vInArrs )
|
||||
Abc_NtkForEachCi( pNtk, pObj, i )
|
||||
Abc_NtkTimeSetArrival( pNtk, Abc_ObjId(pObj), Vec_FltEntry(pAbc->pGia->vInArrs, i), Vec_FltEntry(pAbc->pGia->vInArrs, i) );
|
||||
if ( pAbc->pGia->vOutReqs )
|
||||
Abc_NtkForEachCo( pNtk, pObj, i )
|
||||
Abc_NtkTimeSetRequired( pNtk, Abc_ObjId(pObj), Vec_FltEntry(pAbc->pGia->vOutReqs, i), Vec_FltEntry(pAbc->pGia->vOutReqs, i) );
|
||||
}
|
||||
|
||||
// replace the current network
|
||||
Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
|
||||
if ( fStatusClear )
|
||||
|
|
|
|||
|
|
@ -286,12 +286,15 @@ void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDum
|
|||
Abc_Print( 1," bdd =%6d", Abc_NtkGetBddNodeNum(pNtk) - nSingles );
|
||||
else if ( Abc_NtkHasMapping(pNtk) )
|
||||
{
|
||||
int fHasTimeMan = (int)(pNtk->pManTime != NULL);
|
||||
assert( pNtk->pManFunc == Abc_FrameReadLibGen() );
|
||||
Abc_Print( 1," area =%5.2f", Abc_NtkGetMappedArea(pNtk) );
|
||||
Abc_Print( 1," delay =%5.2f", Abc_NtkDelayTrace(pNtk, NULL, NULL, 0) );
|
||||
if ( pNtk->pManTime )
|
||||
if ( !fHasTimeMan && pNtk->pManTime )
|
||||
{
|
||||
Abc_ManTimeStop( pNtk->pManTime );
|
||||
pNtk->pManTime = NULL;
|
||||
pNtk->pManTime = NULL;
|
||||
}
|
||||
}
|
||||
else if ( !Abc_NtkHasBlackbox(pNtk) )
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue