Commit f7c969ca by Alan Mishchenko

Improvements to timing optimization.

parent 71847b9d
......@@ -646,6 +646,7 @@ extern ABC_DLL void Abc_ObjAddFanin( Abc_Obj_t * pObj, Abc_Obj_t *
extern ABC_DLL void Abc_ObjDeleteFanin( Abc_Obj_t * pObj, Abc_Obj_t * pFanin );
extern ABC_DLL void Abc_ObjRemoveFanins( Abc_Obj_t * pObj );
extern ABC_DLL void Abc_ObjPatchFanin( Abc_Obj_t * pObj, Abc_Obj_t * pFaninOld, Abc_Obj_t * pFaninNew );
extern ABC_DLL void Abc_ObjPatchFanoutFanin( Abc_Obj_t * pObj, int iObjNew );
extern ABC_DLL Abc_Obj_t * Abc_ObjInsertBetween( Abc_Obj_t * pNodeIn, Abc_Obj_t * pNodeOut, Abc_ObjType_t Type );
extern ABC_DLL void Abc_ObjTransferFanout( Abc_Obj_t * pObjOld, Abc_Obj_t * pObjNew );
extern ABC_DLL void Abc_ObjReplace( Abc_Obj_t * pObjOld, Abc_Obj_t * pObjNew );
......
......@@ -211,6 +211,34 @@ void Abc_ObjPatchFanin( Abc_Obj_t * pObj, Abc_Obj_t * pFaninOld, Abc_Obj_t * pFa
/**Function*************************************************************
Synopsis [Replaces pObj by iObjNew in the fanin arrays of the fanouts.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Abc_ObjPatchFanoutFanin( Abc_Obj_t * pObj, int iObjNew )
{
Abc_Obj_t * pFanout;
int i, k, Entry;
// update fanouts of the node to point to this one
Abc_ObjForEachFanout( pObj, pFanout, i )
{
Vec_IntForEachEntry( &pFanout->vFanins, Entry, k )
if ( Entry == (int)Abc_ObjId(pObj) )
{
Vec_IntWriteEntry( &pFanout->vFanins, k, iObjNew );
break;
}
assert( k < Vec_IntSize(&pFanout->vFanins) );
}
}
/**Function*************************************************************
Synopsis [Inserts one-input node of the type specified between the nodes.]
Description []
......
......@@ -753,7 +753,7 @@ int Scl_CommandStime( Abc_Frame_t * pAbc, int argc, char **argv )
{
int c;
int fShowAll = 0;
int fUseWireLoads = 1;
int fUseWireLoads = 0;
int fPrintPath = 0;
int fDumpStats = 0;
int nTreeCRatio = 0;
......
......@@ -38,7 +38,8 @@ struct Scl_Con_t_
word tInLoadDef; // default input load
word tOutReqDef; // default output required time
word tOutLoadDef; // default output load
Vec_Ptr_t vInCells; // input driving gates
Vec_Ptr_t vInCells; // input driving gate names
Vec_Ptr_t vInCellsPtr; // input driving gates
Vec_Wrd_t vInArrs; // input arrival times
Vec_Wrd_t vInSlews; // input slews
Vec_Wrd_t vInLoads; // input loads
......@@ -58,8 +59,8 @@ struct Scl_Con_t_
#define SCL_DIRECTIVE(ITEM) "."ITEM
#define SCL_DEF_DIRECTIVE(ITEM) ".default_"ITEM
#define SCL_NUM 1000000
#define SCL_NUMINV 0.000001
#define SCL_NUM 1000
#define SCL_NUMINV 0.001
#define SCL_INFINITY (~(word)0)
static inline word Scl_Flt2Wrd( float w ) { return SCL_NUM*w; }
......@@ -103,6 +104,7 @@ static inline Scl_Con_t * Scl_ConAlloc( char * pFileName, Abc_Nam_t * pNamI, Abc
}
static inline void Scl_ConFree( Scl_Con_t * p )
{
Vec_PtrErase( &p->vInCellsPtr );
Vec_PtrFreeData( &p->vInCells );
Vec_PtrErase( &p->vInCells );
Vec_WrdErase( &p->vInArrs );
......
......@@ -180,8 +180,8 @@ struct SC_Pin_
float cap; // -- this value is used if 'rise_cap' and 'fall_cap' is missing (copied by 'postProcess()'). (not used)
float rise_cap; // }- used for input pins ('cap' too).
float fall_cap; // }
float rise_capI; // }- used for input pins ('cap' too).
float fall_capI; // }
int rise_capI; // }- used for input pins ('cap' too).
int fall_capI; // }
float max_out_cap; // } (not used)
float max_out_slew; // }- used only for output pins (max values must not be exceeded or else mapping is illegal) (not used)
char * func_text; // }
......@@ -199,8 +199,8 @@ struct SC_Cell_
int unsupp; // -- set to TRUE by parser if cell contains information we cannot handle
float area;
float leakage;
float areaI;
float leakageI;
int areaI;
int leakageI;
int drive_strength; // -- some library files provide this field (currently unused, but may be a good hint for sizing) (not used)
Vec_Ptr_t vPins; // NamedSet<SC_Pin>
int n_inputs; // -- 'pins[0 .. n_inputs-1]' are input pins
......
......@@ -173,8 +173,8 @@ static int Abc_SclReadLibrary( Vec_Str_t * vOut, int * pPos, SC_Lib * p )
pPin->rise_cap = Vec_StrGetF(vOut, pPos);
pPin->fall_cap = Vec_StrGetF(vOut, pPos);
pPin->rise_capI = (int)(MIO_NUM*pPin->rise_capI);
pPin->fall_capI = (int)(MIO_NUM*pPin->fall_capI);
pPin->rise_capI = (int)(MIO_NUM*pPin->rise_cap);
pPin->fall_capI = (int)(MIO_NUM*pPin->fall_cap);
}
for ( j = 0; j < pCell->n_outputs; j++ )
......
......@@ -231,6 +231,8 @@ extern Sfm_Mit_t * Sfm_MitStart( Mio_Library_t * pLib, SC_Lib * pScl, Scl_Con_t
extern void Sfm_MitStop( Sfm_Mit_t * p );
extern int Sfm_MitReadNtkDelay( Sfm_Mit_t * p );
extern int Sfm_MitReadObjDelay( Sfm_Mit_t * p, int iObj );
extern void Sfm_MitTransferLoad( Sfm_Mit_t * p, Abc_Obj_t * pNew, Abc_Obj_t * pOld );
extern void Sfm_MitTimingGrow( Sfm_Mit_t * p );
extern void Sfm_MitUpdateLoad( Sfm_Mit_t * p, Vec_Int_t * vTimeNodes, int fAdd );
extern void Sfm_MitUpdateTiming( Sfm_Mit_t * p, Vec_Int_t * vTimeNodes );
extern int Sfm_MitSortArrayByArrival( Sfm_Mit_t * p, Vec_Int_t * vNodes, int iPivot );
......
......@@ -53,6 +53,8 @@ Sfm_Mit_t * Sfm_MitStart( Mio_Library_t * pLib, SC_Lib * pScl, Scl_Con_t * pExt
void Sfm_MitStop( Sfm_Mit_t * p ) {}
int Sfm_MitReadNtkDelay( Sfm_Mit_t * p ) { return 0;}
int Sfm_MitReadObjDelay( Sfm_Mit_t * p, int iObj ) { return 0;}
void Sfm_MitTransferLoad( Sfm_Mit_t * p, Abc_Obj_t * pNew, Abc_Obj_t * pOld ) {};
void Sfm_MitTimingGrow( Sfm_Mit_t * p ) {};
void Sfm_MitUpdateLoad( Sfm_Mit_t * p, Vec_Int_t * vTimeNodes, int fAdd ) {}
void Sfm_MitUpdateTiming( Sfm_Mit_t * p, Vec_Int_t * vTimeNodes ) {}
int Sfm_MitSortArrayByArrival( Sfm_Mit_t * p, Vec_Int_t * vNodes, int iPivot ) { return 0;}
......
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