diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2018-06-16 14:52:20 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2018-06-16 14:52:20 -0700 |
commit | f4a267d5815e5041c499e12322d70d7996093473 (patch) | |
tree | c3e91686171a4b60a4e284dd178b4629575e32a2 | |
parent | 15939511df8ff1ce15f2112cee01d7693234f2a4 (diff) | |
download | abc-f4a267d5815e5041c499e12322d70d7996093473.tar.gz abc-f4a267d5815e5041c499e12322d70d7996093473.tar.bz2 abc-f4a267d5815e5041c499e12322d70d7996093473.zip |
Bug fix in 'lutpack' (level count overflow).
-rw-r--r-- | src/base/wlc/wlcWriteVer.c | 1 | ||||
-rw-r--r-- | src/opt/lpk/lpkAbcUtil.c | 4 | ||||
-rw-r--r-- | src/opt/lpk/lpkCore.c | 1 | ||||
-rw-r--r-- | src/opt/lpk/lpkInt.h | 8 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/base/wlc/wlcWriteVer.c b/src/base/wlc/wlcWriteVer.c index 45ce31e4..93e2c2c6 100644 --- a/src/base/wlc/wlcWriteVer.c +++ b/src/base/wlc/wlcWriteVer.c @@ -321,7 +321,6 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops ) else if ( pObj->Type == WLC_OBJ_ARI_ADDSUB ) { // out = mode ? a+b+cin : a-b-cin - int nRange = Wlc_ObjRange(Wlc_ObjFanin0(p, pObj)); fprintf( pFile, "%s ;\n", Wlc_ObjName(p, i) ); fprintf( pFile, " " ); fprintf( pFile, "assign " ); diff --git a/src/opt/lpk/lpkAbcUtil.c b/src/opt/lpk/lpkAbcUtil.c index b96614d2..24a42b5f 100644 --- a/src/opt/lpk/lpkAbcUtil.c +++ b/src/opt/lpk/lpkAbcUtil.c @@ -124,7 +124,7 @@ Lpk_Fun_t * Lpk_FunDup( Lpk_Fun_t * p, unsigned * pTruth ) pNew->uSupp = Kit_TruthSupport( pTruth, p->nVars ); Kit_TruthCopy( Lpk_FunTruth(pNew,0), pTruth, p->nVars ); memcpy( pNew->pFanins, p->pFanins, 16 ); - memcpy( pNew->pDelays, p->pDelays, 16 ); + memcpy( pNew->pDelays, p->pDelays, sizeof(int)*16 ); Vec_PtrPush( p->vNodes, pNew ); return pNew; } @@ -212,7 +212,7 @@ void Lpk_FunComputeCofSupps( Lpk_Fun_t * p ) SeeAlso [] ***********************************************************************/ -int Lpk_SuppDelay( unsigned uSupp, char * pDelays ) +int Lpk_SuppDelay( unsigned uSupp, int * pDelays ) { int Delay, Var; Delay = 0; diff --git a/src/opt/lpk/lpkCore.c b/src/opt/lpk/lpkCore.c index 6595b365..27912a9a 100644 --- a/src/opt/lpk/lpkCore.c +++ b/src/opt/lpk/lpkCore.c @@ -451,6 +451,7 @@ p->timeTruth3 += Abc_Clock() - clk; printf( "%c=%d ", 'a'+k, Abc_ObjLevel(pLeaf) ); printf( "\n" ); Kit_DsdPrintFromTruth( pTruth, pCut->nLeaves ); + printf( "\n" ); // pFileName = Kit_TruthDumpToFile( pTruth, pCut->nLeaves, Count++ ); // printf( "Saved truth table in file \"%s\".\n", pFileName ); } diff --git a/src/opt/lpk/lpkInt.h b/src/opt/lpk/lpkInt.h index 841572c7..02181001 100644 --- a/src/opt/lpk/lpkInt.h +++ b/src/opt/lpk/lpkInt.h @@ -147,13 +147,13 @@ struct Lpk_Fun_t_ unsigned Id : 7; // the ID of this node unsigned nVars : 5; // the number of variables unsigned nLutK : 4; // the number of LUT inputs - unsigned nAreaLim : 5; // the area limit (the largest allowed) - unsigned nDelayLim : 9; // the delay limit (the largest allowed) + unsigned nAreaLim : 14; // the area limit (the largest allowed) unsigned fSupports : 1; // supports of cofactors were precomputed unsigned fMark : 1; // marks the MUX-based dec unsigned uSupp; // the support of this component unsigned puSupps[32]; // the supports of the cofactors - char pDelays[16]; // the delays of the inputs + unsigned nDelayLim; // the delay limit (the largest allowed) + int pDelays[16]; // the delays of the inputs char pFanins[16]; // the fanins of this function unsigned pTruth[0]; // the truth table (contains room for three truth tables) }; @@ -215,7 +215,7 @@ extern Lpk_Fun_t * Lpk_FunCreate( Abc_Ntk_t * pNtk, Vec_Ptr_t * vLeaves, unsi extern Lpk_Fun_t * Lpk_FunDup( Lpk_Fun_t * p, unsigned * pTruth ); extern int Lpk_FunSuppMinimize( Lpk_Fun_t * p ); extern void Lpk_FunComputeCofSupps( Lpk_Fun_t * p ); -extern int Lpk_SuppDelay( unsigned uSupp, char * pDelays ); +extern int Lpk_SuppDelay( unsigned uSupp, int * pDelays ); extern int Lpk_SuppToVars( unsigned uBoundSet, char * pVars ); |