summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-04-19 17:13:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-04-19 17:13:00 -0700
commit1bca32bae3190ce4e841231c8020cc5a50c81d32 (patch)
tree717cba2fafb3b4d767f9ec019f697624cf65e6ea
parentd0c4c0cd7b955c49a1d300977555ee14289726e4 (diff)
downloadabc-1bca32bae3190ce4e841231c8020cc5a50c81d32.tar.gz
abc-1bca32bae3190ce4e841231c8020cc5a50c81d32.tar.bz2
abc-1bca32bae3190ce4e841231c8020cc5a50c81d32.zip
Improvements to DSD balancing.
-rw-r--r--src/base/abci/abc.c20
-rw-r--r--src/map/if/ifDelay.c2
-rw-r--r--src/map/if/ifDsd.c2
3 files changed, 21 insertions, 3 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 86500d7a..3a846433 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -15178,7 +15178,11 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
if ( pPars->fUserRecLib )
{
- assert( Abc_NtkRecIsRunning3() );
+ if ( !Abc_NtkRecIsRunning3() )
+ {
+ printf( "LMS manager is not running (use \"rec_start3\").\n" );
+ return 0;
+ }
if ( Abc_NtkRecInputNum3() != pPars->nLutSize )
{
printf( "The number of library inputs (%d) different from the K parameters (%d).\n", Abc_NtkRecInputNum3(), pPars->nLutSize );
@@ -29945,6 +29949,20 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_FrameSetManDsd( If_DsdManAlloc(pPars->nLutSize, LutSize) );
}
+ if ( pPars->fUserRecLib )
+ {
+ if ( !Abc_NtkRecIsRunning3() )
+ {
+ printf( "LMS manager is not running (use \"rec_start3\").\n" );
+ return 0;
+ }
+ if ( Abc_NtkRecInputNum3() != pPars->nLutSize )
+ {
+ printf( "The number of library inputs (%d) different from the K parameters (%d).\n", Abc_NtkRecInputNum3(), pPars->nLutSize );
+ return 0;
+ }
+ }
+
// complain if truth tables are requested but the cut size is too large
if ( pPars->fTruth && pPars->nLutSize > IF_MAX_FUNC_LUTSIZE )
{
diff --git a/src/map/if/ifDelay.c b/src/map/if/ifDelay.c
index 21ae6585..f75c42df 100644
--- a/src/map/if/ifDelay.c
+++ b/src/map/if/ifDelay.c
@@ -277,7 +277,7 @@ int If_CutSopBalanceEval( If_Man_t * p, If_Cut_t * pCut, Vec_Int_t * vAig )
assert( Vec_IntSize(vCover) > 0 );
for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
pTimes[i] = (int)If_ObjCutBest(If_CutLeaf(p, pCut, i))->Delay;
- Delay = If_CutSopBalanceEvalIntInt( vCover, If_CutLeaveNum(pCut), pTimes, vAig, Abc_LitIsCompl(If_CutTruthLit(pCut)), &Area );
+ Delay = If_CutSopBalanceEvalIntInt( vCover, If_CutLeaveNum(pCut), pTimes, vAig, Abc_LitIsCompl(If_CutTruthLit(pCut)) ^ pCut->fCompl, &Area );
pCut->Cost = Area;
return Delay;
}
diff --git a/src/map/if/ifDsd.c b/src/map/if/ifDsd.c
index 5ccfb19b..375b80fd 100644
--- a/src/map/if/ifDsd.c
+++ b/src/map/if/ifDsd.c
@@ -2100,7 +2100,7 @@ int If_CutDsdBalanceEval( If_Man_t * p, If_Cut_t * pCut, Vec_Int_t * vAig )
int Delay, Area = 0;
for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
pTimes[i] = (int)If_ObjCutBest(If_CutLeaf(p, pCut, i))->Delay;
- Delay = If_CutDsdBalanceEvalInt( p->pIfDsdMan, If_CutDsdLit(p, pCut), pTimes, vAig, &Area, If_CutDsdPerm(p, pCut) );
+ Delay = If_CutDsdBalanceEvalInt( p->pIfDsdMan, Abc_LitNotCond(If_CutDsdLit(p, pCut), pCut->fCompl), pTimes, vAig, &Area, If_CutDsdPerm(p, pCut) );
pCut->Cost = Area;
return Delay;
}