summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-04-19 16:55:44 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-04-19 16:55:44 -0700
commitd0c4c0cd7b955c49a1d300977555ee14289726e4 (patch)
treef084311e1b25f25beec3cf790becea6b0c5eb6d1 /src/base
parent17f989ccbaaa9f51d17349c55f0745396d3e7007 (diff)
downloadabc-d0c4c0cd7b955c49a1d300977555ee14289726e4.tar.gz
abc-d0c4c0cd7b955c49a1d300977555ee14289726e4.tar.bz2
abc-d0c4c0cd7b955c49a1d300977555ee14289726e4.zip
Improvements to DSD balancing.
Diffstat (limited to 'src/base')
-rw-r--r--src/base/abci/abc.c22
-rw-r--r--src/base/abci/abcIf.c2
2 files changed, 18 insertions, 6 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 9f424459..86500d7a 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -15097,6 +15097,11 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pPars->pLutStruct )
{
+ if ( pPars->fDsdBalance )
+ {
+ Abc_Print( -1, "Incompatible options (-S and -x).\n" );
+ return 1;
+ }
if ( pPars->nLutSize < 6 || pPars->nLutSize > 16 )
{
Abc_Print( -1, "This feature only works for [6;16]-LUTs.\n" );
@@ -15122,12 +15127,12 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars->pLutLib = NULL;
}
// modify for delay optimization
- if ( pPars->fDelayOpt || pPars->fDsdBalance )
+ if ( pPars->fDelayOpt || pPars->fDsdBalance || pPars->fDelayOptLut )
{
pPars->fTruth = 1;
pPars->fCutMin = 1;
pPars->fExpRed = 0;
- pPars->fUseDsd = pPars->fDsdBalance;
+ pPars->fUseDsd = pPars->fDsdBalance || pPars->fDelayOptLut;
pPars->pLutLib = NULL;
}
// modify for delay optimization
@@ -15162,7 +15167,7 @@ int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
printf( "DSD manager has incompatible number of variables.\n" );
return 0;
}
- if ( p && LutSize != If_DsdManLutSize(p) )
+ if ( p && LutSize != If_DsdManLutSize(p) && !pPars->fDsdBalance )
{
printf( "DSD manager has different LUT size.\n" );
return 0;
@@ -29859,6 +29864,11 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
}
if ( pPars->pLutStruct )
{
+ if ( pPars->fDsdBalance )
+ {
+ Abc_Print( -1, "Incompatible options (-S and -x).\n" );
+ return 1;
+ }
if ( pPars->nLutSize < 6 || pPars->nLutSize > 16 )
{
Abc_Print( -1, "This feature only works for [6;16]-LUTs.\n" );
@@ -29886,12 +29896,12 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
pPars->pLutLib = NULL;
}
// modify for delay optimization
- if ( pPars->fDelayOpt || pPars->fDsdBalance )
+ if ( pPars->fDelayOpt || pPars->fDsdBalance || pPars->fDelayOptLut )
{
pPars->fTruth = 1;
pPars->fCutMin = 1;
pPars->fExpRed = 0;
- pPars->fUseDsd = pPars->fDsdBalance;
+ pPars->fUseDsd = pPars->fDsdBalance || pPars->fDelayOptLut;
pPars->pLutLib = NULL;
}
// modify for delay optimization
@@ -29926,7 +29936,7 @@ int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
printf( "DSD manager has incompatible number of variables.\n" );
return 0;
}
- if ( p && LutSize != If_DsdManLutSize(p) )
+ if ( p && LutSize != If_DsdManLutSize(p) && !pPars->fDsdBalance )
{
printf( "DSD manager has different LUT size.\n" );
return 0;
diff --git a/src/base/abci/abcIf.c b/src/base/abci/abcIf.c
index 5bab925e..8131a64a 100644
--- a/src/base/abci/abcIf.c
+++ b/src/base/abci/abcIf.c
@@ -144,6 +144,8 @@ Abc_Ntk_t * Abc_NtkIf( Abc_Ntk_t * pNtk, If_Par_t * pPars )
assert( pPars->nLutSize <= If_DsdManVarNum(p) );
assert( (pPars->pLutStruct == NULL && If_DsdManLutSize(p) == 0) || (pPars->pLutStruct && pPars->pLutStruct[0] - '0' == If_DsdManLutSize(p)) );
pIfMan->pIfDsdMan = (If_DsdMan_t *)Abc_FrameReadManDsd();
+ if ( pPars->fDsdBalance )
+ If_DsdManAllocIsops( pIfMan->pIfDsdMan, pPars->nLutSize );
}
// perform FPGA mapping