Commit a206287b by Alan Mishchenko

Adding support for input slew and output capacitance to timer and gate-sizer (bug fix).

parent 00d02371
...@@ -122,12 +122,12 @@ Abc_Obj_t * Abc_NtkCreateObj( Abc_Ntk_t * pNtk, Abc_ObjType_t Type ) ...@@ -122,12 +122,12 @@ Abc_Obj_t * Abc_NtkCreateObj( Abc_Ntk_t * pNtk, Abc_ObjType_t Type )
assert(0); assert(0);
break; break;
case ABC_OBJ_PI: case ABC_OBJ_PI:
pObj->iTemp = Vec_PtrSize(pNtk->vCis); // pObj->iTemp = Vec_PtrSize(pNtk->vCis);
Vec_PtrPush( pNtk->vPis, pObj ); Vec_PtrPush( pNtk->vPis, pObj );
Vec_PtrPush( pNtk->vCis, pObj ); Vec_PtrPush( pNtk->vCis, pObj );
break; break;
case ABC_OBJ_PO: case ABC_OBJ_PO:
pObj->iTemp = Vec_PtrSize(pNtk->vCos); // pObj->iTemp = Vec_PtrSize(pNtk->vCos);
Vec_PtrPush( pNtk->vPos, pObj ); Vec_PtrPush( pNtk->vPos, pObj );
Vec_PtrPush( pNtk->vCos, pObj ); Vec_PtrPush( pNtk->vCos, pObj );
break; break;
......
...@@ -232,6 +232,13 @@ void Abc_NtkTimeSetDefaultInputDrive( Abc_Ntk_t * pNtk, float Rise, float Fall ) ...@@ -232,6 +232,13 @@ void Abc_NtkTimeSetDefaultInputDrive( Abc_Ntk_t * pNtk, float Rise, float Fall )
pNtk->pManTime = Abc_ManTimeStart(); pNtk->pManTime = Abc_ManTimeStart();
pNtk->pManTime->tInDriveDef.Rise = Rise; pNtk->pManTime->tInDriveDef.Rise = Rise;
pNtk->pManTime->tInDriveDef.Fall = Fall; pNtk->pManTime->tInDriveDef.Fall = Fall;
if ( pNtk->pManTime->tInDrive != NULL )
{
int i;
for ( i = 0; i < Abc_NtkCiNum(pNtk); i++ )
if ( pNtk->pManTime->tInDrive[i].Rise == 0 && pNtk->pManTime->tInDrive[i].Fall == 0 )
pNtk->pManTime->tInDrive[i] = pNtk->pManTime->tInDriveDef;
}
} }
void Abc_NtkTimeSetDefaultOutputLoad( Abc_Ntk_t * pNtk, float Rise, float Fall ) void Abc_NtkTimeSetDefaultOutputLoad( Abc_Ntk_t * pNtk, float Rise, float Fall )
{ {
...@@ -241,6 +248,13 @@ void Abc_NtkTimeSetDefaultOutputLoad( Abc_Ntk_t * pNtk, float Rise, float Fall ) ...@@ -241,6 +248,13 @@ void Abc_NtkTimeSetDefaultOutputLoad( Abc_Ntk_t * pNtk, float Rise, float Fall )
pNtk->pManTime = Abc_ManTimeStart(); pNtk->pManTime = Abc_ManTimeStart();
pNtk->pManTime->tOutLoadDef.Rise = Rise; pNtk->pManTime->tOutLoadDef.Rise = Rise;
pNtk->pManTime->tOutLoadDef.Fall = Fall; pNtk->pManTime->tOutLoadDef.Fall = Fall;
if ( pNtk->pManTime->tOutLoad != NULL )
{
int i;
for ( i = 0; i < Abc_NtkCoNum(pNtk); i++ )
if ( pNtk->pManTime->tOutLoad[i].Rise == 0 && pNtk->pManTime->tOutLoad[i].Fall == 0 )
pNtk->pManTime->tOutLoad[i] = pNtk->pManTime->tOutLoadDef;
}
} }
/**Function************************************************************* /**Function*************************************************************
...@@ -263,7 +277,12 @@ void Abc_NtkTimeSetInputDrive( Abc_Ntk_t * pNtk, int PiNum, float Rise, float Fa ...@@ -263,7 +277,12 @@ void Abc_NtkTimeSetInputDrive( Abc_Ntk_t * pNtk, int PiNum, float Rise, float Fa
if ( pNtk->pManTime->tInDriveDef.Rise == Rise && pNtk->pManTime->tInDriveDef.Fall == Fall ) if ( pNtk->pManTime->tInDriveDef.Rise == Rise && pNtk->pManTime->tInDriveDef.Fall == Fall )
return; return;
if ( pNtk->pManTime->tInDrive == NULL ) if ( pNtk->pManTime->tInDrive == NULL )
{
int i;
pNtk->pManTime->tInDrive = ABC_CALLOC( Abc_Time_t, Abc_NtkCiNum(pNtk) ); pNtk->pManTime->tInDrive = ABC_CALLOC( Abc_Time_t, Abc_NtkCiNum(pNtk) );
for ( i = 0; i < Abc_NtkCiNum(pNtk); i++ )
pNtk->pManTime->tInDrive[i] = pNtk->pManTime->tInDriveDef;
}
pTime = pNtk->pManTime->tInDrive + PiNum; pTime = pNtk->pManTime->tInDrive + PiNum;
pTime->Rise = Rise; pTime->Rise = Rise;
pTime->Fall = Fall; pTime->Fall = Fall;
...@@ -277,7 +296,12 @@ void Abc_NtkTimeSetOutputLoad( Abc_Ntk_t * pNtk, int PoNum, float Rise, float Fa ...@@ -277,7 +296,12 @@ void Abc_NtkTimeSetOutputLoad( Abc_Ntk_t * pNtk, int PoNum, float Rise, float Fa
if ( pNtk->pManTime->tOutLoadDef.Rise == Rise && pNtk->pManTime->tOutLoadDef.Fall == Fall ) if ( pNtk->pManTime->tOutLoadDef.Rise == Rise && pNtk->pManTime->tOutLoadDef.Fall == Fall )
return; return;
if ( pNtk->pManTime->tOutLoad == NULL ) if ( pNtk->pManTime->tOutLoad == NULL )
{
int i;
pNtk->pManTime->tOutLoad = ABC_CALLOC( Abc_Time_t, Abc_NtkCoNum(pNtk) ); pNtk->pManTime->tOutLoad = ABC_CALLOC( Abc_Time_t, Abc_NtkCoNum(pNtk) );
for ( i = 0; i < Abc_NtkCoNum(pNtk); i++ )
pNtk->pManTime->tOutLoad[i] = pNtk->pManTime->tOutLoadDef;
}
pTime = pNtk->pManTime->tOutLoad + PoNum; pTime = pNtk->pManTime->tOutLoad + PoNum;
pTime->Rise = Rise; pTime->Rise = Rise;
pTime->Fall = Fall; pTime->Fall = Fall;
......
...@@ -1001,6 +1001,15 @@ int Io_ReadBlifNetworkDefaultOutputRequired( Io_ReadBlif_t * p, Vec_Ptr_t * vTok ...@@ -1001,6 +1001,15 @@ int Io_ReadBlifNetworkDefaultOutputRequired( Io_ReadBlif_t * p, Vec_Ptr_t * vTok
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Io_ReadFindCiId( Abc_Ntk_t * pNtk, Abc_Obj_t * pObj )
{
Abc_Obj_t * pTemp;
int i;
Abc_NtkForEachCi( pNtk, pTemp, i )
if ( pTemp == pObj )
return i;
return -1;
}
int Io_ReadBlifNetworkInputDrive( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens ) int Io_ReadBlifNetworkInputDrive( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
{ {
Abc_Obj_t * pNet; Abc_Obj_t * pNet;
...@@ -1034,7 +1043,7 @@ int Io_ReadBlifNetworkInputDrive( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens ) ...@@ -1034,7 +1043,7 @@ int Io_ReadBlifNetworkInputDrive( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
return 1; return 1;
} }
// set the arrival time // set the arrival time
Abc_NtkTimeSetInputDrive( p->pNtkCur, Abc_NtkObj(p->pNtkCur, Abc_ObjFanin0(pNet)->Id)->iTemp, (float)TimeRise, (float)TimeFall ); Abc_NtkTimeSetInputDrive( p->pNtkCur, Io_ReadFindCiId(p->pNtkCur, Abc_NtkObj(p->pNtkCur, Abc_ObjFanin0(pNet)->Id)), (float)TimeRise, (float)TimeFall );
return 0; return 0;
} }
...@@ -1049,6 +1058,15 @@ int Io_ReadBlifNetworkInputDrive( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens ) ...@@ -1049,6 +1058,15 @@ int Io_ReadBlifNetworkInputDrive( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
int Io_ReadFindCoId( Abc_Ntk_t * pNtk, Abc_Obj_t * pObj )
{
Abc_Obj_t * pTemp;
int i;
Abc_NtkForEachPo( pNtk, pTemp, i )
if ( pTemp == pObj )
return i;
return -1;
}
int Io_ReadBlifNetworkOutputLoad( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens ) int Io_ReadBlifNetworkOutputLoad( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
{ {
Abc_Obj_t * pNet; Abc_Obj_t * pNet;
...@@ -1082,7 +1100,7 @@ int Io_ReadBlifNetworkOutputLoad( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens ) ...@@ -1082,7 +1100,7 @@ int Io_ReadBlifNetworkOutputLoad( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens )
return 1; return 1;
} }
// set the arrival time // set the arrival time
Abc_NtkTimeSetOutputLoad( p->pNtkCur, Abc_NtkObj(p->pNtkCur, Abc_ObjFanout0(pNet)->Id)->iTemp, (float)TimeRise, (float)TimeFall ); Abc_NtkTimeSetOutputLoad( p->pNtkCur, Io_ReadFindCoId(p->pNtkCur, Abc_NtkObj(p->pNtkCur, Abc_ObjFanout0(pNet)->Id)), (float)TimeRise, (float)TimeFall );
return 0; 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