summaryrefslogtreecommitdiffstats
path: root/src/aig
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-08-20 22:12:51 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-08-20 22:12:51 -0700
commitc344f3e38c60147cacd8a5d414625b832192ccee (patch)
tree390f8d38d7fc5c601099e08a471c327ac3dc5c7a /src/aig
parent6dbaa4d0f85d8e9ba08b06192aac6013c6461147 (diff)
downloadabc-c344f3e38c60147cacd8a5d414625b832192ccee.tar.gz
abc-c344f3e38c60147cacd8a5d414625b832192ccee.tar.bz2
abc-c344f3e38c60147cacd8a5d414625b832192ccee.zip
Propagating timing support to the new synthesis/mapping commands.
Diffstat (limited to 'src/aig')
-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
6 files changed, 25 insertions, 32 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 );