Commit f4a267d5 by Alan Mishchenko

Bug fix in 'lutpack' (level count overflow).

parent 15939511
...@@ -321,7 +321,6 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops ) ...@@ -321,7 +321,6 @@ void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p, int fNoFlops )
else if ( pObj->Type == WLC_OBJ_ARI_ADDSUB ) else if ( pObj->Type == WLC_OBJ_ARI_ADDSUB )
{ {
// out = mode ? a+b+cin : a-b-cin // 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, "%s ;\n", Wlc_ObjName(p, i) );
fprintf( pFile, " " ); fprintf( pFile, " " );
fprintf( pFile, "assign " ); fprintf( pFile, "assign " );
......
...@@ -124,7 +124,7 @@ Lpk_Fun_t * Lpk_FunDup( Lpk_Fun_t * p, unsigned * pTruth ) ...@@ -124,7 +124,7 @@ Lpk_Fun_t * Lpk_FunDup( Lpk_Fun_t * p, unsigned * pTruth )
pNew->uSupp = Kit_TruthSupport( pTruth, p->nVars ); pNew->uSupp = Kit_TruthSupport( pTruth, p->nVars );
Kit_TruthCopy( Lpk_FunTruth(pNew,0), pTruth, p->nVars ); Kit_TruthCopy( Lpk_FunTruth(pNew,0), pTruth, p->nVars );
memcpy( pNew->pFanins, p->pFanins, 16 ); 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 ); Vec_PtrPush( p->vNodes, pNew );
return pNew; return pNew;
} }
...@@ -212,7 +212,7 @@ void Lpk_FunComputeCofSupps( Lpk_Fun_t * p ) ...@@ -212,7 +212,7 @@ void Lpk_FunComputeCofSupps( Lpk_Fun_t * p )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Lpk_SuppDelay( unsigned uSupp, char * pDelays ) int Lpk_SuppDelay( unsigned uSupp, int * pDelays )
{ {
int Delay, Var; int Delay, Var;
Delay = 0; Delay = 0;
......
...@@ -451,6 +451,7 @@ p->timeTruth3 += Abc_Clock() - clk; ...@@ -451,6 +451,7 @@ p->timeTruth3 += Abc_Clock() - clk;
printf( "%c=%d ", 'a'+k, Abc_ObjLevel(pLeaf) ); printf( "%c=%d ", 'a'+k, Abc_ObjLevel(pLeaf) );
printf( "\n" ); printf( "\n" );
Kit_DsdPrintFromTruth( pTruth, pCut->nLeaves ); Kit_DsdPrintFromTruth( pTruth, pCut->nLeaves );
printf( "\n" );
// pFileName = Kit_TruthDumpToFile( pTruth, pCut->nLeaves, Count++ ); // pFileName = Kit_TruthDumpToFile( pTruth, pCut->nLeaves, Count++ );
// printf( "Saved truth table in file \"%s\".\n", pFileName ); // printf( "Saved truth table in file \"%s\".\n", pFileName );
} }
......
...@@ -147,13 +147,13 @@ struct Lpk_Fun_t_ ...@@ -147,13 +147,13 @@ struct Lpk_Fun_t_
unsigned Id : 7; // the ID of this node unsigned Id : 7; // the ID of this node
unsigned nVars : 5; // the number of variables unsigned nVars : 5; // the number of variables
unsigned nLutK : 4; // the number of LUT inputs unsigned nLutK : 4; // the number of LUT inputs
unsigned nAreaLim : 5; // the area limit (the largest allowed) unsigned nAreaLim : 14; // the area limit (the largest allowed)
unsigned nDelayLim : 9; // the delay limit (the largest allowed)
unsigned fSupports : 1; // supports of cofactors were precomputed unsigned fSupports : 1; // supports of cofactors were precomputed
unsigned fMark : 1; // marks the MUX-based dec unsigned fMark : 1; // marks the MUX-based dec
unsigned uSupp; // the support of this component unsigned uSupp; // the support of this component
unsigned puSupps[32]; // the supports of the cofactors 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 char pFanins[16]; // the fanins of this function
unsigned pTruth[0]; // the truth table (contains room for three truth tables) 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 ...@@ -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 Lpk_Fun_t * Lpk_FunDup( Lpk_Fun_t * p, unsigned * pTruth );
extern int Lpk_FunSuppMinimize( Lpk_Fun_t * p ); extern int Lpk_FunSuppMinimize( Lpk_Fun_t * p );
extern void Lpk_FunComputeCofSupps( 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 ); extern int Lpk_SuppToVars( unsigned uBoundSet, char * pVars );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment