mirror of https://github.com/YosysHQ/abc.git
Propagating timing support to the new synthesis/mapping commands.
This commit is contained in:
parent
6dbaa4d0f8
commit
c344f3e38c
|
|
@ -1184,6 +1184,8 @@ extern void Gia_ManSetRefsMapped( Gia_Man_t * p );
|
|||
extern void Gia_ManSetIfParsDefault( void * pIfPars );
|
||||
extern void Gia_ManMappingVerify( Gia_Man_t * p );
|
||||
extern void Gia_ManTransferMapping( Gia_Man_t * pGia, Gia_Man_t * p );
|
||||
extern void Gia_ManTransferPacking( Gia_Man_t * pGia, Gia_Man_t * p );
|
||||
extern void Gia_ManTransferTiming( Gia_Man_t * pGia, Gia_Man_t * p );
|
||||
extern Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pIfPars, int fNormalized );
|
||||
extern Gia_Man_t * Gia_ManPerformSopBalance( Gia_Man_t * p, int nCutNum, int nRelaxRatio, int fVerbose );
|
||||
extern Gia_Man_t * Gia_ManPerformDsdBalance( Gia_Man_t * p, int nCutNum, int nRelaxRatio, int fVerbose );
|
||||
|
|
|
|||
|
|
@ -559,9 +559,7 @@ Gia_Man_t * Gia_ManCompress2( Gia_Man_t * p, int fUpdateLevel, int fVerbose )
|
|||
Aig_ManStop( pTemp );
|
||||
pGia = Gia_ManFromAig( pNew );
|
||||
Aig_ManStop( pNew );
|
||||
pGia->pManTime = p->pManTime; p->pManTime = NULL;
|
||||
pGia->pAigExtra = p->pAigExtra; p->pAigExtra = NULL;
|
||||
pGia->nAnd2Delay = p->nAnd2Delay; p->nAnd2Delay = 0;
|
||||
Gia_ManTransferTiming( p, pGia );
|
||||
return pGia;
|
||||
}
|
||||
|
||||
|
|
@ -587,9 +585,7 @@ Gia_Man_t * Gia_ManPerformDch( Gia_Man_t * p, void * pPars )
|
|||
// pGia = Gia_ManFromAig( pNew );
|
||||
pGia = Gia_ManFromAigChoices( pNew );
|
||||
Aig_ManStop( pNew );
|
||||
pGia->pManTime = p->pManTime; p->pManTime = NULL;
|
||||
pGia->pAigExtra = p->pAigExtra; p->pAigExtra = NULL;
|
||||
pGia->nAnd2Delay = p->nAnd2Delay; p->nAnd2Delay = 0;
|
||||
Gia_ManTransferTiming( p, pGia );
|
||||
return pGia;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -785,7 +785,10 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
|
|||
}
|
||||
Vec_IntFreeP( &vInits );
|
||||
if ( !fSkipStrash && pNew->vMapping )
|
||||
Abc_Print( 0, "Structural hashing enabled while reading AIGER may have invalidated the mapping. Consider using \"&r -s\".\n" );
|
||||
{
|
||||
Abc_Print( 0, "Structural hashing enabled while reading AIGER invalidated the mapping. Consider using \"&r -s\".\n" );
|
||||
Vec_IntFreeP( &pNew->vMapping );
|
||||
}
|
||||
return pNew;
|
||||
}
|
||||
|
||||
|
|
@ -1035,11 +1038,9 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int
|
|||
{
|
||||
// printf( "Gia_AigerWrite(): Normalizing AIG for writing.\n" );
|
||||
p = Gia_ManDupNormalize( pInit );
|
||||
p->pManTime = pInit->pManTime; pInit->pManTime = NULL;
|
||||
Gia_ManTransferTiming( pInit, p );
|
||||
p->vNamesIn = pInit->vNamesIn; pInit->vNamesIn = NULL;
|
||||
p->vNamesOut = pInit->vNamesOut; pInit->vNamesOut = NULL;
|
||||
p->pAigExtra = pInit->pAigExtra; pInit->pAigExtra = NULL;
|
||||
p->nAnd2Delay = pInit->nAnd2Delay; pInit->nAnd2Delay = 0;
|
||||
p->nConstrs = pInit->nConstrs; pInit->nConstrs = 0;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -970,6 +970,12 @@ Gia_Man_t * Gia_ManAreaBalance( Gia_Man_t * p, int fSimpleAnd, int nNewNodesMax,
|
|||
pNew2 = Gia_ManDupNoMuxes( pNew1 );
|
||||
if ( fVerbose ) Gia_ManPrintStats( pNew2, NULL );
|
||||
Gia_ManStop( pNew1 );
|
||||
// normalize if needed
|
||||
if ( !Gia_ManIsNormalized(pNew2) )
|
||||
{
|
||||
pNew2 = Gia_ManDupNormalize( pNew1 = pNew2 );
|
||||
Gia_ManStop( pNew1 );
|
||||
}
|
||||
return pNew2;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1583,18 +1583,6 @@ void Gia_ManTransferMapping( Gia_Man_t * pGia, Gia_Man_t * p )
|
|||
}
|
||||
Gia_ManMappingVerify( p );
|
||||
}
|
||||
|
||||
/**Function*************************************************************
|
||||
|
||||
Synopsis [Transfers packing from hie GIA to normalized GIA.]
|
||||
|
||||
Description [Hie GIA (pGia) points to normalized GIA (p).]
|
||||
|
||||
SideEffects []
|
||||
|
||||
SeeAlso []
|
||||
|
||||
***********************************************************************/
|
||||
void Gia_ManTransferPacking( Gia_Man_t * pGia, Gia_Man_t * p )
|
||||
{
|
||||
Vec_Int_t * vPackingNew;
|
||||
|
|
@ -1629,6 +1617,12 @@ void Gia_ManTransferPacking( Gia_Man_t * pGia, Gia_Man_t * p )
|
|||
assert( p->vPacking == NULL );
|
||||
p->vPacking = vPackingNew;
|
||||
}
|
||||
void Gia_ManTransferTiming( Gia_Man_t * pGia, Gia_Man_t * p )
|
||||
{
|
||||
p->pManTime = pGia->pManTime; pGia->pManTime = NULL;
|
||||
p->pAigExtra = pGia->pAigExtra; pGia->pAigExtra = NULL;
|
||||
p->nAnd2Delay = pGia->nAnd2Delay; pGia->nAnd2Delay = 0;
|
||||
}
|
||||
|
||||
|
||||
/**Function*************************************************************
|
||||
|
|
@ -1699,7 +1693,7 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp, int fNormalized )
|
|||
Abc_Print( 0, "Switching activity computation for designs with boxes is disabled.\n" );
|
||||
}
|
||||
if ( p->pManTime )
|
||||
pIfMan->pManTim = Tim_ManDup( (Tim_Man_t *)p->pManTime, 0 );
|
||||
pIfMan->pManTim = Tim_ManDup( (Tim_Man_t *)p->pManTime, pPars->fDelayOpt || pPars->fDelayOptLut || pPars->fDsdBalance || pPars->fUserRecLib );
|
||||
if ( !If_ManPerformMapping( pIfMan ) )
|
||||
{
|
||||
If_ManStop( pIfMan );
|
||||
|
|
@ -1718,17 +1712,13 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp, int fNormalized )
|
|||
pNew->pSpec = Abc_UtilStrsav( p->pSpec );
|
||||
Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
|
||||
// return the original (unmodified by the mapper) timing manager
|
||||
pNew->pManTime = p->pManTime; p->pManTime = NULL;
|
||||
pNew->pAigExtra = p->pAigExtra; p->pAigExtra = NULL;
|
||||
pNew->nAnd2Delay = p->nAnd2Delay; p->nAnd2Delay = 0;
|
||||
Gia_ManTransferTiming( p, pNew );
|
||||
Gia_ManStop( p );
|
||||
// normalize and transfer mapping
|
||||
pNew = Gia_ManDupNormalize( p = pNew );
|
||||
Gia_ManTransferMapping( p, pNew );
|
||||
Gia_ManTransferPacking( p, pNew );
|
||||
pNew->pManTime = p->pManTime; p->pManTime = NULL;
|
||||
pNew->pAigExtra = p->pAigExtra; p->pAigExtra = NULL;
|
||||
pNew->nAnd2Delay = p->nAnd2Delay; p->nAnd2Delay = 0;
|
||||
Gia_ManTransferTiming( p, pNew );
|
||||
Gia_ManStop( p );
|
||||
return pNew;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -328,9 +328,7 @@ Gia_Man_t * Gia_ManFraigSweep( Gia_Man_t * p, void * pPars )
|
|||
Gia_ManStop( pTemp );
|
||||
// normalize the result
|
||||
pNew = Gia_ManDupNormalize( pTemp = pNew );
|
||||
pNew->pManTime = pTemp->pManTime; pTemp->pManTime = NULL;
|
||||
pNew->pAigExtra = pTemp->pAigExtra; pTemp->pAigExtra = NULL;
|
||||
pNew->nAnd2Delay = pTemp->nAnd2Delay; pTemp->nAnd2Delay = 0;
|
||||
Gia_ManTransferTiming( pTemp, pNew );
|
||||
Gia_ManStop( pTemp );
|
||||
// return the result
|
||||
assert( pNew->pManTime != NULL );
|
||||
|
|
|
|||
|
|
@ -28068,13 +28068,13 @@ usage:
|
|||
int Abc_CommandAbc9Syn2( Abc_Frame_t * pAbc, int argc, char ** argv )
|
||||
{
|
||||
Gia_Man_t * pTemp;
|
||||
int c, fVerbose = 0;
|
||||
int fOldAlgo = 0;
|
||||
int fCoarsen = 1;
|
||||
int fCutMin = 0;
|
||||
int nRelaxRatio = 20;
|
||||
int fDelayMin = 1;
|
||||
int fVeryVerbose = 0;
|
||||
int c, fVerbose = 0;
|
||||
int fOldAlgo = 0;
|
||||
int fCoarsen = 1;
|
||||
int fCutMin = 0;
|
||||
int nRelaxRatio = 20;
|
||||
int fDelayMin = 0;
|
||||
int fVeryVerbose = 0;
|
||||
Extra_UtilGetoptReset();
|
||||
while ( ( c = Extra_UtilGetopt( argc, argv, "Rakmdvwh" ) ) != EOF )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ Tim_Man_t * Tim_ManDup( Tim_Man_t * p, int fUnitDelay )
|
|||
pDelayTableNew[1] = (int)pDelayTable[1];
|
||||
pDelayTableNew[2] = (int)pDelayTable[2];
|
||||
for ( k = 0; k < nInputs * nOutputs; k++ )
|
||||
pDelayTableNew[3+k] = fUnitDelay ? 1.0 : pDelayTable[3+k];
|
||||
pDelayTableNew[3+k] = fUnitDelay ? (float)fUnitDelay : pDelayTable[3+k];
|
||||
// assert( (int)pDelayTableNew[0] == Vec_PtrSize(pNew->vDelayTables) );
|
||||
assert( Vec_PtrEntry(pNew->vDelayTables, i) == NULL );
|
||||
Vec_PtrWriteEntry( pNew->vDelayTables, i, pDelayTableNew );
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ void Tim_ManSetCiRequired( Tim_Man_t * p, int iCi, float Delay )
|
|||
void Tim_ManSetCoRequired( Tim_Man_t * p, int iCo, float Delay )
|
||||
{
|
||||
assert( iCo < p->nCos );
|
||||
assert( !p->fUseTravId || p->pCos[iCo].TravId != p->nTravIds );
|
||||
assert( !p->fUseTravId || !p->nTravIds || p->pCos[iCo].TravId != p->nTravIds );
|
||||
p->pCos[iCo].timeReq = Delay;
|
||||
p->pCos[iCo].TravId = p->nTravIds;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue