summaryrefslogtreecommitdiffstats
path: root/src/aig/gia
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-11-09 23:01:30 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2014-11-09 23:01:30 -0800
commit9a292bd93c84e7f9445d796fdd5f1ca86c9ea220 (patch)
tree4d3eb45d4cbae9ab2e6b230e4499edf0aeb91a7e /src/aig/gia
parent372a348c90eb3f13c2a366815d1406476a638c24 (diff)
downloadabc-9a292bd93c84e7f9445d796fdd5f1ca86c9ea220.tar.gz
abc-9a292bd93c84e7f9445d796fdd5f1ca86c9ea220.tar.bz2
abc-9a292bd93c84e7f9445d796fdd5f1ca86c9ea220.zip
Detecting full-adder chains and putting them into white boxes.
Diffstat (limited to 'src/aig/gia')
-rw-r--r--src/aig/gia/giaFadds.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/aig/gia/giaFadds.c b/src/aig/gia/giaFadds.c
index 4c2b9481..accba9c3 100644
--- a/src/aig/gia/giaFadds.c
+++ b/src/aig/gia/giaFadds.c
@@ -56,7 +56,7 @@ void Gia_ManIllustrateBoxes( Gia_Man_t * p )
// walk through the boxes
curCi = Tim_ManPiNum(pManTime);
curCo = 0;
- for ( i = 0; i < Tim_ManBoxNum(pManTime); i++ )
+ for ( i = 0; i < nBoxes; i++ )
{
nBoxIns = Tim_ManBoxInputNum(pManTime, i);
nBoxOuts = Tim_ManBoxOutputNum(pManTime, i);
@@ -306,7 +306,7 @@ Vec_Int_t * Gia_ManDetectFullAdders( Gia_Man_t * p, int fVerbose )
vFadds = Dtc_ManFindCommonCuts( p, vCutsXor, vCutsMaj );
qsort( Vec_IntArray(vFadds), Vec_IntSize(vFadds)/5, 20, (int (*)(const void *, const void *))Dtc_ManCompare2 );
if ( fVerbose )
- printf( "XOR3 cuts = %d. MAJ cuts = %d. Fadds = %d.\n", Vec_IntSize(vCutsXor)/4, Vec_IntSize(vCutsMaj)/4, Vec_IntSize(vFadds)/5 );
+ printf( "XOR3 cuts = %d. MAJ cuts = %d. Full-adders = %d.\n", Vec_IntSize(vCutsXor)/4, Vec_IntSize(vCutsMaj)/4, Vec_IntSize(vFadds)/5 );
//Dtc_ManPrintFadds( vFadds );
Vec_IntFree( vCutsXor );
Vec_IntFree( vCutsMaj );
@@ -467,10 +467,11 @@ void Gia_ManPrintChains( Gia_Man_t * p, Vec_Int_t * vFadds, Vec_Int_t * vMap, Ve
Vec_Int_t * Gia_ManFindMapping( Gia_Man_t * p, Vec_Int_t * vFadds, Vec_Int_t * vMap, Vec_Wec_t * vChains )
{
Vec_Int_t * vChain;
- int i, k, iFadd;
+ int i, k, iFadd = -1;
Vec_Int_t * vMap2Chain = Vec_IntStartFull( Gia_ManObjNum(p) );
Vec_WecForEachLevel( vChains, vChain, i )
{
+ assert( Vec_IntSize(vChain) > 0 );
Vec_IntForEachEntry( vChain, iFadd, k )
{
//printf( "Chain %d: setting SUM %d (obj %d)\n", i, k, Vec_IntEntry(vFadds, 5*iFadd+3) );
@@ -692,7 +693,13 @@ Gia_Man_t * Gia_ManDupWithFaddBoxes( Gia_Man_t * p, int nFaddMin, int fVerbose )
Gia_ManDupWithFaddBoxes_rec( pNew, p, Gia_ObjFanin0(pObj), vFadds, vMap, vChains, vMap2Chain, vTruths );
Gia_ManForEachCo( p, pObj, i )
Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
- Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
+// Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
+ if ( Gia_ManRegNum(p) )
+ {
+ if ( fVerbose )
+ printf( "Warning: Sequential design is coverted into combinational one by adding white boxes.\n" );
+ Gia_ManSetRegNum( pNew, 0 );
+ }
assert( !Gia_ManHasDangling(pNew) );
// cleanup