diff options
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/abc/abcObj.c | 4 | ||||
-rw-r--r-- | src/base/abci/abcTiming.c | 24 | ||||
-rw-r--r-- | src/base/io/ioReadBlif.c | 22 |
3 files changed, 46 insertions, 4 deletions
diff --git a/src/base/abc/abcObj.c b/src/base/abc/abcObj.c index 8572d0fc..94a5f0bb 100644 --- a/src/base/abc/abcObj.c +++ b/src/base/abc/abcObj.c @@ -122,12 +122,12 @@ Abc_Obj_t * Abc_NtkCreateObj( Abc_Ntk_t * pNtk, Abc_ObjType_t Type ) assert(0); break; case ABC_OBJ_PI: - pObj->iTemp = Vec_PtrSize(pNtk->vCis); +// pObj->iTemp = Vec_PtrSize(pNtk->vCis); Vec_PtrPush( pNtk->vPis, pObj ); Vec_PtrPush( pNtk->vCis, pObj ); break; case ABC_OBJ_PO: - pObj->iTemp = Vec_PtrSize(pNtk->vCos); +// pObj->iTemp = Vec_PtrSize(pNtk->vCos); Vec_PtrPush( pNtk->vPos, pObj ); Vec_PtrPush( pNtk->vCos, pObj ); break; diff --git a/src/base/abci/abcTiming.c b/src/base/abci/abcTiming.c index 53730a9b..e4dd9503 100644 --- a/src/base/abci/abcTiming.c +++ b/src/base/abci/abcTiming.c @@ -232,6 +232,13 @@ void Abc_NtkTimeSetDefaultInputDrive( Abc_Ntk_t * pNtk, float Rise, float Fall ) pNtk->pManTime = Abc_ManTimeStart(); pNtk->pManTime->tInDriveDef.Rise = Rise; 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 ) { @@ -241,6 +248,13 @@ void Abc_NtkTimeSetDefaultOutputLoad( Abc_Ntk_t * pNtk, float Rise, float Fall ) pNtk->pManTime = Abc_ManTimeStart(); pNtk->pManTime->tOutLoadDef.Rise = Rise; 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************************************************************* @@ -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 ) return; if ( pNtk->pManTime->tInDrive == NULL ) + { + int i; 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->Rise = Rise; pTime->Fall = Fall; @@ -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 ) return; if ( pNtk->pManTime->tOutLoad == NULL ) + { + int i; 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->Rise = Rise; pTime->Fall = Fall; diff --git a/src/base/io/ioReadBlif.c b/src/base/io/ioReadBlif.c index aeb1ec3e..e9e5b329 100644 --- a/src/base/io/ioReadBlif.c +++ b/src/base/io/ioReadBlif.c @@ -1001,6 +1001,15 @@ int Io_ReadBlifNetworkDefaultOutputRequired( Io_ReadBlif_t * p, Vec_Ptr_t * vTok 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 ) { Abc_Obj_t * pNet; @@ -1034,7 +1043,7 @@ int Io_ReadBlifNetworkInputDrive( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens ) return 1; } // 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; } @@ -1049,6 +1058,15 @@ int Io_ReadBlifNetworkInputDrive( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens ) 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 ) { Abc_Obj_t * pNet; @@ -1082,7 +1100,7 @@ int Io_ReadBlifNetworkOutputLoad( Io_ReadBlif_t * p, Vec_Ptr_t * vTokens ) return 1; } // 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; } |