summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-04-27 18:33:23 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2016-04-27 18:33:23 -0700
commit53e86477193186a3b2625f544cc4aad876a832cc (patch)
treebb8e5157ed4d8a133b66450a3b7a30a546853324
parente8f961671c8174971365c4d49e4aa076ce8a7545 (diff)
downloadabc-53e86477193186a3b2625f544cc4aad876a832cc.tar.gz
abc-53e86477193186a3b2625f544cc4aad876a832cc.tar.bz2
abc-53e86477193186a3b2625f544cc4aad876a832cc.zip
Adding option to rehash AIG after mapping.
-rw-r--r--src/aig/gia/gia.h2
-rw-r--r--src/aig/gia/giaAiger.c2
-rw-r--r--src/aig/gia/giaBalAig.c2
-rw-r--r--src/aig/gia/giaDup.c8
-rw-r--r--src/aig/gia/giaFadds.c2
-rw-r--r--src/aig/gia/giaIf.c5
-rw-r--r--src/aig/gia/giaLf.c4
-rw-r--r--src/aig/gia/giaStr.c2
-rw-r--r--src/aig/gia/giaSweep.c4
-rw-r--r--src/aig/gia/giaTim.c3
-rw-r--r--src/base/abci/abc.c6
-rw-r--r--src/base/wlc/wlcBlast.c2
-rw-r--r--src/map/if/if.h1
13 files changed, 22 insertions, 21 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h
index 0b899698..82e82cb2 100644
--- a/src/aig/gia/gia.h
+++ b/src/aig/gia/gia.h
@@ -1456,7 +1456,7 @@ extern int Gia_ManClockDomainNum( Gia_Man_t * p );
extern int Gia_ManIsSeqWithBoxes( Gia_Man_t * p );
extern int Gia_ManIsNormalized( Gia_Man_t * p );
extern Vec_Int_t * Gia_ManOrderWithBoxes( Gia_Man_t * p );
-extern Gia_Man_t * Gia_ManDupNormalize( Gia_Man_t * p );
+extern Gia_Man_t * Gia_ManDupNormalize( Gia_Man_t * p, int fHashMapping );
extern Gia_Man_t * Gia_ManDupUnnormalize( Gia_Man_t * p );
extern Gia_Man_t * Gia_ManDupUnshuffleInputs( Gia_Man_t * p );
extern int Gia_ManLevelWithBoxes( Gia_Man_t * p );
diff --git a/src/aig/gia/giaAiger.c b/src/aig/gia/giaAiger.c
index 04ad8641..940d75ac 100644
--- a/src/aig/gia/giaAiger.c
+++ b/src/aig/gia/giaAiger.c
@@ -1105,7 +1105,7 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int
if ( !Gia_ManIsNormalized(pInit) )
{
// printf( "Gia_AigerWrite(): Normalizing AIG for writing.\n" );
- p = Gia_ManDupNormalize( pInit );
+ p = Gia_ManDupNormalize( pInit, 0 );
Gia_ManTransferMapping( p, pInit );
Gia_ManTransferPacking( p, pInit );
Gia_ManTransferTiming( p, pInit );
diff --git a/src/aig/gia/giaBalAig.c b/src/aig/gia/giaBalAig.c
index 6525d3fb..bc27e187 100644
--- a/src/aig/gia/giaBalAig.c
+++ b/src/aig/gia/giaBalAig.c
@@ -1055,7 +1055,7 @@ Gia_Man_t * Gia_ManAreaBalance( Gia_Man_t * p, int fSimpleAnd, int nNewNodesMax,
// normalize if needed
if ( !Gia_ManIsNormalized(pNew2) )
{
- pNew2 = Gia_ManDupNormalize( pNew1 = pNew2 );
+ pNew2 = Gia_ManDupNormalize( pNew1 = pNew2, 0 );
Gia_ManStop( pNew1 );
}
Gia_ManTransferTiming( pNew2, p );
diff --git a/src/aig/gia/giaDup.c b/src/aig/gia/giaDup.c
index f539642d..e204fb55 100644
--- a/src/aig/gia/giaDup.c
+++ b/src/aig/gia/giaDup.c
@@ -2165,7 +2165,7 @@ Gia_Man_t * Gia_ManDupTopAnd_iter( Gia_Man_t * p, int fVerbose )
printf( "The AIG cannot be decomposed using AND-decomposition.\n" );
Vec_IntFree( vFront );
Vec_IntFree( vLeaves );
- return Gia_ManDupNormalize( p );
+ return Gia_ManDupNormalize( p, 0 );
}
// expand the frontier
Gia_ManForEachObjVec( vFront, p, pObj, i )
@@ -2210,7 +2210,7 @@ Gia_Man_t * Gia_ManDupTopAnd_iter( Gia_Man_t * p, int fVerbose )
ABC_FREE( pCi2Lit );
ABC_FREE( pVar2Val );
Vec_IntFree( vLeaves );
- return Gia_ManDupNormalize( p );
+ return Gia_ManDupNormalize( p, 0 );
}
// create array of input literals
Vec_IntClear( vLeaves );
@@ -2245,7 +2245,7 @@ Gia_Man_t * Gia_ManDupTopAnd( Gia_Man_t * p, int fVerbose )
{
Gia_Man_t * pNew, * pTemp;
int fContinue, iIter = 0;
- pNew = Gia_ManDupNormalize( p );
+ pNew = Gia_ManDupNormalize( p, 0 );
for ( fContinue = 1; fContinue; )
{
pNew = Gia_ManDupTopAnd_iter( pTemp = pNew, fVerbose );
@@ -2425,7 +2425,7 @@ Gia_Man_t * Gia_ManMiter( Gia_Man_t * p0, Gia_Man_t * p1, int nInsDup, int fDual
pNew = Gia_ManCleanup( pTemp = pNew );
Gia_ManStop( pTemp );
- pNew = Gia_ManDupNormalize( pTemp = pNew );
+ pNew = Gia_ManDupNormalize( pTemp = pNew, 0 );
Gia_ManStop( pTemp );
return pNew;
}
diff --git a/src/aig/gia/giaFadds.c b/src/aig/gia/giaFadds.c
index dc39131a..4014814a 100644
--- a/src/aig/gia/giaFadds.c
+++ b/src/aig/gia/giaFadds.c
@@ -726,7 +726,7 @@ Gia_Man_t * Gia_ManDupWithNaturalBoxes( Gia_Man_t * p, int nFaddMin, int fVerbos
pNew->pAigExtra = Gia_ManGenerateExtraAig( nBoxes, 3, 2 );
/*
// normalize
- pNew = Gia_ManDupNormalize( pTemp = pNew );
+ pNew = Gia_ManDupNormalize( pTemp = pNew, 0 );
pNew->pManTime = pTemp->pManTime; pTemp->pManTime = NULL;
pNew->pAigExtra = pTemp->pAigExtra; pTemp->pAigExtra = NULL;
Gia_ManStop( pTemp );
diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c
index 326e6a48..9a72f576 100644
--- a/src/aig/gia/giaIf.c
+++ b/src/aig/gia/giaIf.c
@@ -2180,7 +2180,7 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp )
Gia_ManStop( p );
}
// normalize
- pNew = Gia_ManDupNormalize( p = pNew );
+ pNew = Gia_ManDupNormalize( p = pNew, ((If_Par_t *)pp)->fHashMapping );
Gia_ManTransferMapping( pNew, p );
Gia_ManTransferPacking( pNew, p );
Gia_ManTransferTiming( pNew, p );
@@ -2189,10 +2189,9 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp )
}
else
{
- int fHashMapping = 0;
pNew = Gia_ManPerformMappingInt( p, (If_Par_t *)pp );
Gia_ManTransferTiming( pNew, p );
- if ( fHashMapping )
+ if ( ((If_Par_t *)pp)->fHashMapping )
{
pNew = Gia_ManDupHashMapping( p = pNew );
Gia_ManTransferPacking( pNew, p );
diff --git a/src/aig/gia/giaLf.c b/src/aig/gia/giaLf.c
index 72deabeb..082b1928 100644
--- a/src/aig/gia/giaLf.c
+++ b/src/aig/gia/giaLf.c
@@ -2210,7 +2210,7 @@ Gia_Man_t * Lf_ManPerformMapping( Gia_Man_t * p, Jf_Par_t * pPars )
Gia_ManStop( p );
}
// normalize
- pNew = Gia_ManDupNormalize( p = pNew );
+ pNew = Gia_ManDupNormalize( p = pNew, 0 );
Gia_ManTransferMapping( pNew, p );
// Gia_ManTransferPacking( pNew, p );
Gia_ManTransferTiming( pNew, p );
@@ -2279,7 +2279,7 @@ Gia_Man_t * Gia_ManPerformLfMapping( Gia_Man_t * p, Jf_Par_t * pPars, int fNorma
Gia_ManStop( p );
}
// normalize and transfer mapping
- pNew = Gia_ManDupNormalize( p = pNew );
+ pNew = Gia_ManDupNormalize( p = pNew, 0 );
Gia_ManTransferMapping( pNew, p );
// Gia_ManTransferPacking( pNew, p );
Gia_ManTransferTiming( pNew, p );
diff --git a/src/aig/gia/giaStr.c b/src/aig/gia/giaStr.c
index ea44ebd6..bf89b547 100644
--- a/src/aig/gia/giaStr.c
+++ b/src/aig/gia/giaStr.c
@@ -1394,7 +1394,7 @@ Gia_Man_t * Gia_ManLutBalance( Gia_Man_t * p, int nLutSize, int fUseMuxes, int f
Gia_ManTransferTiming( pNew, p );
Gia_ManStop( p );
// normalize
- pNew = Gia_ManDupNormalize( p = pNew );
+ pNew = Gia_ManDupNormalize( p = pNew, 0 );
Gia_ManTransferTiming( pNew, p );
Gia_ManStop( p );
// cleanup
diff --git a/src/aig/gia/giaSweep.c b/src/aig/gia/giaSweep.c
index 4c2ced07..3bb6487b 100644
--- a/src/aig/gia/giaSweep.c
+++ b/src/aig/gia/giaSweep.c
@@ -691,7 +691,7 @@ Gia_Man_t * Gia_ManSweepWithBoxesAndDomains( Gia_Man_t * p, void * pParsS, int f
}
}
// normalize the result
- pNew = Gia_ManDupNormalize( pTemp = pNew );
+ pNew = Gia_ManDupNormalize( pTemp = pNew, 0 );
Gia_ManTransferTiming( pNew, pTemp );
Gia_ManStop( pTemp );
// check integrity
@@ -757,7 +757,7 @@ Gia_Man_t * Gia_ManSweepWithBoxes( Gia_Man_t * p, void * pParsC, void * pParsS,
pFlopTypes[0], pFlopTypes[1], Abc_MaxInt(0, pFlopTypes[2]), Abc_MaxInt(0, -pFlopTypes[2]) );
}
// normalize the result
- pNew = Gia_ManDupNormalize( pTemp = pNew );
+ pNew = Gia_ManDupNormalize( pTemp = pNew, 0 );
Gia_ManTransferTiming( pNew, pTemp );
Gia_ManStop( pTemp );
// check integrity
diff --git a/src/aig/gia/giaTim.c b/src/aig/gia/giaTim.c
index a3adc9ce..feab0db1 100644
--- a/src/aig/gia/giaTim.c
+++ b/src/aig/gia/giaTim.c
@@ -135,9 +135,8 @@ int Gia_ManIsNormalized( Gia_Man_t * p )
SeeAlso []
***********************************************************************/
-Gia_Man_t * Gia_ManDupNormalize( Gia_Man_t * p )
+Gia_Man_t * Gia_ManDupNormalize( Gia_Man_t * p, int fHashMapping )
{
- int fHashMapping = 0;
Gia_Man_t * pNew;
Gia_Obj_t * pObj;
int i;
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 632edb78..ab220ab3 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -32988,6 +32988,8 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars->fVerbose ^= 1;
break;
case 'h':
+ pPars->fHashMapping ^= 1;
+ break;
default:
goto usage;
}
@@ -33258,7 +33260,7 @@ usage:
sprintf(LutSize, "library" );
else
sprintf(LutSize, "%d", pPars->nLutSize );
- Abc_Print( -2, "usage: &if [-KCFAGRTXY num] [-DEW float] [-S str] [-qarlepmsdbgxyofuijkztncvh]\n" );
+ Abc_Print( -2, "usage: &if [-KCFAGRTXY num] [-DEW float] [-S str] [-qarlepmsdbgxyofuijkztnchv]\n" );
Abc_Print( -2, "\t performs FPGA technology mapping of the network\n" );
Abc_Print( -2, "\t-K num : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
Abc_Print( -2, "\t-C num : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
@@ -33297,8 +33299,8 @@ usage:
Abc_Print( -2, "\t-t : toggles optimizing average rather than maximum level [default = %s]\n", pPars->fDoAverage? "yes": "no" );
Abc_Print( -2, "\t-n : toggles computing DSDs of the cut functions [default = %s]\n", pPars->fUseDsd? "yes": "no" );
Abc_Print( -2, "\t-c : toggles computing truth tables in a new way [default = %s]\n", pPars->fUseTtPerm? "yes": "no" );
+ Abc_Print( -2, "\t-h : toggles rehashing AIG after mapping [default = %s]\n", pPars->fHashMapping? "yes": "no" );
Abc_Print( -2, "\t-v : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
- Abc_Print( -2, "\t-h : prints the command usage\n");
return 1;
}
diff --git a/src/base/wlc/wlcBlast.c b/src/base/wlc/wlcBlast.c
index 99442a00..3a3d614b 100644
--- a/src/base/wlc/wlcBlast.c
+++ b/src/base/wlc/wlcBlast.c
@@ -1238,7 +1238,7 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds )
pNew->pAigExtra = pExtra;
pNew->pManTime = pManTime;
// normalize AIG
- pNew = Gia_ManDupNormalize( pTemp = pNew );
+ pNew = Gia_ManDupNormalize( pTemp = pNew, 0 );
Gia_ManTransferTiming( pNew, pTemp );
Gia_ManStop( pTemp );
//Tim_ManPrint( pManTime );
diff --git a/src/map/if/if.h b/src/map/if/if.h
index 8a4e7395..0282a1bd 100644
--- a/src/map/if/if.h
+++ b/src/map/if/if.h
@@ -140,6 +140,7 @@ struct If_Par_t_
int fUseTtPerm; // compute truth tables of the cut functions
int fDeriveLuts; // enables deriving LUT structures
int fDoAverage; // optimize average rather than maximum level
+ int fHashMapping; // perform AIG hashing after mapping
int fVerbose; // the verbosity flag
char * pLutStruct; // LUT structure
float WireDelay; // wire delay