summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/aig/gia/gia.h2
-rw-r--r--src/aig/gia/giaAig.c8
-rw-r--r--src/aig/gia/giaAiger.c9
-rw-r--r--src/aig/gia/giaBalance.c6
-rw-r--r--src/aig/gia/giaIf.c28
-rw-r--r--src/aig/gia/giaSweep.c4
-rw-r--r--src/base/abci/abc.c14
-rw-r--r--src/misc/tim/timMan.c2
-rw-r--r--src/misc/tim/timTime.c2
9 files changed, 34 insertions, 41 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h
index d4582b59..d7ad4300 100644
--- a/src/aig/gia/gia.h
+++ b/src/aig/gia/gia.h
@@ -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 );
diff --git a/src/aig/gia/giaAig.c b/src/aig/gia/giaAig.c
index 0128ed91..06c91853 100644
--- a/src/aig/gia/giaAig.c
+++ b/src/aig/gia/giaAig.c
@@ -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;
}
diff --git a/src/aig/gia/giaAiger.c b/src/aig/gia/giaAiger.c
index 6821aab2..e1833310 100644
--- a/src/aig/gia/giaAiger.c
+++ b/src/aig/gia/giaAiger.c
@@ -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
diff --git a/src/aig/gia/giaBalance.c b/src/aig/gia/giaBalance.c
index 02315747..918b3009 100644
--- a/src/aig/gia/giaBalance.c
+++ b/src/aig/gia/giaBalance.c
@@ -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;
}
diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c
index 61b40117..6e04efd4 100644
--- a/src/aig/gia/giaIf.c
+++ b/src/aig/gia/giaIf.c
@@ -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;
}
diff --git a/src/aig/gia/giaSweep.c b/src/aig/gia/giaSweep.c
index 4517bb7b..d8bafca9 100644
--- a/src/aig/gia/giaSweep.c
+++ b/src/aig/gia/giaSweep.c
@@ -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 );
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index fbd6e2c4..338033b9 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -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 )
{
diff --git a/src/misc/tim/timMan.c b/src/misc/tim/timMan.c
index 42f2fe1a..0900b7ae 100644
--- a/src/misc/tim/timMan.c
+++ b/src/misc/tim/timMan.c
@@ -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 );
diff --git a/src/misc/tim/timTime.c b/src/misc/tim/timTime.c
index ddec4c62..7d3dd082 100644
--- a/src/misc/tim/timTime.c
+++ b/src/misc/tim/timTime.c
@@ -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;
}